Skip to content

Refactor workspace configuration for Babel dependencies#78974

Merged
manzoorwanijk merged 1 commit into
WordPress:trunkfrom
kushagra-goyal-14:refactor/move-babel-deps-out-of-root
Jun 5, 2026
Merged

Refactor workspace configuration for Babel dependencies#78974
manzoorwanijk merged 1 commit into
WordPress:trunkfrom
kushagra-goyal-14:refactor/move-babel-deps-out-of-root

Conversation

@kushagra-goyal-14
Copy link
Copy Markdown
Contributor

@kushagra-goyal-14 kushagra-goyal-14 commented Jun 5, 2026

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.

@github-actions github-actions Bot added [Package] Block library /packages/block-library [Package] Warning /packages/warning labels Jun 5, 2026
@kushagra-goyal-14 kushagra-goyal-14 marked this pull request as ready for review June 5, 2026 10:09
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: kushagra-goyal-14 <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Copy Markdown
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this. It looks great.

Let us see if Copilot finds anything.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js to a new workspace-owned Babel config (tools/build-scripts/babel.config.cjs).
  • Relocate Babel plugin/preset dependencies to tools/build-scripts and adjust consumers to use require.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.

Comment thread packages/browserslist-config/test/index.test.js
@manzoorwanijk manzoorwanijk merged commit 746baa3 into WordPress:trunk Jun 5, 2026
68 of 81 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.4 milestone Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library [Package] Warning /packages/warning [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants