Skip to content

Commit f4c8500

Browse files
committed
Release v1.1.0
- Updated scalajs-react to the latest v2 RC (2.0.0-RC4) - Added support for scalajs-react's core-generic module (See [Effect agnosticism](https://github.com/japgolly/scalajs-react/blob/master/doc/FX_AGNOSTICISM.md)) - Fixed the default npm path (previously was my personal config, whoops)
1 parent 99d381a commit f4c8500

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

project/NextApp.scala

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ import scala.sys.process._
1313
object NextApp extends AutoPlugin {
1414
override def requires = ScalaJSPlugin
1515
override def trigger = noTrigger
16-
private val scalaJsReactVersion = "2.0.0-RC3"
1716

1817
object autoImport {
1918
val npm = SettingKey[String]("npm", "The path to the npm executable")
19+
val scalaJsReactVersion =
20+
SettingKey[String](
21+
"scalaJsReactVersion",
22+
"The version of scalaJsReact to use"
23+
)
24+
val scalaJsReactUseGeneric = SettingKey[Boolean](
25+
"scalaJsReactUseGeneric",
26+
"Whether to use the 'core-generic' module scalajs-react, that provides effect agnositicism"
27+
)
2028
val nextServerProcess = AttributeKey[Option[Process]](
2129
"nextServerProcess",
2230
"A handle to the currently-running next dev server"
@@ -51,10 +59,20 @@ object NextApp extends AutoPlugin {
5159
(Compile / fastLinkJS / scalaJSLinkerConfig) ~= {
5260
_.withModuleSplitStyle(ModuleSplitStyle.SmallestModules)
5361
},
54-
libraryDependencies ++= Seq(
55-
"com.github.japgolly.scalajs-react" %%% "core" % scalaJsReactVersion
56-
),
57-
npm := "/Users/gbogard/.nix-profile/bin/npm",
62+
scalaJsReactVersion := "2.0.0-RC4",
63+
scalaJsReactUseGeneric := false,
64+
libraryDependencies ++=
65+
(if (scalaJsReactUseGeneric.value) {
66+
Seq(
67+
"com.github.japgolly.scalajs-react" %%% "core-generic" % scalaJsReactVersion.value,
68+
"com.github.japgolly.scalajs-react" %%% "util-dummy-defaults" % scalaJsReactVersion.value
69+
)
70+
} else {
71+
Seq(
72+
"com.github.japgolly.scalajs-react" %%% "core" % scalaJsReactVersion.value
73+
)
74+
}),
75+
npm := "npm",
5876
startNextServer := {
5977
if (!nextServerIsRunning.value) {
6078
val log = streams.value.log
@@ -84,6 +102,6 @@ object NextApp extends AutoPlugin {
84102
},
85103
npmInstall := Process(Seq(npm.value, "install"), baseDirectory.value).!,
86104
nextBuild := Process(Seq(npm.value, "run", "build"), baseDirectory.value).!,
87-
nextBuild := nextBuild.dependsOn(Compile / fullLinkJS).value,
105+
nextBuild := nextBuild.dependsOn(Compile / fullLinkJS).value
88106
)
89107
}

0 commit comments

Comments
 (0)