Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 4477efc

Browse files
authored
Adds auto-update support. (#6)
* Adds auto-update support. * Updates draft documentation.
1 parent 0029bb8 commit 4477efc

File tree

8 files changed

+174
-34
lines changed

8 files changed

+174
-34
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ npm-debug.log
55
yarn-error.log
66
dist/
77
out/
8+
dev-app-update.yml

docs/stack.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ A nice little addition from the `mobx` team. It brings `redux`-like state trees,
4545
There's so much awesome packed in here. `pipe` for days. I'll be honest, it took me a long time get comfortable with `ramda`. Nowadays, you can pry it from my cold dead hands. PRECIOUS!!!
4646

4747

48+
## Electron Things
49+
50+
> **electron-builder**
51+
52+
This does most of the heavy lifting for assembling cross-platform distributables.
53+
54+
> **electron-updater**
55+
56+
Allows our app to auto-update.
57+
58+
> **electron-is-dev**, **electron-log**
59+
60+
A few quality-of-life utilities for working in Electron.
61+
4862
## Bundler
4963

5064
> **fuse-box**

docs/using.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,13 @@ npm run dist
4242
```
4343

4444
To create a .zip and .dmg in the `dist` directory.
45+
46+
And when you're ready to upload to github (if that's what you're doing), you can run:
47+
48+
```sh
49+
npm run draft
50+
```
51+
52+
This will make a new release based on the version number found in your `package.json` file (so you might want to bump that first).
53+
54+
I made it draft mode, because you'll probably want to do release notes. For that step, jump on to github and checkout the draft under releases to complete the process.

fuse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Sparky.task('default', ['copy-html'], () => {
5858
.then(() => {
5959
if (!isProduction) {
6060
// startup electron
61-
spawn('node', [`${__dirname}/node_modules/electron/cli.js`, __dirname])
61+
spawn('node', [`${__dirname}/node_modules/electron/cli.js`, __dirname], { stdio: 'inherit' })
6262
}
6363
})
6464
})

package-lock.json

Lines changed: 52 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@
77
"appId": "com.example.electron-starter",
88
"mac": {
99
"category": "public.app-category.developer-tools"
10+
},
11+
"publish": {
12+
"owner": "skellock",
13+
"provider": "github",
14+
"repo": "electron-starter"
1015
}
1116
},
1217
"dependencies": {
18+
"electron-is-dev": "^0.2.0",
19+
"electron-log": "^2.2.7",
20+
"electron-updater": "^2.7.1",
1321
"mobx": "3.2.1",
1422
"mobx-react": "4.2.2",
1523
"mobx-state-tree": "0.9.2",
@@ -47,6 +55,7 @@
4755
"clean": "rm -rf .fusebox out",
4856
"compile": "NODE_ENV=production node fuse",
4957
"dist": "electron-builder",
58+
"draft": "electron-builder -p always --mac --draft",
5059
"info": "npm-scripts-info",
5160
"pack": "electron-builder --dir",
5261
"postinstall": "electron-builder install-app-deps",
@@ -56,10 +65,11 @@
5665
"clean": "Removes build artifacts and caches.",
5766
"compile": "Builds both js bundles in production mode.",
5867
"dist": "Creates a executable for distributing.",
68+
"draft": "Releases a version as a draft.",
5969
"info": "Shows available npm scripts.",
6070
"pack": "Creates a executable for trying out.",
6171
"postinstall": "Used by electron-builder to build native dependencies.",
6272
"start": "Starts the app in dev mode."
6373
},
64-
"version": "0.2.0"
74+
"version": "0.3.0"
6575
}

0 commit comments

Comments
 (0)