diff --git a/build.sbt b/build.sbt index 4e77e876..70c517f1 100755 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,36 @@ lazy val root = - if (Settings.isDemoEnabled) - project.in(file(".")).aggregate(core, icons, lab, bridge, demo).configure(Settings.rootProject) + if (ProjectSettings.isDemoEnabled) + project.in(file(".")).aggregate(core, icons, lab, bridge, demo).configure(ProjectSettings.rootProfile) else - project.in(file(".")).aggregate(core, icons, lab, bridge).configure(Settings.rootProject) + project.in(file(".")).aggregate(core, icons, lab, bridge).configure(ProjectSettings.rootProfile) + +lazy val core = project + .in(file("core")) + .enablePlugins(MuiColorsGeneratorPlugin) + .configure(Modules.coreProfile) + .dependsOn(bridge) + +lazy val icons = project + .in(file("icons")) + .enablePlugins(MuiIconsGeneratorPlugin) + .configure(Modules.iconsProfile) + .dependsOn(bridge) + +lazy val lab = project + .in(file("lab")) + .configure(Modules.labProfile) + .dependsOn(bridge) + +lazy val demo = project + .in(file("demo")) + .enablePlugins(ScalablyTypedConverterPlugin) + .configure(Modules.demoProfile) + .dependsOn(core, icons, lab, bridge) + +lazy val bridge = project + .in(file("utils/bridge")) + .enablePlugins(BridgeGeneratorPlugin) + .configure(Modules.bridgeProfile) // format: off inThisBuild( @@ -23,103 +51,6 @@ inThisBuild( ) // format: on -lazy val muiColorsGenerator = taskKey[Seq[File]]("mui-colors-generator") - -lazy val core = (project in file("core")) - .dependsOn(bridge) - .configure(commonProfile) - .settings( - name := "scalajs-react-material-ui-core", - scalaJSUseMainModuleInitializer := false, - npmDependencies in Compile ++= Settings.npmDependenciesCore.value, - npmResolutions in Compile ++= (npmDependencies in Compile).value.toMap, - libraryDependencies ++= Settings.scalajsDependenciesLib.value, - muiColorsGenerator := Generator.muiColors( - (sourceManaged in Compile).value / "io" / "kinoplan" / "scalajs" / "react" / "material" / "ui" / "core" / "colors", - (npmInstallDependencies in Compile).value - ), - sourceGenerators in Compile += muiColorsGenerator.taskValue -) - -lazy val muiIconsGenerator = taskKey[Seq[File]]("mui-icons-generator") - -lazy val icons = (project in file("icons")) - .dependsOn(bridge) - .configure(commonProfile) - .settings( - name := "scalajs-react-material-ui-icons", - scalaJSUseMainModuleInitializer := false, - npmDependencies in Compile ++= Settings.npmDependenciesIcons.value, - npmResolutions in Compile ++= (npmDependencies in Compile).value.toMap, - libraryDependencies ++= Settings.scalajsDependenciesLib.value, - muiIconsGenerator := Generator.muiIcons( - (sourceManaged in Compile).value / "io" / "kinoplan" / "scalajs" / "react" / "material" / "ui" / "icons", - (npmInstallDependencies in Compile).value - ), - sourceGenerators in Compile += muiIconsGenerator.taskValue -) - -lazy val lab = (project in file("lab")) - .dependsOn(bridge) - .configure(commonProfile) - .settings( - name := "scalajs-react-material-ui-lab", - scalaJSUseMainModuleInitializer := false, - npmDependencies in Compile ++= Settings.npmDependenciesLab.value, - npmResolutions in Compile ++= (npmDependencies in Compile).value.toMap, - libraryDependencies ++= Settings.scalajsDependenciesLib.value -) - -lazy val demo = (project in file("demo")).dependsOn(core, icons, lab, bridge) - .configure(commonProfile).settings( - scalaJSUseMainModuleInitializer := true, - scalaJSLinkerConfig ~= (_.withSourceMap(false)), - stUseScalaJsDom := false, - stFlavour := Flavour.Japgolly, - stIgnore ++= Settings.stIgnore, - stOutputPackage := "io.kinoplan.scalajs.react.libs.external", - npmDependencies in Compile ++= Settings.npmDependenciesDemo.value, - npmResolutions in Compile ++= (npmDependencies in Compile).value.toMap, - libraryDependencies ++= Settings.scalajsDependenciesDemo.value, - webpackDevServerExtraArgs := Seq("--inline"), - yarnExtraArgs := Seq("--silent"), - webpackConfigFile in fastOptJS := Some(baseDirectory.value / "dev.webpack.config.js"), - skip in publish := true -).enablePlugins(ScalablyTypedConverterPlugin) - -lazy val bridge = (project in file("utils/bridge")) - .configure(commonProfile) - .settings( - name := "scalajs-react-bridge", - scalaJSUseMainModuleInitializer := false, - npmDependencies in Compile ++= Settings.npmDependenciesBridge.value, - npmResolutions in Compile ++= (npmDependencies in Compile).value.toMap, - libraryDependencies ++= Settings.scalajsDependenciesLib.value -).enablePlugins(BridgeGeneratorPlugin) - -lazy val commonProfile: Project => Project = - _.enablePlugins(ScalaJSBundlerPlugin, ScalafixPlugin).settings( - crossScalaVersions := Seq("2.12.15", "2.13.7"), - scalaVersion := crossScalaVersions.value.last, - description := Settings.description, - webpackBundlingMode := BundlingMode.LibraryOnly(), - useYarn := true, - version in webpack := Settings.versions.bundler.webpack, - version in startWebpackDevServer := Settings.versions.bundler.webpackDev, - webpackCliVersion := Settings.versions.bundler.webpackCli, - javacOptions ++= Settings.javacOptions, - scalacOptions ~= (_.filterNot( - Set( - "-Wdead-code", - "-Wunused:params", - "-Ywarn-dead-code", - "-Ywarn-unused:params", - "-Ywarn-unused:patvars", - "-Wunused:explicits" - ) - )) -) - onLoad in Global := ( "project bridge" :: "bridgeImplicitsGenerator" :: diff --git a/commands.sbt b/commands.sbt index 99e8331c..8d7996dd 100644 --- a/commands.sbt +++ b/commands.sbt @@ -1,4 +1,3 @@ -addCommandAlias("fix", ";+scalafixAll") -addCommandAlias("fixCheck", ";scalafixAll --check") +addCommandAlias("fix", "+scalafixAll") addCommandAlias("dev", "; demo/fastOptJS::stopWebpackDevServer; ~demo/fastOptJS::startWebpackDevServer") diff --git a/project/BridgeGeneratorPlugin.scala b/project/BridgeGeneratorPlugin.scala index 86f1342a..25f4d731 100644 --- a/project/BridgeGeneratorPlugin.scala +++ b/project/BridgeGeneratorPlugin.scala @@ -1,6 +1,6 @@ import sbt.Keys._ +import sbt.plugins.JvmPlugin import sbt._ -import sbt.plugins._ object BridgeGeneratorPlugin extends AutoPlugin { override def requires = JvmPlugin @@ -8,9 +8,45 @@ object BridgeGeneratorPlugin extends AutoPlugin { lazy val bridgeImplicitsGenerator = taskKey[Seq[File]]("bridge-implicits-generator") override lazy val projectSettings = Seq( - bridgeImplicitsGenerator := Generator.bridgeImplicits( - (sourceManaged in Compile).value / "io" / "kinoplan" / "scalajs" / "react" / "bridge" + bridgeImplicitsGenerator := bridgeImplicits( + (Compile / sourceManaged).value / "io" / "kinoplan" / "scalajs" / "react" / "bridge" ), - sourceGenerators in Compile += bridgeImplicitsGenerator.taskValue + Compile / sourceGenerators += bridgeImplicitsGenerator.taskValue ) + + def bridgeImplicits(src: File) = { + val moduleFile: File = src / "GeneratedImplicits.scala" + + val functions = (0 to 22).map { arity => + val indices = 1 to arity + val types = indices.map(i => s"T$i") :+ "R" + val tParams = types.mkString(", ") + val params = indices.map(i => s"x$i: T$i").mkString(", ") + val args = indices.map(i => s"x$i").mkString(", ") + + s""" + | implicit def function${arity}Writer[$tParams](implicit writerR: JsWriter[R]): JsWriter[Function$arity[$tParams]] = { + | new JsWriter[Function$arity[$tParams]] { + | override def toJs(value: Function$arity[$tParams]): js.Any = + | fromFunction$arity(($params) => writerR.toJs(value($args))) + | } + | }""".stripMargin + }.mkString("\n") + + IO.write( + moduleFile, + s""" + |package io.kinoplan.scalajs.react.bridge + | + |import scala.scalajs.js + |import scala.scalajs.js.Any._ + | + |trait GeneratedImplicits { + | $functions + |} + """.stripMargin.trim + ) + + Seq(moduleFile) + } } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index d56f5a64..eec83e13 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -4,19 +4,20 @@ import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._ object Dependencies { object Versions { + val catsCoreV = "2.6.1" val scalaCssV = "0.7.0" + val scalaJsDomV = "1.2.0" val scalaJsReactV = "1.7.7" } import Versions._ //A -> Z - val catsCore = Def.setting("org.typelevel" %%% "cats-core" % "2.6.1") + val catsCore = Def.setting("org.typelevel" %%% "cats-core" % catsCoreV) val scalaCssCore = Def.setting("com.github.japgolly.scalacss" %%% "core" % scalaCssV) val scalaCssExtReact = Def.setting("com.github.japgolly.scalacss" %%% "ext-react" % scalaCssV) val scalaCssExtScalatags = Def.setting("com.github.japgolly.scalacss" %% "ext-scalatags" % scalaCssV) - val scalaJsDom = Def.setting("org.scala-js" %%% "scalajs-dom" % "1.2.0") + val scalaJsDom = Def.setting("org.scala-js" %%% "scalajs-dom" % scalaJsDomV) val scalaJsReactCore = Def.setting("com.github.japgolly.scalajs-react" %%% "core" % scalaJsReactV) val scalaJsReactExtra = Def.setting("com.github.japgolly.scalajs-react" %%% "extra" % scalaJsReactV) - val scalablyTypedRuntime = Def.setting("com.olvind" %%% "scalablytyped-runtime" % "2.1.0") } diff --git a/project/Generator.scala b/project/Generator.scala deleted file mode 100644 index ea9173f1..00000000 --- a/project/Generator.scala +++ /dev/null @@ -1,105 +0,0 @@ -import sbt._ - -object Generator { - def bridgeImplicits(src: File) = { - val moduleFile: File = src / "GeneratedImplicits.scala" - - val functions = (0 to 22).map { arity => - val indices = 1 to arity - val types = indices.map(i => s"T$i") :+ "R" - val tParams = types.mkString(", ") - val params = indices.map(i => s"x$i: T$i").mkString(", ") - val args = indices.map(i => s"x$i").mkString(", ") - - s""" - | implicit def function${arity}Writer[$tParams](implicit writerR: JsWriter[R]): JsWriter[Function$arity[$tParams]] = { - | new JsWriter[Function$arity[$tParams]] { - | override def toJs(value: Function$arity[$tParams]): js.Any = - | fromFunction$arity(($params) => writerR.toJs(value($args))) - | } - | }""".stripMargin - }.mkString("\n") - - IO.write( - moduleFile, - s""" - |package io.kinoplan.scalajs.react.bridge - | - |import scala.scalajs.js - |import scala.scalajs.js.Any._ - | - |trait GeneratedImplicits { - | $functions - |} - """.stripMargin.trim - ) - - Seq(moduleFile) - } - - def muiColors(src: File, npm: File): Seq[File] = { - val path = npm / "node_modules" / "@material-ui" / "core" / "colors" - val extensions = "*.js" -- "index.js" -- "index.es.js" -- "common.js" - - val colorSources = path * extensions - - val colorsPackageFile = src / "package.scala" - - val colorsPackage = colorSources.get.sortBy(_.getName).map(file => { - val name = file.getName.stripSuffix(".js") - - s""" @JSImport("@material-ui/core/colors/$name", JSImport.Default) - | @js.native - | object $name extends Color - |""".stripMargin - }).mkString( - start = - """package io.kinoplan.scalajs.react.material.ui.core - | - |import scala.scalajs.js - |import scala.scalajs.js.annotation.JSImport - | - |package object colors { - | - |""".stripMargin, - sep = "\n", - end = - """ - | @JSImport("@material-ui/core/colors/common", JSImport.Default) - | @js.native - | object common extends CommonColors - |} - |""".stripMargin - ) - - IO.write(colorsPackageFile, colorsPackage) - - Seq(colorsPackageFile) - } - - def muiIcons(src: File, npm: File): Seq[File] = { - val iconSources = (npm / "node_modules" / "@material-ui" / "icons") * ("*.js" -- "index.js" -- "index.es.js") - - val iconNames = iconSources.get.map(_.getName.stripSuffix(".js")).sorted - - val moduleFile: File = src / "MuiIconsModule.scala" - - val moduleIcons = iconNames.map(name => s"""| def $name: js.Any = js.native""".stripMargin).mkString("\n") - - IO.write( - moduleFile, - s"""package io.kinoplan.scalajs.react.material.ui.icons - | - |import scala.scalajs.js - |import scala.scalajs.js.annotation.JSImport - | - |@js.native - |@JSImport("@material-ui/icons", JSImport.Namespace) - |object MuiIconsModule extends js.Object { - | type Value = js.Any - """.stripMargin.trim + "\n\n" + moduleIcons + "\n" + "}\n" - ) - - Seq(moduleFile) - } -} diff --git a/project/Modules.scala b/project/Modules.scala new file mode 100644 index 00000000..5ba9edbe --- /dev/null +++ b/project/Modules.scala @@ -0,0 +1,113 @@ +import org.scalablytyped.converter.plugin.ScalablyTypedPluginBase.autoImport._ +import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ +import sbt.Keys._ +import sbt._ +import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport._ + +object Modules { + + lazy val coreProfile: Project => Project = _ + .configure(ProjectSettings.commonProfile) + .settings(name := "scalajs-react-material-ui-core") + .settings(scalaJSUseMainModuleInitializer := false) + .settings( + libraryDependencies ++= Seq(Dependencies.scalaJsReactCore.value), + Compile / npmDependencies ++= Seq( + DependenciesNPM.react, + DependenciesNPM.reactDom, + DependenciesNPM.materialUiCore + ), + Compile / npmResolutions ++= (Compile / npmDependencies).value.toMap, + ) + + lazy val iconsProfile: Project => Project = _ + .configure(ProjectSettings.commonProfile) + .settings(name := "scalajs-react-material-ui-icons") + .settings(scalaJSUseMainModuleInitializer := false) + .settings( + libraryDependencies ++= Seq(Dependencies.scalaJsReactCore.value), + Compile / npmDependencies ++= Seq( + DependenciesNPM.react, + DependenciesNPM.reactDom, + DependenciesNPM.materialUiCore, + DependenciesNPM.materialUiIcons + ), + Compile / npmResolutions ++= (Compile / npmDependencies).value.toMap, + ) + + lazy val labProfile: Project => Project = _ + .configure(ProjectSettings.commonProfile) + .settings(name := "scalajs-react-material-ui-lab") + .settings(scalaJSUseMainModuleInitializer := false) + .settings( + libraryDependencies ++= Seq(Dependencies.scalaJsReactCore.value), + Compile / npmDependencies ++= Seq( + DependenciesNPM.react, + DependenciesNPM.reactDom, + DependenciesNPM.materialUiCore, + DependenciesNPM.materialUiLab + ), + Compile / npmResolutions ++= (Compile / npmDependencies).value.toMap, + ) + + lazy val bridgeProfile: Project => Project = _ + .configure(ProjectSettings.commonProfile) + .settings(name := "scalajs-react-bridge") + .settings(scalaJSUseMainModuleInitializer := false) + .settings( + libraryDependencies ++= Seq(Dependencies.scalaJsReactCore.value), + Compile / npmDependencies ++= Seq( + DependenciesNPM.react, + DependenciesNPM.reactDom + ), + Compile / npmResolutions ++= (Compile / npmDependencies).value.toMap, + ) + + lazy val demoProfile: Project => Project = _ + .configure(ProjectSettings.commonProfile) + .settings( + scalaJSUseMainModuleInitializer := true, + scalaJSLinkerConfig ~= (_.withSourceMap(false)), + webpackDevServerExtraArgs := Seq("--inline"), + yarnExtraArgs := Seq("--silent"), + fastOptJS / webpackConfigFile := Some(baseDirectory.value / "dev.webpack.config.js"), + stUseScalaJsDom := false, + stFlavour := Flavour.Japgolly, + stIgnore ++= List( + "react-dom", + "@material-ui/core", + "@material-ui/icons", + "@material-ui/lab", + "@material-ui/types" + ), + stOutputPackage := "io.kinoplan.scalajs.react.libs.external" + ) + .settings( + libraryDependencies ++= Seq( + Dependencies.catsCore.value, + Dependencies.scalaCssCore.value, + Dependencies.scalaCssExtReact.value, + Dependencies.scalaCssExtScalatags.value, + Dependencies.scalaJsDom.value, + Dependencies.scalaJsReactCore.value, + Dependencies.scalaJsReactExtra.value + ), + Compile / npmDependencies ++= Seq( + DependenciesNPM.react, + DependenciesNPM.reactDom, + DependenciesNPM.materialUiCore, + DependenciesNPM.materialUiIcons, + DependenciesNPM.materialUiLab, + DependenciesNPM.reactSwipeableViews, + DependenciesNPM.reactSwipeableViewsUtils, + DependenciesNPM.typesReactSwipeableViewsUtils, + DependenciesNPM.typesReactSwipeableViews, + DependenciesNPM.typesReactSwipeableViewsUtils, + DependenciesNPM.typesReact, + DependenciesNPM.typesReactDom + ), + Compile / npmResolutions ++= (Compile / npmDependencies).value.toMap, + ) + .settings(publish / skip := true) + +} diff --git a/project/MuiColorsGeneratorPlugin.scala b/project/MuiColorsGeneratorPlugin.scala new file mode 100644 index 00000000..ef64ed67 --- /dev/null +++ b/project/MuiColorsGeneratorPlugin.scala @@ -0,0 +1,58 @@ +import sbt.Keys._ +import sbt.plugins.JvmPlugin +import sbt._ +import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport.npmInstallDependencies + +object MuiColorsGeneratorPlugin extends AutoPlugin { + override def requires = JvmPlugin + + lazy val muiColorsGenerator = taskKey[Seq[File]]("mui-colors-generator") + + override lazy val projectSettings = Seq( + muiColorsGenerator := muiColors( + (Compile / sourceManaged).value / "io" / "kinoplan" / "scalajs" / "react" / "material" / "ui" / "core" / "colors", + (Compile / npmInstallDependencies).value + ), + Compile / sourceGenerators += muiColorsGenerator.taskValue + ) + + def muiColors(src: File, npm: File): Seq[File] = { + val path = npm / "node_modules" / "@material-ui" / "core" / "colors" + val extensions = "*.js" -- "index.js" -- "index.es.js" -- "common.js" + + val colorSources = path * extensions + + val colorsPackageFile = src / "package.scala" + + val colorsPackage = colorSources.get.sortBy(_.getName).map(file => { + val name = file.getName.stripSuffix(".js") + + s""" @JSImport("@material-ui/core/colors/$name", JSImport.Default) + | @js.native + | object $name extends Color + |""".stripMargin + }).mkString( + start = + """package io.kinoplan.scalajs.react.material.ui.core + | + |import scala.scalajs.js + |import scala.scalajs.js.annotation.JSImport + | + |package object colors { + | + |""".stripMargin, + sep = "\n", + end = + """ + | @JSImport("@material-ui/core/colors/common", JSImport.Default) + | @js.native + | object common extends CommonColors + |} + |""".stripMargin + ) + + IO.write(colorsPackageFile, colorsPackage) + + Seq(colorsPackageFile) + } +} diff --git a/project/MuiIconsGeneratorPlugin.scala b/project/MuiIconsGeneratorPlugin.scala new file mode 100644 index 00000000..12018ed3 --- /dev/null +++ b/project/MuiIconsGeneratorPlugin.scala @@ -0,0 +1,44 @@ +import sbt.Keys._ +import sbt.plugins.JvmPlugin +import sbt._ +import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport.npmInstallDependencies + +object MuiIconsGeneratorPlugin extends AutoPlugin { + override def requires = JvmPlugin + + lazy val muiIconsGenerator = taskKey[Seq[File]]("mui-icons-generator") + + override lazy val projectSettings = Seq( + muiIconsGenerator := muiIcons( + (Compile / sourceManaged).value / "io" / "kinoplan" / "scalajs" / "react" / "material" / "ui" / "icons", + (Compile / npmInstallDependencies).value + ), + Compile / sourceGenerators += muiIconsGenerator.taskValue + ) + + def muiIcons(src: File, npm: File): Seq[File] = { + val iconSources = (npm / "node_modules" / "@material-ui" / "icons") * ("*.js" -- "index.js" -- "index.es.js") + + val iconNames = iconSources.get.map(_.getName.stripSuffix(".js")).sorted + + val moduleFile: File = src / "MuiIconsModule.scala" + + val moduleIcons = iconNames.map(name => s"""| def $name: js.Any = js.native""".stripMargin).mkString("\n") + + IO.write( + moduleFile, + s"""package io.kinoplan.scalajs.react.material.ui.icons + | + |import scala.scalajs.js + |import scala.scalajs.js.annotation.JSImport + | + |@js.native + |@JSImport("@material-ui/icons", JSImport.Namespace) + |object MuiIconsModule extends js.Object { + | type Value = js.Any + """.stripMargin.trim + "\n\n" + moduleIcons + "\n" + "}\n" + ) + + Seq(moduleFile) + } +} diff --git a/project/ProjectSettings.scala b/project/ProjectSettings.scala new file mode 100644 index 00000000..614cf49f --- /dev/null +++ b/project/ProjectSettings.scala @@ -0,0 +1,42 @@ +import sbt.Keys._ +import sbt._ +import scalafix.sbt.ScalafixPlugin +import scalajsbundler.BundlingMode +import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin +import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport._ + +object ProjectSettings { + + val isDemoEnabled: Boolean = Option(System.getenv("DEMO_ENABLED")).getOrElse("1").startsWith("1") + + lazy val commonProfile: Project => Project = _ + .enablePlugins(ScalaJSBundlerPlugin, ScalafixPlugin) + .settings( + crossScalaVersions := Seq("2.12.15", "2.13.7"), + scalaVersion := crossScalaVersions.value.last, + webpackBundlingMode := BundlingMode.LibraryOnly(), + useYarn := true, + webpack / version := "4.41.5", + startWebpackDevServer / version := "3.10.2", + webpackCliVersion := "3.3.10", + scalacOptions ~= (_.filterNot( + Set( + "-Wdead-code", + "-Wunused:params", + "-Ywarn-dead-code", + "-Ywarn-unused:params", + "-Ywarn-unused:patvars", + "-Wunused:explicits" + ) + )) + ) + + lazy val rootProfile: Project => Project = _ + .settings( + name := "scalajs-react-material-ui", + publish / skip := true, + publishLocal / skip := true, + publishArtifact / skip := true, + Keys.`package` := file("") + ) +} diff --git a/project/Settings.scala b/project/Settings.scala deleted file mode 100644 index 20dfd8e9..00000000 --- a/project/Settings.scala +++ /dev/null @@ -1,92 +0,0 @@ -import sbt.Keys._ -import sbt._ - -object Settings { - val description = "scalajs-react facade for material-ui" - - val isScalaJSVersion06 = Option(System.getenv("SCALAJS_VERSION")).exists(_.startsWith("0.6")) - - val isDemoEnabled = Option(System.getenv("DEMO_ENABLED")).getOrElse("1").startsWith("1") - - val isPublishVersion = Option(System.getenv("PUBLISH_VERSION")).getOrElse("0").startsWith("1") - - object versions { - object bundler { - val webpack = "4.41.5" - val webpackDev = "3.10.2" - val webpackCli = "3.3.10" - } - } - - val scalajsDependenciesLib = Def.setting(Seq( - Dependencies.scalaJsReactCore.value - )) - - val scalajsDependenciesDemo = Def.setting(Seq( - Dependencies.catsCore.value, - Dependencies.scalaCssCore.value, - Dependencies.scalaCssExtReact.value, - Dependencies.scalaCssExtScalatags.value, - Dependencies.scalaJsDom.value, - Dependencies.scalaJsReactCore.value, - Dependencies.scalaJsReactExtra.value - )) - - val reactDependencies = Seq( - DependenciesNPM.react, - DependenciesNPM.reactDom - ) - - val npmDependenciesCore = Def.setting(reactDependencies ++ Seq( - DependenciesNPM.materialUiCore - )) - - val npmDependenciesIcons = Def.setting(reactDependencies ++ Seq( - DependenciesNPM.materialUiCore, - DependenciesNPM.materialUiIcons - )) - - val npmDependenciesLab = Def.setting(reactDependencies ++ Seq( - DependenciesNPM.materialUiCore, - DependenciesNPM.materialUiLab - )) - - val npmDependenciesDemo = Def.setting(reactDependencies ++ Seq( - DependenciesNPM.materialUiCore, - DependenciesNPM.materialUiIcons, - DependenciesNPM.materialUiLab, - DependenciesNPM.reactSwipeableViews, - DependenciesNPM.reactSwipeableViewsUtils, - DependenciesNPM.typesReactSwipeableViewsUtils, - DependenciesNPM.typesReactSwipeableViews, - DependenciesNPM.typesReactSwipeableViewsUtils, - DependenciesNPM.typesReact, - DependenciesNPM.typesReactDom - )) - - val npmDependenciesBridge = Def.setting(reactDependencies) - - val javacOptions = Seq( - "-source", "1.8", - "-target", "1.8", - "-Xlint" - ) - - val scalacOptions = if (isScalaJSVersion06) Seq("-P:scalajs:sjsDefinedByDefault") else Nil - - val stIgnore = List( - "react-dom", - "@material-ui/core", - "@material-ui/icons", - "@material-ui/lab", - "@material-ui/types" - ) - - lazy val rootProject: Project => Project = _.settings( - name := "scalajs-react-material-ui", - skip in publish := true, - skip in publishLocal := true, - skip in publishArtifact := true, - Keys.`package` := file("") - ) -} diff --git a/project/plugins.sbt b/project/plugins.sbt index 4ffcae8a..21aac048 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,7 +4,7 @@ addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta33") addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) -addSbtPlugin("ch.epfl.scala" % s"sbt-scalajs-bundler" % s"0.20.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.20")