1- addCommandAlias(" restartWDS" , " ; demo/fastOptJS::stopWebpackDevServer; ~demo/fastOptJS::startWebpackDevServer" )
2-
3- lazy val root = project.in(file(" ." )).settings(commonSettings).aggregate(core, icons, lab, demo).settings(
4- name := " scalajs-react-material-ui" ,
5- skip in publish := true
6- )
1+ lazy val root = if (Settings .isDemoEnabled)
2+ project.in(file(" ." )).aggregate(core, icons, lab, bridge, demo).configure(Settings .rootProject)
3+ else
4+ project.in(file(" ." )).aggregate(core, icons, lab, bridge).configure(Settings .rootProject)
75
86inThisBuild(
97 List (
108 homepage := Some (url(" https://github.com/kinoplan/scalajs-react-material-ui" )),
119 licenses := Seq (" MIT" -> url(" http://opensource.org/licenses/MIT" )),
1210 developers := List (
1311 Developer (
14- " kazievab " ,
15- " Alexey Kaziev " ,
16- " kazievab@gmail.com " ,
17- url(" https://github.com/kazievab " )
12+ " kinoplan " ,
13+ " Kinoplan " ,
14+ " job@kinoplan.ru " ,
15+ url(" https://kinoplan.tech " )
1816 )
1917 ),
2018 scmInfo := Some (
@@ -28,53 +26,80 @@ inThisBuild(
2826
2927lazy val muiColorsGenerator = taskKey[Seq [File ]](" mui-colors-generator" )
3028
31- lazy val core = (project in file(" core" )).settings(commonSettings).settings(
29+ lazy val core = (project in file(" core" )).dependsOn(bridge)
30+ .settings(commonSettings).settings(
3231 name := " scalajs-react-material-ui-core" ,
33- scalaJSUseMainModuleInitializer := false ,
32+ scalaJSUseMainModuleInitializer := false ,
3433 npmDependencies in Compile ++= Settings .npmDependenciesCore.value,
34+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
3535 libraryDependencies ++= Settings .scalajsDependenciesLib.value,
36- muiColorsGenerator := Settings .generateColors (
36+ muiColorsGenerator := Generator .muiColors (
3737 (sourceManaged in Compile ).value / " io" / " kinoplan" / " scalajs" / " react" / " material" / " ui" / " core" / " colors" ,
3838 (npmInstallDependencies in Compile ).value
3939 ),
40- sourceGenerators in Compile += muiColorsGenerator.taskValue
40+ sourceGenerators in Compile += muiColorsGenerator.taskValue,
41+ sources in(Compile , doc) := Seq .empty,
42+ publishArtifact in(Compile , packageDoc) := false ,
4143).enablePlugins(ScalaJSBundlerPlugin )
4244
4345lazy val muiIconsGenerator = taskKey[Seq [File ]](" mui-icons-generator" )
4446
45- lazy val icons = (project in file(" icons" )).settings(commonSettings).settings(
47+ lazy val icons = (project in file(" icons" )).dependsOn(bridge)
48+ .settings(commonSettings).settings(
4649 name := " scalajs-react-material-ui-icons" ,
47- scalaJSUseMainModuleInitializer := false ,
50+ scalaJSUseMainModuleInitializer := false ,
4851 npmDependencies in Compile ++= Settings .npmDependenciesIcons.value,
52+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
4953 libraryDependencies ++= Settings .scalajsDependenciesLib.value,
50- muiIconsGenerator := Settings .generateIcons (
54+ muiIconsGenerator := Generator .muiIcons (
5155 (sourceManaged in Compile ).value / " io" / " kinoplan" / " scalajs" / " react" / " material" / " ui" / " icons" ,
5256 (npmInstallDependencies in Compile ).value
5357 ),
54- sourceGenerators in Compile += muiIconsGenerator.taskValue
58+ sourceGenerators in Compile += muiIconsGenerator.taskValue,
59+ sources in(Compile , doc) := Seq .empty,
60+ publishArtifact in(Compile , packageDoc) := false ,
5561).enablePlugins(ScalaJSBundlerPlugin )
5662
57- lazy val lab = (project in file(" lab" )).settings(commonSettings).settings(
63+ lazy val lab = (project in file(" lab" )).dependsOn(bridge)
64+ .settings(commonSettings).settings(
5865 name := " scalajs-react-material-ui-lab" ,
59- scalaJSUseMainModuleInitializer := false ,
66+ scalaJSUseMainModuleInitializer := false ,
6067 npmDependencies in Compile ++= Settings .npmDependenciesLab.value,
61- libraryDependencies ++= Settings .scalajsDependenciesLib.value
68+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
69+ libraryDependencies ++= Settings .scalajsDependenciesLib.value,
70+ sources in(Compile , doc) := Seq .empty,
71+ publishArtifact in(Compile , packageDoc) := false ,
6272).enablePlugins(ScalaJSBundlerPlugin )
6373
64- lazy val demo = (project in file(" demo" )).dependsOn(core, lab)
74+ lazy val demo = (project in file(" demo" )).dependsOn(core, lab, bridge )
6575 .settings(commonSettings).settings(
66- scalaJSUseMainModuleInitializer := true ,
76+ scalaJSUseMainModuleInitializer := true ,
77+ scalaJSLinkerConfig ~= (_.withSourceMap(false )),
78+ stUseScalaJsDom := false ,
79+ stFlavour := Flavour .Japgolly ,
80+ stIgnore ++= Settings .stIgnore,
81+ stOutputPackage := " io.kinoplan.scalajs.react.libs.external" ,
6782 npmDependencies in Compile ++= Settings .npmDependenciesDemo.value,
83+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
6884 libraryDependencies ++= Settings .scalajsDependenciesDemo.value,
69- webpackDevServerExtraArgs := Seq (" --inline" ),
70- yarnExtraArgs := Seq (" --silent" ),
71- webpackConfigFile in fastOptJS := Some (baseDirectory.value / " dev.webpack.config.js" ),
85+ webpackDevServerExtraArgs := Seq (" --inline" ),
86+ yarnExtraArgs := Seq (" --silent" ),
87+ webpackConfigFile in fastOptJS := Some (baseDirectory.value / " dev.webpack.config.js" ),
7288 skip in publish := true
73- ).enablePlugins(ScalaJSBundlerPlugin )
89+ ).enablePlugins(ScalaJSBundlerPlugin , ScalablyTypedConverterPlugin )
90+
91+ lazy val bridge = (project in file(" utils/bridge" )).settings(commonSettings).settings(
92+ name := " scalajs-react-bridge" ,
93+ scalaJSUseMainModuleInitializer := false ,
94+ npmDependencies in Compile ++= Settings .npmDependenciesBridge.value,
95+ npmResolutions in Compile ++= (npmDependencies in Compile ).value.toMap,
96+ libraryDependencies ++= Settings .scalajsDependenciesBridge.value
97+ ).enablePlugins(ScalaJSBundlerPlugin , BridgeGeneratorPlugin )
7498
7599lazy val commonSettings = Seq (
76100 version := Settings .version,
77- scalaVersion := Settings .versions.scala,
101+ crossScalaVersions := Seq (" 2.12.11" , " 2.13.3" ),
102+ scalaVersion := crossScalaVersions.value.last,
78103 organization := Settings .organization,
79104 description := Settings .description,
80105 homepage := Some (url(" https://github.com/kinoplan/scalajs-react-material-ui" )),
@@ -85,7 +110,23 @@ lazy val commonSettings = Seq(
85110 version in webpack := Settings .versions.bundler.webpack,
86111 version in startWebpackDevServer := Settings .versions.bundler.webpackDev,
87112 webpackCliVersion := Settings .versions.bundler.webpackCli,
88- emitSourceMaps := false ,
89113 javacOptions ++= Settings .javacOptions,
90- scalacOptions in ThisBuild ++= Settings .scalacOptions
114+ scalacOptions ++= Settings .scalacOptions,
115+ scalacOptions ~= (_.filterNot(
116+ Set (
117+ " -Wdead-code" ,
118+ " -Wunused:params" ,
119+ " -Ywarn-dead-code" ,
120+ " -Ywarn-unused:params" ,
121+ " -Ywarn-unused:patvars" ,
122+ " -Wunused:explicits"
123+ )
124+ ))
91125)
126+
127+ onLoad in Global := (
128+ " project bridge" ::
129+ " bridgeImplicitsGenerator" ::
130+ " project root" ::
131+ (_ : State )
132+ ) compose (onLoad in Global ).value
0 commit comments