Skip to content

Commit

Permalink
Upgraded scommons libs
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Nov 17, 2021
1 parent 85308bb commit 05fb89b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 64 deletions.
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

//addSbtPlugin(("org.scommons.sbt" % "sbt-scommons-plugin" % "0.5.0-SNAPSHOT").changing())
addSbtPlugin("org.scommons.sbt" % "sbt-scommons-plugin" % "0.6.0")
//addSbtPlugin(("org.scommons.sbt" % "sbt-scommons-plugin" % "0.7.0-SNAPSHOT").changing())
addSbtPlugin("org.scommons.sbt" % "sbt-scommons-plugin" % "0.7.0")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
Expand Down
4 changes: 2 additions & 2 deletions project/src/main/scala/common/Libs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import scommons.sbtplugin.project.CommonLibs

object Libs extends CommonLibs {

val scommonsNodejsVersion = "0.6.0"
val scommonsReactVersion = "0.6.0"
val scommonsNodejsVersion = "0.7.0"
val scommonsReactVersion = "0.7.0"

lazy val scommonsNodejsCore = Def.setting("org.scommons.nodejs" %%% "scommons-nodejs-core" % scommonsNodejsVersion)
lazy val scommonsReactCore = Def.setting("org.scommons.react" %%% "scommons-react-core" % scommonsReactVersion)
Expand Down
3 changes: 3 additions & 0 deletions project/src/main/scala/definitions/MaterialUiModule.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package definitions

import common.Libs
import sbt.Keys._
import sbt._
import scommons.sbtplugin.project.CommonModule
import xerial.sbt.Sonatype.autoImport._

trait MaterialUiModule extends CommonModule {

val scommonsNodejsVersion: String = Libs.scommonsNodejsVersion

override val repoName = "scommons-material-ui"

override def definition: Project = {
Expand Down
56 changes: 2 additions & 54 deletions project/src/main/scala/definitions/NodeJsModule.scala
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
package definitions

import common.{Libs, TestLibs}
import org.scalajs.jsenv.nodejs.NodeJSEnv
import org.scalajs.sbtplugin.ScalaJSPlugin
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import sbt.Keys._
import sbt._
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport._
import scommons.sbtplugin.project.CommonModule.ideExcludedDirectories
import scommons.sbtplugin.project.CommonNodeJsModule
import scoverage.ScoverageKeys.{coverageEnabled, coverageScalacPluginVersion}
import scoverage.ScoverageSbtPlugin._

trait NodeJsModule extends MaterialUiModule {
trait NodeJsModule extends MaterialUiModule with CommonNodeJsModule {

override def definition: Project = {
super.definition
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.settings(NodeJsModule.settings: _*)
.settings(
//TODO: remove these temporal fixes for Scala.js 1.1+ and scoverage
coverageScalacPluginVersion := {
Expand All @@ -41,49 +34,4 @@ trait NodeJsModule extends MaterialUiModule {
}
)
}

override def superRepoProjectsDependencies: Seq[(String, String, Option[String])] = Seq(
("scommons-nodejs", "scommons-nodejs-core", None),

("scommons-nodejs", "scommons-nodejs-test", Some("test"))
)

override def runtimeDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting(Seq(
Libs.scommonsNodejsCore.value
))

override def testDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting(Seq(
TestLibs.scommonsNodejsTest.value
).map(_ % "test"))
}

object NodeJsModule {

val settings: Seq[Setting[_]] = Seq(
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
.withSourceMap(false)
.withESFeatures(_.withUseECMAScript2015(false))
},
requireJsDomEnv in Test := false,
version in webpack := "4.29.0",
webpackEmitSourceMaps := false,
parallelExecution in Test := false,

// required for node.js >= v12.12.0
// see:
// https://github.com/nodejs/node/pull/29919
scalaJSLinkerConfig in Test ~= {
_.withSourceMap(true)
},
jsEnv in Test := new NodeJSEnv(NodeJSEnv.Config().withArgs(List("--enable-source-maps"))),

ideExcludedDirectories ++= {
val base = baseDirectory.value
List(
base / "build",
base / "node_modules"
)
}
)
}
6 changes: 0 additions & 6 deletions project/src/main/scala/definitions/ScalaJsModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ package definitions

import common.{Libs, TestLibs}
import sbt._
import scommons.sbtplugin.project.CommonClientModule

trait ScalaJsModule extends NodeJsModule {

override def definition: Project = {
super.definition
.settings(CommonClientModule.settings: _*)
}

override def superRepoProjectsDependencies: Seq[(String, String, Option[String])] = {
super.superRepoProjectsDependencies ++ Seq(
("scommons-react", "scommons-react-core", None),
Expand Down

0 comments on commit 05fb89b

Please sign in to comment.