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.

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