Skip to content

fix(schematics): ng-add reads Angular from devDependencies too - #363

Merged
xidedix merged 1 commit into
v5.7from
fix/ng-add-dependency-lookup
Dec 2, 2026
Merged

xidedix merged 1 commit into
v5.7from
fix/ng-add-dependency-lookup

Conversation

@xidedix

@xidedix xidedix commented Dec 2, 2026

Copy link
Copy Markdown
Member
  • ng add read the @angular/core version only from dependencies and threw when it sat in devDependencies.
  • It now reads dependencies and devDependencies; peerDependencies do not count.
  • A package already listed is updated in its own section, not added again to dependencies.
  • Listed Angular packages stay as they are.
  • "Added dependency" is logged only for written packages, the version after the check.
  • A package.json with a BOM no longer breaks it.

ng-add threw "@angular/core version not found" when @angular/core sat in
devDependencies, and logged "Added dependency" for versions it kept. It
now reads dependencies and devDependencies, updates a listed package in
its own section instead of adding a second entry to dependencies, keeps
listed Angular packages, and logs only what it writes, the version after
the check. peerDependencies do not count, as not every package manager
installs them. package.json is read through the tree, so a BOM no longer
breaks it.
@xidedix
xidedix merged commit 427c255 into v5.7 Dec 2, 2026
9 checks passed
@xidedix
xidedix deleted the fix/ng-add-dependency-lookup branch December 2, 2026 01:19
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