Repository navigation
fix(@schematics/angular): set explicit type for the app-shell component - #34450
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Angular app-shell schematic to explicitly set the component type option to an empty string (type: ''). This prevents the generated app-shell component from inheriting a custom component type from the workspace defaults, which would otherwise alter the file and class names and break the expected AppShell import. Additionally, a unit test has been added to verify this behavior by emulating workspace defaults. There are no review comments to address, and the changes look solid.
7ece3b8 to
c7f3fce
Compare
alan-agius4
left a comment
There was a problem hiding this comment.
Thanks for the contribution! Left a comment regarding the test in packages/schematics/angular/app-shell/index_spec.ts.
d35e8c2 to
9ca3acf
Compare
`ng generate app-shell` adds an `AppShell` import from `./app-shell/app-shell`, but the component it
generates inherits the workspace `type` option. In workspaces that set
`"@schematics/angular:component": { "type": "component" }`, such as those updated to v20, the
component was generated as `app-shell.component.ts` and the import failed to resolve.
Pass an empty `type`, as the library schematic does (661609e).
Refs angular#34449
9ca3acf to
ffdecff
Compare
|
@MeAkib looks like the last commit was co-authored without a CLA. |
ffdecff to
e15fff0
Compare
Fixed |
ng generate app-shelladds anAppShellimport from./app-shell/app-shell, but the component it generates inherits the workspacetypeoption. In workspaces that set"@schematics/angular:component": { "type": "component" }, such as those updated to v20, the component was generated asapp-shell.component.tsand the import failed to resolve.Pass an empty
type, as the library schematic does (661609e).Closes #34449