Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #37 from felixrieseberg/forge
Browse files Browse the repository at this point in the history
Introduce electron-forge
  • Loading branch information
delvedor committed May 31, 2017
2 parents 431af0c + 6b2df09 commit ead0461
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 31 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ npm install && npm start

Learn more about Electron and its API in the [documentation](http://electron.atom.io/docs/latest).

## To build

This installer can be built for Windows, macOS, and Linux. Calling `npm run make` will create packages for the current platform. On Windows, it will create a `zip` file and self-contained Squirrel installer. On macOS, it will create a `dmg` and `zip` file. On Linux, it will create both a `deb` and a `rpm` package. The configuration for those packages can be found in `package.json`.

## Tests and Linting

This project uses [StandardJS](http://standardjs.com/) as its style guide.
Expand Down
55 changes: 39 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
{
"name": "installer",
"version": "0.1.0",
"description": "**Clone and run for a quick way to see an Electron in action.**",
"main": "main.js",
"productName": "node-installer",
"description": "An Electron application for installing, updating and managing versions of Node.js.",
"main": "src/main/main.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"test": "standard"
},
"keywords": [],
"author": "Mikeal Rogers <mikeal.rogers@gmail.com> (http://www.mikealrogers.com)",
"license": "Apache-2.0",
"config": {
"forge": {
"make_targets": {
"win32": [
"squirrel",
"zip"
],
"darwin": [
"zip"
],
"linux": [
"deb",
"rpm"
]
},
"electronPackagerConfig": {
"appBundleId": "org.nodejs.installer"
},
"electronWinstallerConfig": {
"name": "installer"
},
"electronInstallerDebian": {},
"electronInstallerRedhat": {}
}
},
"dependencies": {
"electron-compile": "^6.4.1",
"electron-sudo": "^3.0.8",
"flexboxgrid": "^6.3.1",
"font-awesome": "^4.6.3",
Expand All @@ -15,20 +51,7 @@
"yo-yo": "^1.2.2"
},
"devDependencies": {
"electron-builder": "^5.10.5",
"electron-prebuilt": "^1.2.5",
"electron-prebuilt-compile": "1.6.11",
"standard": "^7.1.2"
},
"scripts": {
"start": "electron .",
"pack": "build --dir",
"dist": "build",
"test": "standard"
},
"keywords": [],
"author": "Mikeal Rogers <mikeal.rogers@gmail.com> (http://www.mikealrogers.com)",
"license": "Apache-2.0",
"build": {
"appId": "org.nodejs.installer"
}
}
2 changes: 1 addition & 1 deletion main.js → src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function createWindow () {
})

// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`)
mainWindow.loadURL(`file://${__dirname}/../renderer/index.html`)

// Open the DevTools.
mainWindow.webContents.openDevTools()
Expand Down
22 changes: 11 additions & 11 deletions index.html → src/renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@
<head>
<meta charset="UTF-8">
<title>Node.js Installer</title>
<link rel="stylesheet" href="./node_modules/flexboxgrid/dist/flexboxgrid.min.css" type="text/css">
<link rel="stylesheet" href="./node_modules/font-awesome/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="./node_modules/prismjs/themes/prism.css" type="text/css">
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" href="../../node_modules/flexboxgrid/dist/flexboxgrid.min.css" type="text/css">
<link rel="stylesheet" href="../../node_modules/font-awesome/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="../../node_modules/prismjs/themes/prism.css" type="text/css">
<link rel="stylesheet" type="text/css" href="../../static/style.css"/>
</head>
<body>
<div id="main" class="row">
<div class="col-xs-4 left-panel background-green">
<div class="row">
<div class="col-xs-12 node-image-container">
<img id="node-logo" src="./images/nodejs-new-white-bw.png" alt="node logo" onclick="require('electron').shell.openExternal('https://nodejs.org/en/')"/>
<img id="node-logo" src="../../static/images/nodejs-new-white-bw.png" alt="node logo" onclick="require('electron').shell.openExternal('https://nodejs.org/en/')"/>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<p id="installed-version">Installed version: <span><i class="fa fa-spinner fa-pulse fa-fw"></i></span></p>
</div>
<div class="col-xs-12">
<a href="#" id="update-to" class="version-button"><img src="./images/lgoonodejswhite.png" alt="" /> Update to: <span></span></a>
<a href="#" id="update-to" class="version-button"><img src="../../static/images/lgoonodejswhite.png" alt="" /> Update to: <span></span></a>
</div>
</div>
<div class="row bottom">
<div class="col-xs-12">
<p>Latest versions:</p>
</div>
<div class="col-xs-12">
<a href="#" id="install-stable" class="version-button"><img src="./images/lgoonodejswhite.png" alt="" /> Install stable: <span><i class="fa fa-spinner fa-pulse fa-fw"></i></span></a>
<a href="#" id="install-stable" class="version-button"><img src="../../static/images/lgoonodejswhite.png" alt="" /> Install stable: <span><i class="fa fa-spinner fa-pulse fa-fw"></i></span></a>
</div>
<div class="col-xs-12">
<a href="#" id="install-latest" class="version-button"><img src="./images/lgoonodejswhite.png" alt="" /> Install current: <span><i class="fa fa-spinner fa-pulse fa-fw"></i></span></a>
<a href="#" id="install-latest" class="version-button"><img src="../../static/images/lgoonodejswhite.png" alt="" /> Install current: <span><i class="fa fa-spinner fa-pulse fa-fw"></i></span></a>
</div>
</div>
</div>
<div class="col-xs-8 right-panel">
<div class="row">
<div class="col-xs-12 school-image-container">
<img src="./images/schoolhouse.svg" alt="" />
<img src="../../static/images/schoolhouse.svg" alt="" />
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -76,7 +76,7 @@ <h1 class="color-green">Installing Node.js</h1>
<a id="error-button" href="#" class="color-red">Return to installer</a>
</div>
</div>
<script src="./node_modules/prismjs/prism.js"></script>
<script src="./browser.js"></script>
<script src="../../node_modules/prismjs/prism.js"></script>
<script src="./renderer.js"></script>
</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions browser.js → src/renderer/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const semver = require('semver')

const getInstalledVersion = require('./lib/check-node')
const loadVersions = require('./lib/load.js')
const loadVersions = require('./lib/load')
const installNode = require('./lib/install')
const getExample = require('./lib/examples')

Expand All @@ -17,11 +17,11 @@ const major = v => v.split('.')[0]

const installing = {
run: false,
start() {
start () {
domElement('#installing').style.display = 'block'
this.run = true
},
done() {
done () {
domElement('#installing').style.display = 'none'
this.run = false
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.

0 comments on commit ead0461

Please sign in to comment.