Skip to content

fix(@angular/build): preserve entry-point displayName casing and validate paths - #34419

Open
alan-agius4 wants to merge 2 commits into
angular:mainfrom
alan-agius4:fix/library-entry-points-normalization
Open

alan-agius4 wants to merge 2 commits into
angular:mainfrom
alan-agius4:fix/library-entry-points-normalization

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve original casing in NormalizedEntryPoint.displayName so case-sensitive TypeScript paths mappings resolve camelCase secondary entry points while keeping bundleName lowercased.
  • Skip static .d.ts and .d.mts subpath exports in normalizeEntryPoints so they are preserved as non-compiled static exports in package.json#exports.
  • Validate that resolved entry point file paths stay within projectRoot using isSubDirectory.

…ten bundle names

- Preserve original casing in entry point `displayName` so case-sensitive TypeScript `paths` mappings resolve camelCase secondary entry points while keeping `bundleName` lowercased and flattened.
- Skip static `.d.ts` and `.d.mts` subpath exports in `normalizeEntryPoints` so they are preserved as non-compiled static exports in `package.json#exports`.
- Validate that resolved entry point file paths stay within `projectRoot` using `isSubDirectory`.
@alan-agius4
alan-agius4 requested a review from clydin October 20, 2026 09:09
@alan-agius4
alan-agius4 marked this pull request as ready for review October 20, 2026 09:09
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Oct 20, 2026

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

Copy link
Copy Markdown

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 library entry-point normalization process by preserving casing in displayName, ignoring static declaration files (.d.ts and .d.mts) from compilation, and ensuring entry-point file paths do not escape the project root. It also adds corresponding unit tests. A review comment points out a potential issue on Windows systems where path format mismatches between projectRoot and the normalized entryFilePath could cause the subdirectory check to fail, suggesting that projectRoot also be normalized to POSIX format.

@alan-agius4
alan-agius4 requested review from dgp1130 and removed request for clydin October 20, 2026 10:36
@alan-agius4 alan-agius4 changed the title fix(@angular/build): preserve entry-point displayName casing and flatten bundle names fix(@angular/build): preserve entry-point displayName casing and validate paths Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant