scalajs-electron-quick-start
electron-quick-start conversion to Scala.js
How to run
Requires npm
to be installed in the system.
Run sbt app/electronStart
.
Design
The application is split into five sbt
modules to fit a project structure that works well with Scala.js and the
security guidelines outlined in Electron documentation:
app
- Combines Scala.js output of other modules with additional resources into an Electron application.
- Implements a simple Electron
sbt
plugin with following tasks:app/electronInstall
- copies over resources (index.html
,package.json
,package-lock.json
,styles.css
) to target directory and runsnpm install
.app/electronCompile
- compiles Scala.js modules, copies output to target directory.app/electronStart
- runsnpm start
on target directory.
main
- Contains
main
process of the Electron Process Model. - Can use
Node.js
APIs andCommonJS
modules.
- Contains
preload
- Contains
preload
script. - Can use a polyfilled subset of
Node.js
APIs, so it does useCommonJS
modules, but can onlyrequire
a subset of them.
- Contains
node-shared
- Contains Scala.js facades that can be shared between
main
andpreload
modules.
- Contains Scala.js facades that can be shared between
renderer
- Contains
renderer
process of the Electron Process Model. - Because it used for producing
web content and browsers do not have built-in support
CommonJS
modules, it is built separately as a single bundle.
- Contains
scalaJSStage
setting in main
, preload
and renderer
modules can be used to toggle between FastLinkJS
and FullLinkJS
output.
License
This software is licensed under the MIT license