Skip to content

Commit

Permalink
chore: upgrade lerna to 6, cache build step (#26913)
Browse files Browse the repository at this point in the history
* chore: update build-npm-modules script

* chore: update build-npm-modules script

* chore: update build-npm-modules script

* chore: update build-npm-modules script

* chore: update lerna to 6

* [run ci]

* try caching build step

* we can't clean without building after

* add dependencies on scripts for npm packages

* update commands

* add config for data-context build step

* fix output configurations for npm packages, add gitignores

* revert changes to config and data-context build steps

* fix outputs

* run with cache

* fix outputs for cli

* actually fix outputs

* test with cache

---------

Co-authored-by: astone123 <[email protected]>
  • Loading branch information
jordanpowell88 and astone123 committed Aug 17, 2023
1 parent 5dee3e1 commit b1a36f5
Show file tree
Hide file tree
Showing 30 changed files with 1,320 additions and 1,107 deletions.
17 changes: 11 additions & 6 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,7 @@ jobs:
- run: yarn test-scripts
# make sure packages with TypeScript can be transpiled to JS
- run: yarn lerna run build-prod --stream --concurrency 4
- run: yarn lerna run build --stream --concurrency 4
# run unit tests from each individual package
- run: yarn test
# run type checking for each individual package
Expand Down Expand Up @@ -1909,7 +1910,7 @@ jobs:
- restore_cached_workspace
- run:
name: Build
command: yarn workspace @cypress/webpack-preprocessor build
command: yarn lerna run build --scope @cypress/webpack-preprocessor
- run:
name: Run tests
command: yarn workspace @cypress/webpack-preprocessor test
Expand Down Expand Up @@ -1955,6 +1956,10 @@ jobs:
- run:
name: Build
command: yarn lerna run build --scope @cypress/vue
- run:
name: Type Check
command: yarn typecheck
working_directory: npm/vue
- store_test_results:
path: npm/vue/test_results
- store_artifacts:
Expand All @@ -1967,7 +1972,7 @@ jobs:
- restore_cached_workspace
- run:
name: Build
command: yarn workspace @cypress/angular build
command: yarn lerna run build --scope @cypress/angular
- store-npm-logs

npm-react:
Expand All @@ -1976,7 +1981,7 @@ jobs:
- restore_cached_workspace
- run:
name: Build
command: yarn workspace @cypress/react build
command: yarn lerna run build --scope @cypress/react
- run:
name: Run tests
command: yarn test
Expand All @@ -1993,7 +1998,7 @@ jobs:
- restore_cached_workspace
- run:
name: Build
command: yarn workspace @cypress/vite-plugin-cypress-esm build
command: yarn lerna run build --scope @cypress/vite-plugin-cypress-esm
- run:
name: Run tests
command: yarn test
Expand All @@ -2010,7 +2015,7 @@ jobs:
- restore_cached_workspace
- run:
name: Build
command: yarn workspace @cypress/mount-utils build
command: yarn lerna run build --scope @cypress/mount-utils
- store-npm-logs

npm-grep:
Expand Down Expand Up @@ -2049,7 +2054,7 @@ jobs:
- run:
name: Build + Install
command: |
yarn workspace @cypress/schematic build
yarn lerna run build --scope @cypress/schematic
working_directory: npm/cypress-schematic
- run:
name: Run unit tests
Expand Down
10 changes: 10 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,15 @@
"nohoist": [
"@types/*"
]
},
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/types",
"{projectRoot}/build"
]
}
}
}
}
13 changes: 12 additions & 1 deletion npm/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"prebuild": "rimraf dist",
"build": "rollup -c rollup.config.mjs",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"build-prod": "yarn build",
"check-ts": "tsc --noEmit",
"lint": "eslint --ext .js,.ts,.json, ."
},
Expand Down Expand Up @@ -59,6 +58,18 @@
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"inputs": [
"{workspaceRoot}/scripts"
],
"outputs": [
"{workspaceRoot}/cli/angular"
]
}
}
},
"standard": {
"globals": [
"Cypress",
Expand Down
6 changes: 3 additions & 3 deletions npm/create-cypress-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"main": "dist/src/main.js",
"scripts": {
"build": "yarn prepare-example && tsc -p ./tsconfig.json && node scripts/example copy-to ./dist/initial-template && yarn prepare-copy-templates",
"build-prod": "yarn build",
"prepare-example": "node scripts/example copy-to ./initial-template",
"prepare-copy-templates": "node scripts/copy-templates copy-to ./dist/src",
"test": "cross-env TS_NODE_PROJECT=./tsconfig.test.json mocha --config .mocharc.json './src/**/*.test.ts'",
Expand All @@ -23,14 +22,15 @@
"commander": "6.2.1",
"find-up": "5.0.0",
"fs-extra": "^9.1.0",
"inquirer": "7.3.3",
"glob": "^7.1.6",
"inquirer": "8.2.4",
"ora": "^5.1.0",
"recast": "0.20.4",
"semver": "7.3.7"
},
"devDependencies": {
"@types/babel__core": "^7.1.2",
"@types/inquirer": "7.3.1",
"@types/inquirer": "8.2.4",
"@types/mock-fs": "4.10.0",
"@types/node": "16.18.39",
"@types/ora": "^3.2.0",
Expand Down
11 changes: 11 additions & 0 deletions npm/cypress-schematic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,16 @@
"ng-add": {
"save": "devDependencies"
},
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/src/**/*.js",
"{projectRoot}/src/**/*.d.ts",
"{projectRoot}/src/**/*.js.map"
]
}
}
},
"schematics": "./src/schematics/collection.json"
}
14 changes: 13 additions & 1 deletion npm/mount-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"build": "tsc || echo 'built, with type errors'",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"build-prod": "yarn build",
"check-ts": "tsc --noEmit",
"watch": "tsc -w",
"lint": "eslint --ext .js,.ts,.json, ."
Expand All @@ -33,5 +32,18 @@
"bugs": "https://github.com/cypress-io/cypress/issues/new?template=1-bug-report.md",
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"inputs": [
"{workspaceRoot}/scripts"
],
"outputs": [
"{workspaceRoot}/cli/mount-utils",
"{projectRoot}/dist"
]
}
}
}
}
13 changes: 13 additions & 0 deletions npm/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"inputs": [
"{workspaceRoot}/scripts"
],
"outputs": [
"{workspaceRoot}/cli/react",
"{projectRoot}/dist"
]
}
}
},
"standard": {
"globals": [
"Cypress",
Expand Down
13 changes: 13 additions & 0 deletions npm/react18/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,18 @@
},
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"inputs": [
"{workspaceRoot}/scripts"
],
"outputs": [
"{workspaceRoot}/cli/react18",
"{projectRoot}/dist"
]
}
}
}
}
14 changes: 13 additions & 1 deletion npm/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"prebuild": "rimraf dist",
"build": "rollup -c rollup.config.mjs",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"build-prod": "yarn build",
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
"check-ts": "tsc --noEmit"
},
Expand Down Expand Up @@ -40,5 +39,18 @@
"module": "dist/cypress-svelte.esm-bundler.js",
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"inputs": [
"{workspaceRoot}/scripts"
],
"outputs": [
"{workspaceRoot}/cli/svelte",
"{projectRoot}/dist"
]
}
}
}
}
10 changes: 9 additions & 1 deletion npm/vite-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"main": "index.js",
"scripts": {
"build": "tsc || echo 'built, with type errors'",
"build-prod": "tsc || echo 'built, with type errors'",
"check-ts": "tsc --noEmit",
"cypress:run": "yarn cypress:run-cypress-in-cypress node ../../scripts/cypress run --project . --browser chrome",
"cypress:run-cypress-in-cypress": "cross-env CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=1 HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
Expand Down Expand Up @@ -46,5 +45,14 @@
"module": "dist/index.js",
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/dist"
]
}
}
}
}
10 changes: 9 additions & 1 deletion npm/vite-plugin-cypress-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"main": "index.js",
"scripts": {
"build": "tsc || echo 'built, with type errors'",
"build-prod": "tsc || echo 'built, with type errors'",
"check-ts": "tsc --noEmit",
"cypress:open": "node ../../scripts/cypress open --project . --component",
"cypress:run": "node ../../scripts/cypress run --project . --component",
Expand Down Expand Up @@ -42,5 +41,14 @@
"module": "dist/index.js",
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/dist"
]
}
}
}
}
14 changes: 13 additions & 1 deletion npm/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "Browser-based Component Testing for Vue.js with Cypress.io ✌️🌲",
"main": "dist/cypress-vue.cjs.js",
"scripts": {
"build-prod": "yarn build",
"cy:open": "node ../../scripts/cypress.js open --component --project ${PWD}",
"cy:run": "node ../../scripts/cypress.js run --component --project ${PWD}",
"build": "rimraf dist && rollup -c rollup.config.mjs",
Expand Down Expand Up @@ -80,5 +79,18 @@
},
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"inputs": [
"{workspaceRoot}/scripts"
],
"outputs": [
"{workspaceRoot}/cli/vue",
"{projectRoot}/dist"
]
}
}
}
}
14 changes: 13 additions & 1 deletion npm/vue2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"check-ts": "tsc --noEmit",
"build": "rimraf dist && yarn rollup -c rollup.config.mjs",
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
"build-prod": "yarn build",
"test": "echo \"Tests for @cypress/vue2 are run from system-tests\"",
"watch": "yarn build --watch --watch.exclude ./dist/**/*",
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.vue .",
Expand Down Expand Up @@ -49,5 +48,18 @@
"module": "dist/cypress-vue2.esm-bundler.js",
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"inputs": [
"{workspaceRoot}/scripts"
],
"outputs": [
"{workspaceRoot}/cli/vue2",
"{projectRoot}/dist"
]
}
}
}
}
10 changes: 9 additions & 1 deletion npm/webpack-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc || echo 'built, with type errors'",
"build-prod": "yarn build",
"check-ts": "tsc --noEmit",
"dev": "tsc --watch",
"clean": "rimraf dist",
Expand Down Expand Up @@ -57,5 +56,14 @@
"bugs": "https://github.com/cypress-io/cypress/issues/new?template=1-bug-report.md",
"publishConfig": {
"access": "public"
},
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/dist"
]
}
}
}
}
12 changes: 10 additions & 2 deletions npm/webpack-preprocessor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"main": "dist",
"scripts": {
"build": "rimraf dist && tsc || echo 'built, with errors'",
"build-prod": "yarn build",
"deps": "deps-ok && dependency-check --no-dev .",
"secure": "nsp check",
"semantic-release": "semantic-release",
Expand Down Expand Up @@ -72,5 +71,14 @@
"cypress-plugin",
"cypress-preprocessor",
"webpack"
]
],
"nx": {
"targets": {
"build": {
"outputs": [
"{projectRoot}/dist"
]
}
}
}
}
Loading

0 comments on commit b1a36f5

Please sign in to comment.