Skip to content

Commit

Permalink
ScalaJS Support for Smithy4s Modules (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
etspaceman authored Feb 24, 2023
1 parent 04c5e97 commit b106ed9
Show file tree
Hide file tree
Showing 64 changed files with 3,561 additions and 171 deletions.
36 changes: 33 additions & 3 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ pull_request_rules:
conditions:
- author=scala-steward
- body~=labels:.*early-semver-patch
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@17, rootJS)
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@17, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.12.17, temurin@17, rootNative)
- status-success=Build and Test (ubuntu-latest, 3.2.2, temurin@17, rootJS)
- status-success=Build and Test (ubuntu-latest, 3.2.2, temurin@17, rootJVM)
- status-success=Build and Test (ubuntu-latest, 3.2.2, temurin@17, rootNative)
- status-success=Build and Test (ubuntu-latest, 2.13.10, temurin@17, rootJS)
- status-success=Build and Test (ubuntu-latest, 2.13.10, temurin@17, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.13.10, temurin@17, rootNative)
actions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ import com.amazonaws.services.cloudwatch._
import com.amazonaws.services.dynamodbv2._
import com.amazonaws.services.kinesis._
import com.amazonaws.services.kinesis.model._
import retry.RetryPolicies._
import retry._

import kinesis4cats.compat.retry.RetryPolicies._
import kinesis4cats.compat.retry._

/** Helpers for constructing and leveraging AWS Java Client interfaces with
* Localstack.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import scala.concurrent.duration._
import cats.effect.syntax.all._
import cats.effect.{Async, Resource}
import cats.syntax.all._
import retry.RetryPolicies._
import retry._
import software.amazon.awssdk.http.SdkHttpConfigurationOption
import software.amazon.awssdk.http.async.SdkAsyncHttpClient
import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient
Expand All @@ -34,6 +32,9 @@ import software.amazon.awssdk.services.kinesis.KinesisAsyncClient
import software.amazon.awssdk.services.kinesis.model._
import software.amazon.awssdk.utils.AttributeMap

import kinesis4cats.compat.retry.RetryPolicies._
import kinesis4cats.compat.retry._

/** Helpers for constructing and leveraging AWS Java Client interfaces with
* Localstack.
*/
Expand Down
103 changes: 67 additions & 36 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,65 @@ lazy val compat = projectMatrix
)
.jvmPlatform(allScalaVersions)
.nativePlatform(allScalaVersions)
.jsPlatform(allScalaVersions)
.enableIntegrationTests

lazy val `kernel-tests` = projectMatrix
.enablePlugins(NoPublishPlugin)
.settings(
description := "Common test utilities",
libraryDependencies ++= testDependencies
libraryDependencies ++= testDependencies.value
)
.jvmPlatform(allScalaVersions)
.nativePlatform(last2ScalaVersions)
.jsPlatform(allScalaVersions)
.enableIntegrationTests
.dependsOn(`shared-localstack`)

lazy val shared = projectMatrix
.enablePlugins(ProtobufPlugin)
.settings(
description := "Common shared utilities",
libraryDependencies ++= Seq(
Aws.Aggregation.aggregator % Test,
Aws.Aggregation.deaggregator % Test,
Aws.kcl % Test,
Log4Cats.slf4j % Test
)
description := "Common shared utilities"
)
.jvmPlatform(allScalaVersions)
.nativePlatform(allScalaVersions)
.jsPlatform(allScalaVersions)
.enableIntegrationTests
.dependsOn(compat)

lazy val `shared-fs2` = projectMatrix
.settings(
description := "Common code for FS2",
libraryDependencies ++= Seq(FS2.core)
libraryDependencies ++= Seq(FS2.core.value)
)
.jvmPlatform(allScalaVersions)
.nativePlatform(allScalaVersions)
.jsPlatform(allScalaVersions)
.enableIntegrationTests
.dependsOn(shared)

lazy val `shared-circe` = projectMatrix
.settings(
description := "Common shared utilities for Circe",
libraryDependencies ++= Seq(
Circe.core,
Circe.parser
Circe.core.value,
Circe.parser.value
)
)
.jvmPlatform(allScalaVersions)
.nativePlatform(allScalaVersions)
.jsPlatform(allScalaVersions)
.enableIntegrationTests
.dependsOn(shared)

lazy val `shared-ciris` = projectMatrix
.settings(
description := "Common shared utilities for Ciris",
libraryDependencies ++= Seq(Ciris.core)
libraryDependencies ++= Seq(Ciris.core.value)
)
.jvmPlatform(allScalaVersions)
.nativePlatform(allScalaVersions)
.nativePlatform(last2ScalaVersions)
.jsPlatform(allScalaVersions)
.enableIntegrationTests
.dependsOn(shared)

Expand All @@ -74,15 +75,23 @@ lazy val `shared-localstack` = projectMatrix
description := "Common utilities for the localstack test-kits"
)
.jvmPlatform(allScalaVersions)
.nativePlatform(allScalaVersions)
.nativePlatform(last2ScalaVersions)
.jsPlatform(allScalaVersions)
.enableIntegrationTests
.dependsOn(shared, `shared-ciris`, `shared-circe`)

lazy val `shared-tests` = projectMatrix
.enablePlugins(NoPublishPlugin)
.settings(
description := "Common test interfaces",
libraryDependencies ++= testDependencies
libraryDependencies ++= testDependencies.value ++ Seq(
Aws.Aggregation.aggregator % Test,
Aws.Aggregation.deaggregator % Test,
Aws.kcl % Test,
Log4Cats.slf4j % Test,
Logback % Test,
CatsRetry.value
)
)
.jvmPlatform(allScalaVersions)
.enableIntegrationTests
Expand Down Expand Up @@ -129,7 +138,7 @@ lazy val kcl = projectMatrix
lazy val `kcl-fs2` = projectMatrix
.settings(
description := "FS2 interfaces for the KCL",
libraryDependencies ++= Seq(FS2.core)
libraryDependencies ++= Seq(FS2.core.value)
)
.jvmPlatform(allScalaVersions)
.enableIntegrationTests
Expand All @@ -140,10 +149,10 @@ lazy val `kcl-http4s` = projectMatrix
.settings(
description := "Http4s interfaces for the KCL",
libraryDependencies ++= Seq(
S4S.core(smithy4sVersion.value),
S4S.http4s(smithy4sVersion.value),
S4S.http4sSwagger(smithy4sVersion.value),
Http4s.emberServer
"com.disneystreaming.smithy4s" %%% "smithy4s-core" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %%% "smithy4s-http4s" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %%% "smithy4s-http4s-swagger" % smithy4sVersion.value,
Http4s.emberServer.value
)
)
.jvmPlatform(allScalaVersions)
Expand Down Expand Up @@ -211,8 +220,8 @@ lazy val `kcl-tests` = projectMatrix
description := "Integration Tests for the KCL",
libraryDependencies ++= Seq(
Logback,
Http4s.emberClient % FunctionalTest,
Http4s.emberClient % IT
Http4s.emberClient.value % FunctionalTest,
Http4s.emberClient.value % IT
),
assembly / assemblyMergeStrategy := {
case "module-info.class" => MergeStrategy.discard
Expand Down Expand Up @@ -290,7 +299,12 @@ lazy val `kpl-localstack` = projectMatrix
lazy val `kpl-tests` = projectMatrix
.enablePlugins(NoPublishPlugin)
.settings(
description := "Integration Tests for the KPL"
description := "Integration Tests for the KPL",
libraryDependencies ++= Seq(
Logback % IT,
Log4Cats.slf4j % IT
),
IT / javaOptions += "-Dcom.amazonaws.sdk.disableCertChecking=true"
)
.forkTests
.jvmPlatform(allScalaVersions)
Expand Down Expand Up @@ -341,7 +355,12 @@ lazy val `kinesis-client-localstack` = projectMatrix
lazy val `kinesis-client-tests` = projectMatrix
.enablePlugins(NoPublishPlugin)
.settings(
description := "Integration Tests for the Kinesis Client"
description := "Integration Tests for the Kinesis Client",
libraryDependencies ++= Seq(
Logback % IT,
Log4Cats.slf4j % IT,
FS2.reactiveStreams % IT
)
)
.jvmPlatform(allScalaVersions)
.enableIntegrationTests
Expand All @@ -356,7 +375,7 @@ lazy val `kinesis-client-producer-tests` = projectMatrix
.enablePlugins(NoPublishPlugin)
.settings(
description := "Integration Tests for the Client Kinesis Producer",
libraryDependencies ++= Seq(Log4Cats.slf4j % IT)
libraryDependencies ++= Seq(Log4Cats.slf4j % IT, Logback % IT)
)
.jvmPlatform(allScalaVersions)
.enableIntegrationTests
Expand Down Expand Up @@ -384,8 +403,8 @@ lazy val `smithy4s-client` = projectMatrix
.settings(
description := "Cats tooling for the Smithy4s Kinesis Client",
libraryDependencies ++= Seq(
S4S.http4sAws(smithy4sVersion.value),
Log4Cats.noop,
"com.disneystreaming.smithy4s" %%% "smithy4s-aws-http4s" % smithy4sVersion.value,
Log4Cats.noop.value,
Smithy.rulesEngine(smithy4s.codegen.BuildInfo.smithyVersion) % Smithy4s,
S4S.kinesis % Smithy4s
),
Expand All @@ -400,24 +419,27 @@ lazy val `smithy4s-client` = projectMatrix
) / Compile / packageBin).value
)
.jvmPlatform(last2ScalaVersions)
.nativePlatform(last2ScalaVersions)
.nativePlatform(Seq(Scala3))
.jsPlatform(last2ScalaVersions)
.enableIntegrationTests
.dependsOn(shared)

lazy val `smithy4s-client-fs2` = projectMatrix
.jvmPlatform(last2ScalaVersions)
.nativePlatform(last2ScalaVersions)
.nativePlatform(Seq(Scala3))
.jsPlatform(last2ScalaVersions)
.enableIntegrationTests
.dependsOn(`smithy4s-client`, `shared-fs2`)

lazy val `smithy4s-client-logging-circe` = projectMatrix
.enablePlugins(Smithy4sCodegenPlugin)
.settings(
description := "JSON structured logging instances for the Smithy4s Kinesis Client, via Circe",
libraryDependencies ++= Seq(Http4s.circe)
libraryDependencies ++= Seq(Http4s.circe.value)
)
.jvmPlatform(last2ScalaVersions)
.nativePlatform(last2ScalaVersions)
.nativePlatform(Seq(Scala3))
.jsPlatform(last2ScalaVersions)
.enableIntegrationTests
.dependsOn(`shared-circe`, `smithy4s-client`)

Expand All @@ -426,16 +448,22 @@ lazy val `smithy4s-client-localstack` = projectMatrix
description := "A test-kit for working with Kinesis and Localstack, via the Smithy4s Client project"
)
.jvmPlatform(last2ScalaVersions)
.nativePlatform(last2ScalaVersions)
.nativePlatform(Seq(Scala3))
.jsPlatform(last2ScalaVersions)
.dependsOn(`shared-localstack`, `smithy4s-client-fs2`)

lazy val `smithy4s-client-tests` = projectMatrix
.enablePlugins(NoPublishPlugin)
.settings(
description := "Integration Tests for the Smithy4s Kinesis Client",
libraryDependencies ++= Seq(Http4s.blazeClient % IT, Log4Cats.slf4j % IT)
libraryDependencies ++= Seq(
Http4s.blazeClient.value % IT
)
)
.jvmPlatform(last2ScalaVersions)
// TODO: Enable when ember client issues are fixed
// .nativePlatform(Seq(Scala3))
// .jsPlatform(last2ScalaVersions)
.enableIntegrationTests
.dependsOn(
`smithy4s-client-localstack` % IT,
Expand All @@ -447,7 +475,10 @@ lazy val `smithy4s-client-producer-tests` = projectMatrix
.enablePlugins(NoPublishPlugin)
.settings(
description := "Integration Tests for the Smithy4s Kinesis Producer",
libraryDependencies ++= Seq(Http4s.blazeClient % IT, Log4Cats.slf4j % IT)
libraryDependencies ++= Seq(
Http4s.blazeClient.value % IT,
Log4Cats.slf4j % IT
)
)
.jvmPlatform(last2ScalaVersions)
.enableIntegrationTests
Expand All @@ -466,8 +497,8 @@ lazy val docs = projectMatrix
.settings(
libraryDependencies ++= Seq(
Log4Cats.slf4j,
Http4s.emberClient,
Http4s.blazeClient
Http4s.emberClient.value,
Http4s.blazeClient.value
),
tlFatalWarningsInCi := false,
tlSiteApiPackage := Some("kinesis4cats"),
Expand Down
Loading

0 comments on commit b106ed9

Please sign in to comment.