Skip to content

Commit

Permalink
Merge pull request #4847 from MetaMask/node-version-check
Browse files Browse the repository at this point in the history
Enforce usage of node 8.11.3 and npm 6.1.0
  • Loading branch information
Bruno Barbieri authored Jul 21, 2018
2 parents c5520de + f63a92a commit 7cca146
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 49 deletions.
55 changes: 27 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,29 @@ jobs:
- checkout
- restore_cache:
keys:
- dependency-cache-{{ checksum "package-lock.json" }}
- v1.0-dependency-cache-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- dependency-cache-
- v1.0-dependency-cache-
- run:
name: Install npm 6 + deps via npm
command: |
sudo npm install -g [email protected] && npm install
sudo npm install -g [email protected] && npm install --no-save
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
paths:
- node_modules

prep-deps-firefox:
docker:
- image: circleci/node:8.11.3-browsers
steps:
- checkout
- restore_cache:
key: dependency-cache-firefox-
key: v1.0-dependency-cache-firefox-
- run:
name: Download Firefox If needed
command: ./.circleci/scripts/firefox-download.sh
- save_cache:
key: dependency-cache-firefox-
key: v1.0-dependency-cache-firefox-
paths:
- firefox

Expand All @@ -135,7 +134,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: build:dist
command: npm run dist
Expand All @@ -154,7 +153,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: build:dist
command: npm run doc
Expand All @@ -169,7 +168,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
Expand All @@ -188,7 +187,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Test
command: npm run lint
Expand All @@ -199,7 +198,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Test
command: npx nsp check
Expand All @@ -210,7 +209,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- restore_cache:
key: build-cache-{{ .Revision }}
- run:
Expand All @@ -226,12 +225,12 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-firefox-
key: v1.0-dependency-cache-firefox-
- run:
name: Install firefox
command: ./.circleci/scripts/firefox-install.sh
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- restore_cache:
key: build-cache-{{ .Revision }}
- run:
Expand All @@ -247,7 +246,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- restore_cache:
key: build-cache-{{ .Revision }}
- run:
Expand All @@ -263,12 +262,12 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-firefox-
key: v1.0-dependency-cache-firefox-
- run:
name: Install firefox
command: ./.circleci/scripts/firefox-install.sh
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- restore_cache:
key: build-cache-{{ .Revision }}
- run:
Expand All @@ -284,7 +283,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- restore_cache:
key: build-cache-{{ .Revision }}
- run:
Expand All @@ -301,7 +300,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- restore_cache:
key: build-cache-{{ .Revision }}
- restore_cache:
Expand All @@ -328,7 +327,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- restore_cache:
key: build-cache-{{ .Revision }}
- restore_cache:
Expand All @@ -351,7 +350,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: test:coverage
command: npm run test:coverage
Expand All @@ -364,12 +363,12 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-firefox-
key: v1.0-dependency-cache-firefox-
- run:
name: Install firefox
command: ./.circleci/scripts/firefox-install.sh
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
Expand All @@ -388,7 +387,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
Expand All @@ -407,12 +406,12 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-firefox-
key: v1.0-dependency-cache-firefox-
- run:
name: Install firefox
command: ./.circleci/scripts/firefox-install.sh
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
Expand All @@ -431,7 +430,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
key: v1.0-dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Get Scss Cache key
# this allows us to checksum against a whole directory
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ If you're a web dapp developer, we've got two types of guides for you:

## Building locally

- Install [Node.js](https://nodejs.org/en/) version 6.3.1 or later.
- Install [Node.js](https://nodejs.org/en/) version 8.11.3 and npm version 6.1.0
- Install dependencies:
- For node versions up to and including 9, install local dependencies with `npm install`.
- For node versions 10 and later, install [Yarn](https://yarnpkg.com/lang/en/docs/install/) and use `yarn install`.
- If you are using nvm (recommended) running `nvm use` will automatically choose the right node version for you.
- Install gulp globally with `npm install -g gulp-cli`.
- Build the project to the `./dist/` folder with `gulp build`.
- Optionally, to rebuild on file changes, run `gulp dev`.
Expand Down
24 changes: 7 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@
"watchify": "^3.11.0"
},
"engines": {
"node": ">=8.0.0"
"node": "8.11.3",
"npm": "^6.1.0"
}
}

0 comments on commit 7cca146

Please sign in to comment.