Skip to content

Commit 144da32

Browse files
committed
Ditch npm workspaces
Electron Forge doesn't work with npm workspaces. See: #53 And: electron/forge#2306 And: npm/cli#7029 And: npm/rfcs#287 This gets the app working when packaged.
1 parent 561f8cd commit 144da32

File tree

6 files changed

+3674
-18578
lines changed

6 files changed

+3674
-18578
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ To test the Eye Gaze Mode properly, I needed a facial mouse, but eye trackers ar
4040

4141
## Software Architecture
4242

43-
This is a monorepo containing npm workspaces for the library (`core`), the desktop app (`desktop-app`), and the website (`website`).
43+
This is a monorepo containing packages for the library (`core`), the desktop app (`desktop-app`), and the website (`website`).
44+
45+
46+
I tried npm workspaces, but it doesn't work with Electron Forge packaging. See [electron/forge#2306](https://github.com/electron/forge/issues/2306).
4447

4548
### Website
4649

4750
The website uses symlinks to reference the library (`core`) and shared resources (`images`) during development.
4851

49-
When deploying with `npm run deploy -w website`, the symlinks are dereferenced using `cp -rL`.
52+
When deploying with `npm run website:npm -- run deploy`, the symlinks are dereferenced using `cp -rL`.
5053

5154
The website is deployed to GitHub Pages using the [`gh-pages`](https://www.npmjs.com/package/gh-pages) npm package.
5255

@@ -100,11 +103,11 @@ MIT-licensed, see [LICENSE.txt](./LICENSE.txt)
100103
- [Clone the repo.](https://help.github.com/articles/cloning-a-repository/)
101104
- Install [Node.js](https://nodejs.org/) if you don't have it
102105
- Open up a command prompt / terminal in the project directory.
103-
- Run `npm install`
104-
- Run `npm -w core install` (`-w` is short for `--workspace`, and can be used with many npm commands to target a workspace)
105-
- Run `npm -w website start` to start a web server that will automatically reload when files change.
106+
- Run `npm install` to install project-wide dependencies.
107+
- Run `npm run website:npm -- install` to install the website's dependencies. (`--` allows passing arguments to the script, which is just a simple wrapper to run `npm` within the directory of the package.)
108+
- Run `npm run website` to start a web server that will automatically reload when files change.
106109
- For the electron app:
107-
- Then `npm -w desktop-app install`
110+
- Run `npm run desktop-app:npm -- install`
108111

109112
### VS Code
110113

@@ -121,7 +124,7 @@ The app is not yet distributed as precompiled binaries.
121124
If you want to try out the desktop app in the meantime:
122125

123126
- See Development Setup
124-
- `npm -w desktop-app start`
127+
- `npm run desktop-app`
125128

126129
## Add to your project
127130

0 commit comments

Comments
 (0)