Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove webpack and Scala.js bundler #277

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ jobs:
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck

Expand Down
36 changes: 13 additions & 23 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ ThisBuild / scalacOptions ++= Seq(
)
enablePlugins(NoPublishPlugin)

ThisBuild / githubWorkflowBuildPreamble ++= Seq(
WorkflowStep.Use(
UseRef.Public("actions", "setup-node", "v4"),
name = Some("Setup Node"),
params = Map("node-version" -> "20", "cache" -> "npm")
),
WorkflowStep.Run(List("npm ci"))
)

val demo =
project
.in(file("demo"))
Expand Down Expand Up @@ -73,26 +82,9 @@ lazy val facade =
project
.in(file("facade"))
.enablePlugins(ScalaJSPlugin)
.enablePlugins(ScalaJSBundlerPlugin)
.settings(commonSettings: _*)
.settings(
name := "react-aladin",
Compile / npmDependencies ++= Seq(
"react" -> reactJS,
"react-dom" -> reactJS,
"@cquiroz/aladin-lite" -> aladinLiteVersion
),
Test / npmDevDependencies ++= Seq(
"chokidar" -> "3.6.0"
),
// Requires the DOM for tests
Test / requireJsDomEnv := true,
installJsdom / version := "19.0.0",
webpack / version := "5.76.1",
startWebpackDevServer / version := "4.12.0",
scalaJSUseMainModuleInitializer := false,
// Compile tests to JS using fast-optimisation
Test / scalaJSStage := FastOptStage,
name := "react-aladin",
libraryDependencies ++= Seq(
"edu.gemini" %%% "lucuma-core" % lucumaCoreVersion,
"edu.gemini" %%% "lucuma-ui" % lucumaUIVersion,
Expand All @@ -101,16 +93,14 @@ lazy val facade =
"edu.gemini" %%% "lucuma-react-common" % lucumaReactVersion,
"org.scalameta" %%% "munit" % munitVersion % Test
),
testFrameworks += new TestFramework("munit.Framework"),
Test / webpackConfigFile := Some(
baseDirectory.value / "src" / "webpack" / "test.webpack.config.js"
),
Compile / sourceGenerators += Def.task {
val srcDir = (demo / Compile / scalaSource).value
val srcFiles = srcDir ** "*.scala"
val destinationDir = (Compile / sourceManaged).value
copyAndReplace(srcFiles.get, srcDir, destinationDir)
}.taskValue
}.taskValue,
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) },
jsEnv := new lucuma.LucumaJSDOMNodeJSEnv()
)

lazy val commonSettings = Seq(
Expand Down
13 changes: 0 additions & 13 deletions facade/src/webpack/test.webpack.config.js

This file was deleted.

Loading
Loading