diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-10-09 15:09:46 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-10-09 15:09:46 +0200 |
| commit | 833b6295ef8702bf9a785b0860af4711c1f3484e (patch) | |
| tree | ccb914518b0eadfcf983bab4e2b1d718a58448c0 | |
| parent | a99cae309aee4be6e96c52b46fa0e45ee61ca863 (diff) | |
| parent | 4c2e737b8c1e5a5bf2d6e900000ec91ed2f583a0 (diff) | |
| download | mullvadvpn-833b6295ef8702bf9a785b0860af4711c1f3484e.tar.xz mullvadvpn-833b6295ef8702bf9a785b0860af4711c1f3484e.zip | |
Merge branch 'switch-nseventmonitor-to-npm'
| -rw-r--r-- | .travis.yml | 6 | ||||
| -rw-r--r-- | README.md | 7 | ||||
| -rw-r--r-- | appveyor_gui.yml | 7 | ||||
| -rwxr-xr-x | build.sh | 12 | ||||
| -rw-r--r-- | gui/package-lock.json | 3 | ||||
| -rw-r--r-- | gui/package.json | 6 | ||||
| -rwxr-xr-x | prepare_release.sh | 2 | ||||
| -rwxr-xr-x | version_metadata.sh | 9 |
8 files changed, 35 insertions, 17 deletions
diff --git a/.travis.yml b/.travis.yml index 5c4f4c2844..27cab903cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,13 +10,15 @@ matrix: include: # GUI - Electron - language: node_js - node_js: '8' + node_js: '12' cache: npm services: - xvfb + before_install: + - npm install -g npm install: - cd gui - - npm install + - npm ci --no-optional script: - npm run check-format - npm run lint @@ -181,15 +181,14 @@ storePassword = keystore-password 1. Get the latest **stable** Rust toolchain via [rustup.rs](https://rustup.rs/). -1. Get the latest version 8 LTS release of Node.js and the latest version of npm. +1. Get the latest version 12 release of Node.js and the latest version of npm. #### macOS ```bash - brew install node@8 - export PATH="/usr/local/opt/node@8/bin:$PATH" + brew install node ``` #### Linux - Just download and unpack the `node-v8.xxxx.tar.xz` tarball and add its `bin` directory to your + Just download and unpack the `node-v12.xxxx.tar.xz` tarball and add its `bin` directory to your `PATH`. #### Windows diff --git a/appveyor_gui.yml b/appveyor_gui.yml index c9daf04a4e..d405aea46f 100644 --- a/appveyor_gui.yml +++ b/appveyor_gui.yml @@ -1,8 +1,13 @@ +environment: + nodejs_version: "12" + install: + - ps: Install-Product node 12 + - npm install -g npm - npm --version - node --version - cd gui - - npm install + - npm ci --no-optional # This is the "test phase", tweak it as you see fit test_script: @@ -73,14 +73,12 @@ function restore_metadata_backups() { pushd "$SCRIPT_DIR" echo "Restoring version metadata files..." ./version_metadata.sh restore-backup - mv gui/package-lock.json.bak gui/package-lock.json || true mv Cargo.lock.bak Cargo.lock || true popd } trap 'restore_metadata_backups' EXIT echo "Updating version in metadata files..." -cp gui/package-lock.json gui/package-lock.json.bak cp Cargo.lock Cargo.lock.bak ./version_metadata.sh inject $PRODUCT_VERSION @@ -161,7 +159,15 @@ echo $JSONRPC_RESPONSE | node -e "$JSONRPC_CODE" > dist-assets/relays.json pushd "$SCRIPT_DIR/gui" echo "Installing JavaScript dependencies..." -npm install + +# Add `--no-optional` flag when running on non-macOS environments because `npm ci` attempts to +# install optional dependencies that aren't even available on other platforms. +NPM_CI_ARGS="" +if [ "$(uname -s)" != "Darwin" ]; then + NPM_CI_ARGS+="--no-optional" +fi + +npm ci $NPM_CI_ARGS ################################################################################ # Package release. diff --git a/gui/package-lock.json b/gui/package-lock.json index a52ca570b7..dce654e6b8 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -6589,7 +6589,8 @@ }, "nseventmonitor": { "version": "0.0.16", - "resolved": "git+https://github.com/mullvad/NSEventMonitor.git#e434cc37deb89e79ae8797098658d487dfa83707", + "resolved": "https://registry.npmjs.org/nseventmonitor/-/nseventmonitor-0.0.16.tgz", + "integrity": "sha512-QEosXAV/0ZpKWOI5dlkvShMDinJs1OKfRWVPUPbZmWg9e8EfuNfLKoRNeQqXCd2g7z+opUUig1dPG2UX176FTA==", "optional": true, "requires": { "node-pre-gyp": "^0.12.0" diff --git a/gui/package.json b/gui/package.json index ccf7f93a6e..052aa27e24 100644 --- a/gui/package.json +++ b/gui/package.json @@ -35,7 +35,7 @@ "validated": "^2.0.1" }, "optionalDependencies": { - "nseventmonitor": "https://github.com/mullvad/NSEventMonitor.git#0.0.16" + "nseventmonitor": "^0.0.16" }, "devDependencies": { "@types/chai": "^4.1.7", @@ -98,5 +98,9 @@ "pack:win": "gulp pack-win", "pack:linux": "gulp pack-linux", "private:format": "prettier \"**/*.{js,css,ts,tsx}\"" + }, + "engines": { + "node": ">=12", + "npm": ">=6.12" } } diff --git a/prepare_release.sh b/prepare_release.sh index b55744403a..f30e2e2749 100755 --- a/prepare_release.sh +++ b/prepare_release.sh @@ -30,8 +30,6 @@ echo "Syncing Cargo.lock with new version numbers" source env.sh "" cargo +stable build -(cd gui/ && npm install) || exit 1 - echo "Commiting metadata changes to git..." git commit -S -m "Updating version in package files" \ gui/package.json \ diff --git a/version_metadata.sh b/version_metadata.sh index 6624ea9f37..e2d3b1907a 100755 --- a/version_metadata.sh +++ b/version_metadata.sh @@ -30,8 +30,9 @@ case "$1" in SEMVER_PATCH="0" # Electron GUI - sed -i.bak -Ee "s/\"version\": \"[^\"]+\",/\"version\": \"$SEMVER_VERSION\",/g" \ - gui/package.json + cp gui/package.json gui/package.json.bak + cp gui/package-lock.json gui/package-lock.json.bak + (cd gui/ && npm version $SEMVER_VERSION --no-git-tag-version) # Rust crates sed -i.bak -Ee "s/^version = \"[^\"]+\"\$/version = \"$SEMVER_VERSION\"/g" \ @@ -61,6 +62,7 @@ EOF "restore-backup") # Electron GUI mv gui/package.json.bak gui/package.json || true + mv gui/package-lock.json.bak gui/package-lock.json || true # Rust crates mv mullvad-daemon/Cargo.toml.bak mullvad-daemon/Cargo.toml || true mv mullvad-cli/Cargo.toml.bak mullvad-cli/Cargo.toml || true @@ -76,6 +78,7 @@ EOF "delete-backup") # Electron GUI rm gui/package.json.bak || true + rm gui/package-lock.json.bak || true # Rust crates rm mullvad-daemon/Cargo.toml.bak || true rm mullvad-cli/Cargo.toml.bak || true @@ -92,4 +95,4 @@ EOF echo "Invalid command" exit 1 ;; -esac
\ No newline at end of file +esac |
