You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(cli): add automatic CLI version selection and temporary execution for ig update - #1891
Enhances ig update with automatic CLI version selection and temporary execution, ensuring updates can run using a newer compatible igniteui-cli without requiring users to manually upgrade their global CLI installation.
When updating packages in React or Web Components projects, the CLI checks whether a newer compatible version is available and temporarily uses it to perform the update.
Key changes:
CLI version selection: Prefers the appropriate project-local CLI and checks npm for a newer compatible version, considering Node.js requirements.
Temporary CLI execution: Installs the selected CLI version in an isolated temporary directory, forwards the original command, and cleans up afterward.
Explicit version requests: Supports selecting the CLI major version through requests such as ig update igniteui-cli@17.
Safe fallback: Continues with the current CLI when version checks fail, including offline or unavailable registry scenarios.
Reliable execution: Preserves exit codes, handles installation failures, and prevents stale npm cache issues.
Analytics: Avoids duplicate analytics events when execution is delegated to a temporary CLI.
The implementation reuses existing npm utilities and preserves the current behavior for Angular, other frameworks, and commands unrelated to ig update.
Type of Change
Bug fix (non-breaking change that fixes an issue)
New feature (non-breaking change that adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The CLI delegates to a local installation without checking its Node.js requirement, risking a startup failure before compatibility checks can preserve the usable invoked CLI.
No open issues 🎉
What changed in this PR
Adds automatic CLI selection and temporary execution to ig update for React and Web Components, extending the update workflow introduced for #1847 without requiring a global CLI upgrade.
Changes:
Selects a project-local or newer registry CLI, including explicit major-version requests.
Installs temporary runners, forwards arguments, preserves exit codes, and cleans up afterward.
Reuses npm helpers and suppresses duplicate analytics during delegated execution.
File
Description
spec/unit/version-update-spec.ts
Tests shared npm command construction and extra arguments.
spec/unit/update-runner-spec.ts
Tests runner selection, installation, execution, and cleanup.
spec/unit/update-command-spec.ts
Tests delegation, fallback, analytics, and framework exclusions.
spec/unit/GoogleAnalytic-spec.ts
Tests environment-based analytics suppression.
spec/unit/execute-spec.ts
Tests version-aware project-local CLI selection.
packages/core/util/GoogleAnalytics.ts
Supports disabling analytics through an environment variable.
packages/core/update/version-update.ts
Exports reusable npm helpers and validates Windows shell arguments.
packages/cli/lib/commands/update.ts
Integrates runner selection before updates and migrations.
packages/cli/lib/commands/update-runner.ts
Implements registry selection and temporary CLI execution.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The temporary CLI receives host process arguments instead of the arguments supplied to exported run(args) calls, potentially launching interactive setup rather than the requested update.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Forward run() arguments to the temporary CLI
packages/cli/lib/commands/update-runner.ts:80
When a newer runner is selected for an exported run(args) call, the temporary CLI receives the host process's arguments instead of the supplied update arguments. For example, run(["update", "igniteui-react", "--dry-run"]) from a script with no command-line arguments launches interactive setup rather than the update. Pass the actual invocation arguments through the update handler to runTemporaryCli instead of reading process.argv here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Related to #1847
Description
Enhances
ig updatewith automatic CLI version selection and temporary execution, ensuring updates can run using a newer compatibleigniteui-cliwithout requiring users to manually upgrade their global CLI installation.When updating packages in React or Web Components projects, the CLI checks whether a newer compatible version is available and temporarily uses it to perform the update.
Key changes:
ig update igniteui-cli@17.The implementation reuses existing npm utilities and preserves the current behavior for Angular, other frameworks, and commands unrelated to
ig update.Type of Change
Affected Packages
igniteui-cli(packages/cli)@igniteui/cli-core(packages/core)@igniteui/angular-templates(packages/igx-templates)@igniteui/angular-schematics(packages/ng-schematics)@igniteui/mcp-server(packages/igniteui-mcp)Checklist
npm run test)npm run build)npm run lint)Additional Context