Skip to content

refactor(@angular/build): export NormalizedAssetsPattern and avoid mutating input patterns - #34354

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:refactor-normalize-asset-patterns
Oct 15, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:refactor-normalize-asset-patterns

Conversation

@alan-agius4

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

Copy link
Copy Markdown
Collaborator

Export the NormalizedAssetsPattern interface from normalize-asset-patterns.ts, avoid mutating input AssetPatternClass objects in place, and simplify directory detection using statSync(..., { throwIfNoEntry: false }).

Also import normalizeAssetPatterns directly in library/options.ts and add test coverage for asset ignore patterns.

@alan-agius4 alan-agius4 added target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 15, 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 refactors asset pattern normalization by introducing a dedicated NormalizedAssetsPattern interface, simplifying the directory check logic, and cleaning up imports and JSDoc comments. It also streamlines tslib dependency resolution in library package manifests and adds tests for asset ignoring. Feedback highlights that the simplified statSync call with throwIfNoEntry: false could still throw on non-ENOENT errors (like permission issues), and recommends wrapping it in a try-catch block to ensure robustness.

Comment thread packages/angular/build/src/utils/normalize-asset-patterns.ts Outdated
@alan-agius4
alan-agius4 force-pushed the refactor-normalize-asset-patterns branch from 384feda to 792654f Compare October 15, 2026 10:56
@alan-agius4
alan-agius4 requested a review from clydin October 15, 2026 11:24
…tating input patterns

Export the `NormalizedAssetsPattern` interface from `normalize-asset-patterns.ts`, avoid mutating input `AssetPatternClass` objects in place, and simplify directory detection using `statSync(..., { throwIfNoEntry: false })`.

Also import `normalizeAssetPatterns` directly in `library/options.ts` and add test coverage for asset `ignore` patterns.
@alan-agius4
alan-agius4 force-pushed the refactor-normalize-asset-patterns branch from c4616df to 2809844 Compare October 15, 2026 13:27
@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 15, 2026
@alan-agius4
alan-agius4 merged commit c042a66 into angular:main Oct 15, 2026
39 of 40 checks passed
@alan-agius4
alan-agius4 deleted the refactor-normalize-asset-patterns branch October 15, 2026 14:28
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

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

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