Skip to content

Commit

Permalink
Merge pull request #21 from http4s/merge-core-main
Browse files Browse the repository at this point in the history
Merge v0.24.0 and the pre-schism core/main
  • Loading branch information
rossabaker authored Jun 17, 2022
2 parents 04fb7fd + 1d94e06 commit bafbe95
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
scala: [2.12.15, 2.13.8]
scala: [2.13.8, 3.1.2]
java: [temurin@8, temurin@11, temurin@17]
exclude:
- scala: 2.12.15
- scala: 3.1.2
java: temurin@11
- scala: 2.12.15
- scala: 3.1.2
java: temurin@17
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -220,12 +220,12 @@ jobs:
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (2.12.15)
- name: Download target directories (2.13.8)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.15
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8

- name: Inflate target directories (2.12.15)
- name: Inflate target directories (2.13.8)
run: |
tar xf targets.tar
rm targets.tar
Expand All @@ -250,12 +250,12 @@ jobs:
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.8)
- name: Download target directories (3.1.2)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.8
name: target-${{ matrix.os }}-${{ matrix.java }}-3.1.2

- name: Inflate target directories (2.13.8)
- name: Inflate target directories (3.1.2)
run: |
tar xf targets.tar
rm targets.tar
Expand Down
4 changes: 0 additions & 4 deletions .scala-steward.conf

This file was deleted.

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/
9 changes: 4 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
ThisBuild / tlBaseVersion := "0.23"
ThisBuild / tlMimaPreviousVersions ++= (0 to 11).map(y => s"0.23.$y").toSet
ThisBuild / tlBaseVersion := "1.0"
ThisBuild / developers := List(
tlGitHubDev("rossabaker", "Ross A. Baker")
)

val Scala213 = "2.13.8"
ThisBuild / crossScalaVersions := Seq("2.12.15", Scala213)
ThisBuild / crossScalaVersions := Seq(Scala213, "3.1.2")
ThisBuild / scalaVersion := Scala213

lazy val root = project.in(file(".")).aggregate(scalatags).enablePlugins(NoPublishPlugin)

val http4sVersion = "0.23.12"
val scalatagsVersion = "0.10.0"
val http4sVersion = "1.0.0-M33"
val scalatagsVersion = "0.11.1"
val munitVersion = "0.7.29"
val munitCatsEffectVersion = "1.0.7"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ import org.http4s.Charset.`UTF-8`
import org.http4s.headers.`Content-Type`

trait ScalatagsInstances {
implicit def scalatagsEncoder[F[_], C <: Frag[_, String]](implicit
implicit def scalatagsEncoder[C <: Frag[_, String]](implicit
charset: Charset = `UTF-8`
): EntityEncoder[F, C] =
): EntityEncoder.Pure[C] =
contentEncoder(MediaType.text.html)

private def contentEncoder[F[_], C <: Frag[_, String]](
private def contentEncoder[C <: Frag[_, String]](
mediaType: MediaType
)(implicit charset: Charset): EntityEncoder[F, C] =
EntityEncoder
.stringEncoder[F]
)(implicit charset: Charset): EntityEncoder.Pure[C] =
EntityEncoder.stringEncoder
.contramap[C](content => content.render)
.withContentType(`Content-Type`(mediaType, charset))
}

0 comments on commit bafbe95

Please sign in to comment.