Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ptrdom/scalajs-electron-quick-start
electron-quick-start conversion to Scala.js
https://github.com/ptrdom/scalajs-electron-quick-start
electron javascript nodejs quickstart scalajs
Last synced: 11 days ago
JSON representation
electron-quick-start conversion to Scala.js
- Host: GitHub
- URL: https://github.com/ptrdom/scalajs-electron-quick-start
- Owner: ptrdom
- License: mit
- Created: 2022-07-17T07:49:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-13T06:08:47.000Z (10 months ago)
- Last Synced: 2024-10-06T03:05:41.558Z (about 1 month ago)
- Topics: electron, javascript, nodejs, quickstart, scalajs
- Language: Scala
- Homepage:
- Size: 73.2 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scalajs-electron-quick-start
**[electron-quick-start](https://github.com/electron/electron-quick-start) conversion to [Scala.js](https://www.scala-js.org/)**
## 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](https://www.electronjs.org/docs/latest/tutorial/security) 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 runs `npm install`.
- `app/electronCompile` - compiles Scala.js modules, copies output to target directory.
- `app/electronStart` - runs `npm start` on target directory.
- `main`
- Contains `main` process of the [Electron Process Model](https://www.electronjs.org/docs/latest/tutorial/process-model).
- Can use `Node.js` APIs and `CommonJS` modules.
- `preload`
- Contains `preload` script.
- Can use a [polyfilled subset](https://www.electronjs.org/docs/latest/tutorial/sandbox#preload-scripts) of `Node.js`
APIs, so it does use `CommonJS` modules, but can only `require` a subset of them.
- `node-shared`
- Contains Scala.js facades that can be shared between `main` and `preload` modules.
- `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.`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