Repository navigation
Commit 3aad86e
committed
fix(@schematics/angular): report invalid entry point names with a descriptive error
The entry-point schematic accepts any name that is a valid npm export
subpath, but the final path segment is also used to name the generated
class, selector, and source files. A segment that cannot be used that
way fails deep inside the component schematic with an error about
something the user never provided: `ng generate entry-point 3d` fails
with 'Selector "lib-3d" is invalid.' and `ng generate entry-point
svg~icons` fails with a raw schema validation dump of the internal
component options.
Validate the final path segment up front and report the entry point
name together with the allowed shape. Dots remain supported, as
`classify` removes them when deriving the class name ('testing.v2'
generates the class `TestingV2`); a test now covers that case to keep
it working.1 parent 63a1c6a commit 3aad86e
2 files changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
61 | 75 | | |
62 | 76 | | |
63 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
476 | 509 | | |
477 | 510 | | |
478 | 511 | | |
| |||
0 commit comments