Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a8478f

Browse files
add dependency check pre-condition to all packages (cypress-io#2580)
1 parent f4209db commit 2a8478f

File tree

17 files changed

+234
-18
lines changed

17 files changed

+234
-18
lines changed

cli/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010
"node": ">=4.0.0"
1111
},
1212
"scripts": {
13+
"pretest": "npm run check-deps-pre",
1314
"test": "npm run test-unit",
15+
"pretest-unit": "npm run check-deps-pre",
1416
"test-unit": "npm run dtslint && npm run unit",
17+
"pretest-watch": "npm run check-deps-pre",
1518
"test-watch": "npm run unit -- --watch",
16-
"test-dependencies": "bin-up deps-ok && dependency-check . --no-dev",
19+
"check-deps": "node ../scripts/check-deps.js --verbose",
20+
"check-deps-pre": "npm run check-deps -- --prescript",
21+
"test-dependencies": "npm run check-deps && dependency-check . --no-dev",
1722
"test-debug": "node --inspect --debug-brk $(bin-up _mocha)",
1823
"test-cov": "nyc npm run unit",
1924
"unit": "BLUEBIRD_DEBUG=1 NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json",
@@ -92,8 +97,7 @@
9297
"proxyquire": "2.0.1",
9398
"shelljs": "0.7.8",
9499
"sinon": "5.0.7",
95-
"snap-shot-it": "^5.0.0",
96-
"strip-ansi": "4.0.0"
100+
"snap-shot-it": "^5.0.0"
97101
},
98102
"files": [
99103
"bin",

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@
88
"node": ">=8.2.1"
99
},
1010
"scripts": {
11+
"prestart": "npm run check-deps-pre",
1112
"start": "node ./cli/bin/cypress open --dev --global",
1213
"cypress:open": "node ./cli/bin/cypress open --dev --global",
1314
"cypress:run": "node ./cli/bin/cypress run --dev",
1415
"dev": "node ./scripts/start.js",
1516
"watch": "npm run all watch",
16-
"deps": "deps-ok",
17-
"prebuild": "npm run deps",
17+
"check-deps": "node ./scripts/check-deps.js --verbose",
18+
"check-deps-pre": "node ./scripts/check-deps.js --verbose --prescript",
19+
"prebuild": "npm run check-deps-pre",
1820
"build": "npm run all build",
1921
"all": "node ./scripts/run.js",
2022
"test": "echo '⚠️ This root monorepo is only for local development and new contributions. There are no tests.'",
2123
"link": "node ./scripts/link-packages.js",
24+
"install-filtered": "npm run all install -- --package $(node ./scripts/check-deps.js --list)",
2225
"postinstall": "echo 'root postinstall' && npm run link && npm run all install && npm run build",
2326
"clean-deps": "npm run all clean-deps",
2427
"docker": "./scripts/run-docker-local.sh",
@@ -61,6 +64,7 @@
6164
"bluebird-retry": "^0.11.0",
6265
"chai": "^4.0.2",
6366
"chalk": "^2.0.1",
67+
"check-dependencies": "1.1.0",
6468
"check-more-types": "^2.24.0",
6569
"cloudflare-cli": "^2.1.0",
6670
"coffeelint": "^1.16.0",
@@ -69,7 +73,6 @@
6973
"console.table": "^0.9.1",
7074
"debug": "3.1.0",
7175
"del": "^3.0.0",
72-
"deps-ok": "^1.4.1",
7376
"electron-osx-sign": "^0.4.6",
7477
"eslint": "4.13.1",
7578
"eslint-plugin-cypress": "^2.0.1",
@@ -109,6 +112,7 @@
109112
"shelljs": "^0.7.8",
110113
"snap-shot-it": "^5.0.1",
111114
"stop-only": "2.1.0",
115+
"strip-ansi": "4.0.0",
112116
"terminal-banner": "^1.0.0",
113117
"typescript": "^2.3.4",
114118
"vagrant": "0.0.1",

packages/coffee/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"files": [
99
"register.js"
1010
],
11-
"scripts": {},
12-
"devDependencies": {}
11+
"scripts": {
12+
"check-deps": "node ../../scripts/check-deps.js --verbose"
13+
}
1314
}

packages/desktop-gui/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
"private": true,
66
"scripts": {
77
"postinstall": "echo '@packages/desktop-gui needs: npm run build'",
8+
"prebuild": "npm run check-deps-pre",
89
"build": "node ./scripts/build-dev.js",
10+
"prebuild-prod": "npm run check-deps-pre",
911
"build-prod": "node ./scripts/build-prod.js",
12+
"prewatch": "npm run check-deps-pre",
1013
"watch": "node ./scripts/watch.js",
14+
"check-deps": "node ../../scripts/check-deps.js --verbose",
15+
"check-deps-pre": "npm run check-deps -- --prescript",
1116
"clean": "zunder clean",
1217
"clean-deps": "rm -rf node_modules",
1318
"lint": "$(bin-up eslint) --fix lib/*.js src/*.js* src/**/*.js*",

packages/driver/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
"main": "index.js",
66
"browser": "src/main",
77
"scripts": {
8+
"prestart": "npm run check-deps-pre",
89
"start": "../coffee/node_modules/.bin/coffee test/support/server.coffee",
910
"cypress:open": "node ../../scripts/cypress open --project ./test",
1011
"cypress:run": "node ../../scripts/cypress run --project ./test",
12+
"check-deps": "node ../../scripts/check-deps.js --verbose",
13+
"check-deps-pre": "npm run check-deps -- --prescript",
1114
"clean-deps": "rm -rf node_modules"
1215
},
1316
"files": [

packages/electron/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
"main": "index.js",
77
"scripts": {
88
"postinstall": "echo '@packages/electron needs: npm run build'",
9+
"prestart": "npm run check-deps-pre",
910
"start": "./bin/cypress-electron",
11+
"pretest": "npm run check-deps-pre",
1012
"test": "mocha --compilers coffee:@packages/coffee/register",
13+
"prebuild": "npm run check-deps-pre",
1114
"build": "node ./bin/cypress-electron --install",
15+
"check-deps": "node ../../scripts/check-deps.js --verbose",
16+
"check-deps-pre": "npm run check-deps -- --prescript",
1217
"clean-deps": "rm -rf node_modules"
1318
},
1419
"bin": {

packages/example/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
"main": "index.js",
66
"scripts": {
77
"postinstall": "echo '@packages/example needs: npm run build'",
8+
"check-deps": "node ../../scripts/check-deps.js --verbose",
9+
"check-deps-pre": "npm run check-deps -- --prescript",
810
"clean-deps": "rm -rf node_modules",
11+
"pretest": "npm run check-deps-pre && npm run lint",
912
"test": "cross-env NODE_ENV=test mocha",
1013
"test-e2e": "cypress run",
14+
"prebuild": "npm run check-deps-pre",
1115
"build": "node ./bin/build.js && gulp build",
1216
"predeploy": "npm run build",
1317
"deploy": "gulp deploy",
14-
"lint": "bin-up eslint --fix *.js bin/*.js lib/*.js test/*.js",
15-
"pretest": "npm run lint"
18+
"lint": "bin-up eslint --fix *.js bin/*.js lib/*.js test/*.js"
1619
},
1720
"files": [
1821
"cypress",

packages/extension/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@
55
"main": "index.js",
66
"scripts": {
77
"postinstall": "echo '@packages/extension needs: npm run build'",
8+
"prewatch": "npm run check-deps-pre",
89
"watch": "gulp watch",
10+
"prebuild": "npm run check-deps-pre",
911
"build": "gulp build",
12+
"prebuild-prod": "npm run check-deps-pre",
1013
"build-prod": "gulp build",
14+
"pretest": "npm run check-deps-pre",
1115
"test": "cross-env NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json",
16+
"pretest-watch": "npm run check-deps-pre",
1217
"test-watch": "npm run test -- --watch",
18+
"check-deps": "node ../../scripts/check-deps.js --verbose",
19+
"check-deps-pre": "npm run check-deps -- --prescript",
1320
"clean": "gulp clean",
1421
"clean-deps": "rm -rf node_modules"
1522
},

packages/https-proxy/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
"private": true,
55
"main": "index.js",
66
"scripts": {
7+
"prestart": "npm run check-deps-pre",
78
"start": "node index.js",
9+
"check-deps": "node ../../scripts/check-deps.js --verbose",
10+
"check-deps-pre": "npm run check-deps -- --prescript",
811
"clean-deps": "rm -rf node_modules",
12+
"pretest": "npm run check-deps-pre",
913
"test": "cross-env NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json",
14+
"pretest-watch": "npm run check-deps-pre",
1015
"test-watch": "cross-env NODE_ENV=test bin-up mocha --watch",
1116
"https": "node https.js"
1217
},

packages/launcher/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
"main": "index.js",
66
"types": "../ts/index.d.ts",
77
"scripts": {
8-
"deps": "deps-ok",
9-
"pretest": "npm run lint",
8+
"pretest": "npm run check-deps-pre && npm run lint",
109
"test": "npm run unit",
1110
"unit": "bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json",
11+
"check-deps": "node ../../scripts/check-deps.js --verbose",
12+
"check-deps-pre": "npm run check-deps -- --prescript",
1213
"clean-deps": "rm -rf node_modules",
13-
"preclean": "npm run deps",
14+
"preclean": "npm run check-deps-pre",
1415
"clean": "node scripts/clean.js || true",
1516
"clean-js": "npm run clean",
1617
"lint": "npm run format-ts && npm run lint-ts && npm run lint-js",
@@ -36,7 +37,6 @@
3637
"bin-up": "^1.1.0",
3738
"chai": "^3.5.0",
3839
"prettier": "^1.7.0",
39-
"deps-ok": "^1.2.1",
4040
"shelljs": "^0.7.8",
4141
"sinon": "^1.17.3",
4242
"sinon-chai": "^2.8.0",

0 commit comments

Comments
 (0)