Skip to content

Commit 30aacd4

Browse files
authored
Merge pull request #103 from aslesarenko/scalably-typed
Setup ScalablyTyped
2 parents 1d2db26 + a0bc617 commit 30aacd4

File tree

6 files changed

+30
-22
lines changed

6 files changed

+30
-22
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
matrix:
2323
os: [ubuntu-latest]
24-
scala: [2.13.8, 2.12.15, 2.11.12]
24+
scala: [2.13.11, 2.12.18, 2.11.12]
2525
2626
runs-on: ${{ matrix.os }}
2727
steps:
@@ -64,7 +64,7 @@ jobs:
6464
strategy:
6565
matrix:
6666
os: [ubuntu-latest]
67-
scala: [2.13.8, 2.12.15]
67+
scala: [2.13.11]
6868
6969
node-version: [16.x]
7070
runs-on: ${{ matrix.os }}

build.sbt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name := "scrypto"
44
description := "Cryptographic primitives for Scala"
55
organization := "org.scorexfoundation"
66

7-
lazy val scala213 = "2.13.8"
8-
lazy val scala212 = "2.12.15"
7+
lazy val scala213 = "2.13.11"
8+
lazy val scala212 = "2.12.18"
99
lazy val scala211 = "2.11.12"
1010

1111
javacOptions ++=
@@ -15,7 +15,7 @@ javacOptions ++=
1515

1616
lazy val commonSettings = Seq(
1717
organization := "org.scorexfoundation",
18-
resolvers += Resolver.sonatypeRepo("public"),
18+
resolvers ++= Resolver.sonatypeOssRepos("public"),
1919
licenses := Seq("CC0" -> url("https://creativecommons.org/publicdomain/zero/1.0/legalcode")),
2020
homepage := Some(url("https://github.com/input-output-hk/scrypto")),
2121
pomExtra :=
@@ -34,7 +34,7 @@ lazy val commonSettings = Seq(
3434
),
3535
libraryDependencies ++= Seq(
3636
"org.rudogma" %%% "supertagged" % "2.0-RC2",
37-
"org.scorexfoundation" %%% "scorex-util" % "0.2.0",
37+
"org.scorexfoundation" %%% "scorex-util" % "0.2.1",
3838
"org.scalatest" %%% "scalatest" % "3.3.0-SNAP3" % Test,
3939
"org.scalatest" %%% "scalatest-propspec" % "3.3.0-SNAP3" % Test,
4040
"org.scalatest" %%% "scalatest-shouldmatchers" % "3.3.0-SNAP3" % Test,
@@ -71,17 +71,17 @@ lazy val scrypto = crossProject(JVMPlatform, JSPlatform)
7171

7272
lazy val scryptoJS = scrypto.js
7373
.enablePlugins(ScalaJSBundlerPlugin)
74-
.enablePlugins(ScalablyTypedConverterExternalNpmPlugin)
74+
.enablePlugins(ScalablyTypedConverterGenSourcePlugin)
7575
.settings(
7676
scalaVersion := scala213,
77-
crossScalaVersions := Seq(scala212, scala213),
77+
crossScalaVersions := Seq(scala213),
7878
libraryDependencies ++= Seq(
7979
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0",
8080
("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13)
8181
),
8282
Test / parallelExecution := false,
83-
// how to setup ScalablyTyped https://youtu.be/hWUAVrNj65c?t=1341
84-
externalNpm := { file(s"${baseDirectory.value}/..") },
83+
// how to setup ScalablyTyped https://scalablytyped.org/docs/library-developer
84+
stOutputPackage := "scorex",
8585
Compile / npmDependencies ++= Seq(
8686
"@noble/hashes" -> "1.1.4"
8787
),

js/src/main/scala/scorex/crypto/hash/Platform.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package scorex.crypto.hash
22

3-
import typings.nobleHashes.blake2Mod.BlakeOpts
4-
import typings.nobleHashes.mod.blake2b
5-
import typings.nobleHashes.sha256Mod.sha256
6-
import typings.nobleHashes.utilsMod
3+
import scorex.nobleHashes.blake2Mod.BlakeOpts
4+
import scorex.nobleHashes.blake2bMod.blake2b
5+
import scorex.nobleHashes.sha256Mod.sha256
6+
import scorex.nobleHashes.utilsMod
77

88
import scala.scalajs.js.typedarray.Uint8Array
99

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
sbt.version=1.5.4
1+
sbt.version=1.9.1
22

project/plugins.sbt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ logLevel := Level.Warn
33

44
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0")
55

6-
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
7-
8-
//addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")
6+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8")
97

108
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.3")
119

@@ -15,7 +13,7 @@ addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.0")
1513

1614
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
1715

18-
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
19-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
20-
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0")
21-
addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta37")
16+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.1")
17+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")
18+
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.21.1")
19+
addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta42")

shared/src/test/scala/scorex/ScalaJsSpec.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,14 @@ class ScalaJsSpec extends AnyPropSpec with Matchers {
151151
val lines = Source.fromString("abc").getLines.toSeq
152152
lines.length shouldBe 1
153153
}
154+
155+
property("System.currentTimeMillis") {
156+
val start = System.currentTimeMillis()
157+
println(s"time: $start ms")
158+
}
159+
160+
property("System.nanoTime") {
161+
val start = System.nanoTime()
162+
println(s"time: $start ns")
163+
}
154164
}

0 commit comments

Comments
 (0)