-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Regex expression in 1.0.0-beta-24 disallows multiple dashes in project name #3680
Comments
You misunderstood my RegExp; it does not allow to have a substring that is just numbers. Which I think is fair. Your project name contains Your regex is wrong in many other ways, btw:
|
This is my very first attempt at documenting an issue on a project like this...on a minor issue, so that I become familiar with the bug-reporting process and can contribute more effectively in the future. I appreciate the feedback. This is not a show-stopper by any means, just a "bump in the road" on a simple workflow I'd become used to. I'm not a RegEx expert by any means and my attempt at the expression appeared to work in the testing tool I was using, but perhaps isn't a full representation of the naming convention the team is trying to uphold. At a minimum, perhaps a minor tweak of the error message would suffice for any other users that may attempt to use a similar naming convention to mine. Maybe state that only one dash is permitted instead of the plural inferred in the current message. Showing 2 or 3 examples of valid, slightly "complex" names in the error message may improve it as well.
|
Is there a good reason (technical limitation?) to have such a restriction on the project name? |
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version. If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Versions.
Repro steps.
The log given by the failure.
Mention any other details that might be useful.
After installing any new build of angular-cli I always create a default project in a sandbox folder. I use the new build as a base for diffing changes to previous versions and to the app I'm developing. Using beta.24 the regex expression disallows the naming convention I've been able to use without issue up through beta-22.
The project name I tried to use this time:
cli-beta-24-base
Please see line 40 of https://github.com/angular/angular-cli/blob/master/packages/angular-cli/commands/new.ts
The regex expression there shows:
/^[a-zA-Z][.0-9a-zA-Z](-[a-zA-Z][.0-9a-zA-Z])*$/
This appears to have been introduced as part of this fix:
#3478
From my experimentation, it appears that the dash in the capture group might be misplaced. The beta.24 regex only seems to allow one occurrence of the dash within the entire name. By moving the dash to the later character set listed in appears to correct the situation and allow multiple dashes within the project name.
An expression that appears to work properly:
/^[a-zA-Z][.0-9a-zA-Z]([a-zA-Z][-.0-9a-zA-Z])*$/
That's about it. It's a minor issue but perhaps this could be addressed in an upcoming build. Thanks for all of the great work!
The text was updated successfully, but these errors were encountered: