Skip to content

fix(@angular/cli): validate registry option is a valid URL in ng add#33302

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:feat/ng-add-validate-registry
Open

fix(@angular/cli): validate registry option is a valid URL in ng add#33302
clydin wants to merge 1 commit into
angular:mainfrom
clydin:feat/ng-add-validate-registry

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Jun 3, 2026

Ensure that the --registry option passed to ng add is parsed as a valid absolute URL.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Jun 3, 2026
Copy link
Copy Markdown

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

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 introduces URL validation for the --registry option in the ng add command, throwing a CommandModuleError if the provided registry is not a valid URL, and adds a corresponding E2E test. The review feedback suggests enhancing this validation to ensure robust runtime type safety, specifically handling cases where registry might be parsed as an array or an empty string, and provides a code suggestion to address this.

Comment thread packages/angular/cli/src/commands/add/cli.ts
Ensure that the --registry option passed to ng add is parsed as a valid absolute URL.
@clydin clydin force-pushed the feat/ng-add-validate-registry branch from 91f449d to 4257663 Compare June 3, 2026 22:39
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 3, 2026
@clydin clydin requested a review from alan-agius4 June 3, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer 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.

1 participant