Skip to content

Commit

Permalink
refactor: switch to NPM workspaces
Browse files Browse the repository at this point in the history
The `lerna bootstrap` command is deprecated[1]
and resulted in a very weird CI failure (#685).

This commit switches the repository to instead use
NPM workspaces.[2]

[1]: lerna/lerna#3410
[2]: https://docs.npmjs.com/cli/v7/using-npm/workspaces
  • Loading branch information
not-my-profile committed Mar 17, 2023
1 parent 7e43ea0 commit 469b155
Show file tree
Hide file tree
Showing 26 changed files with 35,104 additions and 94,022 deletions.
64 changes: 3 additions & 61 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,6 @@ jobs:
- restore_cache:
keys:
- v2-root-npm-{{ checksum "package-lock.json" }}
- restore_cache:
keys:
- v2-cli-npm-{{ checksum "packages/cli/package-lock.json" }}
- restore_cache:
keys:
- v2-playwright-npm-{{ checksum "packages/playwright/package-lock.json" }}
- restore_cache:
keys:
- v2-puppeteer-npm-{{ checksum "packages/puppeteer/package-lock.json" }}
- restore_cache:
keys:
- v2-webdriverjs-npm-{{ checksum "packages/webdriverjs/package-lock.json" }}
- restore_cache:
keys:
- v2-webdriverjs-npm-example-{{ checksum "packages/webdriverjs/tests/example/package-lock.json" }}
- restore_cache:
keys:
- v2-webdriverio-npm-{{ checksum "packages/webdriverio/package-lock.json" }}
- restore_cache:
keys:
- v2-reporter-earl-npm-{{ checksum "packages/reporter-earl/package-lock.json" }}
- restore_cache:
keys:
- v2-react-npm-{{ checksum "packages/react/package-lock.json" }}
- restore_cache:
keys:
- v2-axe-core-test-npm-{{ checksum "axe_core_test/package-lock.json" }}
# Install and cache each package's dependencies.
- run:
name: Install top-level dependencies
Expand All @@ -65,42 +38,14 @@ jobs:
key: v2-root-npm-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run: npm run bootstrap -- --ci
- save_cache:
key: v2-cli-npm-{{ checksum "packages/cli/package-lock.json" }}
paths:
- packages/cli/node_modules
- save_cache:
key: v2-playwright-npm-{{ checksum "packages/playwright/package-lock.json" }}
paths:
- packages/playwright/node_modules
- save_cache:
key: v2-puppeteer-npm-{{ checksum "packages/puppeteer/package-lock.json" }}
paths:
- packages/puppeteer/node_modules
- save_cache:
key: v2-webdriverjs-npm-{{ checksum "packages/webdriverjs/package-lock.json" }}
paths:
- packages/webdriverjs/node_modules
- save_cache:
key: v2-webdriverjs-npm-example-{{ checksum "packages/webdriverjs/tests/example/package-lock.json" }}
paths:
- packages/webdriverjs/tests/example/node_modules
- save_cache:
key: v2-webdriverio-npm-{{ checksum "packages/webdriverio/package-lock.json" }}
paths:
- packages/webdriverio/node_modules
- save_cache:
key: v2-reporter-earl-npm-{{ checksum "packages/reporter-earl/package-lock.json" }}
paths:
- packages/reporter-earl/node_modules
- save_cache:
key: v2-react-npm-{{ checksum "packages/react/package-lock.json" }}
paths:
- packages/react/node_modules
- save_cache:
key: v2-axe-core-test-npm-{{ checksum "axe_core_test/package-lock.json" }}
paths:
- axe_core_test/node_modules
- save_cache:
key: v3-npm-cache-{{ .Environment.CIRCLE_SHA1 }}
Expand Down Expand Up @@ -130,13 +75,9 @@ jobs:
steps:
- checkout
- restore_dependency_cache
# Re-build packages, ensuring packages/webdriverjs/dist exists.
- run: npx lerna run prepare
# required for browser-driver-manager
- run: sudo apt-get update -y
- run: cd packages/cli && npx [email protected] install chrome chromedriver --verbose
# lerna link after installing the latest version of chromedriver, as we depend on webdriverJS
- run: cd packages/cli && npx lerna link
- run: npm run coverage --prefix=packages/cli

puppeteer:
Expand Down Expand Up @@ -187,6 +128,7 @@ jobs:
- restore_dependency_cache
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run: npm install -g npm@7
- run:
command: npm run coverage --prefix=packages/webdriverio
environment:
Expand Down Expand Up @@ -216,10 +158,10 @@ jobs:
steps:
# We need to pin node@14 to run WDIO due to WDIO sync, only works on node@14
- run: npm install -g node@14 --force
- run: npm install -g npm@7
- checkout
- restore_dependency_cache
- run: npm install
- run: npm run bootstrap -- --ci
- run: npm ci
- run: npm run build --prefix=packages/playwright
- run: npm run coverage --prefix=packages/playwright

Expand Down
Loading

0 comments on commit 469b155

Please sign in to comment.