Angular-cli: `ng new game-2d` fails

Created on 12 Mar 2019  ·  6Comments  ·  Source: angular/angular-cli

🐞 Bug report

Command (mark with an x)

- [x ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

?

Description

Apparently can't create a new project with a hyphen in the name.

leege@studio MINGW64 /l/src/game-2d
$ npm install -g @angular/cli
C:\Users\leege\AppData\Roaming\npm\ng -> C:\Users\leege\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\@angular\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @angular/[email protected]
added 110 packages from 91 contributors, removed 61 packages and updated 27 packages in 17.326s

leege@studio MINGW64 /l/src/game-2d
$

leege@studio MINGW64 /l/src/game-2d
$ ng new game-2d
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS    (.css )
Schematic input does not validate against the Schema: {"name":"game-2d","version":"7.3.5","routing":true,"style":"css"}
Errors:

  Data path ".name" should match format "html-selector".

leege@studio MINGW64 /l/src/game-2d
$ ng new game2d
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS    (.css )
CREATE game2d/angular.json (3807 bytes)
CREATE game2d/package.json (1305 bytes)
CREATE game2d/README.md (1023 bytes)...
...etc...

🔬 Minimal Reproduction

ng new game-2d

🔥 Exception or Error

As above:


Schematic input does not validate against the Schema: {"name":"game-2d","version":"7.3.5","routing":true,"style":"css"}
Errors:

  Data path ".name" should match format "html-selector".

🌍 Your Environment


Angular CLI: 7.3.5
Node: 11.9.0
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.13.5
@angular-devkit/core         7.3.5
@angular-devkit/schematics   7.3.5
@schematics/angular          7.3.5
@schematics/update           0.13.5
rxjs                         6.3.3
typescript                   3.2.4
devkischematics low broken bufix

All 6 comments

Hi, the issue here is the number as html selectors should not contain digits.

Seeing specs here: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name

Perhaps I misreading but the spec to which you point reads as below, where
PCENChar can contain any character in the range [0-9]:

name must match the PotentialCustomElementName
https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname
production:
PotentialCustomElementName ::=[a-z] (PCENChar
https://html.spec.whatwg.org/multipage/custom-elements.html#prod-pcenchar)*
'-' (PCENChar
https://html.spec.whatwg.org/multipage/custom-elements.html#prod-pcenchar
)*PCENChar ::="-" | "." | [0-9] | "_" | [a-z] | #xB7 | [#xC0-#xD6] |
[#xD8-#xF6] | [#xF8-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] |
[#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] |
[#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]

On Tue, 12 Mar 2019 at 08:49, Alan Agius notifications@github.com wrote:

Closed #13885 https://github.com/angular/angular-cli/issues/13885.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular-cli/issues/13885#event-2196259323,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAfTMAJYj26-RBEgiueKCNIblXlqZsUjks5vV1wHgaJpZM4bqPB7
.

Should I create a new issue with reference to the specs, or have I misunderstood?

Re-opened as your clarification seems corrent.

Thank you.

Hi again, actually, this was fixed in this https://github.com/angular/angular-cli/pull/13837

See this spec https://github.com/angular/angular-cli/pull/13837/files#diff-867e0bcfb9109ac41d6c72f11fc039a0R46

This will be available in the next beta (v8.0.0-beta.6).

Thanks

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JanStureNielsen picture JanStureNielsen  ·  3Comments

jmurphzyo picture jmurphzyo  ·  3Comments

IngvarKofoed picture IngvarKofoed  ·  3Comments

sysmat picture sysmat  ·  3Comments

rajjejosefsson picture rajjejosefsson  ·  3Comments