Over the weekend, WooCommerce Blocks was merged into the WooCommerce Monorepo. This brings with it a more streamlined development process and enhances collaboration across our community. As previously announced, this means WooCommerce Blocks development will take place in the WooCommerce Core monorepo instead of a separate repository (which is now archived). This also means there will no longer be a separate feature plugin release for WooCommerce Blocks.
Contributing to WooCommerce Blocks
PHP code contributions can be made in the /plugins/woocommerce/src folder and JavaScript contributions in the /plugins/woocommerce-blocks folder.
Over the last week, the WooCommerce team has worked to merge many community-created pull requests for WooCommerce Blocks. The authors of any pull requests that remain unmerged will have received a comment from a member of the WooCommerce team outlining next steps.
WooCommerce Blocks changes will now be shipped as part of WooCommerce releases on a monthly cadence, rather than every two weeks. If youโd like to take a peek at whatโs coming next, check out the Beta Tester Plugin for WooCommerce.
There have been tooling changes in the monorepo which will be outlined later, but for WooCommerce Blocks development, here is a list of mapped commands from what you used previously, and what you should use now:
pnpm --filter='@woocommerce/plugin-woocommerce' build
will build WooCommerce Core.pnpm --filter='@woocommerce/block-library' build
will build WooCommerce Blocksโ client.pnpm --filter='@woocommerce/block-library' test:js
will run WooCommerce Blocksโ JavaScript test suite.lint
andlint:fix
commands in the same format are also available.
You can learn more about these commands in the WooCommerce Core README.
Woo merchants and store managers will not be affected by this change.ย
Tooling Changes
We heard from various community members that they encountered challenges when working with the monorepo. Based on this feedback, weโve implemented some changes to the monorepoโs tooling:
- Turborepo has been replaced with Wireit – we anticipate that this change will provide faster and more reliable caching, both when working locally and with CI tools. In our testing, this has had a major impact, including decreasing the amount of time a major CI step takes to run from over five minutes in some cases to approximately one minute.
- Weโve standardized our NPM scripts – we heard feedback that it wasnโt always clear what our NPM scripts did, as they were inconsistently named throughout the monorepo. As part of this update, weโre standardizing the scripts used, creating a more predictable experience for developers. Learn more about this change.
- All packages are being brought under the @woocommerce scope – this avoids the possibility of external dependencies being pulled and resolves some invalid package names.
As a result of these changes, some commands have changed. Specifically:
- Commands which reference plugin packages will now use the full
@woocommerce/plugin-{slug}
names. For example,pnpm --filter=woocommerce build
is nowpnpm --filter=@woocommerce/plugin-woocommerce build
. - The packages
woocommerce/client/legacy
andwoocommerce/client/admin
have new names –@woocommerce/classic-assets
and@woocommerce/admin-library
respectively – which should be referenced from within commands.
You can find a full list of packages in the woocommerce/plugins folder of the monorepo.
Please note that this does not impact path-based filters such as pnpm --filter=./plugins/woocommerce build
, nor does it affect pnpm {script}
commands run from within project directories.
Where to find more information
Weโre here to support developers during this transition. Over the coming weeks, weโll be providing support in the #monorepo
channel on the Woo Community Slack. Weโd love to hear your feedback about this new tooling, as well as answer any questions you may have.
Leave a Reply