Repository navigation
chore(examples): standardize npm scripts across examples - #857
Open
josephfusco wants to merge 6 commits into
Open
josephfusco wants to merge 6 commits into
josephfusco wants to merge 6 commits into
Conversation
josephfusco
requested review from
a team,
colinmurphy and
wpe-ie-deploy-bot
as code owners
October 27, 2026 13:15
Contributor
📦 Plugin Artifacts Ready!Download from GitHub Actions run Available plugins:
See the "Artifacts" section at the bottom of the Actions run page |
…step ACF's GitHub releases now attach a versioned zip, so the unversioned releases/latest/download/advanced-custom-fields.zip URL returns 404 and wp-env start failed in every example that installs ACF. In the examples that install Twenty Twenty-One, 'wp theme delete --all' can't remove the theme directory wp-env mounts, so afterStart failed.
WordPress.org now serves ACF itself, so use its latest-stable zip instead of a pinned GitHub release. afterStart ran 'wp plugin update wpgraphql-acf', which tries to replace the plugin directory wp-env mounts and fails whenever WordPress.org has a newer version. WordPress.org is now on 3.0.0, a major release, so pin the 2.4.1 release the examples were built against and drop the update.
Drop the per-example lists of what setup does, which had already drifted (they missed the media unzip and listed steps out of order); the shared 'Running an example' section describes setup. Also fix 'Astro' in the Next.js template-hierarchy README and restore the dev server step in proxied-graphql-debug, whose list follows both setup and dev.
colinmurphy
approved these changes
Oct 27, 2026
colinmurphy
left a comment
Member
There was a problem hiding this comment.
Thanks @josephfusco for fixing these issues 🚀
I ran pnpm check:examples locally and everything passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How to test
pnpm check:examples. It checks every example has the standard scripts, that every script/--prefix/README link it references exists, and thatassets:unzipmatches each zip's layout. CI runs the same check (new Example Scripts workflow). It reports 699 problems onmainand none here.npm run setup, thennpm run dev. If port 8888 is taken, prefix both withWP_ENV_PORT=8977. Note: examples that read a WordPress URL from.envstill need it created by hand until the.env.examplefollow-up lands.Description
Standardizes the npm scripts across all 23 wp-env examples, using the names the team agreed in #330:
setupdevapp:devstop/cleanwp:start,db:import,db:export,db:query,assets:zip,assets:unzipExample-specific extras stay where needed:
wp:multisite,app:styles:fetch(wp-theme-rendered-blocks),backend:dev(Angular).render-blocks-pages-routerhas no wp-env and is unchanged.The scripts are documented once, in a new Running an example section of
examples/README.md; each example's README links there instead of carrying its own copy.Commits (one pass each)
scripts/check-example-scripts.js,pnpm check:examples, CI workflow) and testing notes inexamples/README.md.latest/downloadURL 404'd in 8 examples; andwp theme delete --allfailed in the 3 examples using Twenty Twenty-One.afterStartranwp plugin update wpgraphql-acf, which fails on a wp-env-mounted plugin whenever WordPress.org is newer, and WordPress.org is now on 3.0.0 (a major). Upgrading to 3.0 can be its own tested change.Bugs fixed along the way
wp-env/uploads/...were unzipped with-d wp-env, extracting outside the mounted folder.wp:destroypointed at a config file that doesn't exist.example-app's dependencies;setupnow does, and copiesbackend/.env.example(which had an emptyFRONTEND_URL).echo >that overwrote the first.envline.Related Issue
Closes #330. The
.env.examplesuggestion from the thread follows in a separate PR.Type of Change
How Has This Been Tested?
pnpm check:examplespasses for all 23 examples.End to end with
WP_ENV_PORT=8977on 14 examples covering every framework, both zip layouts, and each special case. Before the fixes in commits 3–4, 7 of them failedsetup; now all pass:¹ Hardcodes
localhost:8888, which on this machine is another site, so CORS fails. ² No.env, so the WordPress URL isundefined(the.env.examplefollow-up). ³ The multisite network is registered tolocalhost:8888. ⁴ REST example, no WPGraphQL. ⁵ Its zip contains only empty folders.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Assisting with the script standardization, the check script, end-to-end testing and fixes, README updates, and this PR description.