Simplify turbo commands (#34055)

* Change package json commands and turbo repo config to allow for greatly simplifying running turbo
* Remove require-turbo script which was causing caching issues
* Colorize CI output from scripts
* Add missing changelog script to extend-cart-checkout-block
This commit is contained in:
Sam Seay 2022-08-05 12:03:17 +12:00 committed by GitHub
parent 4a4de7a7f6
commit 5becf47d60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 1073 additions and 1256 deletions

View File

@ -26,4 +26,4 @@ runs:
- name: Run build
shell: bash
working-directory: ${{ inputs.working_directory }}
run: pnpm -- turbo run build --filter=woocommerce
run: pnpm run build --filter="${{ inputs.working_directory }}" --color

View File

@ -83,4 +83,4 @@ jobs:
run: ./tests/bin/install.sh woo_test root root 127.0.0.1 ${{ matrix.wp }}
- name: Run tests
run: pnpm -- turbo run test --filter=woocommerce
run: pnpm run test --filter="woocommerce" --color

View File

@ -35,7 +35,7 @@ jobs:
uses: ./.github/actions/install-build
- name: Lint
run: pnpm -- turbo run lint --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api'
run: pnpm run lint --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color
- name: Test
run: pnpm -- turbo run test --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api'
run: pnpm run test --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color

View File

@ -82,4 +82,4 @@ jobs:
run: ./tests/bin/install.sh woo_test root root 127.0.0.1 ${{ matrix.wp }}
- name: Run tests
run: pnpm -- turbo run test --filter=woocommerce
run: pnpm run test --filter=woocommerce --color

View File

@ -8,7 +8,7 @@ Please refer to [the Getting Started section of the `README.md`](README.md#getti
## Turborepo Commands
Our repository uses [Turborepo](https://turborepo.org) for `build`, `lint`, and `test` commands. This tool ensures that all dependencies of a plugin, package, or tool are prepared before running a command. When using `pnpm -- turbo run {command}` without any options, it will execute that command against every project in the repository. You can view a list of the commands Turborepo supports in [our turbo.json file](turbo.json).
Our repository uses [Turborepo](https://turborepo.org) for `build` and `test` commands. This tool ensures that all dependencies of a plugin, package, or tool are prepared before running a command. This is done transparently when running these commands. When using `pnpm run {command}` without any options, it will execute that command against every project in the repository. You can view a list of the commands Turborepo supports in [our turbo.json file](turbo.json).
### Plugin, Package, and Tool Filtering
@ -18,29 +18,40 @@ If you would like to read more about the syntax, please check out [the Turborepo
### Examples
Here are some examples of the ways you can use Turborepo commands:
Here are some examples of the ways you can use Turborepo / pnpm commands:
```bash
# Lint and build all plugins, packages, and tools
pnpm -- turbo run lint build
pnpm run lint && pnpm run build
# Build WooCommerce Core and all of its dependencies
pnpm -- turbo run build --filter='woocommerce'
pnpm run build --filter='woocommerce'
# Lint the @woocommerce/components package
pnpm -- turbo run lint --filter='@woocommerce/components'
pnpm run lint --filter='@woocommerce/components'
# Test all of the @woocommerce scoped packages
pnpm -- turbo run test --filter='@woocommerce/*'
pnpm run test --filter='@woocommerce/*'
# Build all of the JavaScript packages
pnpm -- turbo run build --filter='./packages/js/*'
pnpm run build --filter='./packages/js/*'
# Build everything except WooCommerce Core
pnpm -- turbo run build --filter='!woocommerce'
pnpm run build --filter='!woocommerce'
# Lint everything that has changed since the last commit
pnpm -- turbo run build --filter='[HEAD^1]'
# Build everything that has changed since the last commit
pnpm run build --filter='[HEAD^1]'
```
### Cache busting Turbo
In the event that you need to force turbo not to cache a command you can set the env variable `TURBO_FORCE=true`.
e.g.
```bash
# Force an uncached build of WooCommerce Core and all of its dependencies
TURBO_FORCE=true pnpm run build --filter='woocommerce'
```
## Other Commands

View File

@ -23,10 +23,10 @@ nvm use
# Install the PHP and Composer dependencies for all of the plugins, packages, and tools
pnpm install
# Build all of the plugins, packages, and tools in the monorepo
pnpm -- turbo run build
pnpm run build
```
At this point you are now ready to begin developing and testing. All of the build outputs are cached running `pnpm -- turbo run build` again will only build the plugins, packages, and tools that have changed since the last time you ran the command.
At this point you are now ready to begin developing and testing. All of the build outputs are cached running `pnpm run build` again will only build the plugins, packages, and tools that have changed since the last time you ran the command.
Check out [our development guide](DEVELOPMENT.md) if you would like a more comprehensive look at working in our repository.

View File

@ -14,6 +14,8 @@
"url": "https://github.com/woocommerce/woocommerce/issues"
},
"scripts": {
"build": "pnpm exec turbo run turbo:build -- -- ",
"test": "pnpm exec turbo run turbo:test -- --",
"build-storybook": "build-storybook -c ./tools/storybook/.storybook",
"preinstall": "npx only-allow pnpm",
"postinstall": "pnpm git:update-hooks",

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -42,7 +42,6 @@
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"jest-mock-extended": "^1.0.18",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"
@ -51,12 +50,13 @@
"access": "public"
},
"scripts": {
"turbo:build": "tsc --build",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"build": "node ./node_modules/require-turbo && tsc --build",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"prepack": "pnpm run clean && pnpm run build"
},

View File

@ -9,7 +9,7 @@
"e2e:hello": "jest --group=hello",
"make:collection": "node utils/api-collection/build-collection.js",
"report": "allure generate --clean && allure serve",
"lint": "node ./node_modules/require-turbo && eslint data endpoints tests utils --ext=js,ts,tsx",
"lint": "eslint data endpoints tests utils --ext=js,ts,tsx",
"lint:fix": "eslint data endpoints tests utils --ext=js,ts,tsx --fix"
},
"repository": {
@ -32,8 +32,7 @@
},
"devDependencies": {
"@woocommerce/eslint-plugin": "workspace:*",
"eslint": "^8.12.0",
"require-turbo": "workspace:*"
"eslint": "^8.12.0"
},
"publishConfig": {
"access": "public"

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -26,15 +26,17 @@
],
"sideEffects": false,
"scripts": {
"turbo:build": "pnpm run clean && npm run compile",
"turbo:test": "jest",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "rm -rf ./dist ./tsconfig.tsbuildinfo",
"compile": "tsc -b",
"build": "node ./node_modules/require-turbo && pnpm run clean && npm run compile",
"prepack": "pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest"
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint src",
"lint:fix": "eslint src --fix"
},
"dependencies": {
"axios": "^0.24.0",
@ -50,7 +52,6 @@
"axios-mock-adapter": "^1.20.0",
"eslint": "^8.2.0",
"jest": "^25",
"require-turbo": "workspace:*",
"ts-jest": "^25",
"typescript": "^4.4.4"
},

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -106,7 +106,6 @@
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"postcss-loader": "^3.0.0",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"sass-loader": "^10.2.1",
"ts-jest": "^27.1.3",
@ -115,17 +114,19 @@
"webpack-cli": "^3.3.12"
},
"scripts": {
"turbo:build": "pnpm run build:js && pnpm run build:css",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src --ext=js,ts,tsx",
"build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build:css": "webpack",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"lint": "node ./node_modules/require-turbo && eslint src --ext=js,ts,tsx",
"lint:fix": "eslint src --ext=js,ts,tsx --fix",
"prepack": "pnpm run clean && pnpm run build",
"start": "concurrently \"tsc --build ./tsconfig.json --watch\" \"webpack --watch\"",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test:update-snapshots": "pnpm run test -- --updateSnapshot",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -29,15 +29,17 @@
"access": "public"
},
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"devDependencies": {
@ -46,7 +48,6 @@
"eslint": "^8.12.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -32,15 +32,17 @@
"access": "public"
},
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"devDependencies": {
@ -49,7 +51,6 @@
"eslint": "^8.12.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -40,8 +40,8 @@
"@testing-library/react": "^12.1.3",
"@types/prop-types": "^15.7.4",
"@types/wordpress__components": "^9.8.6",
"@woocommerce/internal-style-build": "workspace:*",
"@woocommerce/eslint-plugin": "workspace:*",
"@woocommerce/internal-style-build": "workspace:*",
"@wordpress/browserslist-config": "^4.1.1",
"concurrently": "^7.0.0",
"css-loader": "^3.6.0",
@ -49,7 +49,6 @@
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"postcss-loader": "^3.0.0",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"sass-loader": "^10.2.1",
"ts-jest": "^27.1.3",
@ -62,17 +61,19 @@
"react-dom": "^17.0.0"
},
"scripts": {
"turbo:build": "pnpm run build:js && pnpm run build:css",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build:css": "webpack",
"start": "concurrently \"tsc --build --watch\" \"webpack --watch\"",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"lint-staged": {

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -58,7 +58,6 @@
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"redux": "^4.1.0",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"
@ -70,15 +69,17 @@
"react-dom": "^17.0.0"
},
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"lint-staged": {

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -36,7 +36,6 @@
"eslint": "^8.12.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"
@ -48,15 +47,17 @@
"access": "public"
},
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"lint-staged": {

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -29,7 +29,6 @@
"eslint": "^8.12.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2",
@ -39,7 +38,7 @@
"scripts": {
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint": "eslint src",
"lint:fix": "eslint src --fix"
},
"lint-staged": {

View File

@ -32,8 +32,8 @@
"@babel/plugin-transform-runtime": "^7.16.4",
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.12.7",
"@woocommerce/internal-e2e-builds": "workspace:*",
"@woocommerce/eslint-plugin": "workspace:*",
"@woocommerce/internal-e2e-builds": "workspace:*",
"@wordpress/babel-plugin-import-jsx-pragma": "1.1.3",
"@wordpress/babel-preset-default": "3.0.2",
"@wordpress/browserslist-config": "^4.1.0",
@ -47,10 +47,11 @@
"access": "public"
},
"scripts": {
"turbo:build": "./bin/build.sh && pnpm run clean && pnpm run compile",
"prepare": "pnpm run build",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"clean": "rm -rf ./build ./build-module",
"compile": "e2e-builds",
"build": "./bin/build.sh && pnpm run clean && pnpm run compile",
"lint": "eslint src --ext=js,ts,tsx",
"lint:fix": "eslint src --ext=js,ts,tsx --fix"
},

View File

@ -38,7 +38,7 @@ Again, if you don't have shell access to your test site, through WP Admin ensure
3. You have an admin user set up (if their credentials differ from u/ `admin` and p/ `password` be sure to update `/plugins/woocommerce/tests/e2e/config/default.json`)
4. You have a customer user set up named 'Jane Smith'. This user should be a `subscriber` and again make sure their username and password are reflected in `/plugins/woocommerce/tests/e2e/config/default.json`.
You should then be able to run the e2e tests by running `pnpm -- turbo run e2e --filter=woocommerce`.
You should then be able to run the e2e tests by running `pnpm run e2e --filter=woocommerce`.
### Test Sequencer Setup

View File

@ -49,11 +49,11 @@
"@babel/plugin-transform-runtime": "^7.16.4",
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.12.7",
"@woocommerce/eslint-plugin": "workspace:*",
"@woocommerce/internal-e2e-builds": "workspace:*",
"@wordpress/babel-plugin-import-jsx-pragma": "1.1.3",
"@wordpress/babel-preset-default": "3.0.2",
"@wordpress/browserslist-config": "^4.1.0",
"@woocommerce/eslint-plugin": "workspace:*",
"eslint": "^8.1.0",
"ndb": "^1.1.5",
"semver": "^7.3.2"
@ -62,9 +62,10 @@
"access": "public"
},
"scripts": {
"turbo:build": "pnpm run clean && pnpm run compile",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"clean": "rm -rf ./build ./build-module",
"compile": "e2e-builds",
"build": "pnpm run clean && pnpm run compile",
"prepare": "pnpm run build",
"docker:up": "./bin/docker-compose.sh up",
"docker:wait": "bash ./bin/wait-for-build.sh",

View File

@ -41,9 +41,10 @@
"access": "public"
},
"scripts": {
"turbo:build": "pnpm run clean && pnpm run compile",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"clean": "rm -rf ./build ./build-module",
"compile": "e2e-builds",
"build": "pnpm run clean && pnpm run compile",
"prepare": "pnpm run build",
"lint": "eslint src --ext=js,ts,tsx",
"lint:fix": "eslint src --ext=js,ts,tsx --fix"

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -38,7 +38,7 @@
"scripts": {
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"lint": "node ./node_modules/require-turbo && eslint ./rules ./configs",
"lint": "eslint ./rules ./configs",
"lint:fix": "eslint ./rules ./configs --fix"
},
"devDependencies": {
@ -46,7 +46,6 @@
"eslint": "^8.11.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -62,7 +62,6 @@
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"postcss-loader": "^3.0.0",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"sass-loader": "^10.2.1",
"ts-jest": "^27.1.3",
@ -75,17 +74,19 @@
"react-dom": "^17.0.0"
},
"scripts": {
"turbo:build": "pnpm run build:js && pnpm run build:css",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build:css": "webpack",
"start": "concurrently \"tsc --build --watch\" \"webpack --watch\"",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"lint-staged": {

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -42,21 +42,22 @@
"eslint": "^8.12.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"
},
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"lint-staged": {

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -1,20 +1,21 @@
{
"name": "@woocommerce/extend-cart-checkout-block",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"postinstall": "composer install"
},
"repository": {
"type": "git",
"url": "git+https://github.com/woocommerce/woocommerce.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/woocommerce/woocommerce/issues"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/extend-cart-checkout-block#readme"
"name": "@woocommerce/extend-cart-checkout-block",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"postinstall": "composer install",
"changelog": "composer exec -- changelogger"
},
"repository": {
"type": "git",
"url": "git+https://github.com/woocommerce/woocommerce.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/woocommerce/woocommerce/issues"
},
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/extend-cart-checkout-block#readme"
}

View File

@ -17,7 +17,7 @@
},
"homepage": "https://github.com/woocommerce/woocommerce#readme",
"scripts": {
"node ./node_modules/require-turbo && lint": "eslint build.js",
"lint": "eslint build.js",
"lint:fix": "eslint build.js --fix"
},
"devDependencies": {
@ -26,9 +26,8 @@
"chalk": "^4.1.2",
"eslint": "^8.12.0",
"glob": "^7.2.0",
"mkdirp": "^1.0.4",
"lodash": "^4.17.21",
"require-turbo": "workspace:*"
"mkdirp": "^1.0.4"
},
"lint-staged": {
"*.(t|j)s?(x)": [

View File

@ -17,11 +17,12 @@
"main": "build/util/index.js",
"module": "build-module/util/index.js",
"scripts": {
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint src",
"ts:check": "tsc --noEmit --project ./tsconfig.json",
"clean": "pnpm exec rimraf *.tsbuildinfo build build-*",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix"
},
"dependencies": {
@ -38,7 +39,6 @@
"eslint": "^8.12.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"

View File

@ -29,7 +29,7 @@
"webpack-rtl-plugin": "^2.0.0"
},
"scripts": {
"lint": "node ./node_modules/require-turbo && eslint index.js",
"lint": "eslint index.js",
"lint:fix": "eslint index.js --fix"
},
"private": true,
@ -39,7 +39,6 @@
"eslint": "^8.12.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2",

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -39,25 +39,26 @@
"access": "public"
},
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"devDependencies": {
"@babel/core": "^7.17.5",
"@babel/runtime": "^7.17.2",
"@woocommerce/eslint-plugin": "workspace:*",
"eslint": "^8.12.0",
"@babel/runtime": "^7.17.2",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"

View File

@ -37,11 +37,12 @@
},
"private": true,
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix"
},
"devDependencies": {
@ -52,7 +53,6 @@
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"redux": "^4.2.0",
"require-turbo": "workspace*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -27,25 +27,26 @@
"access": "public"
},
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"turbo:test": "jest --config ./jest.config.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix",
"test": "node ./node_modules/require-turbo && jest --config ./jest.config.json",
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
},
"devDependencies": {
"@babel/core": "^7.17.5",
"@babel/runtime": "^7.17.2",
"@woocommerce/eslint-plugin": "workspace:*",
"eslint": "^8.12.0",
"@babel/runtime": "^7.17.2",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -47,7 +47,6 @@
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"postcss-loader": "^3.0.0",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"sass-loader": "^10.2.1",
"ts-jest": "^27.1.3",
@ -56,15 +55,16 @@
"webpack-cli": "^3.3.12"
},
"scripts": {
"turbo:build": "pnpm run build:js && pnpm run build:css",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint src",
"build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build:css": "webpack",
"start": "concurrently \"tsc --build --watch\" \"webpack --watch\"",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix"
},
"lint-staged": {

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -28,13 +28,14 @@
"access": "public"
},
"scripts": {
"turbo:build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"prepare": "composer install",
"changelog": "composer exec -- changelogger",
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
"build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint src",
"start": "tsc --build --watch",
"prepack": "pnpm run clean && pnpm run build",
"lint": "node ./node_modules/require-turbo && eslint src",
"lint:fix": "eslint src --fix"
},
"devDependencies": {
@ -44,7 +45,6 @@
"eslint": "^8.12.0",
"jest": "^27.5.1",
"jest-cli": "^27.5.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.2"

View File

@ -9,18 +9,21 @@
"url": "https://github.com:woocommerce/woocommerce.git"
},
"scripts": {
"turbo:build": "pnpm run clean && WC_ADMIN_PHASE=core pnpm run build:feature-config && cross-env NODE_ENV=production WC_ADMIN_PHASE=core webpack",
"turbo:test": "pnpm run test:client",
"analyze": "cross-env NODE_ENV=production ANALYZE=true webpack",
"build": "node ./node_modules/require-turbo && pnpm run clean && WC_ADMIN_PHASE=core pnpm run build:feature-config && cross-env NODE_ENV=production WC_ADMIN_PHASE=core webpack",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "pnpm run lint:js && pnpm run lint:css",
"build:feature-config": "php ../woocommerce/bin/generate-feature-config.php",
"build:packages": "cross-env NODE_ENV=production pnpm -w exec turbo run build --filter='./packages/js/*'",
"build:packages": "cross-env NODE_ENV=production pnpm -w run build --filter='./packages/js/*'",
"clean": "rimraf ../woocommerce/assets/client/admin/*",
"client:watch": "cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && cross-env WC_ADMIN_PHASE=development webpack --watch",
"create-hook-reference": "node ./bin/hook-reference/index.js",
"create-wc-extension": "node ./bin/starter-pack/starter-pack.js",
"dev": "cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && cross-env WC_ADMIN_PHASE=development pnpm -w exec turbo run build --filter='./packages/js/*' && cross-env WC_ADMIN_PHASE=development webpack",
"dev": "cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && cross-env WC_ADMIN_PHASE=development pnpm -w run build --filter='./packages/js/*' && cross-env WC_ADMIN_PHASE=development webpack",
"example": "webpack --config docs/examples/extensions/examples.config.js --watch",
"preinstall": "npx only-allow pnpm",
"lint": "node ./node_modules/require-turbo && pnpm run lint:js && pnpm run lint:css",
"lint:fix": "pnpm lint:js-fix && pnpm lint:css-fix",
"lint:css": "stylelint '**/*.scss'",
"lint:css-fix": "stylelint '**/*.scss' --fix --ip 'storybook/wordpress'",
@ -32,8 +35,7 @@
"packages:fix:textdomain": "node ./bin/package-update-textdomain.js",
"packages:watch": "cross-env WC_ADMIN_PHASE=development pnpm run:packages -- start --parallel",
"run:packages": "pnpm run --filter ../../packages/js/",
"start": "cross-env WC_ADMIN_PHASE=development pnpm -w exec turbo run build --filter='./packages/js/*' && cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && concurrently \"cross-env WC_ADMIN_PHASE=development webpack --watch\" \"cross-env WC_ADMIN_PHASE=development pnpm packages:watch\"",
"test": "node ./node_modules/require-turbo && pnpm run test:client",
"start": "cross-env WC_ADMIN_PHASE=development pnpm -w run build --filter='./packages/js/*' && cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && concurrently \"cross-env WC_ADMIN_PHASE=development webpack --watch\" \"cross-env WC_ADMIN_PHASE=development pnpm packages:watch\"",
"test-staged": "pnpm run test:client -- --bail --findRelatedTests",
"test:client": "jest --config client/jest.config.js",
"test:debug": "node --inspect-brk ./node_modules/.bin/jest --config client/jest.config.js --watch --runInBand --no-cache",
@ -138,11 +140,11 @@
"@woocommerce/experimental": "workspace:*",
"@woocommerce/explat": "workspace:*",
"@woocommerce/internal-js-tests": "workspace:*",
"@woocommerce/internal-style-build": "workspace:*",
"@woocommerce/navigation": "workspace:*",
"@woocommerce/notices": "workspace:*",
"@woocommerce/number": "workspace:*",
"@woocommerce/onboarding": "workspace:*",
"@woocommerce/internal-style-build": "workspace:*",
"@woocommerce/tracks": "workspace:*",
"@wordpress/babel-preset-default": "^6.5.1",
"@wordpress/browserslist-config": "^4.1.1",
@ -194,7 +196,6 @@
"raw-loader": "^4.0.2",
"readline-sync": "^1.4.10",
"replace": "^1.2.1",
"require-turbo": "workspace:*",
"rimraf": "^3.0.2",
"rtlcss": "^2.6.2",
"sass": "^1.49.9",

View File

@ -12,7 +12,7 @@ mkdir -p "$DEST_PATH"
echo "Installing PHP and JS dependencies..."
pnpm install
echo "Running JS Build..."
pnpm -w exec turbo run build --filter=woocommerce-beta-tester || exit "$?"
pnpm -w run build --filter=woocommerce-beta-tester || exit "$?"
echo "Syncing files..."
rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -15,7 +15,6 @@
"@wordpress/env": "^4.8.0",
"@wordpress/scripts": "^19.2.4",
"eslint": "5.16.0",
"require-turbo": "workspace:*",
"uglify-js": "^3.5.3"
},
"dependencies": {
@ -38,7 +37,8 @@
"scripts": {
"postinstall": "composer install",
"changelog": "composer exec -- changelogger",
"build": "node ./node_modules/require-turbo && pnpm run build:admin && pnpm run uglify",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"turbo:build": "pnpm run build:admin && pnpm run uglify",
"build:admin": "wp-scripts build",
"build:zip": "./bin/build-zip.sh",
"build:dev": "pnpm run lint:js && pnpm run build",

View File

@ -19,7 +19,7 @@ Please make sure you follow the [repository's getting started guide](../../READM
```bash
# Make sure that WooCommerce Core and all of its dependencies are built
pnpm -- turbo run build --filter=woocommerce
pnpm run build --filter=woocommerce
# Make sure you're in the WooCommerce Core directory
cd plugins/woocommerce
# Start the development environment
@ -39,9 +39,9 @@ This directory contains the CSS and jQuery code for WooCommerce.
```bash
# Build the assets.
pnpm -- turbo run build --filter=woocommerce/client/legacy
pnpm run build --filter=woocommerce/client/legacy
# Lint the assets.
pnpm -- turbo run lint --filter=woocommerce/client/legacy
pnpm run lint --filter=woocommerce/client/legacy
```
### `plugins/woocommerce-admin`
@ -50,11 +50,11 @@ This directory contains the React-based admin interface.
```bash
# Build the React-based admin client.
pnpm -- turbo run build --filter=woocommerce/client/admin
pnpm run build --filter=woocommerce/client/admin
# Lint the React-based admin client.
pnpm -- turbo run lint --filter=woocommerce/client/admin
pnpm run lint --filter=woocommerce/client/admin
# Test the React-based admin client.
pnpm -- turbo run test --filter=woocommerce/client/admin
pnpm run test --filter=woocommerce/client/admin
```
#### Helper Scripts

View File

@ -12,7 +12,7 @@ mkdir -p "$DEST_PATH"
echo "Installing PHP and JS dependencies..."
pnpm install
echo "Running JS Build..."
pnpm -w exec turbo run build --filter=woocommerce || exit "$?"
pnpm -w run build --filter=woocommerce || exit "$?"
echo "Cleaning up PHP dependencies..."
composer install --no-dev || exit "$?"
echo "Run makepot..."

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Package scripts were modified to support simplified running of turbo commands in the monorepo.

View File

@ -6,8 +6,9 @@
"private": true,
"main": "Gruntfile.js",
"scripts": {
"build": "node ./node_modules/require-turbo && grunt assets",
"lint": "node ./node_modules/require-turbo && grunt eslint stylelint --force"
"turbo:build": "grunt assets",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "grunt eslint stylelint --force"
},
"devDependencies": {
"@wordpress/stylelint-config": "19.1.0",
@ -29,7 +30,6 @@
"grunt-sass": "3.1.0",
"grunt-stylelint": "0.16.0",
"gruntify-eslint": "5.0.0",
"require-turbo": "workspace:*",
"sass": "^1.45.0",
"stylelint": "13.8.0"
}

View File

@ -33,7 +33,7 @@ End-to-end tests are powered by Playwright. The test site is spinned up using `w
- `nvm use`
- `pnpm install`
- `pnpm -- turbo run build --filter=woocommerce`
- `pnpm run build --filter=woocommerce`
- `pnpm env:test --filter=woocommerce`
To run the test again, re-create the environment to start with a fresh state:

View File

@ -967,7 +967,7 @@ final class WooCommerce {
return;
}
$message_one = __( 'You have installed a development version of WooCommerce which requires files to be built and minified. From the plugin directory, run <code>pnpm install</code> and then <code>pnpm -- turbo run build --filter=woocommerce</code> to build and minify assets.', 'woocommerce' );
$message_one = __( 'You have installed a development version of WooCommerce which requires files to be built and minified. From the plugin directory, run <code>pnpm install</code> and then <code>pnpm run build --filter=woocommerce</code> to build and minify assets.', 'woocommerce' );
$message_two = sprintf(
/* translators: 1: URL of WordPress.org Repository 2: URL of the GitHub Repository release page */
__( 'Or you can download a pre-built version of the plugin from the <a href="%1$s">WordPress.org repository</a> or by visiting <a href="%2$s">the releases page in the GitHub repository</a>.', 'woocommerce' ),

View File

@ -13,13 +13,17 @@
"build_step": "pnpm run build:zip"
},
"scripts": {
"turbo:build": "WC_ADMIN_PHASE=core pnpm run build:feature-config",
"e2e": "pnpm exec wc-e2e test:e2e",
"turbo:test": "pnpm test:unit",
"preinstall": "npx only-allow pnpm",
"postinstall": "composer install",
"changelog": "composer exec -- changelogger",
"build": "node ./node_modules/require-turbo && WC_ADMIN_PHASE=core pnpm run build:feature-config",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name -- --",
"lint": "pnpm lint:js && pnpm lint:php",
"build:feature-config": "php bin/generate-feature-config.php",
"build:zip": "./bin/build-zip.sh",
"lint": "node ./node_modules/require-turbo && pnpm lint:js && pnpm lint:php",
"lint:fix": "pnpm lint:js:fix && pnpm lint:php:fix",
"lint:js": "eslint assets/js --ext=js",
"lint:js:fix": "eslint assets/js --ext=js --fix",
@ -35,10 +39,8 @@
"env:destroy": "pnpm wp-env destroy",
"test:api": "API_TEST_REPORT_DIR=\"$PWD/tests/api\" pnpm exec wc-api-tests test api",
"make:collection": "pnpm exec wc-api-tests make:collection",
"e2e": "pnpm exec wc-e2e test:e2e",
"e2e:debug": "pnpm exec wc-e2e test:e2e-debug",
"e2e:dev": "pnpm exec wc-e2e test:e2e-dev",
"test": "node ./node_modules/require-turbo && pnpm test:unit",
"test:unit": "./vendor/bin/phpunit -c ./phpunit.xml",
"makepot": "composer run-script makepot",
"packages:fix:textdomain": "node ./bin/package-update-textdomain.js"
@ -80,7 +82,6 @@
"jest": "^25.1.0",
"mocha": "7.2.0",
"prettier": "npm:wp-prettier@2.0.5",
"require-turbo": "workspace:*",
"stylelint": "^13.8.0",
"typescript": "3.9.7",
"uuid": "^8.3.2",

View File

@ -120,7 +120,7 @@ Run the following in a terminal/command line window
- `pnpm install`
- `pnpm -- turbo run build --filter=woocommerce`
- `pnpm run build --filter=woocommerce`
- `npm install jest --global` (this only needs to be done once)
@ -159,7 +159,7 @@ Note that running `pnpm docker:down --filter=woocommerce` and then `pnpm docker:
To run e2e tests in headless mode use the following command:
```bash
pnpm -- turbo run e2e --filter=woocommerce
pnpm run e2e --filter=woocommerce
```
### How to run tests in non-headless mode
@ -167,7 +167,7 @@ pnpm -- turbo run e2e --filter=woocommerce
Tests run in headless mode by default. However, sometimes it's useful to observe the browser while running or developing tests. To do so, you can run tests in a non-headless (dev) mode:
```bash
pnpm -- turbo run e2e:dev --filter=woocommerce
pnpm run e2e:dev --filter=woocommerce
```
The dev mode also enables SlowMo mode. SlowMo slows down Puppeteers operations. This makes it easier to see what is happening in the browser.
@ -175,7 +175,7 @@ The dev mode also enables SlowMo mode. SlowMo slows down Puppeteers operation
By default, SlowMo mode adds a 50 millisecond delay between test steps. If you'd like to override the length of the delay and have the tests run faster or slower in the `-dev` mode, pass `PUPPETEER_SLOWMO` variable when running tests as shown below:
```
PUPPETEER_SLOWMO=10 pnpm -- turbo run e2e:dev --filter=woocommerce
PUPPETEER_SLOWMO=10 pnpm run e2e:dev --filter=woocommerce
```
The faster you want the tests to run, the lower the value should be of `PUPPETEER_SLOWMO` should be.
@ -199,7 +199,7 @@ E2E_RETRY_TIMES=2 pnpm exec wc-e2e test:e2e
Tests run in headless mode by default. While writing tests it may be useful to have the debugger loaded while running a test in non-headless mode. To run tests in debug mode:
```bash
pnpm -- turbo run e2e:debug --filter=woocommerce
pnpm run e2e:debug --filter=woocommerce
```
When all tests have been completed the debugger remains active. Control doesn't return to the command line until the debugger is closed. Otherwise, debug mode functions the same as non-headless mode.
@ -378,6 +378,6 @@ The [WooCommerce E2E Tests Boilerplate repo](https://github.com/woocommerce/wooc
## Debugging tests
The test sequencer (`pnpm -- turbo run e2e --filter=woocommerce`) includes support for saving [screenshots on test errors](https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment#test-screenshots) which can be sent to a Slack channel via a [Slackbot](https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment#slackbot-setup).
The test sequencer (`pnpm run e2e --filter=woocommerce`) includes support for saving [screenshots on test errors](https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment#test-screenshots) which can be sent to a Slack channel via a [Slackbot](https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment#slackbot-setup).
For Puppeteer debugging, follow [Google's documentation](https://developers.google.com/web/tools/puppeteer/debugging).

File diff suppressed because it is too large Load Diff

View File

@ -7,4 +7,4 @@ packages:
- 'tools/create-extension'
- 'tools/package-release'
- 'tools/cherry-pick'
- 'tools/require-turbo'

View File

@ -50,7 +50,8 @@
}
},
"scripts": {
"build": "shx rm -rf dist && tsc -b",
"turbo:build": "shx rm -rf dist && tsc -b",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint . --ext .ts --config .eslintrc",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "pnpm lint",

View File

@ -52,7 +52,8 @@
}
},
"scripts": {
"build": "shx rm -rf dist && tsc -b",
"turbo:build": "shx rm -rf dist && tsc -b",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint . --ext .ts --config .eslintrc",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "pnpm lint",

View File

@ -49,7 +49,8 @@
}
},
"scripts": {
"build": "shx rm -rf dist && tsc -b",
"turbo:build": "shx rm -rf dist && tsc -b",
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name -- --",
"lint": "eslint . --ext .ts --config .eslintrc",
"postpack": "shx rm -f oclif.manifest.json",
"posttest": "pnpm lint",

View File

@ -1,8 +0,0 @@
# Require Turbo
A simple helper tool for checking that a script is being run via Turborepo.
### Usage
Add this package to your dev dependencies (via `workspace:*`). Then, for any script that you want to ensure is executed via Turborepo, add the following to the start: `node ./node_modules/require-turbo && `

View File

@ -1,16 +0,0 @@
if ( ! process.env.TURBO_HASH && process.env.SKIP_TURBO !== 'true' ) {
console.error(
'This project uses Turborepo. You should not run this script from the project directly.'
);
if ( process.env.npm_lifecycle_event && process.env.npm_package_name ) {
console.error(
'\nTry running the following from the root of the monorepo instead:'
);
console.error(
'pnpm -- turbo run %s --filter=%s\n',
process.env.npm_lifecycle_event,
process.env.npm_package_name
);
}
process.exit( 1 );
}

View File

@ -1,11 +0,0 @@
{
"name": "require-turbo",
"version": "0.0.0",
"description": "A tool for checking that package scripts are run through Turborepo",
"main": "index.js",
"author": "Automattic",
"license": "GPL-2.0-only",
"engines": {
"node": "^16.13.1"
}
}

View File

@ -1,100 +1,84 @@
{
"$schema": "https://turborepo.org/schema.json",
"baseBranch": "origin/trunk",
"pipeline": {
"lint": {
"cache": false
},
"lint:fix": {
"cache": false
},
"$schema": "https://turborepo.org/schema.json",
"baseBranch": "origin/trunk",
"pipeline": {
"turbo:build": {
"dependsOn": [ "^turbo:build", "$WC_ADMIN_PHASE" ],
"inputs": [
"src/*.js",
"src/**/*.js",
"src/*.jsx",
"src/**/*.jsx",
"src/*.ts",
"src/**/*.ts",
"src/*.tsx",
"src/**/*.tsx",
"src/*.php",
"src/**/*.php",
"includes/*.php",
"includes/**/*.php"
],
"outputs": [
"dist/**",
"build/**",
"build-module/**",
"build-style/**",
"build-types/**"
],
"outputMode": "new-only"
},
"build": {
"dependsOn": [ "^build", "$WC_ADMIN_PHASE" ],
"inputs": [
"src/*.js",
"src/**/*.js",
"src/*.jsx",
"src/**/*.jsx",
"src/*.ts",
"src/**/*.ts",
"src/*.tsx",
"src/**/*.tsx",
"src/*.php",
"src/**/*.php",
"includes/*.php",
"includes/**/*.php"
],
"outputs": [
"dist/**",
"build/**",
"build-module/**",
"build-style/**",
"build-types/**"
]
},
"woocommerce#build": {
"dependsOn": [
"^build",
"woocommerce/client/admin#build",
"woocommerce/client/legacy#build"
],
"outputs": [],
"inputs": [
"src/*.php",
"src/**/*.php",
"includes/*.php",
"includes/**/*.php"
]
},
"woocommerce/client/admin#build": {
"dependsOn": [ "^build", "$WC_ADMIN_PHASE" ],
"outputs": [],
"inputs": [
"client/*.js",
"client/**/*.js",
"client/*.jsx",
"client/**/*.jsx",
"client/*.ts",
"client/**/*.ts",
"client/*.tsx",
"client/**/*.tsx",
"client/*.scss",
"client/**/*.scss"
]
},
"woocommerce#turbo:build": {
"dependsOn": [
"^turbo:build",
"woocommerce/client/admin#turbo:build",
"woocommerce/client/legacy#turbo:build"
],
"outputs": [],
"inputs": [
"src/*.php",
"src/**/*.php",
"includes/*.php",
"includes/**/*.php"
],
"outputMode": "new-only"
},
"test": {
"dependsOn": [ "build" ],
"inputs": [
"src/*.js",
"src/**/*.js",
"src/*.jsx",
"src/**/*.jsx",
"src/*.ts",
"src/**/*.ts",
"src/*.tsx",
"src/**/*.tsx",
"src/*.php",
"src/**/*.php",
"includes/*.php",
"includes/**/*.php"
],
"outputs": []
},
"woocommerce/client/admin#turbo:build": {
"dependsOn": [ "^turbo:build", "$WC_ADMIN_PHASE" ],
"outputs": [],
"inputs": [
"client/*.js",
"client/**/*.js",
"client/*.jsx",
"client/**/*.jsx",
"client/*.ts",
"client/**/*.ts",
"client/*.tsx",
"client/**/*.tsx",
"client/*.scss",
"client/**/*.scss"
],
"outputMode": "new-only"
},
"e2e": {
"dependsOn": [ "build" ],
"cache": false
},
"e2e:debug": {
"dependsOn": [ "build" ],
"cache": false
},
"e2e:dev": {
"dependsOn": [ "build" ],
"cache": false
}
}
"turbo:test": {
"dependsOn": [ "turbo:build" ],
"inputs": [
"src/*.js",
"src/**/*.js",
"src/*.jsx",
"src/**/*.jsx",
"src/*.ts",
"src/**/*.ts",
"src/*.tsx",
"src/**/*.tsx",
"src/*.php",
"src/**/*.php",
"includes/*.php",
"includes/**/*.php"
],
"outputs": []
}
}
}