-
Notifications
You must be signed in to change notification settings - Fork 12k
Naming restriction for new projects is more restrictive than error indicates #3816
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
Comments
@judepoole thanks for creating this issue. You are right, the error message is not detailed enough, I've added a patch to address this. |
Can somebody explain, what is the reason of this restriction? |
@zsfarkas as far as I understand the main reason for this is that there are class names that are derived from the project name, and class names must start with So if you would create an app with |
@beeman Thank you. I think there is no generated class with the project name. Instead of, the selector of the root component is generated by the project name. And html tags like <1-two></1-two> are not allowed. It is kind of sad, but reasonable. |
@zsfarkas you are right, it's the selector, not a class. That selector is (afaik) only controlled by the Because when you run |
@beeman Thank you. It must be a small change. May I try to solve that? Is there a guide, how to contribute? |
I'm adding this for future reference for anyone running into this problem. I read in a guide i should use Btw, the error message is not very clear still, it points at the wrong invalid charcher.
A few more examples:
These do work correctly:
These last 2 made me realize my mistake :) Also, to find out where the name fails, you could use this regex: |
We have an existing scope that's |
@chrillewoodz I'm not sure, but i think the issue is that identifiers in JavaScript (and thus TypeScript) can't start with an integer. What I would try is generated it with a dummy name and then run a search/replace on my codebase to rename the dummy name to the desired name, and see where it breaks. |
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?
Ubuntu Linux
Versions.
angular-cli: 1.0.0-beta.24
node: 6.6.0
os: linux x64
Repro steps.
try to create a app named alpha-bravo-2
The log given by the failure.
project name "alpha-bravo-2" is not valid. New project names must start with a letter, and must contain only alphanumeric characters or dashes.
Mention any other details that might be useful.
Regular expression checking name of project is more restrictive than the error message indicates. It actually requires than any part of the name following a dash (-) must itself start with an alpha character, not just the initial character for the whole name.
The text was updated successfully, but these errors were encountered: