outwatch-test/build.sbt
Rohan Sircar e5c3802e92 Many changes
Added odin logger
Used macwire and tagging for DI
JS libs now embedded with webpack instead of server from CDN
Refactored the application into components and pages
Added Chartjs and Fusejs demo with scalablytyped typings
2020-12-29 12:27:37 +05:30

149 lines
5.2 KiB
Scala

//organization := "wow.doge"
//name := "Outwatchtest"
//version := "0.1.0"
name := "OutwatchApp"
scalaVersion := "2.13.4"
resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies ++= Seq(
"com.github.outwatch.outwatch" %%% "outwatch" % "61deece8",
"com.github.outwatch.outwatch" %%% "outwatch-util" % "master-SNAPSHOT",
"com.github.cornerman.colibri" %%% "colibri-monix" % "master-SNAPSHOT",
"com.github.outwatch.outwatch" %%% "outwatch-monix" % "master-SNAPSHOT",
"org.scalatest" %%% "scalatest" % "3.2.0" % Test,
"org.typelevel" %%% "cats-core" % "2.1.1",
"org.typelevel" %%% "cats-effect" % "2.1.4",
"io.monix" %%% "monix" % "3.2.2",
"io.monix" %%% "monix-bio" % "1.1.0",
"io.circe" %%% "circe-core" % "0.13.0",
"io.circe" %%% "circe-generic" % "0.13.0",
"com.softwaremill.sttp.client" %%% "core" % "2.2.5",
"com.softwaremill.sttp.client" %%% "monix" % "2.2.5",
"com.softwaremill.sttp.client" %%% "circe" % "2.2.5",
// "com.softwaremill.sttp.client" %%% "async-http-client-backend-monix" % "2.2.5",
// "com.softwaremill.sttp.client3" %%% "httpclient-backend-monix" % "2.2.5",
// "com.softwaremill.macwire" %% "util" % "2.3.7" % "provided",
"com.softwaremill.common" %%% "tagging" % "2.2.1",
"com.softwaremill.macwire" %% "macros" % "2.3.7" % "provided",
// "com.softwaremill.macwire" %%% "macrosakka" % "2.3.6" % "provided",
"com.softwaremill.quicklens" %%% "quicklens" % "1.6.1",
// "com.typesafe.scala-logging" %%% "scala-logging" % "3.9.2",
// "io.circe" %%% "circe-config" % "0.8.0",
"org.akka-js" %%% "shocon" % "1.0.0",
"com.beachape" %%% "enumeratum-circe" % "1.6.1",
"com.github.valskalla" %%% "odin-core" % "0.7.0+95-ab4381ae+20201227-1831-SNAPSHOT"
// "com.clovellytech" %%% "outwatch-router" % "0.0.9+7-5be0b1a2+20201227-2019-SNAPSHOT"
)
Compile / npmDependencies ++= Seq(
"jquery" -> "3.3.1",
"popper.js" -> "1.16.1",
// // "@popperjs/core" -> "2.6.0",
"blk-design-system" -> "1.0.2",
"bootstrap" -> "4.5.3",
"@types/chart.js" -> "2.9.11",
"chart.js" -> "2.9.3",
"snabbdom" -> "git://github.com/outwatch/snabbdom.git#semver:0.7.5",
"fuse.js" -> "6.4.3"
)
Compile / npmDevDependencies ++= Seq(
"css-loader" -> "5.0.1",
"style-loader" -> "2.0.0",
"webpack-merge" -> "4.1",
"file-loader" -> "3.0.1",
"url-loader" -> "1.1.2"
)
stIgnore ++= List("jquery", "blk-design-system", "bootstrap")
stIgnore ++= List("snabbdom")
stStdlib := List("es6")
stUseScalaJsDom := false
enablePlugins(ScalaJSBundlerPlugin)
enablePlugins(ScalablyTypedConverterPlugin)
useYarn := true // makes scalajs-bundler use yarn instead of npm
requireJsDomEnv in Test := true
scalaJSUseMainModuleInitializer := true
// configure Scala.js to emit a JavaScript module instead of a top-level script
scalaJSLinkerConfig ~= (
/*hmm*/
_.withSourceMap(false)
.withModuleKind(ModuleKind.CommonJSModule)
)
scalacOptions ++=
Seq(
"-encoding",
"UTF-8",
"-deprecation",
"-feature",
"-language:existentials",
"-language:experimental.macros",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xlint",
"-Ywarn-numeric-widen",
"-Ymacro-annotations",
//silence warnings for by-name implicits
"-Wconf:cat=lint-byname-implicit:s",
//give errors on non exhaustive matches
"-Wconf:msg=match may not be exhaustive:e",
"-explaintypes" // Explain type errors in more detail.
)
// hot reloading configuration:
// https://github.com/scalacenter/scalajs-bundler/issues/180
addCommandAlias(
"dev",
"; compile; fastOptJS::startWebpackDevServer; devwatch; fastOptJS::stopWebpackDevServer"
)
addCommandAlias("devwatch", "~; fastOptJS; copyFastOptJS")
version in webpack := "4.43.0"
version in startWebpackDevServer := "3.11.0"
webpackDevServerExtraArgs := Seq("--progress", "--color")
webpackDevServerPort := 8080
webpackConfigFile in fastOptJS := Some(
baseDirectory.value / "webpack.config.dev.js"
)
// webpackConfigFile in fullOptJS := Some(
// baseDirectory.value / "webpack.config.js"
// )
// https://scalacenter.github.io/scalajs-bundler/cookbook.html#performance
webpackBundlingMode in fastOptJS := BundlingMode.LibraryOnly()
// when running the "dev" alias, after every fastOptJS compile all artifacts are copied into
// a folder which is served and watched by the webpack devserver.
// this is a workaround for: https://github.com/scalacenter/scalajs-bundler/issues/180
lazy val copyFastOptJS =
TaskKey[Unit]("copyFastOptJS", "Copy javascript files to target directory")
copyFastOptJS := {
val inDir = (crossTarget in (Compile, fastOptJS)).value
val outDir = (crossTarget in (Compile, fastOptJS)).value / "dev"
val files = Seq(
name.value.toLowerCase + "-fastopt-loader.js",
name.value.toLowerCase + "-fastopt.js"
// name.value.toLowerCase + "-fastopt.js.map"
) map { p => (inDir / p, outDir / p) }
IO.copy(
files,
overwrite = true,
preserveLastModified = true,
preserveExecutable = true
)
}
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.4.3"
inThisBuild(
List(
scalaVersion := scalaVersion.value, // 2.11.12, or 2.13.3
semanticdbEnabled := true, // enable SemanticDB
semanticdbVersion := "4.4.2" // use Scalafix compatible version
)
)