Title: fix(@schematics/angular): set explicit type for the application root component by nagahara-naoki · Pull Request #34685 · angular/angular-cli · GitHub
Open Graph Title: fix(@schematics/angular): set explicit type for the application root component by nagahara-naoki · Pull Request #34685 · angular/angular-cli
X Title: fix(@schematics/angular): set explicit type for the application root component by nagahara-naoki · Pull Request #34685 · angular/angular-cli
Description: PR Checklist The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type Bugfix Feature Code style update (formatting, local variables) Refactoring (no functional changes, no api changes) Build related changes CI related changes Documentation content changes Other... Please describe: What is the current behavior? When the workspace sets "@schematics/angular:component": { "type": "component" }, ng generate application --file-name-style-guide=2025 inherits that type for its root component. It generates app.component.css, while the application template generates app.ts referencing ./app.css. The first build fails with NG2008, and extra app.component.* files are left in the application. Issue Number: Closes #34684 What is the new behavior? Pass an explicit empty type when generating the application root component with the 2025 naming style, so the component files match the application templates: app.ts, app.html, and app.css. The 2016 branch continues to pass type: 'component'. Ordinary component generation still uses the workspace default. This follows the approach used in #34450 and #34472. The new E2E test sets the workspace component type, generates and builds applications using both naming styles, checks their stylesheet references and the absence of the incorrectly named root component, and verifies that a separately generated component still uses the workspace type. Does this PR introduce a breaking change? Yes No Other information Validated locally against main at d5035923f0e357b2526c98110125eee04b05192f: Before the fix, the new regression test fails during the generated application's build with NG2008. After the fix, the regression test and the existing schematic-defaults E2E test both pass. The Angular schematics unit suite reports 976 specs, 0 failures, and 1 existing pending spec. Prettier, ESLint on the production file, and git diff --check pass. Commands: pnpm bazel test //tests:e2e_node24 \ --config=e2e --config=no-sharding \ --test_filter='tests/generate/{application/application-workspace-type-default,schematic-defaults}.ts' \ --test_arg=--esbuild --nocache_test_results pnpm bazel test //packages/schematics/angular:test --config=no-sharding The full CLI repository test suite was not run.
Open Graph Description: PR Checklist The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug...
X Description: PR Checklist The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug...
Opengraph URL: https://github.com/angular/angular-cli/pull/34685
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6b9bc447-fd06-ea7f-3323-10994430d312 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 81CA:2E124E:333E150:417E6F8:6B01E473 |
| html-safe-nonce | 9efcffe2eb0fdbe91d526d52ba7e81d3387a448b5dc44e3761ee1f2297d5b4e8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUNBOjJFMTI0RTozMzNFMTUwOjQxN0U2Rjg6NkIwMUU0NzMiLCJ2aXNpdG9yX2lkIjoiNTE2NTI0OTUzMzA3MTk3NTUzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d9ca8b11599c25d24133a4d0369c3dba605311a44d9c41ae6188c456d2a7c462 |
| hovercard-subject-tag | pull_request:5259045846 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular-cli/pull/34685/files |
| twitter:image | https://avatars.githubusercontent.com/u/118710021?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/118710021?s=400&v=4 |
| og:image:alt | PR Checklist The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width