From e9484c33f41120b603c2f259b9d1a58c56cbdd3d Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:13:51 -0800 Subject: [PATCH] Removed Unnecessary `run` Usage Since `pnpm` defaults to `run` unless a built-in command exists we don't really need to use `run`. --- .github/CONTRIBUTING.md | 2 +- .../tests/setup-local-test-environment/action.yml | 4 ++-- .../workflows/hpos-build-and-e2e-tests-daily.yml | 4 ++-- .github/workflows/pr-build-and-e2e-tests.yml | 6 +++--- plugins/woocommerce-beta-tester/README.md | 2 +- .../code-freeze/commands/changelog/lib/index.ts | 2 +- tools/monorepo/check-changelogger-use.php | 4 ++-- tools/storybook/package.json | 14 +++++++------- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 9c8c2b34388..5280efb46ba 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -35,7 +35,7 @@ Please take a moment to review the [project readme](https://github.com/woocommer - Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/). - Run our build process described in the document on [how to set up WooCommerce development environment](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment), it will install our pre-commit hook, code sniffs, dependencies, and more. -- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=@woocommerce/plugin-woocommerce run lint:php:changes:branch`. +- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=@woocommerce/plugin-woocommerce lint:php:changes:branch`. - Whenever possible, please fix pre-existing code standards errors in code that you change. - Please consider adding appropriate tests related to your change if applicable such as unit, API and E2E tests. You can check the following guides for this purpose: - [Writing unit tests](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/README.md#guide-for-writing-unit-tests). diff --git a/.github/actions/tests/setup-local-test-environment/action.yml b/.github/actions/tests/setup-local-test-environment/action.yml index c04e44ce50f..6a6899873af 100644 --- a/.github/actions/tests/setup-local-test-environment/action.yml +++ b/.github/actions/tests/setup-local-test-environment/action.yml @@ -25,5 +25,5 @@ runs: working-directory: plugins/woocommerce shell: bash run: | - pnpm env:dev --filter=@woocommerce/plugin-woocommerce - pnpm env:performance-init --filter=@woocommerce/plugin-woocommerce + pnpm --filter=@woocommerce/plugin-woocommerce env:dev + pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init diff --git a/.github/workflows/hpos-build-and-e2e-tests-daily.yml b/.github/workflows/hpos-build-and-e2e-tests-daily.yml index d0afe99350c..06627e6b378 100644 --- a/.github/workflows/hpos-build-and-e2e-tests-daily.yml +++ b/.github/workflows/hpos-build-and-e2e-tests-daily.yml @@ -32,7 +32,7 @@ jobs: working-directory: plugins/woocommerce env: ENABLE_HPOS: 1 - run: pnpm env:test:cot --filter=@woocommerce/plugin-woocommerce + run: pnpm --filter=@woocommerce/plugin-woocommerce env:test:cot - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -91,7 +91,7 @@ jobs: working-directory: plugins/woocommerce env: ENABLE_HPOS: 1 - run: pnpm env:test:cot --filter=@woocommerce/plugin-woocommerce + run: pnpm --filter=@woocommerce/plugin-woocommerce env:test:cot - name: Run Playwright API tests. id: run_playwright_api_tests diff --git a/.github/workflows/pr-build-and-e2e-tests.yml b/.github/workflows/pr-build-and-e2e-tests.yml index 415dc72fa48..fafd94564d1 100644 --- a/.github/workflows/pr-build-and-e2e-tests.yml +++ b/.github/workflows/pr-build-and-e2e-tests.yml @@ -105,7 +105,7 @@ jobs: working-directory: plugins/woocommerce env: ENABLE_HPOS: 0 - run: pnpm env:test --filter=@woocommerce/plugin-woocommerce + run: pnpm --filter=@woocommerce/plugin-woocommerce env:test - name: Run Playwright API tests. id: run_playwright_api_tests @@ -159,8 +159,8 @@ jobs: env: ENABLE_HPOS: 0 run: | - pnpm env:dev --filter=@woocommerce/plugin-woocommerce - pnpm env:performance-init --filter=@woocommerce/plugin-woocommerce + pnpm --filter=@woocommerce/plugin-woocommerce env:dev + pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init - name: Install k6 run: | diff --git a/plugins/woocommerce-beta-tester/README.md b/plugins/woocommerce-beta-tester/README.md index 5af12e07e16..7b4f2cfc700 100644 --- a/plugins/woocommerce-beta-tester/README.md +++ b/plugins/woocommerce-beta-tester/README.md @@ -12,7 +12,7 @@ To get started, run the following commands: ```text pnpm --filter=@woocommerce/plugin-woocommerce-beta-tester install -pnpm --filter=@woocommerce/plugin-woocommerce-beta-tester run start +pnpm --filter=@woocommerce/plugin-woocommerce-beta-tester start ``` See [wp-scripts](https://github.com/WordPress/gutenberg/tree/master/packages/scripts) for more usage information. diff --git a/tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts b/tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts index c1618ae2326..10296304150 100644 --- a/tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts +++ b/tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts @@ -113,7 +113,7 @@ export const updateReleaseBranchChangelogs = async ( Logger.notice( `Running the changelog script in ${ tmpRepoPath }` ); execSync( - `pnpm --filter=@woocommerce/plugin-woocommerce run changelog write --add-pr-num -n -vvv --use-version ${ version }`, + `pnpm --filter=@woocommerce/plugin-woocommerce changelog write --add-pr-num -n -vvv --use-version ${ version }`, { cwd: tmpRepoPath, stdio: 'inherit', diff --git a/tools/monorepo/check-changelogger-use.php b/tools/monorepo/check-changelogger-use.php index 2c58f284178..f1abc4f9cb2 100644 --- a/tools/monorepo/check-changelogger-use.php +++ b/tools/monorepo/check-changelogger-use.php @@ -216,7 +216,7 @@ foreach ( $touched_projects as $slug => $files ) { } elseif ( getenv( 'CI' ) ) { printf( "---\n" ); // Bracket message containing newlines for better visibility in GH's logs. printf( - "::error::Project %s is being changed, but no change file in %s is touched!\n\nUse `pnpm --filter=./%s run changelog add` to add a change file.\n", + "::error::Project %s is being changed, but no change file in %s is touched!\n\nUse `pnpm --filter=./%s changelog add` to add a change file.\n", $slug, "$slug/{$changelogger_projects[ $slug ]['changes-dir']}/", $slug @@ -234,7 +234,7 @@ foreach ( $touched_projects as $slug => $files ) { } } if ( $exit && ! getenv( 'CI' ) && ! $list ) { - printf( "\e[32mUse `pnpm --filter={project} run changelog add` to add a change file for each project.\e[0m\n" ); + printf( "\e[32mUse `pnpm --filter={project} changelog add` to add a change file for each project.\e[0m\n" ); } exit( $exit ); diff --git a/tools/storybook/package.json b/tools/storybook/package.json index f9802a5a57d..bc96f2044bd 100644 --- a/tools/storybook/package.json +++ b/tools/storybook/package.json @@ -10,6 +10,13 @@ }, "author": "Automattic", "license": "GPL-3.0-or-later", + "scripts": { + "build-storybook": "build-storybook -c ./.storybook", + "build-woocommerce": "pnpm --filter=@woocommerce/plugin-woocommerce build", + "preinstall": "npx only-allow pnpm", + "storybook": "pnpm run build-woocommerce && ./import-wp-css-storybook.sh && BABEL_ENV=storybook STORYBOOK=true start-storybook -c ./.storybook -p 6007 --ci", + "storybook-rtl": "USE_RTL_STYLE=true pnpm run storybook" + }, "engines": { "node": "^16.14.1", "pnpm": "^8.6.7" @@ -17,13 +24,6 @@ "bugs": { "url": "https://github.com/woocommerce/woocommerce/issues" }, - "scripts": { - "build-storybook": "build-storybook -c ./.storybook", - "preinstall": "npx only-allow pnpm", - "build-woocommerce": "pnpm --filter=@woocommerce/plugin-woocommerce run build", - "storybook": "pnpm run build-woocommerce && ./import-wp-css-storybook.sh && BABEL_ENV=storybook STORYBOOK=true start-storybook -c ./.storybook -p 6007 --ci", - "storybook-rtl": "USE_RTL_STYLE=true pnpm run storybook" - }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/preset-env": "^7.23.5",