From 169bbcbda922d53a50d3d13fdfb2ab6413c16e19 Mon Sep 17 00:00:00 2001 From: Ben Plommer Date: Mon, 20 Sep 2021 11:02:59 +0100 Subject: [PATCH 01/11] Make EntityEncoder covariant in its effect type --- .../main/scala/org/http4s/scalatags/ScalatagsInstances.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala b/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala index ca5f8aa..7a7028c 100644 --- a/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala +++ b/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala @@ -27,8 +27,7 @@ trait ScalatagsInstances { private def contentEncoder[F[_], C <: Frag[_, String]](mediaType: MediaType)(implicit charset: Charset): EntityEncoder[F, C] = - EntityEncoder - .stringEncoder[F] + EntityEncoder.stringEncoder .contramap[C](content => content.render) .withContentType(`Content-Type`(mediaType, charset)) } From 300c020b4556306f1f2d13a22d9d6797ee392c1f Mon Sep 17 00:00:00 2001 From: Ben Plommer Date: Mon, 20 Sep 2021 13:50:00 +0100 Subject: [PATCH 02/11] Make more EntityEncoder instances pure --- .../scala/org/http4s/scalatags/ScalatagsInstances.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala b/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala index 7a7028c..76ce9d7 100644 --- a/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala +++ b/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala @@ -21,12 +21,12 @@ import _root_.scalatags.generic.Frag import org.http4s.headers.`Content-Type` trait ScalatagsInstances { - implicit def scalatagsEncoder[F[_], C <: Frag[_, String]](implicit - charset: Charset = DefaultCharset): EntityEncoder[F, C] = + implicit def scalatagsEncoder[C <: Frag[_, String]](implicit + charset: Charset = DefaultCharset): EntityEncoder.Pure[C] = contentEncoder(MediaType.text.html) - private def contentEncoder[F[_], C <: Frag[_, String]](mediaType: MediaType)(implicit - charset: Charset): EntityEncoder[F, C] = + private def contentEncoder[C <: Frag[_, String]](mediaType: MediaType)(implicit + charset: Charset): EntityEncoder.Pure[C] = EntityEncoder.stringEncoder .contramap[C](content => content.render) .withContentType(`Content-Type`(mediaType, charset)) From b56efefcd1c3faccac79a80153156e912f6ddee9 Mon Sep 17 00:00:00 2001 From: danicheg Date: Fri, 3 Dec 2021 19:06:13 +0300 Subject: [PATCH 03/11] Scalafmt --- .../scala/org/http4s/scalatags/ScalatagsInstances.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala b/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala index e5182bb..51b9aa9 100644 --- a/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala +++ b/scalatags/src/main/scala/org/http4s/scalatags/ScalatagsInstances.scala @@ -23,11 +23,13 @@ import org.http4s.headers.`Content-Type` trait ScalatagsInstances { implicit def scalatagsEncoder[C <: Frag[_, String]](implicit - charset: Charset = `UTF-8`): EntityEncoder.Pure[C] = + charset: Charset = `UTF-8` + ): EntityEncoder.Pure[C] = contentEncoder(MediaType.text.html) - private def contentEncoder[C <: Frag[_, String]](mediaType: MediaType)(implicit - charset: Charset): EntityEncoder.Pure[C] = + private def contentEncoder[C <: Frag[_, String]]( + mediaType: MediaType + )(implicit charset: Charset): EntityEncoder.Pure[C] = EntityEncoder.stringEncoder .contramap[C](content => content.render) .withContentType(`Content-Type`(mediaType, charset)) From 20fee2fc47e85452197e64868fea335b994b0df0 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 17 May 2022 09:29:35 +0200 Subject: [PATCH 04/11] Update scalatags to 0.11.1 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 7a35909..989b8ee 100644 --- a/build.sbt +++ b/build.sbt @@ -11,7 +11,7 @@ ThisBuild / scalaVersion := Scala213 lazy val root = project.in(file(".")).aggregate(scalatags).enablePlugins(NoPublishPlugin) val http4sVersion = "0.23.11" -val scalatagsVersion = "0.10.0" +val scalatagsVersion = "0.11.1" val munitVersion = "0.7.29" val munitCatsEffectVersion = "1.0.7" From 7a6dc14b8de20c8a7d61967bf1e8f3861f3014cd Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Fri, 17 Jun 2022 09:35:55 -0400 Subject: [PATCH 05/11] Unpin scalatags-0.10 --- .scala-steward.conf | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .scala-steward.conf diff --git a/.scala-steward.conf b/.scala-steward.conf deleted file mode 100644 index bac2700..0000000 --- a/.scala-steward.conf +++ /dev/null @@ -1,4 +0,0 @@ -updates.pin = [ - # scalatags-0.11 breaks bincompat - { groupId = "com.lihaoyi", artifactId = "scalatags", version = "0.10." } -] From 5c8a2d4889c8c53a2fd24ce5044a4c23191491f1 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Fri, 17 Jun 2022 09:38:25 -0400 Subject: [PATCH 06/11] Base version is 0.24 --- build.sbt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 6316d53..0739045 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,4 @@ -ThisBuild / tlBaseVersion := "0.23" -ThisBuild / tlMimaPreviousVersions ++= (0 to 11).map(y => s"0.23.$y").toSet +ThisBuild / tlBaseVersion := "0.24" ThisBuild / developers := List( tlGitHubDev("rossabaker", "Ross A. Baker") ) From 9d762705a8daf0b42d6bb01d233a5c35f384eb55 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Fri, 17 Jun 2022 09:48:17 -0400 Subject: [PATCH 07/11] Add Scala 3 support --- .github/workflows/ci.yml | 16 +++++++++++++++- build.sbt | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af25d30..7b8e45c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,13 +29,17 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - scala: [2.12.15, 2.13.8] + scala: [2.12.15, 2.13.8, 3.1.2] java: [temurin@8, temurin@11, temurin@17] exclude: - scala: 2.12.15 java: temurin@11 - scala: 2.12.15 java: temurin@17 + - scala: 3.1.2 + java: temurin@11 + - scala: 3.1.2 + java: temurin@17 runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -260,6 +264,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (3.1.2) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.2 + + - name: Inflate target directories (3.1.2) + run: | + tar xf targets.tar + rm targets.tar + - name: Import signing key if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' run: echo $PGP_SECRET | base64 -di | gpg --import diff --git a/build.sbt b/build.sbt index f5ef36f..75b7518 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ ThisBuild / developers := List( ) val Scala213 = "2.13.8" -ThisBuild / crossScalaVersions := Seq("2.12.15", Scala213) +ThisBuild / crossScalaVersions := Seq("2.12.15", Scala213, "3.1.2") ThisBuild / scalaVersion := Scala213 lazy val root = project.in(file(".")).aggregate(scalatags).enablePlugins(NoPublishPlugin) From 50032a454b0d707a5ef3299d752a12a186962d86 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Fri, 17 Jun 2022 10:00:32 -0400 Subject: [PATCH 08/11] [ci skip] Add README --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..63dbda4 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# http4s-scalatags + +Provides http4s entity codec instances for [scalatags][scalatags]. + +## SBT coordinates + +```scala +libraryDependencies ++= Seq( + "org.http4s" %% "http4s-scalatags" % http4sScalatagsV +) +``` + +## Compatibility + +| http4s-scalatags | http4s-core | scalatags | Scala 2.12 | Scala 2.13 | Scala 3 | Status | +|:-----------------|:------------|:----------|------------|------------|---------|:-------| +| 0.23.x | 0.23.x | 0.10.x | ✅ | ✅ | ❌ | EOL | +| 0.24.x | 0.23.x | 0.11.x | ✅ | ✅ | ✅ | Stable | + +[scalatags]: https://com-lihaoyi.github.io/scalatags/ From dd839dcc2aaeaf77d3cff70f7acd0905d4970199 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Fri, 17 Jun 2022 11:25:59 -0400 Subject: [PATCH 09/11] http4s-1.0.0-M33 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 75b7518..9b6275b 100644 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,7 @@ ThisBuild / scalaVersion := Scala213 lazy val root = project.in(file(".")).aggregate(scalatags).enablePlugins(NoPublishPlugin) -val http4sVersion = "0.23.12" +val http4sVersion = "1.0.0-M33" val scalatagsVersion = "0.11.1" val munitVersion = "0.7.29" val munitCatsEffectVersion = "1.0.7" From f0122c10959b27b1805248ce7b5761fcd000bda1 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Fri, 17 Jun 2022 11:29:25 -0400 Subject: [PATCH 10/11] Drop Scala 2.12 --- .github/workflows/ci.yml | 16 +--------------- build.sbt | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b8e45c..f270e91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,13 +29,9 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - scala: [2.12.15, 2.13.8, 3.1.2] + scala: [2.13.8, 3.1.2] java: [temurin@8, temurin@11, temurin@17] exclude: - - scala: 2.12.15 - java: temurin@11 - - scala: 2.12.15 - java: temurin@17 - scala: 3.1.2 java: temurin@11 - scala: 3.1.2 @@ -224,16 +220,6 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - name: Download target directories (2.12.15) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15 - - - name: Inflate target directories (2.12.15) - run: | - tar xf targets.tar - rm targets.tar - - name: Download target directories (2.13.8) uses: actions/download-artifact@v2 with: diff --git a/build.sbt b/build.sbt index 9b6275b..267df57 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ ThisBuild / developers := List( ) val Scala213 = "2.13.8" -ThisBuild / crossScalaVersions := Seq("2.12.15", Scala213, "3.1.2") +ThisBuild / crossScalaVersions := Seq(Scala213, "3.1.2") ThisBuild / scalaVersion := Scala213 lazy val root = project.in(file(".")).aggregate(scalatags).enablePlugins(NoPublishPlugin) From 1d94e06ae86f231f3a50d9e54e0525536b9b214b Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Fri, 17 Jun 2022 11:29:52 -0400 Subject: [PATCH 11/11] Base version is 1.0 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 267df57..5f412b6 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,4 @@ -ThisBuild / tlBaseVersion := "0.24" +ThisBuild / tlBaseVersion := "1.0" ThisBuild / developers := List( tlGitHubDev("rossabaker", "Ross A. Baker") )