diff --git a/build.sbt b/build.sbt index 47e8d7c5..f17c9571 100644 --- a/build.sbt +++ b/build.sbt @@ -45,15 +45,15 @@ lazy val delimitedJVM = `validation-delimited`.jvm lazy val delimitedJS = `validation-delimited`.js lazy val delimited = aggregate("validation-delimited", delimitedJVM, delimitedJS) -lazy val `validation-json-ast` = crossProject +lazy val `validation-jsonast` = crossProject .crossType(CrossType.Full) .settings(validationSettings: _*) .dependsOn(`validation-core`) .jvmSettings(libraryDependencies += "com.typesafe.play" %% "play-json" % playVersion) -lazy val jsonAstJVM = `validation-json-ast`.jvm -lazy val jsonAstJS = `validation-json-ast`.js -lazy val jsonAst = aggregate("validation-json-ast", jsonAstJVM, jsonAstJS) +lazy val jsonAstJVM = `validation-jsonast`.jvm +lazy val jsonAstJS = `validation-jsonast`.js +lazy val jsonAst = aggregate("validation-jsonast", jsonAstJVM, jsonAstJS) lazy val `validation-playjson` = project .settings(validationSettings: _*) diff --git a/date-tests/src/test/scala/DateSpec.scala b/date-tests/src/test/scala/DateSpec.scala index 411c6b04..9f7c7984 100644 --- a/date-tests/src/test/scala/DateSpec.scala +++ b/date-tests/src/test/scala/DateSpec.scala @@ -481,7 +481,7 @@ class DateSpec extends WordSpec with Matchers { } "jsonAst" should { - import jto.validation.jsonAst._ + import jto.validation.jsonast._ import Rules._, Writes._ "Format" when { diff --git a/docs/src/main/tut/ReleaseNotes.md b/docs/src/main/tut/ReleaseNotes.md index 5ea648ce..48425fe8 100644 --- a/docs/src/main/tut/ReleaseNotes.md +++ b/docs/src/main/tut/ReleaseNotes.md @@ -6,6 +6,6 @@ - Impove error reporting ([#40](/~https://github.com/jto/validation/pull/40) [1](/~https://github.com/jto/validation/commit/357b87778f19fbbc06a49da08cb2dccf9e0a40e3), [2](/~https://github.com/jto/validation/commit/c1bdac7fcff098b1d85c6881c731d5fd4ee2ac2e)) -- Rework project structure: `json` → `playjson`, `json4s` → `json-ast`, `jsjson` ([#50](/~https://github.com/jto/validation/pull/50) [0](/~https://github.com/jto/validation/commit/f95ac30b1d1346a27e26c08841ee06c00340891f) [1](/~https://github.com/jto/validation/commit/5b36f606334a5fe26715cf0d7c47ebf861acb811), [2](/~https://github.com/jto/validation/commit/3f31f4917d01b8f6fdefe4adaca70ddc823722db)) +- Rework project structure: `json` → `playjson`, `json4s` → `jsonast`, `jsjson` ([#50](/~https://github.com/jto/validation/pull/50) [0](/~https://github.com/jto/validation/commit/f95ac30b1d1346a27e26c08841ee06c00340891f) [1](/~https://github.com/jto/validation/commit/5b36f606334a5fe26715cf0d7c47ebf861acb811), [2](/~https://github.com/jto/validation/commit/3f31f4917d01b8f6fdefe4adaca70ddc823722db)) - Add Scala.js support ([#42](/~https://github.com/jto/validation/pull/42) [1](/~https://github.com/jto/validation/commit/db359abfbe90d2b3b853beabcbabe88ecd1cfddb), [2](/~https://github.com/jto/validation/commit/568aa1fa1df06d775abb583cac8da679c1301227), [3](/~https://github.com/jto/validation/commit/d67d6dee7d99d27d6cf751cc69b83235b57a8246), [4](/~https://github.com/jto/validation/commit/67499a823ff463860b72d6697cf45b5764c475b2), [5](/~https://github.com/jto/validation/commit/d720ba265541a90f225c388043b5430a68e9fff3)) diff --git a/docs/src/main/tut/V2MigrationGuide.md b/docs/src/main/tut/V2MigrationGuide.md index b31777a5..74f4106d 100644 --- a/docs/src/main/tut/V2MigrationGuide.md +++ b/docs/src/main/tut/V2MigrationGuide.md @@ -21,7 +21,7 @@ becomes #### Package name - Since the library does not depend on Play anymore and is not planned to be integrated into Play, the package names have changed. Basically `play.api.mapping` now becomes `jto.validation`. A simple search and replace in your project should work. -- The validation api support both json4s and play-json. Therefore, the package name for play json changes. `play.api.mapping.json` becomes `play.api.mapping.playjson` +- The validation api support several json representations. Therefore, the package name for play json changes. `play.api.mapping.json` becomes `play.api.mapping.playjson` #### Rule renaming diff --git a/play-scalajs-example/build.sbt b/play-scalajs-example/build.sbt index 7cc27d1b..c683e638 100644 --- a/play-scalajs-example/build.sbt +++ b/play-scalajs-example/build.sbt @@ -16,6 +16,7 @@ lazy val jvm = project // "io.github.jto" %% "validation-playjson" % "2.0")) .dependsOn(ProjectRef(file(".."), "validation-core")) .dependsOn(ProjectRef(file(".."), "validation-playjson")) + .dependsOn(ProjectRef(file(".."), "validation-jsonast")) lazy val js = project .in(file("js")) @@ -30,6 +31,7 @@ lazy val js = project // "io.github.jto" %%% "validation-jsjson" % "2.0")) .dependsOn(ProjectRef(file(".."), "validation-core")) .dependsOn(ProjectRef(file(".."), "validation-jsjson")) + .dependsOn(ProjectRef(file(".."), "validation-jsonast")) lazy val shared = crossProject.crossType(CrossType.Pure) .in(file("shared")) diff --git a/validation-json-ast/js/src/main/scala/Ast.scala b/validation-jsonast/js/src/main/scala/Ast.scala similarity index 100% rename from validation-json-ast/js/src/main/scala/Ast.scala rename to validation-jsonast/js/src/main/scala/Ast.scala diff --git a/validation-json-ast/jvm/src/main/scala/Ast.scala b/validation-jsonast/jvm/src/main/scala/Ast.scala similarity index 100% rename from validation-json-ast/jvm/src/main/scala/Ast.scala rename to validation-jsonast/jvm/src/main/scala/Ast.scala diff --git a/validation-json-ast/shared/src/main/scala/Ast.scala b/validation-jsonast/shared/src/main/scala/Ast.scala similarity index 100% rename from validation-json-ast/shared/src/main/scala/Ast.scala rename to validation-jsonast/shared/src/main/scala/Ast.scala diff --git a/validation-json-ast/shared/src/main/scala/Rules.scala b/validation-jsonast/shared/src/main/scala/Rules.scala similarity index 100% rename from validation-json-ast/shared/src/main/scala/Rules.scala rename to validation-jsonast/shared/src/main/scala/Rules.scala diff --git a/validation-json-ast/shared/src/main/scala/Writes.scala b/validation-jsonast/shared/src/main/scala/Writes.scala similarity index 100% rename from validation-json-ast/shared/src/main/scala/Writes.scala rename to validation-jsonast/shared/src/main/scala/Writes.scala diff --git a/validation-json-ast/shared/src/test/scala/AstSpec.scala b/validation-jsonast/shared/src/test/scala/AstSpec.scala similarity index 95% rename from validation-json-ast/shared/src/test/scala/AstSpec.scala rename to validation-jsonast/shared/src/test/scala/AstSpec.scala index 2f428280..9c5ad313 100644 --- a/validation-json-ast/shared/src/test/scala/AstSpec.scala +++ b/validation-jsonast/shared/src/test/scala/AstSpec.scala @@ -1,4 +1,4 @@ -import jto.validation.jsonAst._ +import jto.validation.jsonast._ import org.scalatest._ class AstSpec extends WordSpec with Matchers { diff --git a/validation-json-ast/shared/src/test/scala/FormatSpec.scala b/validation-jsonast/shared/src/test/scala/FormatSpec.scala similarity index 99% rename from validation-json-ast/shared/src/test/scala/FormatSpec.scala rename to validation-jsonast/shared/src/test/scala/FormatSpec.scala index a8e611b1..3629ffac 100644 --- a/validation-json-ast/shared/src/test/scala/FormatSpec.scala +++ b/validation-jsonast/shared/src/test/scala/FormatSpec.scala @@ -1,5 +1,5 @@ import jto.validation._ -import jto.validation.jsonAst._ +import jto.validation.jsonast._ import org.scalatest._ import scala.Function.unlift diff --git a/validation-json-ast/shared/src/test/scala/MacroSpec.scala b/validation-jsonast/shared/src/test/scala/MacroSpec.scala similarity index 99% rename from validation-json-ast/shared/src/test/scala/MacroSpec.scala rename to validation-jsonast/shared/src/test/scala/MacroSpec.scala index 463bbeca..9ced6b76 100644 --- a/validation-json-ast/shared/src/test/scala/MacroSpec.scala +++ b/validation-jsonast/shared/src/test/scala/MacroSpec.scala @@ -1,5 +1,5 @@ import jto.validation._ -import jto.validation.jsonAst._ +import jto.validation.jsonast._ import org.scalatest._ case class User(age: Int, name: String) diff --git a/validation-json-ast/shared/src/test/scala/RulesSpec.scala b/validation-jsonast/shared/src/test/scala/RulesSpec.scala similarity index 99% rename from validation-json-ast/shared/src/test/scala/RulesSpec.scala rename to validation-jsonast/shared/src/test/scala/RulesSpec.scala index 29fb7d7b..f01970d2 100644 --- a/validation-json-ast/shared/src/test/scala/RulesSpec.scala +++ b/validation-jsonast/shared/src/test/scala/RulesSpec.scala @@ -1,5 +1,5 @@ import jto.validation._ -import jto.validation.jsonAst._ +import jto.validation.jsonast._ import org.scalatest._ class RulesSpec extends WordSpec with Matchers { diff --git a/validation-json-ast/shared/src/test/scala/WritesSpec.scala b/validation-jsonast/shared/src/test/scala/WritesSpec.scala similarity index 99% rename from validation-json-ast/shared/src/test/scala/WritesSpec.scala rename to validation-jsonast/shared/src/test/scala/WritesSpec.scala index 84ed8620..52a6f41e 100644 --- a/validation-json-ast/shared/src/test/scala/WritesSpec.scala +++ b/validation-jsonast/shared/src/test/scala/WritesSpec.scala @@ -1,6 +1,6 @@ import jto.validation._ -import jto.validation.jsonAst._ -import jto.validation.jsonAst.Writes._ +import jto.validation.jsonast._ +import jto.validation.jsonast.Writes._ import org.scalatest._ import scala.Function.unlift