Skip to content

fix(@angular/cli): add packages with built-in schematics to devDependencies only - #33702

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix-33701-ng-add-dev-dependencies
Jul 30, 2026
Merged

fix(@angular/cli): add packages with built-in schematics to devDependencies only#33702
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix-33701-ng-add-dev-dependencies

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

When running ng add on a package that does not provide a native ng-add schematic but is handled by a built-in schematic (e.g. tailwindcss or @vitest/browser-*), the CLI previously installed the package into dependencies before executing the built-in schematic.

With this change, built-in schematics specify their target dependency section (devDependencies), so ng add installs them as devDependencies and omits them from dependencies.

Closes #33701

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the ng add command logic to skip confirmation and installation tasks when a package does not have schematics, and updates E2E tests to assert that packages like Tailwind CSS and Vitest are correctly added to devDependencies instead of dependencies. Feedback on the pull request highlights a critical issue where the new skip logic based on context.hasSchematics introduces a security regression by bypassing installation confirmation for built-in schematics, and breaks installation entirely for non-schematic packages. It is recommended to adjust the skip logic to target only packages handled by built-in schematics.

Comment thread packages/angular/cli/src/commands/add/cli.ts
…encies only

When running `ng add` on a package that does not provide a native `ng-add` schematic but is handled by a built-in schematic (e.g. `tailwindcss` or `@vitest/browser-*`), the CLI previously installed the package into `dependencies` before executing the built-in schematic.

With this change, built-in schematics specify their target dependency section (`devDependencies`), so `ng add` installs them as `devDependencies` and omits them from `dependencies`.

Closes angular#33701
@alan-agius4
alan-agius4 force-pushed the fix-33701-ng-add-dev-dependencies branch from dab6d6e to ac4b67a Compare July 30, 2026 13:10
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jul 30, 2026
@alan-agius4
alan-agius4 requested a review from dgp1130 July 30, 2026 13:10
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 30, 2026
@alan-agius4
alan-agius4 merged commit 035b9d5 into angular:main Jul 30, 2026
42 checks passed
@alan-agius4
alan-agius4 deleted the fix-33701-ng-add-dev-dependencies branch July 30, 2026 15:36
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng add tailwindcss adds tailwindcss to dependencies and devDependencies

2 participants