fix(schematics): declare the runtime dependencies the schematics bundle requires - #3747
Open
armando-navarro wants to merge 1 commit into
Open
fix(schematics): declare the runtime dependencies the schematics bundle requires#3747armando-navarro wants to merge 1 commit into
armando-navarro wants to merge 1 commit into
Conversation
…le requires The shipped schematics require jsonc-parser, @angular-devkit/core, and @angular-devkit/architect at runtime, but the published manifest never declared them. The first two resolve today only because npm hoists them from the declared @angular-devkit/schematics and @schematics/angular. Architect is worse: it is not in the package's dependency closure at all and resolves from the app's own @angular/cli install, so ng deploy breaks under pnpm's strict layout or Yarn PnP. The architect range is the comparator pair matching its 0.YYMM version scheme. A caret on a 0.x version would lock consumers to Angular 21.0.x. Also prunes the ng-packagr allowlist to the seven names actually declared, dropping ten entries for dependencies removed long ago and a duplicate @schematics/angular.
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.
Checklist
requirecalls for all three packages in the built schematics bundles.yarn install,yarn testrun successfully?: yesDescription
Fixes #3746.
The shipped schematics
requirejsonc-parser,@angular-devkit/core, and@angular-devkit/architectat runtime, but the published manifest never declared them. The first two resolve today only because npm hoists them from the declared@angular-devkit/schematicsand@schematics/angular. Architect is not in the package's dependency closure at all and resolves from the app's own@angular/cliinstall, song deploybreaks under pnpm's isolated layout or Yarn Plug'n'Play.The architect range (
>= 0.2100.0 < 0.2200.0) is the comparator pair matching its0.YYMMversion scheme, the same shape other packages shipping architect builders use. A caret on a0.xversion would restrict consumers to Angular 21.0.x only.The change also prunes
allowedNonPeerDependenciesinsrc/ng-package.jsonto the seven names actually declared, dropping ten entries for dependencies removed long ago and a duplicate@schematics/angularentry.Refs #3694: that issue proposes moving schematic dependencies out of
dependenciesentirely. This fix runs the other way in the short term because the shipped bundles genuinely require these packages at runtime, so leaving them undeclared is a correctness bug today. The structural question of where schematic dependencies should live stays open in #3694.