chore: declare @angular/build at repo root for merge-schemes.ts#2239
Open
just-jeb wants to merge 1 commit into
Open
chore: declare @angular/build at repo root for merge-schemes.ts#2239just-jeb wants to merge 1 commit into
just-jeb wants to merge 1 commit into
Conversation
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).
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.
PR Checklist
PR Type
What is the current behavior?
merge-schemes.ts(the root build script that produces builder schemas) callsresolvePackagePath('@angular/build', …)to find Angular's internal schema files. Neither rootpackage.jsonnorpackages/commondeclares@angular/build. The resolution works on master purely because Yarn hoists@angular/buildfrompackages/custom-esbuild/packages/custom-webpackinto the top-levelnode_modules. Any change to hoist layout (e.g. the TS6 bump that surfaced PR #2229's CI failure) silently breaks the build withCannot find module '@angular/build/package.json'.What is the new behavior?
@angular/buildis added to rootdevDependencieswith 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?
Other information
Could also be placed in
packages/common'sdependencies, but the function is only ever called from the rootmerge-schemes.tsscript, andcommonis a published package — pulling@angular/buildinto all consumers (includingjest, which doesn't need it) would be overkill.