PurpleTurtleCreative / completionist

Asana integration plugin for WordPress.
https://purpleturtlecreative.com/completionist/
GNU General Public License v3.0
1 stars 0 forks source link

Define wp-env configuration for performant local development and testing #176

Closed MichelleBlanchette closed 9 months ago

MichelleBlanchette commented 1 year ago

I installed and tried out using @wordpress/env and it amazed me how fast it performed and how easy it was to use!

It uses Docker, yet it was much faster than my simple Docker Compose v3 configuration. My current configuration makes product demos really rough with how slow it is to make requests (a common issue noted in the Docker community), experiences random cURL 28 timeout errors because of this, and causes WordPress itself to often randomly log network-related issues.

Anyways... The config documentation is here: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#wp-env-json

Including local environment configuration steps also makes the open source project way more portable and friendly to potential contributors or future teammates.

Even better, include wp-env in package.json so people don't even need to install the package on their machine globally. Details here: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#installation-as-a-local-package

Also, lifecycle scripts are possible, described here: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#lifecycle-scripts Though I'd really want a script to run when the environment is first built (rather than afterStart) to use WP CLI to always create specific WordPress users, update options such as the site name, create some posts, etc... The docs don't immediately make it clear how to accomplish this...