Skip to content

fix(schematics): declare the runtime dependencies the schematics bundle requires - #3747

Open
armando-navarro wants to merge 1 commit into
angular:mainfrom
armando-navarro:a20-dependency-declarations
Open

fix(schematics): declare the runtime dependencies the schematics bundle requires#3747
armando-navarro wants to merge 1 commit into
angular:mainfrom
armando-navarro:a20-dependency-declarations

Conversation

@armando-navarro

Copy link
Copy Markdown
Collaborator

Checklist

  • Issue number for this PR: 3 schematics-required packages undeclared in package.json #3746 (required)
  • Docs included?: No, none affected (dependency manifests only)
  • Test units included?: No. The existing suite passes (156 specs). The fix was verified by building the package and confirming the dist manifest declares all three ranges, and by locating the require calls for all three packages in the built schematics bundles.
  • In a clean directory, yarn install, yarn test run successfully?: yes

Description

Fixes #3746.

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 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 isolated layout or Yarn Plug'n'Play.

The architect range (>= 0.2100.0 < 0.2200.0) is the comparator pair matching its 0.YYMM version scheme, the same shape other packages shipping architect builders use. A caret on a 0.x version would restrict consumers to Angular 21.0.x only.

The change also prunes allowedNonPeerDependencies in src/ng-package.json to the seven names actually declared, dropping ten entries for dependencies removed long ago and a duplicate @schematics/angular entry.

Refs #3694: that issue proposes moving schematic dependencies out of dependencies entirely. 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.

…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.
@armando-navarro armando-navarro added bump: patch comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen. labels Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump: patch comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 schematics-required packages undeclared in package.json

1 participant