Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version = 3.9.9
runner.dialect = scala212
runner.dialect = scala212source3
maxColumn = 120
project.git = true

Expand Down Expand Up @@ -29,3 +29,6 @@ fileOverride {
runner.dialect = scala3
}
}

rewrite.scala3.convertToNewSyntax = true
rewrite.scala3.newSyntax.control = false
2 changes: 1 addition & 1 deletion src/main/scala-2.12/com/typesafe/sbt/PluginCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sbt.Keys.Classpath
import com.typesafe.sbt.web.PathMapping
import xsbti.FileConverter

import java.nio.file.{ Path => NioPath }
import java.nio.file.Path as NioPath

private[sbt] object PluginCompat {
type FileRef = java.io.File
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala-3/com/typesafe/sbt/PluginCompat.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.typesafe.sbt

import java.nio.file.{ Path => NioPath }
import java.io.{ File => IoFile }
import java.nio.file.Path as NioPath
import java.io.File as IoFile
import sbt.*
import sbt.Keys.Classpath
import xsbti.{ FileConverter, HashedVirtualFileRef, VirtualFileRef }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.typesafe.sbt.web

import sbt._
import xsbti._
import sbt.*
import xsbti.*
import java.util.Optional

object CompileProblems {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/typesafe/sbt/web/SbtWeb.scala
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ object SbtWeb extends AutoPlugin {
}
}

def packageSettings: Seq[Setting[_]] = inConfig(Assets)(
def packageSettings: Seq[Setting[?]] = inConfig(Assets)(
Defaults.packageTaskSettings(packageBin, packageAssetsMappings) ++ Seq(
packagePrefix := "",
Keys.`package` := packageBin.value
Expand Down
14 changes: 7 additions & 7 deletions src/main/scala/com/typesafe/sbt/web/js/JS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ object JS {

val undefined: JS[JavaScript] = JS(JavaScript("undefined"))

class Array(seq: Seq[JS[_]]) extends JS[Seq[JS[_]]](seq) {
def +(js: JS[_]): Array = new Array(value :+ js)
class Array(seq: Seq[JS[?]]) extends JS[Seq[JS[?]]](seq) {
def +(js: JS[?]): Array = new Array(value :+ js)
def ++(other: Array): Array = new Array(value ++ other.value)
}

object Array {
val empty: Array = apply()
def apply(values: JS[_]*): Array = new Array(values)
def apply(values: JS[?]*): Array = new Array(values)
}

class Object(map: Map[String, JS[_]]) extends JS[Map[String, JS[_]]](map) {
def +(property: (String, JS[_])): Object = new Object(value + property)
class Object(map: Map[String, JS[?]]) extends JS[Map[String, JS[?]]](map) {
def +(property: (String, JS[?])): Object = new Object(value + property)
def ++(other: Object): Object = new Object(value ++ other.value)
}

object Object {
val empty: Object = apply()
def apply(properties: (String, JS[_])*): Object = new Object(properties.toMap)
def apply(properties: (String, JS[?])*): Object = new Object(properties.toMap)
}

def write[A: Write](a: A): String = implicitly[Write[A]].apply(a)
Expand Down Expand Up @@ -94,7 +94,7 @@ object JS {
implicit def map[V: Write]: Write[Map[String, V]] =
Write[Map[String, V]](m => jsObject(m.map { case (k, v) => (k, write[V](v)) }))

implicit def js[J <: JS[_]]: Write[J] = Write[J](_.js)
implicit def js[J <: JS[?]]: Write[J] = Write[J](_.js)

def quoted(s: String): String = "\"" + (s flatMap escaped) + "\""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.typesafe.sbt.web.pipeline

import sbt._
import sbt.*
import sbt.Def.Initialize
import com.typesafe.sbt.web.PathMapping

Expand Down
Loading