You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
5.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. //organization := "wow.doge"
  2. //name := "Outwatchtest"
  3. //version := "0.1.0"
  4. name := "OutwatchApp"
  5. scalaVersion := "2.13.4"
  6. resolvers += "jitpack" at "https://jitpack.io"
  7. libraryDependencies ++= Seq(
  8. "com.github.outwatch.outwatch" %%% "outwatch" % "61deece8",
  9. "com.github.outwatch.outwatch" %%% "outwatch-util" % "master-SNAPSHOT",
  10. "com.github.cornerman.colibri" %%% "colibri-monix" % "master-SNAPSHOT",
  11. "com.github.outwatch.outwatch" %%% "outwatch-monix" % "master-SNAPSHOT",
  12. "org.scalatest" %%% "scalatest" % "3.2.0" % Test,
  13. "org.typelevel" %%% "cats-core" % "2.1.1",
  14. "org.typelevel" %%% "cats-effect" % "2.1.4",
  15. "io.monix" %%% "monix" % "3.2.2",
  16. "io.monix" %%% "monix-bio" % "1.1.0",
  17. "io.circe" %%% "circe-core" % "0.13.0",
  18. "io.circe" %%% "circe-generic" % "0.13.0",
  19. "com.softwaremill.sttp.client" %%% "core" % "2.2.5",
  20. "com.softwaremill.sttp.client" %%% "monix" % "2.2.5",
  21. "com.softwaremill.sttp.client" %%% "circe" % "2.2.5",
  22. // "com.softwaremill.sttp.client" %%% "async-http-client-backend-monix" % "2.2.5",
  23. // "com.softwaremill.sttp.client3" %%% "httpclient-backend-monix" % "2.2.5",
  24. // "com.softwaremill.macwire" %% "util" % "2.3.7" % "provided",
  25. "com.softwaremill.common" %%% "tagging" % "2.2.1",
  26. "com.softwaremill.macwire" %% "macros" % "2.3.7" % "provided",
  27. // "com.softwaremill.macwire" %%% "macrosakka" % "2.3.6" % "provided",
  28. "com.softwaremill.quicklens" %%% "quicklens" % "1.6.1",
  29. // "com.typesafe.scala-logging" %%% "scala-logging" % "3.9.2",
  30. // "io.circe" %%% "circe-config" % "0.8.0",
  31. "org.akka-js" %%% "shocon" % "1.0.0",
  32. "com.beachape" %%% "enumeratum-circe" % "1.6.1",
  33. "com.github.valskalla" %%% "odin-core" % "0.7.0+95-ab4381ae+20201227-1831-SNAPSHOT"
  34. // "com.clovellytech" %%% "outwatch-router" % "0.0.9+7-5be0b1a2+20201227-2019-SNAPSHOT"
  35. )
  36. Compile / npmDependencies ++= Seq(
  37. "jquery" -> "3.3.1",
  38. "blk-design-system" -> "1.0.2",
  39. "bootstrap" -> "4.5.3",
  40. "@types/chart.js" -> "2.9.11",
  41. "chart.js" -> "2.9.3",
  42. "snabbdom" -> "git://github.com/outwatch/snabbdom.git#semver:0.7.5",
  43. "fuse.js" -> "6.4.3"
  44. )
  45. Compile / npmDevDependencies ++= Seq(
  46. "css-loader" -> "5.0.1",
  47. "style-loader" -> "2.0.0",
  48. "webpack-merge" -> "4.1",
  49. "file-loader" -> "3.0.1",
  50. "url-loader" -> "1.1.2"
  51. )
  52. stIgnore ++= List("jquery", "blk-design-system", "bootstrap")
  53. stIgnore ++= List("snabbdom")
  54. stStdlib := List("es6")
  55. stUseScalaJsDom := false
  56. enablePlugins(ScalaJSBundlerPlugin)
  57. enablePlugins(ScalablyTypedConverterPlugin)
  58. useYarn := true // makes scalajs-bundler use yarn instead of npm
  59. requireJsDomEnv in Test := true
  60. scalaJSUseMainModuleInitializer := true
  61. // configure Scala.js to emit a JavaScript module instead of a top-level script
  62. scalaJSLinkerConfig ~= (
  63. /*hmm*/
  64. _.withSourceMap(false)
  65. .withModuleKind(ModuleKind.CommonJSModule)
  66. )
  67. scalacOptions ++=
  68. Seq(
  69. "-encoding",
  70. "UTF-8",
  71. "-deprecation",
  72. "-feature",
  73. "-language:existentials",
  74. "-language:experimental.macros",
  75. "-language:higherKinds",
  76. "-language:implicitConversions",
  77. "-unchecked",
  78. "-Xlint",
  79. "-Ywarn-numeric-widen",
  80. "-Ymacro-annotations",
  81. //silence warnings for by-name implicits
  82. "-Wconf:cat=lint-byname-implicit:s",
  83. //give errors on non exhaustive matches
  84. "-Wconf:msg=match may not be exhaustive:e",
  85. "-explaintypes" // Explain type errors in more detail.
  86. )
  87. // hot reloading configuration:
  88. // https://github.com/scalacenter/scalajs-bundler/issues/180
  89. addCommandAlias(
  90. "dev",
  91. "; compile; fastOptJS::startWebpackDevServer; devwatch; fastOptJS::stopWebpackDevServer"
  92. )
  93. addCommandAlias("devwatch", "~; fastOptJS; copyFastOptJS")
  94. version in webpack := "4.43.0"
  95. version in startWebpackDevServer := "3.11.0"
  96. webpackDevServerExtraArgs := Seq("--progress", "--color")
  97. webpackDevServerPort := 8080
  98. webpackConfigFile in fastOptJS := Some(
  99. baseDirectory.value / "webpack.config.dev.js"
  100. )
  101. webpackConfigFile in fullOptJS := Some(
  102. baseDirectory.value / "webpack.config.prod.js"
  103. )
  104. // webpackConfigFile in fullOptJS := Some(
  105. // baseDirectory.value / "webpack.config.js"
  106. // )
  107. // https://scalacenter.github.io/scalajs-bundler/cookbook.html#performance
  108. webpackBundlingMode in fastOptJS := BundlingMode.LibraryOnly()
  109. // when running the "dev" alias, after every fastOptJS compile all artifacts are copied into
  110. // a folder which is served and watched by the webpack devserver.
  111. // this is a workaround for: https://github.com/scalacenter/scalajs-bundler/issues/180
  112. lazy val copyFastOptJS =
  113. TaskKey[Unit]("copyFastOptJS", "Copy javascript files to target directory")
  114. copyFastOptJS := {
  115. val inDir = (crossTarget in (Compile, fastOptJS)).value
  116. val outDir = (crossTarget in (Compile, fastOptJS)).value / "dev"
  117. val files = Seq(
  118. name.value.toLowerCase + "-fastopt-loader.js",
  119. name.value.toLowerCase + "-fastopt.js"
  120. // name.value.toLowerCase + "-fastopt.js.map"
  121. ) map { p => (inDir / p, outDir / p) }
  122. IO.copy(
  123. files,
  124. overwrite = true,
  125. preserveLastModified = true,
  126. preserveExecutable = true
  127. )
  128. }
  129. ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.4.3"
  130. inThisBuild(
  131. List(
  132. scalaVersion := scalaVersion.value, // 2.11.12, or 2.13.3
  133. semanticdbEnabled := true, // enable SemanticDB
  134. semanticdbVersion := "4.4.2" // use Scalafix compatible version
  135. )
  136. )