Skip to content

Commit

Permalink
Support ZIO 2.x (#149)
Browse files Browse the repository at this point in the history
* Run scalafix ZIO 2 migration

* Get core project compiling

* Get Optics to compile and pass tests

* Get protobuf to compile and pass tests

* Run `sbt prepare`

* Remove unused reference to zio-nio in BuildHelper.scala

* Update to ZIO 2.0.0-RC1

* Update zio-schema-json and examples to ZIO 2

* Update dependency ch.epfl.scala:sbt-scalafix to v0.9.33 (#98)

Co-authored-by: Renovate Bot <[email protected]>

* Capture annotations on Enums and all cases (#167)

* Capture annotations on Enums and all cases

* Linting

* Update dependency com.github.ghik:silencer-lib to v1.7.7 (#123)

Co-authored-by: Renovate Bot <[email protected]>

* Upgrade zio-json to 0.3.0-RC1-1

* Update zio-prelude and zio-optics versions to ZIO-2 releases and address Adam's PR feedback

* Last bit of PR cleanup

* Fix linter error

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Dan Harris <[email protected]>
  • Loading branch information
4 people authored Jan 10, 2022
1 parent 4315bcf commit 4a5c9e7
Show file tree
Hide file tree
Showing 32 changed files with 1,260 additions and 1,185 deletions.
10 changes: 5 additions & 5 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ object BuildHelper {
val Scala213: String = versions("2.13")
val ScalaDotty: String = "3.1.0" //versions.getOrElse("3.0", versions("3.1"))

val zioVersion = "1.0.12"
val zioJsonVersion = "0.2.0-M2"
val zioPreludeVersion = "1.0.0-RC7"
val zioOpticsVersion = "0.1.0"
val silencerVersion = "1.7.6"
val zioVersion = "2.0.0-RC1"
val zioJsonVersion = "0.3.0-RC1-1"
val zioPreludeVersion = "1.0.0-RC9"
val zioOpticsVersion = "0.2.0-RC1"
val silencerVersion = "1.7.7"

private val testDeps = Seq(
"dev.zio" %% "zio-test" % zioVersion % "test",
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.4")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.32")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.33")
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.10")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.8.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
Expand Down
14 changes: 7 additions & 7 deletions tests/shared/src/test/scala/zio/schema/AccessorBuilderSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ object AccessorBuilderSpec extends DefaultRunnableSpec {
test("fail") {
assert(Schema.fail("error").makeAccessors(builder).asInstanceOf[Unit])(isUnit)
},
testM("primitive") {
test("primitive") {
check(SchemaGen.anyPrimitive) { schema =>
assert(schema.makeAccessors(builder))(isUnit)
}
},
testM("sequence") {
test("sequence") {
check(SchemaGen.anySchema) { elementSchema =>
val collectionSchema = elementSchema.repeated
val traversal = collectionSchema.makeAccessors(builder)
Expand All @@ -33,7 +33,7 @@ object AccessorBuilderSpec extends DefaultRunnableSpec {
)(isTrue)
}
},
testM("transform") {
test("transform") {
check(SchemaGen.anyPrimitive) { schema =>
val transform = schema.transformOrFail[Unit](_ => Left("error"), _ => Left("error"))

Expand All @@ -45,7 +45,7 @@ object AccessorBuilderSpec extends DefaultRunnableSpec {
)(isTrue)
}
},
testM("optional") {
test("optional") {
check(SchemaGen.anyPrimitive) { schema =>
val optionalSchema: Schema.Optional[_] = schema.optional.asInstanceOf[Schema.Optional[_]]
val enumSchema = optionalSchema.toEnum
Expand All @@ -63,7 +63,7 @@ object AccessorBuilderSpec extends DefaultRunnableSpec {
)(isTrue)
}
},
testM("tuple") {
test("tuple") {
check(SchemaGen.anyPrimitive <*> SchemaGen.anyPrimitive) {
case (leftSchema, rightSchema) =>
val tupleSchema: Schema.Tuple[_, _] = (leftSchema <*> rightSchema).asInstanceOf[Schema.Tuple[_, _]]
Expand All @@ -81,7 +81,7 @@ object AccessorBuilderSpec extends DefaultRunnableSpec {
)(isTrue)
}
},
testM("either") {
test("either") {
check(SchemaGen.anyPrimitive <*> SchemaGen.anyPrimitive) {
case (leftSchema, rightSchema) =>
val eitherSchema: Schema.EitherSchema[_, _] =
Expand All @@ -103,7 +103,7 @@ object AccessorBuilderSpec extends DefaultRunnableSpec {
)(isTrue)
}
},
testM("lazy") {
test("lazy") {
check(SchemaGen.anyPrimitive) { schema =>
val lazySchema = Schema.defer(schema)
val eagerAccessor: Any = schema.makeAccessors(builder)
Expand Down
Loading

0 comments on commit 4a5c9e7

Please sign in to comment.