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.

167 lines
5.7 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
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. "io.github.cquiroz" %%% "scala-java-time" % "2.1.0",
  35. "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.1.0",
  36. "com.lihaoyi" %%% "scalatags" % "0.9.2"
  37. // "com.clovellytech" %%% "outwatch-router" % "0.0.9+7-5be0b1a2+20201227-2019-SNAPSHOT"
  38. )
  39. Compile / npmDependencies ++= Seq(
  40. "jquery" -> "3.5.1",
  41. "@types/jquery" -> "3.5.5",
  42. "blk-design-system" -> "1.0.2",
  43. "bootstrap" -> "4.5.3",
  44. "@types/chart.js" -> "2.9.11",
  45. "chart.js" -> "2.9.3",
  46. "snabbdom" -> "git://github.com/outwatch/snabbdom.git#semver:0.7.5",
  47. "fuse.js" -> "6.4.3",
  48. "datatables.net-bs4" -> "1.10.23",
  49. // "datatables.net-dt" -> "1.10.23",
  50. "@types/datatables.net" -> "1.10.19",
  51. "sweetalert2" -> "10.12.6",
  52. "@sweetalert2/themes" -> "4.0.1",
  53. "reconnecting-websocket" -> "4.4.0",
  54. "paralleljs" -> "1.1.0",
  55. "@types/paralleljs" -> "0.0.20"
  56. )
  57. Compile / npmDevDependencies ++= Seq(
  58. "css-loader" -> "5.0.1",
  59. "style-loader" -> "2.0.0",
  60. "webpack-merge" -> "4.1",
  61. "file-loader" -> "3.0.1",
  62. "url-loader" -> "1.1.2"
  63. )
  64. stIgnore ++= List(
  65. "datatables.net-bs4",
  66. "datatables.net-dt",
  67. "blk-design-system",
  68. "bootstrap",
  69. "snabbdom",
  70. "@sweetalert2/themes"
  71. )
  72. stStdlib := List("es6")
  73. stUseScalaJsDom := false
  74. enablePlugins(ScalaJSBundlerPlugin)
  75. enablePlugins(ScalablyTypedConverterPlugin)
  76. useYarn := true // makes scalajs-bundler use yarn instead of npm
  77. requireJsDomEnv in Test := true
  78. scalaJSUseMainModuleInitializer := true
  79. // configure Scala.js to emit a JavaScript module instead of a top-level script
  80. scalaJSLinkerConfig ~= (
  81. /*hmm*/
  82. _.withSourceMap(false)
  83. .withModuleKind(ModuleKind.CommonJSModule)
  84. )
  85. scalacOptions ++=
  86. Seq(
  87. "-encoding",
  88. "UTF-8",
  89. "-deprecation",
  90. "-feature",
  91. "-language:existentials",
  92. "-language:experimental.macros",
  93. "-language:higherKinds",
  94. "-language:implicitConversions",
  95. "-unchecked",
  96. "-Xlint",
  97. "-Ywarn-numeric-widen",
  98. "-Ymacro-annotations",
  99. //silence warnings for by-name implicits
  100. "-Wconf:cat=lint-byname-implicit:s",
  101. //give errors on non exhaustive matches
  102. "-Wconf:msg=match may not be exhaustive:e",
  103. "-explaintypes" // Explain type errors in more detail.
  104. )
  105. // hot reloading configuration:
  106. // https://github.com/scalacenter/scalajs-bundler/issues/180
  107. addCommandAlias(
  108. "dev",
  109. "; compile; fastOptJS::startWebpackDevServer; devwatch; fastOptJS::stopWebpackDevServer"
  110. )
  111. addCommandAlias("devwatch", "~; fastOptJS; copyFastOptJS")
  112. version in webpack := "4.43.0"
  113. version in startWebpackDevServer := "3.11.0"
  114. webpackDevServerExtraArgs := Seq("--progress", "--color")
  115. webpackDevServerPort := 8080
  116. webpackConfigFile in fastOptJS := Some(
  117. baseDirectory.value / "webpack.config.dev.js"
  118. )
  119. webpackConfigFile in fullOptJS := Some(
  120. baseDirectory.value / "webpack.config.prod.js"
  121. )
  122. // webpackConfigFile in fullOptJS := Some(
  123. // baseDirectory.value / "webpack.config.js"
  124. // )
  125. // https://scalacenter.github.io/scalajs-bundler/cookbook.html#performance
  126. webpackBundlingMode in fastOptJS := BundlingMode.LibraryOnly()
  127. // when running the "dev" alias, after every fastOptJS compile all artifacts are copied into
  128. // a folder which is served and watched by the webpack devserver.
  129. // this is a workaround for: https://github.com/scalacenter/scalajs-bundler/issues/180
  130. lazy val copyFastOptJS =
  131. TaskKey[Unit]("copyFastOptJS", "Copy javascript files to target directory")
  132. copyFastOptJS := {
  133. val inDir = (crossTarget in (Compile, fastOptJS)).value
  134. val outDir = (crossTarget in (Compile, fastOptJS)).value / "dev"
  135. val files = Seq(
  136. name.value.toLowerCase + "-fastopt-loader.js",
  137. name.value.toLowerCase + "-fastopt.js"
  138. // name.value.toLowerCase + "-fastopt.js.map"
  139. ) map { p => (inDir / p, outDir / p) }
  140. IO.copy(
  141. files,
  142. overwrite = true,
  143. preserveLastModified = true,
  144. preserveExecutable = true
  145. )
  146. }
  147. ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.4.3"
  148. inThisBuild(
  149. List(
  150. scalaVersion := scalaVersion.value, // 2.11.12, or 2.13.3
  151. semanticdbEnabled := true, // enable SemanticDB
  152. semanticdbVersion := "4.4.2" // use Scalafix compatible version
  153. )
  154. )