Skip to content

Commit

Permalink
build: rely on engines to prevent using npm for dependency install
Browse files Browse the repository at this point in the history
See angular/angular@c385e74 for more context
  • Loading branch information
alan-agius4 committed Apr 19, 2021
1 parent 10d4a54 commit 6a6aef6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict = true
3 changes: 0 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ node_repositories(

yarn_install(
name = "npm",
data = [
"//:tools/yarn/check-yarn.js",
],
package_json = "//:package.json",
strict_visibility = False, # Needed for ts-api-guardian. More info about this can be found https://github.com/bazelbuild/rules_nodejs/wiki#strict_visibility-on-yarn_install-and-npm_install-now-defaults-true-2199
yarn_lock = "//:yarn.lock",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"lint": "tslint --project tsconfig.json",
"templates": "node ./bin/devkit-admin templates",
"validate": "node ./bin/devkit-admin validate",
"preinstall": "node ./tools/yarn/check-yarn.js",
"postinstall": "yarn webdriver-update && yarn ngcc && yarn husky install",
"//webdriver-update-README": "ChromeDriver version must match Puppeteer Chromium version, see https://github.com/GoogleChrome/puppeteer/releases http://chromedriver.chromium.org/downloads",
"webdriver-update": "webdriver-manager update --standalone false --gecko false --versions.chrome 89.0.4389.0",
Expand All @@ -43,7 +42,8 @@
},
"engines": {
"node": ">=12.13.0 <15.0.0",
"yarn": ">=1.22.4"
"yarn": ">=1.21.1 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},
"author": "Angular Authors",
"license": "MIT",
Expand Down
14 changes: 0 additions & 14 deletions tools/yarn/check-yarn.js

This file was deleted.

0 comments on commit 6a6aef6

Please sign in to comment.