Build Tools: Move build scripts to @wordpress/build-scripts workspace package#78509
Conversation
removing tsconfig.json since it is not needed anymore in bin
tools/build to @wordpress/build-tools workspace packagebin/build* to @wordpress/build-tools workspace package
bin/build* to @wordpress/build-tools workspace package@wordpress/build-tools workspace package
|
I also changed the workspace name to |
Let us use the same name as that of the directory |
@wordpress/build-tools workspace package@wordpress/build-scripts workspace package
There was a problem hiding this comment.
Pull request overview
This PR migrates the repository’s build orchestration scripts out of bin/ into a dedicated npm workspace package (tools/build-scripts, published internally as @wordpress/build-scripts) so build-time dependencies are explicit and the root package.json can be slimmed down for stricter workspace isolation.
Changes:
- Added the new
@wordpress/build-scriptsworkspace package and moved/updated build helper scripts undertools/build-scripts/. - Updated root
build/deventrypoints to run via the new workspace and adjusted internal script paths accordingly. - Updated references/docs/workflows to point at the new script locations and removed the
binTypeScript project config.
Reviewed changes
Copilot reviewed 11 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tsconfig.json |
Removes the bin TS project reference after build scripts move out of bin/. |
tools/release/commands/performance.js |
Updates documentation reference for the trace source-map resolver script path. |
tools/build-scripts/packages/resolve-trace-source-maps.cjs |
Updates usage/help text to reflect the new script location (but currently has a stale path). |
tools/build-scripts/packages/generate-worker-placeholders.mjs |
Adjusts repo-root resolution after relocation under tools/build-scripts/. |
tools/build-scripts/packages/check-build-type-declaration-files.cjs |
Adds a new script for verifying published type declarations. |
tools/build-scripts/packages/build-vendors.mjs |
Adjusts repo-root resolution after relocation under tools/build-scripts/. |
tools/build-scripts/package.json |
Introduces the new workspace package and exposes build/dev helper scripts. |
tools/build-scripts/dev.mjs |
Updates orchestrator script to call relocated helper scripts. |
tools/build-scripts/build.mjs |
Updates orchestrator script to call relocated helper scripts. |
packages/e2e-test-utils-playwright/src/metrics/index.ts |
Updates comment to point to the new trace source-map resolver location. |
package.json |
Routes build/dev through the new workspace and removes build-script deps from root. |
package-lock.json |
Adds workspace linkage for @wordpress/build-scripts (but currently includes a stale/extraneous tools/build entry). |
docs/contributors/folder-structure.md |
Updates folder-structure docs to mention tools/build-scripts (but still references removed bin/api-docs). |
bin/tsconfig.json |
Deletes the old TS config for the removed bin project scripts. |
.github/workflows/bundle-size.yml |
Updates path filters from bin/packages to tools/build-scripts/packages. |
Comments suppressed due to low confidence (1)
tools/build-scripts/packages/resolve-trace-source-maps.cjs:12
USAGEstill referencestools/build/..., but this script now lives undertools/build-scripts/...(andtools/builddoesn’t exist). This makes the help text misleading; update the path in the usage string to the new location (or to the workspace script invocation).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
manzoorwanijk
left a comment
There was a problem hiding this comment.
Thank you @USERSATOSHI for working on this. It looks great.
Let us address the feedback given by Copilot, then we should be ready to land this.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
manzoorwanijk
left a comment
There was a problem hiding this comment.
Thank you for working on this and refining the changes. This looks great now.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 15 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
tools/build-scripts/packages/resolve-trace-source-maps.cjs:10
- The help/usage text points to
tools/build/packages/resolve-trace-source-maps.cjs, but this script now lives undertools/build-scripts/packages/.... This makes--helpoutput misleading and suggests a path that doesn’t exist.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
What?
Related to #75041
Converts
buildinto a dedicated npm workspace package,@wordpress/build-scripts, to support the ongoing cleanup of the rootpackage.jsonand make dependencies explicit.Why?
As part of #75041 (Phase 4.1), the build scripts were relying on dependencies implicitly available from the root
node_modules. This “phantom dependency” setup can break under stricter workspace isolation (for example, with pnpm).Creating a dedicated workspace package:
package.json.How?
package.jsonfor the private@wordpress/build-toolsworkspace package.buildanddevscripts to run through the workspace.workspacesconfiguration, so no additional registration was needed.Decisions
build:allanddev, since the previousbuildscript was callingnpm run buildacross all workspaces and causing an infinite loop.build-toolstobuild-scripts, as having onlytools/buildexcluded via.gitignorefelt inconsistent and not ideal for the package structure.Testing Instructions
Run
npm install.Run
npm run build.Run
npm start.Verify:
npm run --workspace @wordpress/build-scripts build-vendorsnpm run --workspace @wordpress/build-scripts generate-worker-placeholdersUse of AI Tools
PR description drafted with GitHub Copilot.