Skip to content

refactor(@angular/cli): use static import for Module in update command - #34121

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:cleanup-require-cli
Sep 18, 2026
Merged

clydin merged 1 commit into
angular:mainfrom
clydin:cleanup-require-cli

Conversation

@clydin

@clydin clydin commented Sep 18, 2026

Copy link
Copy Markdown
Member

Replace the inline dynamic require('node:module') call with a top-level static import of Module in UpdateCommandModule. Also update the _pathCache check to use the 'in' operator for safer property access and cleaner type narrowing.

Replace the inline dynamic require('node:module') call with a top-level static import of Module in UpdateCommandModule. Also update the _pathCache check to use the 'in' operator for safer property access and cleaner type narrowing.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Sep 18, 2026
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 18, 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 replaces the dynamic require of 'node:module' with a static import of Module and updates the logic to clear Node's module resolution path cache. A review comment identifies a TypeScript compilation error where accessing '_pathCache' on the statically imported Module is not allowed because it is an internal, undocumented property. The reviewer suggests casting Module to a type that explicitly includes the optional '_pathCache' property to resolve the compilation error.

Comment thread packages/angular/cli/src/commands/update/cli.ts
@clydin
clydin requested a review from alan-agius4 September 18, 2026 14:59
@clydin clydin 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 Sep 18, 2026
@clydin
clydin merged commit 1860222 into angular:main Sep 18, 2026
43 checks passed
@clydin

clydin commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

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

@clydin
clydin deleted the cleanup-require-cli branch September 18, 2026 16:02
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/cli 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