Skip to content

Commit c0d1df6

Browse files
authored
Update Scala.js guide - package command (#823)
* Update Scala.js guide - package command * Unify the name Scala.js
1 parent f585b93 commit c0d1df6

File tree

24 files changed

+124
-72
lines changed

24 files changed

+124
-72
lines changed

examples/cross-build/Hello.js.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ import scala.scalajs.js
66
object Test {
77
def main(args: Array[String]): Unit = {
88
val console = js.Dynamic.global.console
9-
console.log("Hello from Scala.JS")
9+
console.log("Hello from Scala.js")
1010
}
1111
}

examples/scala-js/foojs.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
println(s"Hello from Scala.JS ${scala.scalajs.runtime.linkingInfo.linkerVersion}")
1+
println(s"Hello from Scala.js ${scala.scalajs.runtime.linkingInfo.linkerVersion}")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package scala.build.errors
22

3-
final class ScalaJsLinkingError extends BuildException("Error linking Scala.JS")
3+
final class ScalaJsLinkingError extends BuildException("Error linking Scala.js")

modules/cli-options/src/main/scala/scala/cli/commands/HelpGroupOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ case class HelpGroupOptions(
2323
}
2424

2525
def maybePrintGroupHelp(help: Help[_]): Unit = {
26-
if (helpJs) printHelpWithGroup(help, "Scala.JS")
26+
if (helpJs) printHelpWithGroup(help, "Scala.js")
2727
else if (helpNative) printHelpWithGroup(help, "Scala Native")
2828
}
2929
}

modules/cli-options/src/main/scala/scala/cli/commands/ScalaJsOptions.scala

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,67 @@ import com.github.plokhotnyuk.jsoniter_scala.macros._
88
final case class ScalaJsOptions(
99

1010
@Group("Scala")
11-
@HelpMessage("Enable Scala.JS. To show more options for Scala.Js pass `--help-js`")
11+
@HelpMessage("Enable Scala.js. To show more options for Scala.Js pass `--help-js`")
1212
js: Boolean = false,
1313

14-
@Group("Scala.JS")
14+
@Group("Scala.js")
1515
@HelpMessage("The Scala JS version")
1616
jsVersion: Option[String] = None,
17-
@Group("Scala.JS")
17+
@Group("Scala.js")
1818
@HelpMessage("The Scala JS mode, either `dev` or `release`")
1919
jsMode: Option[String] = None,
2020
@HelpMessage("The Scala JS module kind: commonjs/common, esmodule/es, nomodule/none")
21-
@Group("Scala.JS")
21+
@Group("Scala.js")
2222
jsModuleKind: Option[String] = None,
2323

24-
@Group("Scala.JS")
24+
@Group("Scala.js")
2525
jsCheckIr: Option[Boolean] = None,
2626

27-
@Group("Scala.JS")
27+
@Group("Scala.js")
2828
@HelpMessage("Emit source maps")
2929
jsEmitSourceMaps: Boolean = false,
30-
@Group("Scala.JS")
30+
@Group("Scala.js")
3131
@HelpMessage("Set the destination path of source maps")
3232
jsSourceMapsPath: Option[String] = None,
33-
@Group("Scala.JS")
33+
@Group("Scala.js")
3434
@HelpMessage("Enable jsdom")
3535
jsDom: Option[Boolean] = None,
36-
@Group("Scala.JS")
36+
@Group("Scala.js")
3737
@HelpMessage("A header that will be added at the top of generated .js files")
3838
jsHeader: Option[String] = None,
39-
@Group("Scala.JS")
39+
@Group("Scala.js")
4040
@HelpMessage("Primitive Longs *may* be compiled as primitive JavaScript bigints")
4141
jsAllowBigIntsForLongs: Option[Boolean] = None,
42-
@Group("Scala.JS")
42+
@Group("Scala.js")
4343
@HelpMessage("Avoid class'es when using functions and prototypes has the same observable semantics.")
4444
jsAvoidClasses: Option[Boolean] = None,
45-
@Group("Scala.JS")
45+
@Group("Scala.js")
4646
@HelpMessage("Avoid lets and consts when using vars has the same observable semantics.")
4747
jsAvoidLetsAndConsts: Option[Boolean] = None,
48-
@Group("Scala.JS")
48+
@Group("Scala.js")
4949
@HelpMessage("The Scala JS module split style: fewestmodules, smallestmodules")
5050
jsModuleSplitStyle: Option[String] = None,
51-
@Group("Scala.JS")
51+
@Group("Scala.js")
5252
@HelpMessage("The Scala JS ECMA Script version: es5_1, es2015, es2016, es2017, es2018, es2019, es2020, es2021")
5353
jsEsVersion: Option[String] = None,
5454

55-
@Group("Scala.JS")
56-
@HelpMessage("Path to the Scala.JS linker")
55+
@Group("Scala.js")
56+
@HelpMessage("Path to the Scala.js linker")
5757
@ValueDescription("path")
5858
@Hidden
5959
jsLinkerPath: Option[String] = None,
60-
@Group("Scala.JS")
61-
@HelpMessage("Scala.JS CLI version to use for linking")
60+
@Group("Scala.js")
61+
@HelpMessage("Scala.js CLI version to use for linking")
6262
@ValueDescription("version")
6363
@Hidden
6464
jsCliVersion: Option[String] = None,
65-
@Group("Scala.JS")
66-
@HelpMessage("Scala.JS CLI Java options")
65+
@Group("Scala.js")
66+
@HelpMessage("Scala.js CLI Java options")
6767
@ValueDescription("option")
6868
@Hidden
6969
jsCliJavaArg: List[String] = Nil,
70-
@Group("Scala.JS")
71-
@HelpMessage("Whether to run the Scala.JS CLI on the JVM or using a native executable")
70+
@Group("Scala.js")
71+
@HelpMessage("Whether to run the Scala.js CLI on the JVM or using a native executable")
7272
@Hidden
7373
jsCliOnJvm: Option[Boolean] = None
7474
)

modules/cli/src/main/scala/scala/cli/commands/Package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ object Package extends ScalaCommand[PackageOptions] {
131131
): Either[BuildException, Option[Long]] = either {
132132

133133
val packageType = forcedPackageType.getOrElse {
134-
// FIXME We'll probably need more refined rules if we start to support extra Scala.JS or Scala Native specific types
134+
// FIXME We'll probably need more refined rules if we start to support extra Scala.js or Scala Native specific types
135135
if (build.options.notForBloopOptions.packageOptions.isDockerEnabled)
136136
PackageType.Docker
137137
else if (build.options.platform.value == Platform.JS)

modules/cli/src/main/scala/scala/cli/commands/ScalaCommand.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ abstract class ScalaCommand[T](implicit parser: Parser[T], help: Help[T])
110110
""
111111
)))
112112
.withHiddenGroups(Some(Seq(
113-
"Scala.JS",
113+
"Scala.js",
114114
"Scala Native"
115115
)))
116116
.withTerminalWidthOpt {

modules/cli/src/main/scala/scala/cli/errors/ScalaJsLinkingError.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ final class ScalaJsLinkingError(
66
val expected: os.RelPath,
77
val foundFiles: Seq[os.RelPath]
88
) extends BuildException(
9-
s"Error: $expected not found after Scala.JS linking " +
9+
s"Error: $expected not found after Scala.js linking " +
1010
(if (foundFiles.isEmpty) "(no files found)" else s"(found ${foundFiles.mkString(", ")})")
1111
)

modules/cli/src/main/scala/scala/cli/internal/ScalaJsLinker.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ object ScalaJsLinker {
140140
val retCode = res.waitFor()
141141

142142
if (retCode == 0)
143-
logger.debug("Scala.JS linker ran successfully")
143+
logger.debug("Scala.js linker ran successfully")
144144
else {
145-
logger.debug(s"Scala.JS linker exited with return code $retCode")
145+
logger.debug(s"Scala.js linker exited with return code $retCode")
146146
value(Left(new ScalaJsLinkingError))
147147
}
148148
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
package scala.build.errors
22

33
final class NoFrameworkFoundByBridgeError
4-
extends TestError("No framework found by Scala.JS test bridge")
4+
extends TestError("No framework found by Scala.js test bridge")

0 commit comments

Comments
 (0)