packages/php/email-editor/development.md
There are two ways to develop this package as a part of the WooCommerce plugin:
You can extend your .wp-env.override.json file to map this package directly to have your changes up to date:
{
...
"env": {
"development": {
"mappings": {
...
"wp-content/plugins/woocommerce/packages/email-editor": "../../packages/php/email-editor"
}
}
}
}
Alternatively, you can use the watch command within the WooCommerce plugin to keep your changes synchronized during development:
Run the following command. It will watch for changes, rebuild assets if necessary, and sync the package files automatically:
pnpm --filter='@woocommerce/plugin-woocommerce' watch:build:admin
Press Ctrl+C in the terminal to stop watching.
Using the watch command is particularly useful when you don't want to restart wp-env after making modifications to this package.
We use wp-env to setup test environment in Docker.
Please install wp-env by running npm install -g @wordpress/env if you haven't already.
composer run env:start to run wp-env.composer run test:unit to run unit tests.composer run test:integration to run integration tests.composer run env:stop to stop wp-env.More detailed guide for writing tests can be found at writing-tests.md
Guide for writing E2E tests can be found at packages/js/email-editor/writing-e2e-tests.md