Releases: kevin-lee/extras
Releases · kevin-lee/extras
v0.24.0
0.24.0 - 2022-11-20
New Features
extras-type-info
- [
extras-type-info
] Addextras-type-info
module to replaceextras-reflects
with Scala 3 support (#264)sealed trait Aaa object Aaa { final case class Bbb(n: Int) extends Aaa case object Ccc extends Aaa def bbb(n: Int): Aaa = Bbb(n) def ccc: Aaa = Ccc } final case class Something[A](a: A) Aaa.bbb(123).nestedClassName // Aaa.Bbb Aaa.ccc.nestedTypeName // Aaa.Ccc
extras-hedgehog-circe
- [
extras-hedgehog-circe
] Addround-trip
test support for circe (#263)object SomethingSpec extends Properties { override def tests: List[Test] = List( property("round-trip test Codec[Something]", roundTripTestCodecSomething) ) def roundTripTestCodecSomething: Property = for { something <- genSomething.log("something") } yield { RoundTripTester(something) .indent(2) .test() } def genSomething: Gen[Something] = for { id <- Gen.int(Range.linear(1, 100)) name <- Gen.string(Gen.unicode, Range.linear(3, 20)) } yield Something(id, name) final case class Something(id: Int, name: String) object Something { implicit val somethingShow: Show[Something] = something => s"Something(id = ${something.id.toString}, name = ${something.name})" implicit val somethingCodec: Codec[Something] = io.circe.generic.semiauto.deriveCodec } }
- [
extras-hedgehog-circe
] Useextras-type-info
to support Scala 3 (#270)- Scala 2 version uses
extras-type-info
as well, butextras-type-info
internally usesWeakTypeTag
fromscala.reflect.runtime.universe
inscala-reflect
, an additional reflection API library, to get the type info. - Scala 3 version of
extras-type-info
usesscala.reflect.ClassTag
,scala.compiletime
andscala.quoted
to get the type info.
- Scala 2 version uses
v0.23.0
0.23.0 - 2022-10-22
Package Rename
- Rename
extras.render.syntax.render
=>extras.render.syntax
(#252)
New Features
- [
extras-render
] AddString
interpolation support forRender
(#253)import extras.render.Render import extras.render.syntax._ final case class Foo(id: Int, name: String) object Foo { implicit val fooRender: Render[Foo] = foo => s"{ID=${foo.id.toString},Name=${foo.name}}" } val foo1 = Foo(1, "A") val foo2 = Foo(2, "B") val foo3 = Foo(3, "C") println(render"$foo1 > $foo2 >> $foo3") // {ID=1,Name=A} > {ID=2,Name=B} >> {ID=3,Name=C}
- [
extras-render
] AddRender.render[A](A => String): Render[A]
(#256)import extras.render.Render final case class Something(value: String) object Something { implicit val renderSomething: Render[Something] = Render.render(s => s"value=${s.value}") } val foo = Something("Blah") Render[Something].render(foo) // String = "value=Blah"
v0.22.0
v0.21.1
v0.21.0
v0.20.0
0.20.0 - 2022-10-01
Artifact Name Change
- Rename
extras-hedgehog-cats-effect3
toextras-hedgehog-ce3
(#215)
New Features
- [
extras-hedgehog-ce3
] Add support for test returningIO[Result]
(#216) - [
extras-hedgehog-ce3
] RenamewithIO
torunIO
inCatsEffectRunner
(#221)def testSomething: Property = for { n <- Gen.int(Range.linear(Int.MinValue, Int.MaxValue)).log("n") } yield runIO { // withIO: (=> IO[Result]) => Result // Manual implicit Ticker creation is no longer required. val expected = n val actual = IO(n) actual.map(_ ==== expected) // IO[Result] }
- [
extras-hedgehog-ce3
] AddwithIO
withimplicit ticker =>
(#223)def testSomething: Property = for { n <- Gen.int(Range.linear(Int.MinValue, Int.MaxValue)).log("n") } yield withIO { implicit ticker => val expected = n val actual = IO(n) actual.completeAs(expected) // Result }
Internal Housekeeping
- Bump Scala.js (#219)
sbt-scalajs
to1.11.0
sbt-scalajs-crossproject
to1.2.0
v0.19.0
0.19.0 - 2022-09-07
New Features
- [
extras-refinement
] AddNonEmptyString
concatenation syntax (#208)import eu.timepit.refined.types.string.NonEmptyString import extras.refinement.syntax.string._ NonEmptyString("abc") ++ NonEmptyString("def") // NonEmptyString("abcdef") val givenName = NonEmptyString("Kevin") val surname = NonEmptyString("Lee") val fullName = givenName ++ NonEmptyString(" ") ++ surname // NonEmptyString("Kevin Lee")
- [
extras-refinement
] Addall
syntax to refinement (#210)is equivalent toimport extras.refinement.syntax.all._
import extras.refinement.syntax.refinement._ import extras.refinement.syntax.string._
Internal Housekeeping
- Upgrade docs site to Docusaurus
2.0.0-rc.1
(#195) - Upgrade docs site to Docusaurus
2.0.1
(#206) - [docs] Add
Fira Code Nerd Font
andCaskaydiaCove Nerd Font
, and useFiraCode Nerd Font
for code blocks (#203) - Upgrade
hedgehog
to0.9.0
(#199) - Replace lunr search with Algolia DocSearch (#193)
- Remove
-XX:+UseJVMCICompiler
from.jvmopts
(#191)
v0.18.0
v0.17.0
0.17.0 - 2022-06-26
Done
- [
extras-core
] Addsyntax
to encodeString
to escaped unicode chars (#172) - [
extras-scala-io
]extras.scala.io.syntax.color
"".colored(Color)
should return""
(#170) - [
extras-scala-io
] Addcolor
andcolored
toColor
(#175) - [
extras-scala-io
]Rgb.color("")
andRgb.colored("")
should return""
(#176) - [
extras-scala-io
]"".rgb
and"".rgbed
should return""
(#177) - [
extras-scala-io
]Rainbow.rainbow("")
andRainbow.rainbowHtml("")
should return""
(#180) - [
extras-scala-io
]"".rainbowed
and"".rainbowedHtml
should return""
(#181)
v0.16.0
0.16.0 - 2022-06-19
Done
- [
extras-scala-io
] AddRgb
to have true color support (#162)Rgb.fromInt(0x000000) // Right(Rgb(0)) Rgb.fromInt(0xff0000) // Right(Rgb(16711680)) Rgb.fromInt(0x00ff00) // Right(Rgb(65280)) Rgb.fromInt(0x0000ff) // Right(Rgb(255)) Rgb.fromInt(0xffffff) // Right(Rgb(16777215)) // and more smart constructors and extension methods to get ASCII escape chars and HTML colors (hex)
- [
extras-scala-io
] Add a way to paintString
with rainbow 🌈 colors (#161)