This single-page client-only web app is available for execution in your browser here:
https://cs.lth.se/pgk/muntabot
Developed using fantastic Scala 3 and Scala JS. Built using sbt
and nodejs
.
-
Clone or download this repo on your machine.
-
The build creates
main.js
that is consumed byindex.html
, which in turn needs thestyle.css
file for formatting. -
While developing type
~fastLinkJS
insbt
and open/reload thedev/index-dev.html
file in your browser. -
If you are using a sand-boxed browser (e.g. Firefox installed as a snap) then local files are opened as something similar to
file:///run/user/1000/doc/ad1d72e5/index.html
which means that the index.html-page cannot access the accompanying local files main.js and style.css so you need to explicitly type the correct path in the URL field using something similar tofile:///home/user/project/dev/index.html#muntabot
where you change the user and project in the path to where the files are located. Note the trippel slashes///
-
To avoid having to reload the page upon every change the vscode extension Live Server can be used to do this automatically. Install the extension in vscode and right-click
dev/index-dev.html
and clickOpen with Live Server
after running~fastLinkJS
insbt
. Don't forget to check thatdev/index-dev.html
points to the correct subdir oftarget/scala-3.x.y/
...
- When bumping versions: DON'T FORGET to update versions here:
-
Scala version:
build.sbt
dev/index-dev.html
publish.sh
-
When bumping lib versions och scalajs-dom:
build.sbt
-
When bumping scalajs plugin:
project/plugins.sbt
-
When bumping sbt version:
project/build.properties
-
- When an update is ready for production, use the
publish.sh
bash script which includes the following commands where3.x.y
is your current Scala version:
sbt "clean;fullLinkJS"
cp target/scala-3.x.y/muntabot-opt/main.js public/.
-
Note: you need correct credentials to also upload the contents of the
public
folder to a public server. The web server needs the filesmain.js
,index.html
andstyle.css
. -
To test before uploading to production you can install the vscode extension Live Server and right-click
public/index.html
and clickOpen with Live Server
.