Skip to content

Releases: kevin-lee/extras

v0.24.0

20 Nov 06:27
bf6d97e
Compare
Choose a tag to compare

0.24.0 - 2022-11-20

New Features

extras-type-info

  • [extras-type-info] Add extras-type-info module to replace extras-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] Add round-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] Use extras-type-info to support Scala 3 (#270)
    • Scala 2 version uses extras-type-info as well, but extras-type-info internally uses WeakTypeTag from scala.reflect.runtime.universe in scala-reflect, an additional reflection API library, to get the type info.
    • Scala 3 version of extras-type-info uses scala.reflect.ClassTag, scala.compiletime and scala.quoted to get the type info.

v0.23.0

22 Oct 07:55
a62b95a
Compare
Choose a tag to compare

0.23.0 - 2022-10-22

Package Rename

  • Rename extras.render.syntax.render => extras.render.syntax (#252)

New Features

  • [extras-render] Add String interpolation support for Render (#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] Add Render.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

19 Oct 13:37
557d32a
Compare
Choose a tag to compare

0.22.0 - 2022-10-20

New Module

  • Modularise extras-render (#248)

v0.21.1

19 Oct 05:41
af987df
Compare
Choose a tag to compare

0.21.1 - 2022-10-19

Fixed

  • Fix Iterable[A].renderString renders only the first element (#243)

v0.21.0

17 Oct 11:36
574b118
Compare
Choose a tag to compare

0.21.0 - 2022-10-17

Supported Scala Version

  • Drop support for Scala 2.11 (#236)

New Features

  • [extras-core] Add Render[A] type-class (#234)
  • [extras-core] Add syntax for Render[A] type-class (#238)

Internal Housekeeping

  • Add sbt-dependency-submission GitHub workflow (#231)

v0.20.0

01 Oct 13:09
ef4734c
Compare
Choose a tag to compare

0.20.0 - 2022-10-01

Artifact Name Change

  • Rename extras-hedgehog-cats-effect3 to extras-hedgehog-ce3 (#215)

New Features

  • [extras-hedgehog-ce3] Add support for test returning IO[Result] (#216)
  • [extras-hedgehog-ce3] Rename withIO to runIO in CatsEffectRunner (#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] Add withIO with implicit 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 to 1.11.0
    • sbt-scalajs-crossproject to 1.2.0

v0.19.0

07 Sep 12:41
40f3429
Compare
Choose a tag to compare

0.19.0 - 2022-09-07

New Features

  • [extras-refinement] Add NonEmptyString 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] Add all syntax to refinement (#210)
    import extras.refinement.syntax.all._
    is equivalent to
    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 and CaskaydiaCove Nerd Font, and use FiraCode Nerd Font for code blocks (#203)
  • Upgrade hedgehog to 0.9.0 (#199)
  • Replace lunr search with Algolia DocSearch (#193)
  • Remove -XX:+UseJVMCICompiler from .jvmopts (#191)

v0.18.0

08 Jul 14:01
e2e09d2
Compare
Choose a tag to compare

0.18.0 - 2022-07-08

Done

  • [extras-scala-io] Add Rainbow.rainbows(Seq[String]) (#186)
  • [extras-scala-io] Add syntax: Seq[String].rainbowed (#188)

v0.17.0

26 Jun 12:15
a6b1d94
Compare
Choose a tag to compare

0.17.0 - 2022-06-26

Done

  • [extras-core] Add syntax to encode String to escaped unicode chars (#172)
  • [extras-scala-io] extras.scala.io.syntax.color "".colored(Color) should return "" (#170)
  • [extras-scala-io] Add color and colored to Color (#175)
  • [extras-scala-io] Rgb.color("") and Rgb.colored("") should return "" (#176)
  • [extras-scala-io] "".rgb and "".rgbed should return "" (#177)
  • [extras-scala-io] Rainbow.rainbow("") and Rainbow.rainbowHtml("") should return "" (#180)
  • [extras-scala-io] "".rainbowed and "".rainbowedHtml should return "" (#181)

v0.16.0

19 Jun 10:16
8e7b9fe
Compare
Choose a tag to compare

0.16.0 - 2022-06-19

Done

  • [extras-scala-io] Add Rgb 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 paint String with rainbow 🌈 colors (#161)
    Screen Shot 2022-06-18 at 7 00 16 pm