GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(@schematics/angular): set explicit type for the application root component by nagahara-naoki · Pull Request #34685 · angular/angular-cli

Conversation

@nagahara-naoki

@nagahara-naoki nagahara-naoki commented Nov 11, 2026

Copy link
Copy Markdown

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@nagahara-naoki
fix(@schematics/angular): set explicit type for the application root …
c3f60f9
…component

Pass an empty type for the 2025 application root component so workspace component
defaults cannot produce filenames that differ from the application templates.
Keep the 2016 naming behavior and ordinary component defaults intact.

Add an E2E regression test that builds both naming styles with a workspace type
configured and verifies that separate component generation still uses that type.

Closes angular#34684
@angular-robot angular-robot Bot added the area: @schematics/angular label Nov 11, 2026
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Nov 11, 2026
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Angular application schematic to set componentOptions.type to an empty string when the file name style guide is not '2016'. It also introduces a new end-to-end test to verify application generation behavior across different style guides and ensure workspace defaults are respected. I have no feedback to provide.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area: @schematics/angular

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ng generate application produces a missing stylesheet when a workspace component type is configured

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@nagahara-naoki
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.