Skip to content

fix(@angular/cli): add schema.json options to parsed command, also when a version is passed to ng add <package>@<version> - #27767

Merged
dgp1130 merged 1 commit into
angular:mainfrom
Platonn:bugfix/GH-27766
Jun 4, 2024
Merged

dgp1130 merged 1 commit into
angular:mainfrom
Platonn:bugfix/GH-27766

Conversation

@Platonn

@Platonn Platonn commented Jun 3, 2024

Copy link
Copy Markdown
Contributor

This commit fixes the method AddCommandModule.getCollectionName(), so it now returns only the package name, but remove the specified version (if present).

Previously, a @<version> specified in the const collectionName was causing a (silenced) error during the invocation of workflow.engine.createCollection(collectionName), which lead to skipping eventually the invocation of the method this.addSchemaOptionsToCommand() in the try/catch block.

fixes #27766

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #27766

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@Platonn
Platonn force-pushed the bugfix/GH-27766 branch from e3708b6 to 3216802 Compare June 3, 2024 14:13
Comment thread packages/angular/cli/src/commands/add/cli.ts
@alan-agius4 alan-agius4 added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews target: patch This PR is targeted for the next patch release labels Jun 3, 2024
@Platonn
Platonn force-pushed the bugfix/GH-27766 branch from 3216802 to 8192276 Compare June 3, 2024 23:13
…when a version is passed to `ng add <package>@<version>`

This commit fixes the method `AddCommandModule.getCollectionName()`, so it now returns only the package name, but remove the specified version (if present).

Previously, a `@<version>` specified in the const `collectionName` was causing a (silenced) error during the invocation of `workflow.engine.createCollection(collectionName)`, which lead to skipping eventually the invocation of the method `this.addSchemaOptionsToCommand()` in the try/catch block.

fixes angular#27766
@Platonn
Platonn force-pushed the bugfix/GH-27766 branch from 8192276 to ae6e6a1 Compare June 4, 2024 13:01
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Jun 4, 2024

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for your contribution.

@dgp1130
dgp1130 merged commit ce8b5a3 into angular:main Jun 4, 2024
@dgp1130

dgp1130 commented Jun 4, 2024

Copy link
Copy Markdown
Collaborator

The changes were merged into the following branches: main, 18.0.x

@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A silent error is thrown in AddCommandModule.builder, when passing a version to the command ng add @my/lib@<version>

3 participants