Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generators: allow dash - in selector before a number #25164

Closed
sod opened this issue May 8, 2023 · 3 comments · Fixed by #25253
Closed

generators: allow dash - in selector before a number #25164

sod opened this issue May 8, 2023 · 3 comments · Fixed by #25253
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix

Comments

@sod
Copy link

sod commented May 8, 2023

Command

generate

Description

We use jira. Tickets always follow the schema <PROJECT>-<TICKETNUMBER> so e.g. Task-123. If we do an a/b test, we like to postfix the files that mirror the control group with the ticket, so e.g feature-task-123.component.ts. But the cli right now doesn't allow this.

See ng g c TodoItemTask123 neither the files nor the selector have the -. So task-123 is actually task123:
CleanShot 2023-05-08 at 13 48 53@2x

So what I'd like to do would be one of these:

ng g c TodoItemTask-123
ng g c TodoItemTask123 --selector app-todo-item-task-123

but both commands get rejected with Selector "app-todo-item-task-123" is invalid:
CleanShot 2023-05-08 at 13 46 29@2x

Describe the solution you'd like

I'd like if ng g c TodoItemTask-123 was allowed and generates files like:

todo-item-task-123.component.ts
              ^ having the dash

Describe alternatives you've considered

Renaming all the files and updating the NgModule by hand afterwards.

@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: schematics/angular labels May 8, 2023
@sumitparakh
Copy link

Hi @alan-agius4. I would like to take this up

@alan-agius4
Copy link
Collaborator

@sumitparakh go for it.

sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue May 20, 2023
sumitparakh added a commit to sumitparakh/angular-cli that referenced this issue May 20, 2023
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue May 22, 2023
Closes angular#25164

fix(@angular/cli): fix regex

fix(@angular/cli): updated test case

fix(@angular/cli): fix "too big tests" error in ci

added a new file to test dash with number case
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue May 22, 2023
Closes angular#25164

fix(@angular/cli): fix regex

fix(@angular/cli): updated test case

fix(@angular/cli): fix "too big tests" error in ci

added a new file to test dash with number case
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue May 24, 2023
Closes angular#25164

fix(@angular/cli): fix regex

fix(@angular/cli): updated test case

fix(@angular/cli): fix "too big tests" error in ci

added a new file to test dash with number case
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue May 24, 2023
This commit updates the validator regexp to allow a dash before a
number.

Closes angular#25164
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue May 24, 2023
This commit updates the validator regexp to allow a dash before a
number.

Closes angular#25164
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue May 30, 2023
This commit updates the validator regexp to allow a dash before a number.

Closes angular#25164
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue Jun 3, 2023
This commit updates the validator regexp to allow a dash before a number.

Closes angular#25164
sumitparakh added a commit to sumitparakh/angular-cli that referenced this issue Jun 3, 2023
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue Jun 3, 2023
This commit updates the validator regexp to allow a dash before a number.

Closes angular#25164
sumitparakh pushed a commit to sumitparakh/angular-cli that referenced this issue Jun 3, 2023
This commit updates the validator regexp to allow a dash before a number.

Closes angular#25164
alan-agius4 pushed a commit that referenced this issue Oct 26, 2023
This commit updates the validator regexp to allow a dash before a number.

Closes #25164
alan-agius4 pushed a commit that referenced this issue Oct 26, 2023
This commit updates the validator regexp to allow a dash before a number.

Closes #25164

(cherry picked from commit c5827d4)
alan-agius4 pushed a commit that referenced this issue Oct 26, 2023
This commit updates the validator regexp to allow a dash before a number.

Closes #25164

(cherry picked from commit c5827d4)
@angular-automatic-lock-bot
Copy link

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 Nov 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants