Simplifying WooCommerce’s Repository Tooling

WooCommerce is a complex project that needs powerful tooling for its development. However, over time, the commands needed to successfully manage a WooCommerce development environment have become more and more unwieldy. Especially newcomers to the project will have to overcome more obstacles than necessary — making it less likely for them to become successful contributors.

A few internal teams have tried to counter this complexity with extra npm scripts in their packages. Some developers have a command they always use because they “finally got it working”, but don’t know if they should still be using it or maybe it “works” but doesn’t give them a lot of benefits.

All of this led us to believe that the setup was just a bit too much cognitive load.

When you’re developing a feature in your work area or want to make a contribution to solve a problem you’re having, the last thing you want to have to do is dive into understanding the Turborepo docs. Tools should stay out of your way while still allowing you to be productive. 

So we went ahead and simplified the development tooling to make it easier to use.

To build things, you previously had to ensure you’re always running pnpm -- turbo run build from the root of the repository. Passing different flags to turbo or to your build script also got tricky very quickly.

Now, after we’ve streamlined things, you can simply run pnpm run build from the root and from any package that you’d like to run it from. It will still use Turborepo “under the hood” but theres a lot less to think about here.

If you want to add flags you can pass them to both Turborepo and your build command quite simply.

Passing a flag to Turborepo: pnpm run build --filter=woocommerce

Passing a flag to your build command: pnpm run build -- --watch

Or as complex as it gets, pass to both: pnpm run build --filter=woocommerce -- --watch

You also don’t need to worry about the filter parameter anymore when working in packages. Running pnpm run build from a package will take care of that for you. 🎉

You should not need to interact with Turborepo directly anymore, and we hope that this will lead to less confusion. Of course for some advanced cases you’ll still be able to using Turborepo as needed.

Summary: this pull request should make building, linting, and testing easier. Please try it out and give us your feedback! 🙌


Keep yourself in the loop!

Sign up for the WooCommerce developer newsletter:
Hidden
Hidden
Hidden


Leave a Reply

Your email address will not be published. Required fields are marked *