Renamed WooCommerce Plugin Package
In order to prevent supply-chain attacks we have renamed the package. The new name is `@woocommerce/plugin-woocommerce`.
This commit is contained in:
parent
c0237250fb
commit
5bbb9edc6d
|
@ -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 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 run 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).
|
||||
|
@ -46,7 +46,7 @@ Please take a moment to review the [project readme](https://github.com/woocommer
|
|||
- Ensure that your code supports the minimum supported versions of PHP and WordPress; this is shown at the top of the `readme.txt` file.
|
||||
- Push the changes to your fork and submit a pull request on the trunk branch of the WooCommerce repository.
|
||||
- Make sure to write good and detailed commit messages (see [this post](https://chris.beams.io/posts/git-commit/) for more on this) and follow all the applicable sections of the pull request template.
|
||||
- Please create a change file for your changes by running `pnpm --filter=<project> changelog add`. For example, a change file for the WooCommerce Core project would be added by running `pnpm --filter=woocommerce changelog add`.
|
||||
- Please create a change file for your changes by running `pnpm --filter=<project> changelog add`. For example, a change file for the WooCommerce Core project would be added by running `pnpm --filter=@woocommerce/plugin-woocommerce changelog add`.
|
||||
- Please avoid modifying the changelog directly or updating the .pot files. These will be updated by the WooCommerce team.
|
||||
|
||||
If you are contributing code to our (Javascript-driven) Gutenberg blocks, please note that they are developed in their [own repository](https://github.com/woocommerce/woocommerce-gutenberg-products-block) and have their [own issue tracker](https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues).
|
||||
|
|
|
@ -25,5 +25,5 @@ runs:
|
|||
working-directory: plugins/woocommerce
|
||||
shell: bash
|
||||
run: |
|
||||
pnpm env:dev --filter=woocommerce
|
||||
pnpm env:performance-init --filter=woocommerce
|
||||
pnpm env:dev --filter=@woocommerce/plugin-woocommerce
|
||||
pnpm env:performance-init --filter=@woocommerce/plugin-woocommerce
|
||||
|
|
|
@ -29,7 +29,7 @@ jobs:
|
|||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
ENABLE_HPOS: 1
|
||||
run: pnpm env:test:cot --filter=woocommerce
|
||||
run: pnpm env:test:cot --filter=@woocommerce/plugin-woocommerce
|
||||
|
||||
- name: Download and install Chromium browser.
|
||||
working-directory: plugins/woocommerce
|
||||
|
@ -85,7 +85,7 @@ jobs:
|
|||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
ENABLE_HPOS: 1
|
||||
run: pnpm env:test:cot --filter=woocommerce
|
||||
run: pnpm env:test:cot --filter=@woocommerce/plugin-woocommerce
|
||||
|
||||
- name: Run Playwright API tests.
|
||||
id: run_playwright_api_tests
|
||||
|
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
|
||||
- name: Load docker images and start containers
|
||||
working-directory: plugins/woocommerce
|
||||
run: pnpm env:test --filter=woocommerce
|
||||
run: pnpm env:test --filter=@woocommerce/plugin-woocommerce
|
||||
|
||||
- name: Download and install Chromium browser.
|
||||
working-directory: plugins/woocommerce
|
||||
|
@ -81,7 +81,7 @@ jobs:
|
|||
|
||||
- name: Load docker images and start containers
|
||||
working-directory: plugins/woocommerce
|
||||
run: pnpm env:test --filter=woocommerce
|
||||
run: pnpm env:test --filter=@woocommerce/plugin-woocommerce
|
||||
|
||||
- name: Run Playwright API tests.
|
||||
id: run_playwright_api_tests
|
||||
|
|
|
@ -99,7 +99,7 @@ jobs:
|
|||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
ENABLE_HPOS: 0
|
||||
run: pnpm env:test --filter=woocommerce
|
||||
run: pnpm env:test --filter=@woocommerce/plugin-woocommerce
|
||||
|
||||
- name: Run Playwright API tests.
|
||||
id: run_playwright_api_tests
|
||||
|
@ -150,8 +150,8 @@ jobs:
|
|||
env:
|
||||
ENABLE_HPOS: 0
|
||||
run: |
|
||||
pnpm env:dev --filter=woocommerce
|
||||
pnpm env:performance-init --filter=woocommerce
|
||||
pnpm env:dev --filter=@woocommerce/plugin-woocommerce
|
||||
pnpm env:performance-init --filter=@woocommerce/plugin-woocommerce
|
||||
|
||||
- name: Install k6
|
||||
run: |
|
||||
|
|
|
@ -66,10 +66,10 @@ Here are some examples of the commands you will make use of.
|
|||
|
||||
```bash
|
||||
# Add a changelog entry for WooCommerce Core
|
||||
pnpm --filter=woocommerce run changelog add
|
||||
pnpm --filter=@woocommerce/plugin-woocommerce run changelog add
|
||||
|
||||
# Create the woocommerce.zip file
|
||||
pnpm --filter=woocommerce run build:zip
|
||||
pnpm --filter=@woocommerce/plugin-woocommerce run build:zip
|
||||
```
|
||||
|
||||
## Plugin Development Environments
|
||||
|
|
|
@ -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 run e2e --filter=woocommerce`.
|
||||
You should then be able to run the e2e tests by running `pnpm run e2e --filter=@woocommerce/plugin-woocommerce`.
|
||||
|
||||
### Test Sequencer Setup
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"url": "https://github.com:woocommerce/woocommerce.git"
|
||||
},
|
||||
"scripts": {
|
||||
"changelog": "pnpm --filter=woocommerce -r run changelog ",
|
||||
"changelog": "pnpm --filter=@woocommerce/plugin-woocommerce -r run changelog ",
|
||||
"turbo:build": "pnpm run clean && 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",
|
||||
|
|
|
@ -16,7 +16,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 run --filter=woocommerce build
|
||||
pnpm run --filter=@woocommerce/plugin-woocommerce build
|
||||
# Make sure you're in the WooCommerce Core directory
|
||||
cd plugins/woocommerce
|
||||
# Start the development environment
|
||||
|
|
|
@ -15,11 +15,11 @@ find "$PROJECT_PATH/assets/css/." ! -name '.gitkeep' -type f -exec rm -f {} + &&
|
|||
echo "Installing PHP and JS dependencies..."
|
||||
pnpm install
|
||||
echo "Running JS Build..."
|
||||
pnpm -w run build --filter=woocommerce || exit "$?"
|
||||
pnpm -w run build --filter=@woocommerce/plugin-woocommerce || exit "$?"
|
||||
echo "Cleaning up PHP dependencies..."
|
||||
composer install --no-dev || exit "$?"
|
||||
echo "Run makepot..."
|
||||
pnpm -r --filter=woocommerce run makepot || exit "$?"
|
||||
pnpm -r --filter=@woocommerce/plugin-woocommerce run makepot || exit "$?"
|
||||
echo "Syncing files..."
|
||||
rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded
|
||||
|
||||
|
|
|
@ -1028,7 +1028,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 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/plugin-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' ),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "woocommerce",
|
||||
"name": "@woocommerce/plugin-woocommerce",
|
||||
"title": "WooCommerce",
|
||||
"version": "8.3.0",
|
||||
"homepage": "https://woo.com/",
|
||||
|
|
|
@ -38,7 +38,7 @@ WooCommerce's `api-core-tests` are powered by Playwright. The test site is spun
|
|||
|
||||
- `nvm use`
|
||||
- `pnpm install`
|
||||
- `pnpm run build --filter=woocommerce`
|
||||
- `pnpm run build --filter=@woocommerce/plugin-woocommerce`
|
||||
- `cd plugins/woocommerce`
|
||||
- `pnpm env:test`
|
||||
- `pnpm test:api-pw`
|
||||
|
|
|
@ -36,7 +36,7 @@ End-to-end tests are powered by Playwright. The test site is spinned up using `w
|
|||
|
||||
- `nvm use` (uses the default node version you have set in NVM)
|
||||
- `pnpm install` (installs dependencies)
|
||||
- `pnpm run build --filter=woocommerce` (builds WooCommerce locally)
|
||||
- `pnpm run build --filter=@woocommerce/plugin-woocommerce` (builds WooCommerce locally)
|
||||
- `cd plugins/woocommerce` (changes into the WooCommerce plugin folder)
|
||||
- `npx playwright install` (installs the latest Playwright version)
|
||||
- `pnpm env:start` (starts the local environment)
|
||||
|
|
|
@ -120,11 +120,11 @@ Run the following in a terminal/command line window
|
|||
|
||||
- `pnpm install`
|
||||
|
||||
- `pnpm run build --filter=woocommerce`
|
||||
- `pnpm run build --filter=@woocommerce/plugin-woocommerce`
|
||||
|
||||
- `npm install jest --global` (this only needs to be done once)
|
||||
|
||||
- `pnpm docker:up --filter=woocommerce` (this will build the test site using Docker)
|
||||
- `pnpm docker:up --filter=@woocommerce/plugin-woocommerce` (this will build the test site using Docker)
|
||||
|
||||
- Use `docker ps` to confirm that the Docker containers are running. You should see a log similar to one below indicating that everything had been built as expected:
|
||||
|
||||
|
@ -150,16 +150,16 @@ Username: admin
|
|||
PW: password
|
||||
```
|
||||
|
||||
- Run `pnpm docker:down --filter=woocommerce` when you are done with running e2e tests and before making any changes to test site configuration.
|
||||
- Run `pnpm docker:down --filter=@woocommerce/plugin-woocommerce` when you are done with running e2e tests and before making any changes to test site configuration.
|
||||
|
||||
Note that running `pnpm docker:down --filter=woocommerce` and then `pnpm docker:up --filter=woocommerce` re-initializes the test container.
|
||||
Note that running `pnpm docker:down --filter=@woocommerce/plugin-woocommerce` and then `pnpm docker:up --filter=@woocommerce/plugin-woocommerce` re-initializes the test container.
|
||||
|
||||
### How to run tests in headless mode
|
||||
|
||||
To run e2e tests in headless mode use the following command:
|
||||
|
||||
```bash
|
||||
pnpm run e2e --filter=woocommerce
|
||||
pnpm run e2e --filter=@woocommerce/plugin-woocommerce
|
||||
```
|
||||
|
||||
### How to run tests in non-headless mode
|
||||
|
@ -167,7 +167,7 @@ pnpm 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 run e2e:dev --filter=woocommerce
|
||||
pnpm run e2e:dev --filter=@woocommerce/plugin-woocommerce
|
||||
```
|
||||
|
||||
The dev mode also enables SlowMo mode. SlowMo slows down Puppeteer’s 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 Puppeteer’s 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 run e2e:dev --filter=woocommerce
|
||||
PUPPETEER_SLOWMO=10 pnpm run e2e:dev --filter=@woocommerce/plugin-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 run e2e:debug --filter=woocommerce
|
||||
pnpm run e2e:debug --filter=@woocommerce/plugin-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.
|
||||
|
@ -270,7 +270,7 @@ The following variables can be used to specify the versions of WordPress, PHP an
|
|||
The full command to build the site will look as follows:
|
||||
|
||||
```
|
||||
TRAVIS_MARIADB_VERSION=10.5.3 TRAVIS_PHP_VERSION=7.4.5 WP_VERSION=5.4.1 pnpm docker:up --filter=woocommerce
|
||||
TRAVIS_MARIADB_VERSION=10.5.3 TRAVIS_PHP_VERSION=7.4.5 WP_VERSION=5.4.1 pnpm docker:up --filter=@woocommerce/plugin-woocommerce
|
||||
```
|
||||
|
||||
## Guide for writing e2e tests
|
||||
|
@ -378,6 +378,6 @@ The [WooCommerce E2E Tests Boilerplate repo](https://github.com/woocommerce/wooc
|
|||
|
||||
## Debugging tests
|
||||
|
||||
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).
|
||||
The test sequencer (`pnpm run e2e --filter=@woocommerce/plugin-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).
|
||||
|
|
|
@ -57,8 +57,8 @@ Before using the tests a test environment is needed to run against.
|
|||
We first spin up an environment using `wp-env` and configure that environment with the necessary plugins and data using the Initialization Script [`init-sample-products.sh`](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/performance/bin/init-sample-products.sh) that will set up a shop with sample products imported and the shop settings (payment method, permalinks, address etc) needed for the tests already set. It is recommended using this to just see the tests in action.
|
||||
|
||||
```sh
|
||||
pnpm run env:dev --filter=woocommerce
|
||||
pnpm run env:performance-init --filter=woocommerce
|
||||
pnpm run env:dev --filter=@woocommerce/plugin-woocommerce
|
||||
pnpm run env:performance-init --filter=@woocommerce/plugin-woocommerce
|
||||
```
|
||||
|
||||
If using a different environment the details can be changed in `config.js`.
|
||||
|
|
|
@ -113,7 +113,7 @@ export const updateReleaseBranchChangelogs = async (
|
|||
|
||||
Logger.notice( `Running the changelog script in ${ tmpRepoPath }` );
|
||||
execSync(
|
||||
`pnpm --filter=woocommerce run changelog write --add-pr-num -n -vvv --use-version ${ version }`,
|
||||
`pnpm --filter=@woocommerce/plugin-woocommerce run changelog write --add-pr-num -n -vvv --use-version ${ version }`,
|
||||
{
|
||||
cwd: tmpRepoPath,
|
||||
stdio: 'inherit',
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"scripts": {
|
||||
"build-storybook": "build-storybook -c ./.storybook",
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"build-woocommerce": "pnpm --filter=woocommerce run build",
|
||||
"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"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue