From 3f22ec8dc82716b60b5e3ccc03f65bf841c6d775 Mon Sep 17 00:00:00 2001 From: Nate Goldman Date: Wed, 20 Jan 2016 12:02:43 -0800 Subject: [PATCH 1/3] use electron-prebuilt@^0.36.4, node >= 4 adjust docs to reflect change, run fixpack for good measure --- README.md | 2 +- package.json | 38 +++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index fc4913f..e5ba3bf 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ See [our site](http://moose-team.github.io/friends/) or the `gh-pages` branch. ### Prerequisites -You'll need the newest [io.js](https://iojs.org) and npm (`>= 1.8.1`, `>= 2.8.3`) +You'll need the newest [node.js](https://nodejs.org) (`>= 4`) and npm (`>= 2.8.3`). ### Build diff --git a/package.json b/package.json index 5eab49e..bb58860 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,11 @@ "github-current-user": false, "leveldown": "level-js" }, + "browserify": { + "transforms": [ + "brfs" + ] + }, "bugs": { "url": "https://github.com/moose-team/friends/issues" }, @@ -49,7 +54,7 @@ "beefy": "^2.1.5", "brfs": "^1.4.1", "electron-packager": "^5.0.2", - "electron-prebuilt": "^0.34.2", + "electron-prebuilt": "^0.36.4", "mkdirp": "^0.5.0", "nib": "^1.1.0", "node-gyp": "^2.0.2", @@ -59,21 +64,25 @@ "stylus": "^0.52.0", "watchify": "^3.2.1" }, + "engines": { + "node": ">=4", + "npm": ">=2.8.3" + }, "homepage": "https://github.com/moose-team/friends", "keywords": [ - "peer-to-peer", - "mad science", "chat", - "friends", - "p2p", - "discussion", "communication", - "team chat", - "replication", "crypto", - "webrtc", + "discussion", + "friends", "irc", - "slack" + "mad science", + "p2p", + "peer-to-peer", + "replication", + "slack", + "team chat", + "webrtc" ], "license": "MIT", "main": "index.js", @@ -81,20 +90,15 @@ "type": "git", "url": "https://github.com/moose-team/friends.git" }, - "browserify": { - "transforms": [ - "brfs" - ] - }, "scripts": { "build-css": "mkdirp dist && stylus -u nib css/app.styl -o dist/ -c", "package": "node pkg.js", "package-all": "node pkg.js --all", + "rebuild-leveldb": "cd node_modules/leveldown && set HOME=~/.electron-gyp && node-gyp rebuild --target=0.34.2 --arch=x64 --dist-url=https://atom.io/download/atom-shell", "start": "npm run build-css && electron index.js 2>&1 | silence-chromium", "test": "standard", "watch": "npm run build-css && (npm run watch-css & electron index.js 2>&1 | silence-chromium)", "watch-css": "mkdirp dist && stylus -u nib css/app.styl -o dist/ -w", - "web": "beefy web.js:bundle.js", - "rebuild-leveldb": "cd node_modules/leveldown && set HOME=~/.electron-gyp && node-gyp rebuild --target=0.34.2 --arch=x64 --dist-url=https://atom.io/download/atom-shell" + "web": "beefy web.js:bundle.js" } } From 08ba0480dcc7ce81a35c07e39bf9a1c745617bb3 Mon Sep 17 00:00:00 2001 From: Nate Goldman Date: Wed, 20 Jan 2016 12:06:16 -0800 Subject: [PATCH 2/3] use loadURL (loadUrl is deprecated) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7579d68..bc2d3e1 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ function appReady () { height: 600, title: APP_NAME }) - mainWindow.loadUrl(INDEX) + mainWindow.loadURL(INDEX) mainWindow.on('closed', function () { mainWindow = null From 63d5b08d89d05c933f8941466ca0fede60e67a94 Mon Sep 17 00:00:00 2001 From: Nate Goldman Date: Wed, 20 Jan 2016 18:25:37 -0800 Subject: [PATCH 3/3] always get electron version from package.json --- README.md | 2 +- package.json | 2 +- pkg.js | 2 +- version.js | 8 ++++++++ 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100755 version.js diff --git a/README.md b/README.md index e5ba3bf..6397964 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are not on 64-bit architecture, you will have to modify the command in package.json: ``` -"rebuild-leveldb": "cd node_modules/leveldown && set HOME=~/.electron-gyp && node-gyp rebuild --target=0.34.2 --arch=x64 --dist-url=https://atom.io/download/atom-shell" +"rebuild-leveldb": "cd node_modules/leveldown && set HOME=~/.electron-gyp && node-gyp rebuild --target=$(../../version.js) --arch=x64 --dist-url=https://atom.io/download/atom-shell" ``` to use `--arch=ia32`. diff --git a/package.json b/package.json index bb58860..1617e26 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "build-css": "mkdirp dist && stylus -u nib css/app.styl -o dist/ -c", "package": "node pkg.js", "package-all": "node pkg.js --all", - "rebuild-leveldb": "cd node_modules/leveldown && set HOME=~/.electron-gyp && node-gyp rebuild --target=0.34.2 --arch=x64 --dist-url=https://atom.io/download/atom-shell", + "rebuild-leveldb": "cd node_modules/leveldown && set HOME=~/.electron-gyp && node-gyp rebuild --target=$(../../version.js) --arch=x64 --dist-url=https://atom.io/download/atom-shell", "start": "npm run build-css && electron index.js 2>&1 | silence-chromium", "test": "standard", "watch": "npm run build-css && (npm run watch-css & electron index.js 2>&1 | silence-chromium)", diff --git a/pkg.js b/pkg.js index d137fb8..1d3d380 100755 --- a/pkg.js +++ b/pkg.js @@ -4,11 +4,11 @@ var os = require('os') var pkgjson = require('./package.json') var path = require('path') var sh = require('shelljs') +var electronVersion = require('./version') var appVersion = pkgjson.version var appName = pkgjson.name var electronPackager = './node_modules/.bin/electron-packager' -var electronVersion = '0.26.0' var icon = 'static/Icon.icns' if (process.argv[2] === '--all') { diff --git a/version.js b/version.js new file mode 100755 index 0000000..e207642 --- /dev/null +++ b/version.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var pkg = require('./package.json') +var version = pkg.devDependencies['electron-prebuilt'].replace('^', '') + +if (require.main === module) console.log(version) + +module.exports = version