Skip to content

chore: declare @angular/build at repo root for merge-schemes.ts#2239

Open
just-jeb wants to merge 1 commit into
masterfrom
chore/declare-angular-build-dep
Open

chore: declare @angular/build at repo root for merge-schemes.ts#2239
just-jeb wants to merge 1 commit into
masterfrom
chore/declare-angular-build-dep

Conversation

@just-jeb
Copy link
Copy Markdown
Owner

PR Checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

merge-schemes.ts (the root build script that produces builder schemas) calls resolvePackagePath('@angular/build', …) to find Angular's internal schema files. Neither root package.json nor packages/common declares @angular/build. The resolution works on master purely because Yarn hoists @angular/build from packages/custom-esbuild/packages/custom-webpack into the top-level node_modules. Any change to hoist layout (e.g. the TS6 bump that surfaced PR #2229's CI failure) silently breaks the build with Cannot find module '@angular/build/package.json'.

What is the new behavior?

@angular/build is added to root devDependencies with the same major range used elsewhere. The build-time use is now declared at the same level it actually runs.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Could also be placed in packages/common's dependencies, but the function is only ever called from the root merge-schemes.ts script, and common is a published package — pulling @angular/build into all consumers (including jest, which doesn't need it) would be overkill.

merge-schemes.ts (root build script) resolves @angular/build/package.json via
require.resolve to find Angular's internal schema files for the schema merge step.
Today the resolution works only by Yarn hoist from custom-esbuild/custom-webpack's
deps. Declaring the dep at root makes the build script's actual requirement
explicit and protects against hoist-layout changes (such as PR #2229's CI failure
when a TS6 bump shifted node_modules).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant