Skip to content

Commit d9e3dab

Browse files
committed
update to scalajs 1.0.0-M1
1 parent c3f22dd commit d9e3dab

20 files changed

+4486
-435
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignore" : ["sjs.test.js"]
3+
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ npm-debug.log
3232

3333

3434
#project
35-
incubation/assets/
35+
incubation/assets/
36+
*.test.js
37+
*.test.js.map

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ env:
1818
JSENV=node
1919

2020
script:
21-
- sbt ++$TRAVIS_SCALA_VERSION test:fastOptJS test:fullOptJS
22-
- sbt ++$TRAVIS_SCALA_VERSION 'set parallelExecution in ThisBuild := false' test
23-
- sbt ++$TRAVIS_SCALA_VERSION 'set parallelExecution in ThisBuild := false' 'set scalaJSStage in ThisBuild := FullOptStage' test
21+
- sbt ++$TRAVIS_SCALA_VERSION testDev testProd
2422

2523

2624
deploy:

build.sbt

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "vdom"
22

3-
//version := "2017.4.0-SNAPSHOT"
3+
//version := "2017.7.0-SNAPSHOT"
44

55
enablePlugins(ScalaJSPlugin)
66

@@ -21,8 +21,9 @@ scalacOptions ++= Seq(
2121

2222
//Dependencies
2323
libraryDependencies ++= Seq(
24-
"scalajs-react-interface" %%% "core" % "2017.3.26-beta" % Provided,
25-
"scalajs-react-interface" %%% "universal" % "2017.4.9-beta" % Provided
24+
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided,
25+
"scalajs-react-interface" %%% "core" % "2017.7.9-RC" % Provided,
26+
"scalajs-react-interface" %%% "universal" % "2017.7.9-RC" % Provided
2627
)
2728

2829
//bintray
@@ -43,5 +44,40 @@ publishArtifact in Test := false
4344

4445
//Test
4546
resolvers += Resolver.bintrayRepo("scalajs-react-interface", "maven")
46-
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.0" % Test
47-
scalaJSStage in Global := FastOptStage
47+
scalaJSUseMainModuleInitializer in Test := true
48+
49+
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule))
50+
51+
val TEST_FILE = s"./sjs.test.js"
52+
53+
artifactPath in Test in fastOptJS := new File(TEST_FILE)
54+
artifactPath in Test in fullOptJS := new File(TEST_FILE)
55+
56+
val testDev = Def.taskKey[Unit]("test in dev mode")
57+
val testProd = Def.taskKey[Unit]("test in prod mode")
58+
59+
testDev := {
60+
(fastOptJS in Test).value
61+
runJest()
62+
}
63+
64+
testProd := {
65+
(fullOptJS in Test).value
66+
runJest()
67+
}
68+
69+
def runJest() = {
70+
import sys.process._
71+
val jestResult = "npm test".!
72+
if (jestResult != 0) throw new IllegalStateException("Jest Suite failed")
73+
}
74+
75+
resolvers += Resolver.bintrayRepo("scalajs-react-interface", "maven")
76+
resolvers += Resolver.bintrayRepo("scalajs-jest", "maven")
77+
78+
libraryDependencies ++= Seq(
79+
"org.scala-js" %%% "scalajs-dom" % "0.9.3" % Test,
80+
"scalajs-jest" %%% "core" % "2017.7.9-beta" % Test
81+
)
82+
//scalaJSStage in Global := FastOptStage
83+
scalaJSStage in Global := FullOptStage

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
"url": ""
88
},
99
"scripts": {
10-
"start": "webpack --watch & webpack-dev-server --progress --colors --port 8090",
11-
"build": "webpack --watch"
12-
},
13-
"devDependencies": {
14-
"jsdom-global": "2.1.1",
15-
"jsdom": "^9.9.1"
10+
"test": "jest"
1611
},
12+
"devDependencies": {},
1713
"dependencies": {
18-
14+
"jest": "^20.0.4"
1915
}
2016
}

project/build.properties

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

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.15")
1+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0-M1")
22
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
3-
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "1.1.1")
3+
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "1.3.0")
44
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")

0 commit comments

Comments
 (0)