From fecbf2d9403a1d1887623e09ba883f9653bcd49b Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 22 Feb 2022 10:01:20 -0300 Subject: [PATCH] a buildable scala-js (`sbt ~fastLinkJS`) project that does nothing. --- .gitignore | 2 ++ .scalafmt.conf | 2 ++ build.sbt | 9 +++++++++ index.html | 4 ++++ project/build.properties | 1 + project/plugins.sbt | 1 + src/main/scala/app/main.scala | 13 +++++++++++++ 7 files changed, 32 insertions(+) create mode 100644 .gitignore create mode 100644 .scalafmt.conf create mode 100644 build.sbt create mode 100644 index.html create mode 100644 project/build.properties create mode 100644 project/plugins.sbt create mode 100644 src/main/scala/app/main.scala diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c3f9f81 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target +.bsp diff --git a/.scalafmt.conf b/.scalafmt.conf new file mode 100644 index 0000000..d21ae24 --- /dev/null +++ b/.scalafmt.conf @@ -0,0 +1,2 @@ +version = 3.4.3 +runner.dialect = scala213 diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..78c4e9c --- /dev/null +++ b/build.sbt @@ -0,0 +1,9 @@ +enablePlugins(ScalaJSPlugin) + +name := "app" +scalaVersion := "2.13.7" + +scalaJSUseMainModuleInitializer := true +mainClass := Some("app.Main") + +libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.1.0" diff --git a/index.html b/index.html new file mode 100644 index 0000000..d6bcfad --- /dev/null +++ b/index.html @@ -0,0 +1,4 @@ + +title + + diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 0000000..10fd9ee --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.5.5 diff --git a/project/plugins.sbt b/project/plugins.sbt new file mode 100644 index 0000000..4931e02 --- /dev/null +++ b/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.9.0") diff --git a/src/main/scala/app/main.scala b/src/main/scala/app/main.scala new file mode 100644 index 0000000..599f80a --- /dev/null +++ b/src/main/scala/app/main.scala @@ -0,0 +1,13 @@ +package app + +import org.scalajs.dom +import org.scalajs.dom.document + +object Main { + def main(args: Array[String]): Unit = { + val div = document.createElement("div") + div.id = "main" + document.body.appendChild(div) + println("Hello!") + } +}