Refactor workspace configuration for Babel dependencies#78974
Conversation
|
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. It looks great.
Let us see if Copilot finds anything.
There was a problem hiding this comment.
Pull request overview
This PR continues the Phase 7.1 workspace cleanup by moving Babel-related dependency ownership out of the repo root and into the @wordpress/build-scripts workspace, while updating a few call sites to resolve presets/plugins reliably from their owning packages.
Changes:
- Delegate the root
babel.config.jsto a new workspace-owned Babel config (tools/build-scripts/babel.config.cjs). - Relocate Babel plugin/preset dependencies to
tools/build-scriptsand adjust consumers to userequire.resolve(...)where appropriate. - Update affected package/test configurations and lockfile entries to reflect the new dependency layout.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tools/build-scripts/package.json |
Adds Babel-related deps to the build-scripts workspace so Babel resolution is no longer rooted at the repo. |
tools/build-scripts/babel.config.cjs |
Introduces a workspace-owned monorepo Babel config (presets/plugins/override). |
babel.config.js |
Replaces the root Babel config with a delegating wrapper to the workspace-owned config. |
package.json |
Removes Babel-related devDependencies from the repo root. |
package-lock.json |
Updates lockfile to reflect dependency ownership changes across workspaces. |
test/unit/scripts/babel-transformer.js |
Resolves the Babel preset via require.resolve for workspace-safe resolution. |
test/unit/package.json |
Adds @wordpress/babel-preset-default to ensure unit tests declare what they use. |
packages/wp-build/lib/build.mjs |
Resolves @emotion/babel-plugin via a Node require helper for consistent resolution in ESM. |
packages/warning/package.json |
Adds @babel/core as a dev dependency for workspace-level build/test tooling needs. |
packages/block-library/package.json |
Adds @babel/core as a dev dependency for workspace-level build/test tooling needs. |
packages/browserslist-config/test/index.test.js |
Updates the validation test to run browserslist against the exported config. |
packages/browserslist-config/package.json |
Adds browserslist as a dev dependency for the package’s tests. |
packages/babel-plugin-import-jsx-pragma/test/index.js |
Resolves @babel/plugin-syntax-jsx via require.resolve for consistency/reliability. |
What?
Related to #75041
Why? & How?
This implements the "Move babel deps out of root" task from the Phase 7.1 cleanup, adapting the diff from the issue description to the current state of trunk.