Skip to content

Commit

Permalink
WIP: build.sbt,package.scala,Deps.scala,plugins.sbt,Config.scala,Glob…
Browse files Browse the repository at this point in the history
…alState.scala,GraphChangesAutomation.scala,GraphChangesAutomationUI.scala,RightSidebar.scala,Crisp.scala
  • Loading branch information
fdietze committed Aug 12, 2020
1 parent bdbd034 commit 1054651
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 17 deletions.
15 changes: 14 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@ dynver in ThisBuild ~= (_.replace('+', '-')) // TODO: https://github.com/dwijnan
import Def.{setting => dep}

// -- common setting --
crossScalaVersions in ThisBuild := Seq("2.12.12", "2.13.3")
crossScalaVersions in ThisBuild := Seq("2.12.12")//, "2.13.3")
scalaVersion in ThisBuild := crossScalaVersions.value.last

inThisBuild(
List(
semanticdbEnabled := true, // enable SemanticDB
semanticdbVersion := scalafixSemanticdb.revision // use Scalafix compatible version
)
)


scalafixDependencies in ThisBuild += "org.scala-lang.modules" %% "scala-collection-migrations" % "2.1.4"
addCompilerPlugin(scalafixSemanticdb)
scalacOptions ++= List("-Yrangepos", "-P:semanticdb:synthetics:on")


Global / onChangedBuildSource := IgnoreSourceChanges // disabled, since it doesn't recover state of devserver

lazy val commonSettings = Seq(
Expand Down
5 changes: 0 additions & 5 deletions ids/src/main/scala/wust/ids/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package wust
import java.util.Date
import java.time.{LocalDateTime, ZonedDateTime, ZoneOffset, Instant}

import com.github.ghik.silencer.silent
import supertagged._

import scala.util.Try
Expand Down Expand Up @@ -83,7 +82,6 @@ package object ids {
@inline def now: EpochMilli = localNow plus delta
@inline def zero: EpochMilli = EpochMilli(0L)

@silent("deprecated")
def parse(str: String) = Try(Date.parse(str)).toOption.map(EpochMilli(_))

def fromDate(d: Date): EpochMilli = EpochMilli(d.toInstant.toEpochMilli)
Expand All @@ -108,7 +106,6 @@ package object ids {
@inline def toLocalDateTime: LocalDateTime = toZonedDateTime.toLocalDateTime
def toZonedDateTime: ZonedDateTime = Instant.ofEpochMilli(t).atZone(ZoneOffset.UTC)

@silent("deprecated")
def humanReadable: String = {
// java.util.Date is deprecated, but implemented in java and scalajs
// and therefore a simple cross-compiling solution
Expand All @@ -123,7 +120,6 @@ package object ids {
f"$year%04d-$month%02d-$day%02d $hour%02d:$minute%02d:$second%02d"
}

@silent("deprecated")
def isoDate: String = {
// java.util.Date is deprecated, but implemented in java and scalajs
// and therefore a simple cross-compiling solution
Expand All @@ -135,7 +131,6 @@ package object ids {
f"$year%04d-$month%02d-$day%02d"
}

@silent("deprecated")
def isoDateAndTime: String = {
// java.util.Date is deprecated, but implemented in java and scalajs
// and therefore a simple cross-compiling solution
Expand Down
2 changes: 1 addition & 1 deletion project/Deps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ object Deps {
val base58s = dep("io.github.fdietze.base58s" %%% "base58s" % "43d5684")
val monix = dep("io.monix" %%% "monix" % "3.2.2")
// val taggedTypes = dep("org.rudogma" %%% "supertagged" % "2.0-RC1")
val taggedTypes = dep("com.github.fdietze.scala-supertagged" % "supertagged_2.13" % "0157b28") // until https://github.com/rudogma/scala-supertagged/pull/2 is merged
val taggedTypes = dep("com.github.fdietze.scala-supertagged" %%% "supertagged" % "0157b28") // until https://github.com/rudogma/scala-supertagged/pull/2 is merged
val colorado = dep("com.github.fdietze.colorado" %%% "colorado" % "d36c389")
val scalacss = dep("com.github.japgolly.scalacss" %%% "core" % "0.6.1")
val kantanRegex = new {
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")
/* addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") */
/* addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.6") */

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.19")
1 change: 1 addition & 0 deletions util/jvm/src/main/scala/wust/util/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package wust.util

import pureconfig._
import pureconfig.error.{ConvertFailure, KeyNotFound}
import pureconfig.generic.ProductHint

object Config {
implicit def hint[T] =
Expand Down
2 changes: 0 additions & 2 deletions webApp/src/main/scala/wust/webApp/state/GlobalState.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package wust.webApp.state

// import acyclic.file
import com.github.ghik.silencer.silent
import org.scalajs.dom.experimental.permissions.PermissionState
import org.scalajs.dom.window
import outwatch.dsl.events
Expand Down Expand Up @@ -100,7 +99,6 @@ object GlobalState {
val uiModalConfig = Subject.publish[Ownable[ModalConfig]]
val uiModalClose = Subject.publish[Unit]

@silent("deprecated")
val rawGraph: Rx[Graph] = {
val internalGraph = eventProcessor.graph.unsafeToRx(seed = Graph.empty)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package wust.webApp.state

import com.github.ghik.silencer.silent
import wust.facades.segment.Segment
import org.scalajs.dom
import rx.Var
Expand Down Expand Up @@ -56,7 +55,6 @@ private object StringWalker {
object GraphChangesAutomation {

val templateVariableRegex = "\\$(@)?\\{woost((\\.[^\\.\\}]+)+)\\}".r
@silent("possible missing interpolator")
def replaceVariableInText(userId: UserId, graph: Graph, node: Node, templateText: String, newEdges: mutable.HashMap[NodeId, mutable.ArrayBuffer[(Edge, Node)]], newEdgesReverse: mutable.HashMap[NodeId, mutable.ArrayBuffer[(Edge, Node)]]): (String, Array[Edge]) = try {

val extraEdges = Array.newBuilder[Edge]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package wust.webApp.views

import wust.sdk.{BaseColors, NodeColor}
import com.github.ghik.silencer.silent
import outwatch._
import outwatch.dsl._
import colibri.ext.rx._
Expand All @@ -27,7 +26,6 @@ import fontAwesome.freeSolid

// Offers methods for rendering components for the GraphChangesAutomation.

@silent("possible missing interpolator")
object GraphChangesAutomationUI {

val createAutomationTemplateText = "Create Template"
Expand Down
3 changes: 1 addition & 2 deletions webApp/src/main/scala/wust/webApp/views/RightSidebar.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package wust.webApp.views

import acyclic.file
import com.github.ghik.silencer.silent
import fontAwesome.freeSolid
import outwatch._
import outwatch.dsl._
Expand Down Expand Up @@ -485,7 +484,7 @@ object RightSidebar {
},
customOptions = Some(VDomModifier(
UI.checkbox("Create a new node from the reference", isCreateReference),
UI.checkbox("Rename existing node (original content in `${woost.original}`)", isRenameReference): @silent("possible missing interpolator")
UI.checkbox("Rename existing node (original content in `${woost.original}`)", isRenameReference)
))
),
ItemProperties.EdgeFactory.Plain(create),
Expand Down
3 changes: 1 addition & 2 deletions webUtil/src/main/scala/wust/facades/crisp/Crisp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package wust.facades.crisp

import scala.scalajs.js
import scala.scalajs.js.annotation._
import com.github.ghik.silencer.silent

//TODO: this is a workaround for scalajs: https://github.com/scala-js/scala-js/issues/3737
object JSNames {
@silent("possible missing interpolator") final val Crisp = "$crisp"
final val Crisp = "$crisp"
}
@js.native
@JSGlobal(JSNames.Crisp)
Expand Down

0 comments on commit 1054651

Please sign in to comment.