Releases: arainko/ducktape
ducktape 0.2.6
This is a bugfix release that fixes a compiletime issue where the wrong owners were used for a lambda in fallible accumulating transformations which sometimes manifested itself in an error after macro expansion.
It also fixes a runtime issue that resulted in an exception being thrown when directly configuring coproduct cases with Field
configs.
What's Changed
- Update README.md by @arainko in #200
- Update sbt-typelevel-ci-release, ... to 0.7.3 by @scala-steward in #201
- Update munit to 1.0.2 by @scala-steward in #202
- Update sbt-mdoc to 2.6.0 by @scala-steward in #204
- Update sbt to 1.10.2 by @scala-steward in #203
- Update sbt-mdoc to 2.6.1 by @scala-steward in #205
- [Issue#188] change the test for F-unwrapping, clarify the docs by @arainko in #209
- Update scala3-library, ... to 3.3.4 by @scala-steward in #208
- Update sbt-scalafix to 0.13.0 by @scala-steward in #206
- Update sbt-scalajs, scalajs-library_2.13, ... to 1.17.0 by @scala-steward in #207
- Update sbt-typelevel-ci-release, ... to 0.7.4 by @scala-steward in #210
- [Issue-211] by @arainko in #212
- Fix warnings by @arainko in #213
- reenable -Xcheck-macros, fix owner issues by @arainko in #214
- Update sbt, scripted-plugin to 1.10.3 by @scala-steward in #215
Full Changelog: v0.2.5...v0.2.6
ducktape 0.2.5
This release removes a limitation of transformation configs that disallowed using them like lenses for updates, eg. the following:
case class Person(age: Int, name: String)
Person(1, "Joe").into[Person].transform(Field.const(_.age, 23))
would previously fail to compile because the transformation underneath was an identity transformation (i.e. not a configurable product-to-product transformation) - this has now been lifted and code like the above now works as you'd expect.
What's Changed
- Update scalafmt-core to 3.8.3 by @scala-steward in #192
- update scalafmt and scalafix, run both by @arainko in #185
- [Issue 179] lens like configs by @arainko in #193
- Update munit to 1.0.1 by @scala-steward in #194
- [Issue-195] Improve error message in case a
Factory
instance is missing when transforming between collections by @arainko in #198 - Update auxlib, clib, javalib, nativelib, ... to 0.5.5 by @scala-steward in #196
Full Changelog: v0.2.4...v0.2.5
ducktape 0.2.4
ducktape 0.2.4
This a bugfix release.
Special-cased Option
transformations shouldn't get dropped when doing fallible transformations with a Mode[Option]
in scope.
Additionally, match-type-based tuple transformations are now bulletproof to most of the quirks of match types so stuff like tuple concatenation shouldn't throw it off.
What's Changed
- Tuple docs by @arainko in #184
- Update sbt-typelevel-ci-release, ... to 0.7.2 by @scala-steward in #186
- Make
Context.current
a transparent inline to make it work under Scala 3.4.+ by @WojciechMazur in #189 - [Issues #187 and #190] Make F-unwrapping not interfere with special-cased Option transformations and make transformations more bulletproof in relation to match types by @arainko in #191
Full Changelog: v0.2.3...v0.2.4
ducktape 0.2.3
ducktape 0.2.3
This release brings the ability to transform tuples in all kind of ways (tuple-to-tuple, product-to-tuple, tuple-to-product), so stuff like this is now possible:
import io.github.arainko.ducktape.*
case class Source(field1: Int, field2: List[Int], field3: Int, field4: Int)
Source(1, List(2, 2, 2), 3, 4).to[(Int, Vector[Int], Option[Int])]
// res18: Tuple3[Int, Vector[Int], Option[Int]] = (
// 1,
// Vector(2, 2, 2),
// Some(value = 3)
// )
(1, List(2, 2, 2), 3, 4).to[Source]
// res19: Source = Source(
// field1 = 1,
// field2 = List(2, 2, 2),
// field3 = 3,
// field4 = 4
// )
The newly added ability for F-unwrapping
(i.e. lifting the wrapper type into the 'outside' of a fallible transformation) in conjuction with tuple transformation enables some fantastic use cases for match types, like the ability to 'traverse' a tuple:
import io.github.arainko.ducktape.*
val source =
(
Right(1),
Right("str"),
Right(List(3, 3, 3)),
Right(4)
)
Mode.Accumulating.either[String, List].locally {
source.fallibleTo[Tuple.InverseMap[source.type, Mode.current.Self]]
}
// res0: Either[List[String], *:[Int, *:[String, *:[List[Int], *:[Int, EmptyTuple]]]]] = Right(
// value = (1, "str", List(3, 3, 3), 4)
// )
...which is really just the tip of the iceberg - stay tuned for a more in-depth look on how this mechanism can be leveraged in other use cases.
Head on over to the docs on configuring tuples to see how the configuration DSL works with tuples.
What's Changed
- Update README.md by @arainko in #172
- Update nscplugin, sbt-scala-native to 0.5.3 by @scala-steward in #171
- Refactor
Debug
by @arainko in #174 - Update sbt-mdoc to 2.5.3 by @scala-steward in #175
- Update auxlib, clib, javalib, nativelib, ... to 0.5.4 by @scala-steward in #176
- [Issue 154] Tuple transformations by @arainko in #177
- Update sbt to 1.10.1 by @scala-steward in #180
- Update sbt-mdoc to 2.5.4 by @scala-steward in #181
- [Issue 178] F-unwrapping by @arainko in #182
- F-unwrapping cleanup by @arainko in #183
Full Changelog: v0.2.2...v0.2.3
ducktape 0.2.2
This release brings back lints for configs that override each other, for example:
final case class FieldSource(additionalArg: String, str: String)
val fieldSource = FieldSource("str-sourced", "str2")
val expected = TestClassWithAdditionalString(1, "str2", "str-computed")
testClass
.into[TestClassWithAdditionalString]
.transform(
Field.allMatching(fieldSource),
Field.allMatching(fieldSource),
)
will result in a compilation warning that looks like this:
Configs for:
* TestClassWithAdditionalString.str
* TestClassWithAdditionalString.additionalArg
are being overriden by Field.allMatching(fieldSource) @ AppliedBuilderSuite.scala:185:41
It also introduces Mode#locally
that allows you to use a Mode in a scope of a function so that it doesn't need to be bound to a given.
What's Changed
- [Issue#142] config linting by @arainko in #159
- Update munit to 1.0.0 by @scala-steward in #168
- Add 'Mode#locally' by @arainko in #169
Full Changelog: v0.2.1...v0.2.2
ducktape 0.2.1
This release adds a lint that rejects calls to non-Transformer.define* family of methods in given Transformer declarations (#165 )
What's Changed
- Update README.md versions by @arainko in #152
- Update scalafmt-core to 3.8.1 by @scala-steward in #153
- Update sbt-typelevel-ci-release, ... to 0.7.0 by @scala-steward in #160
- Update munit to 1.0.0-RC1 by @scala-steward in #161
- Update sbt to 1.10.0 by @scala-steward in #163
- Update sbt-typelevel-ci-release, ... to 0.7.1 by @scala-steward in #164
- [Issue#165] reject calls to _.to and _.into.transform (and their fallible counterparts) in given Transformer definitions by @arainko in #167
Full Changelog: v0.2.0...v0.2.1
ducktape 0.2.0
ducktape 0.2.0
First of all, head on over to the new docs site.
The library has been rebuilt from the ground-up to not rely on automatic derivation of Transformer
and Transformer.Fallible
and enable further development of more advanced features (the examples of which are nested configurations and support for regional configs like Field.fallbackToDefault
- with more still to come). All of that should result in a much higher quality of code that gets generated underneath (for example, fallible transformations do not generate interim Transformer.Fallible
instances anymore).
While this release is not binary-compatible with ducktape 0.1.x
, it's aiming to be as source-compatible as possible. All the known breakages are documented in the Coming from 0.1.x section of the docs. There are also a bunch of deprecated forwarders with (hopefully) user-friendly tips on how to make the deprecation warnings go away.
New highlight features
-
ability to configure deeply nested transformations without having to resort to building out new
Transformer
instances, best showcased in theConfiguring transformations
section of the docs -
revamped error reporting - errors are now accumulated and shown at once and are supposed to be actionable e.g. in case of a field that's missing it'll give the user a hint and a path to that field for usage in one of the configuration options, for example:
No field 'name' found in MdocApp0.this.wire.PaymentMethod.Card @ Person.paymentMethods.element.at[MdocApp0.this.domain.Payment.Card].name
More information is available in the
Motivating example
section of the docs. -
new flavor of configuration options - regional configs:
Field.fallbackToDefault
for falling back to default values in cases where a transformation couldn't be derived,Field.fallbackToNone
for falling back toNone
forOption
fields for which a transformation couldn't be derived
Regional configs can be made to work in only user-selected subregions of the transformations, eg.:
Field.fallbackToDefault.regional(_.field1.at[Case1])
will make it apply only 'below'
field1
at it'sCase1
subtype. More info and examples are available inConfiguring transformations
What's Changed
- Update versions in README by @arainko in #141
- Update sbt-typelevel-ci-release to 0.6.7 by @scala-steward in #148
- Update scalafmt-core to 3.8.0 by @scala-steward in #147
- Update munit to 1.0.0-M11 by @scala-steward in #146
- Update scala3-library, ... to 3.3.3 by @scala-steward in #145
- Update sbt-scalajs, scalajs-library_2.13, ... to 1.16.0 by @scala-steward in #144
Full Changelog: v0.2.0-RC1...v0.2.0
ducktape 0.2.0-RC1
ducktape 0.2.0-RC1
The first release candidate of the 0.2.x line - to be promoted to a final 0.2.0 release if nothing comes up in the next week.
Starting from this release the default branch will start pointing to the series/0.2.x
branch.
The docs are now published on a docs page as opposed to being kept in a readme.
What's Changed
- Create docs website by @arainko in #136
- Rework fallible docs by @arainko in #137
- Add missing
private
modifiers, link to docs in README by @arainko in #138 - Additional webpage fixes by @arainko in #140
Full Changelog: v0.2.0-M5...v0.2.0-RC1
ducktape 0.2.0-M5
ducktape 0.2.0-M5
This release bring a new encoding of accumulating transformations (well, the 'decoding', really) - the final step destructing the zipped Tuple is now represented as a chain of accessors, i.e. this:
(value: Tuple2[Type, Tuple2[Type, Type]]) => new Person(name = value._1, age = value._2._1, socialSecurityNo = value._2._2)
): Either[List[String], Person]): Either[List[String], Person])
instead of a pattern match like this one:
value: Tuple2[Tuple2[Type, Type], Type]) =>
value match {
case Tuple2(Tuple2(name, age), socialSecurityNo) =>
new ValidatedPerson(name = name, age = age, socialSecurityNo = socialSecurityNo)
case x =>
throw new MatchError(x)
}
)
This release is very likely to become an RC if nothing serious comes up in the next week.
What's Changed
- annotate
Transformer
andTransformer.Fallible
with FunctionalInterface by @arainko in #124 - Revert "update deps" by @arainko in #125
- Revert "Revert "update deps"" by @arainko in #126
- Fix bad owners for fail fast and partially for accumulating by @arainko in #127
- dramatically simplify
ProductZipper
by @arainko in #130 - Regional config docs by @arainko in #133
- More fallible docs by @arainko in #134
Full Changelog: v0.2.0-M4...v0.2.0-M5
ducktape 0.2.0-M4
This release is identical to 0.2.0-M3
in terms of features. Publishing should be fixed now.
What's Changed
Full Changelog: v0.2.0-M3...v0.2.0-M4