Skip to content

Commit

Permalink
Upgrade to Electron 1.8.2 / Node.js 8.2.1 (#2066)
Browse files Browse the repository at this point in the history
* Upgrade to Electron 1.8.2 / Node.js 8.2.1

* Update CI Node.js versions

* Make `engines` top-level property

This was accidentally included under `build` which is disallowed
by `electron-builder`.

* Refactor notification updates

Allows easier debugging through variable inspection.

* Use `appId` for Application User Model ID

Recommended in:
electron/electron#10864 (comment)

* Update `spectron` to 3.8.0

* Bump `electron-builder` based dependencies

* Use `config.extraMetadata` instead of `em`

Prevents `Unknown argument: em` error.

See: electron-userland/electron-builder#2615

* Revert AUMID to be based on `packageJson.name`

In our build artifact `packageJson.build.appId` causes an NPE.
  • Loading branch information
gasi committed Mar 2, 2018
1 parent 3a334f3 commit a4c52b8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.9.0
8.2.1
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '7.9.0'
- '8.2.1'
os:
- linux
dist: trusty
Expand All @@ -12,7 +12,7 @@ script:
- yarn eslint
- yarn test-server
- yarn lint
- ./node_modules/.bin/build --em.environment=$SIGNAL_ENV --config.mac.bundleVersion='$TRAVIS_BUILD_NUMBER' --publish=never
- $(yarn bin)/build --config.extraMetadata.environment=$SIGNAL_ENV --config.mac.bundleVersion='$TRAVIS_BUILD_NUMBER' --publish=never
- ./travis.sh
env:
global:
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cache:
install:
- systeminfo | findstr /C:"OS"
- set PATH=C:\Ruby23-x64\bin;%PATH%
- ps: Install-Product node 7.9.0 x64
- ps: Install-Product node 8.2.1 x64
- yarn install

build_script:
Expand All @@ -20,7 +20,7 @@ build_script:
- type package.json | findstr /v certificateSubjectName > temp.json
- move temp.json package.json
- yarn prepare-beta-build
- node_modules\.bin\build --em.environment=%SIGNAL_ENV% --publish=never
- node_modules\.bin\build --config.extraMetadata.environment=%SIGNAL_ENV% --publish=never

test_script:
- node build\grunt.js test
Expand Down
8 changes: 5 additions & 3 deletions js/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
this.trigger('click', conversation);
},
update: function() {
const isFocused = window.isFocused();
console.log(
'updating notifications - count:', this.length,
'focused:', window.isFocused(),
'focused:', isFocused,
'enabled:', enabled
);
if (!enabled) {
Expand All @@ -37,8 +38,9 @@
if (this.length === 0) {
return;
}
if (window.isFocused()) {
// The window is focused. Consider yourself notified.

const isNotificationOmitted = isFocused;
if (isNotificationOmitted) {
this.clear();
return;
}
Expand Down
7 changes: 3 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ const logging = require('./app/logging');
const autoUpdate = require('./app/auto_update');
const windowState = require('./app/window_state');


const aumid = `org.whispersystems.${packageJson.name}`;
console.log(`setting AUMID to ${aumid}`);
app.setAppUserModelId(aumid);
const appUserModelId = `org.whispersystems.${packageJson.name}`;
console.log('Set Windows Application User Model ID (AUMID)', { appUserModelId });
app.setAppUserModelId(appUserModelId);

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"asarl": "asar l release/mac/Signal.app/Contents/Resources/app.asar",
"icon-gen": "electron-icon-maker --input=images/icon_1024.png --output=./build",
"generate": "npm run icon-gen && grunt",
"build": "build --em.environment=$SIGNAL_ENV",
"build": "build --config.extraMetadata.environment=$SIGNAL_ENV",
"dist": "npm run generate && npm run build",
"pack": "npm run generate && npm run build -- --dir",
"prepare-beta-build": "node prepare_beta_build.js",
Expand Down Expand Up @@ -51,7 +51,7 @@
"electron-config": "^1.0.0",
"electron-editor-context-menu": "^1.1.1",
"electron-is-dev": "^0.3.0",
"electron-updater": "^2.19.0",
"electron-updater": "^2.21.0",
"emoji-datasource": "4.0.0",
"emoji-datasource-apple": "4.0.0",
"emoji-js": "^3.4.0",
Expand All @@ -75,10 +75,10 @@
"asar": "^0.14.0",
"bower": "^1.8.2",
"chai": "^4.1.2",
"electron": "1.7.12",
"electron-builder": "^19.53.7",
"electron": "1.8.2",
"electron-builder": "^20.2.0",
"electron-icon-maker": "0.0.3",
"electron-publisher-s3": "^19.53.7",
"electron-publisher-s3": "^20.2.0",
"eslint": "^4.14.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.8.0",
Expand All @@ -98,9 +98,12 @@
"mocha-testcheck": "^1.0.0-rc.0",
"node-sass-import-once": "^1.2.0",
"nyc": "^11.4.1",
"spectron": "^3.7.2",
"spectron": "^3.8.0",
"tmp": "^0.0.33"
},
"engines": {
"node": "8.2.1"
},
"build": {
"appId": "org.whispersystems.signal-desktop",
"mac": {
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"7zip-bin-mac" "^1.0.1"
"7zip-bin-win" "^2.1.1"

"@types/node@^7.0.18":
version "7.0.43"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
"@types/node@^8.0.24":
version "8.9.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.9.4.tgz#dfd327582a06c114eb6e0441fa3d6fab35edad48"

"JSV@>= 4.0.x":
version "4.0.2"
Expand Down Expand Up @@ -1535,11 +1535,11 @@ electron-updater@^2.19.0:
semver "^5.4.1"
source-map-support "^0.5.0"

electron@1.7.12:
version "1.7.12"
resolved "https://registry.yarnpkg.com/electron/-/electron-1.7.12.tgz#dcc61a2c1b0c3df25f68b3425379a01abd01190e"
electron@1.8.2:
version "1.8.2"
resolved "https://registry.yarnpkg.com/electron/-/electron-1.8.2.tgz#a817cd733c2972b3c7cc4f777caf6e424b88014d"
dependencies:
"@types/node" "^7.0.18"
"@types/node" "^8.0.24"
electron-download "^3.0.1"
extract-zip "^1.0.3"

Expand Down

0 comments on commit a4c52b8

Please sign in to comment.