Skip to content

Commit

Permalink
Update scala-did to 0.1.0-M13, Scala to 3.3.1, ScalaJs to 1.14.0 (#166)
Browse files Browse the repository at this point in the history
Update did, did-imp, did-method-peer to 0.1.0-M12
Minor fixes
Update Scala to 3.3.1, ScalaJs to 1.14.0
Update did, did-imp, did-method-peer to 0.1.0-M13
  • Loading branch information
FabioPinheiro authored and mineme0110 committed Apr 30, 2024
1 parent c2a7867 commit 529c91f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
14 changes: 5 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ resolvers ++= Resolver.sonatypeOssRepos("snapshots")

inThisBuild(
Seq(
scalaVersion := "3.3.0", // Also update docs/publishWebsite.sh and any ref to scala-3.3.0
scalaVersion := "3.3.1", // Also update docs/publishWebsite.sh and any ref to scala-3.3.1
)
)

/** Versions */
lazy val V = new {
val scalaDID = "0.1.0-M10"
val scalaDID = "0.1.0-M13"
// val scalajsJavaSecureRandom = "1.0.0"

// FIXME another bug in the test framework https://github.com/scalameta/munit/issues/554
val munit = "1.0.0-M10" // "0.7.29"

// // https://mvnrepository.com/artifact/org.scala-js/scalajs-dom
// val scalajsDom = "2.4.0"
// // val scalajsLogging = "1.1.2-SNAPSHOT" //"1.1.2"

// // https://mvnrepository.com/artifact/dev.zio/zio
Expand Down Expand Up @@ -60,8 +59,6 @@ lazy val D = new {
// .cross(CrossVersion.for3Use2_13)
// )

// val dom = Def.setting("org.scala-js" %%% "scalajs-dom" % V.scalajsDom)

val zio = Def.setting("dev.zio" %%% "zio" % V.zio)
// val zioStreams = Def.setting("dev.zio" %%% "zio-streams" % V.zio)
val zioJson = Def.setting("dev.zio" %%% "zio-json" % V.zioJson)
Expand Down Expand Up @@ -99,7 +96,6 @@ lazy val NPM = new {

val materialDesign = Seq("material-components-web" -> V.materialComponents)

val sha1 = Seq("js-sha1" -> "0.6.0", "@types/js-sha1" -> "0.6.0")
val sha256 = Seq("js-sha256" -> "0.9.0")
}

Expand Down Expand Up @@ -187,7 +183,7 @@ lazy val httpUtils = crossProject(JSPlatform, JVMPlatform) // project
libraryDependencies += D.scalaDID.value,
)
.jsConfigure(scalaJSBundlerConfigure)
.jsSettings(Compile / npmDependencies ++= NPM.sha1 ++ NPM.sha256)
.jsSettings(Compile / npmDependencies ++= NPM.sha256)
.jvmSettings(
libraryDependencies += D.zioHttp.value,
)
Expand Down Expand Up @@ -251,7 +247,7 @@ lazy val mediator = project
// pipelineStages ++= Seq(digest, gzip), //Compression - If you serve your Scala.js application from a web server, you should additionally gzip the resulting .js files.
Compile / unmanagedResourceDirectories += baseDirectory.value / "src" / "main" / "extra-resources",
// Compile / unmanagedResourceDirectories += (baseDirectory.value.toPath.getParent.getParent / "docs-build" / "target" / "mdoc").toFile,
// Compile / unmanagedResourceDirectories += (baseDirectory.value.toPath.getParent.getParent / "serviceworker" / "target" / "scala-3.3.0" / "fmgp-serviceworker-fastopt").toFile,
// Compile / unmanagedResourceDirectories += (baseDirectory.value.toPath.getParent.getParent / "serviceworker" / "target" / "scala-3.3.1" / "fmgp-serviceworker-fastopt").toFile,
Compile / compile := ((Compile / compile) dependsOn scalaJSPipeline).value,
// Frontend dependency configuration
Assets / WebKeys.packagePrefix := "public/",
Expand All @@ -272,7 +268,7 @@ lazy val webapp = project
libraryDependencies ++= Seq(D.laminar.value, D.waypoint.value, D.upickle.value),
libraryDependencies ++= Seq(D.zio.value, D.zioJson.value),
libraryDependencies ++= Seq(D.scalaDID.value, D.scalaDID_peer.value),
Compile / npmDependencies ++= NPM.qrcode ++ NPM.materialDesign ++ NPM.sha1 ++ NPM.sha256,
Compile / npmDependencies ++= NPM.qrcode ++ NPM.materialDesign ++ NPM.sha256,
)
.settings(
stShortModuleNames := true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@ object ActionUtils {
doc <- resolver
.didDocument(to)
.mapError(fail => MediatorDidError(fail))
mURL = doc.service.toSeq.flatten
.filter(_.`type` match {
case str: String => str == DIDService.TYPE_DIDCommMessaging
case seq: Seq[String] => seq.contains(DIDService.TYPE_DIDCommMessaging)
}) match {
case head +: next => // FIXME discarte the next
head.getServiceEndpointAsURIs.headOption // TODO head
case Seq() => None // TODO
services = {
doc.service.toSeq.flatten
.collect { case service: DIDServiceDIDCommMessaging =>
service
}
}
mURL = services.flatMap(_.endpoints.map(_.uri)).headOption // TODO head
jobToRun <- mURL match
case None => ZIO.logWarning(s"No url to send message")
case Some(url) => {
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
val scalaJSVersion = sys.env.getOrElse("SCALAJS_VERSION", "1.13.2")
val scalaJSVersion = sys.env.getOrElse("SCALAJS_VERSION", "1.14.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
Expand Down
4 changes: 2 additions & 2 deletions webapp/index-fastopt.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- https://material.io/develop/web/getting-started -->
<!-- <link href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css" rel="stylesheet"> -->
<link
href="./target/scala-3.3.0/scalajs-bundler/main/node_modules/material-components-web/dist/material-components-web.min.css"
href="./target/scala-3.3.1/scalajs-bundler/main/node_modules/material-components-web/dist/material-components-web.min.css"
rel="stylesheet">
<!-- <script src="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.js"></script> -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
Expand All @@ -24,7 +24,7 @@
}
</script>
<!-- My APP -->
<script type="text/javascript" src="./target/scala-3.3.0/scalajs-bundler/main/webapp-fastopt-bundle.js"></script>
<script type="text/javascript" src="./target/scala-3.3.1/scalajs-bundler/main/webapp-fastopt-bundle.js"></script>
</head>

<body style="margin:0;">
Expand Down
2 changes: 1 addition & 1 deletion webapp/index-fullopt.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet">
<!-- <script src="https://cdn.jsdelivr.net/npm/ipfs-http-client/dist/index.min.js"></script> -->
<script type="text/javascript" src="./target/scala-3.3.0/scalajs-bundler/main/webapp-fastopt-bundle.js"></script>
<script type="text/javascript" src="./target/scala-3.3.1/scalajs-bundler/main/webapp-fastopt-bundle.js"></script>
</head>

<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import MyRouter._
@JSExportTopLevel("AppUtils")
object AppUtils {

def onEnterPress = onKeyPress.filter(_.keyCode == dom.ext.KeyCode.Enter)
def onEnterPress = onKeyPress.filter(_.keyCode == dom.KeyCode.Enter)

val menuClickObserver = Observer[dom.MouseEvent](onNext = ev => {
import typings.materialDrawer.mod.MDCDrawer
Expand Down

0 comments on commit 529c91f

Please sign in to comment.