Skip to content

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

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:fix/library-entry-points-normalization
Oct 21, 2026
Merged

alan-agius4 merged 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
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 21, 2026
@alan-agius4
alan-agius4 merged commit faca2b0 into angular:main Oct 21, 2026
40 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4
alan-agius4 deleted the fix/library-entry-points-normalization branch October 21, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker 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.

2 participants