Skip to content

feat(pm): add update command for package dependencies - #238

Merged
fengmk2 merged 1 commit into
mainfrom
pm-update-command
Oct 25, 2025
Merged

feat(pm): add update command for package dependencies#238
fengmk2 merged 1 commit into
mainfrom
pm-update-command

Conversation

@fengmk2

@fengmk2fengmk2 commented Oct 21, 2025

Copy link
Copy Markdown
Member

TL;DR

Add vite update command to update packages across different package managers.

What changed?

  • Added a new update.rs module to handle package updates across pnpm, yarn, and npm
  • Implemented UpdateCommandOptions to configure update behavior with various flags
  • Added command resolution logic for each package manager with appropriate flags
  • Created comprehensive test suite for all package managers and their versions
  • Added snap tests for real-world usage scenarios
  • Included documentation in RFC format

How to test?

Test the new update command with different package managers:

# Basic update
vite update react
# Update to latest version
vite update react --latest
# Update all packages
vite update
# Update in specific workspace
vite update --filter app
# Update recursively in all workspaces
vite update -r
# Update only dev dependencies
vite update -D
# Interactive mode
vite update -i

Why make this change?

This change provides a unified interface for updating packages across different package managers. It simplifies workflows by automatically detecting and using the correct package manager syntax, providing consistent commands regardless of the underlying tool. The implementation handles the differences between pnpm, yarn (v1 and v2+), and npm, making it easier for developers to maintain dependencies without remembering package manager-specific commands.

@fengmk2fengmk2 changed the title feat(pm): support update commandfeat(pm): add update command for package dependenciesOct 21, 2025
@fengmk2Graphite App

fengmk2 commented Oct 21, 2025

Copy link
Copy Markdown
MemberAuthor

@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch from 4d14157 to 0da1898CompareOctober 23, 2025 01:55
@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch 2 times, most recently from a082d7d to 80f4466CompareOctober 23, 2025 03:05
@fengmk2
fengmk2force-pushed the pm-update-command branch 2 times, most recently from 706912f to f54a2f8CompareOctober 23, 2025 05:02
@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch 2 times, most recently from 9c80889 to c7552deCompareOctober 23, 2025 07:32
@fengmk2
fengmk2force-pushed the pm-update-command branch 2 times, most recently from 6660415 to 363eca9CompareOctober 23, 2025 08:01
@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch from c7552de to 419e76dCompareOctober 23, 2025 08:01
@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch from 419e76d to 2d3b5b1CompareOctober 23, 2025 08:16
@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch from 2d3b5b1 to 6ad482cCompareOctober 23, 2025 08:24
@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch from 6ad482c to 5412a3bCompareOctober 23, 2025 08:38
@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch 2 times, most recently from e66535f to 693ceedCompareOctober 23, 2025 11:11
@fengmk2
fengmk2force-pushed the pm-update-command branch 2 times, most recently from 7bef881 to fb52854CompareOctober 23, 2025 11:17
@fengmk2
fengmk2force-pushed the 10-20-feat_pm_support_remove_package branch 2 times, most recently from cba738c to 8a0976eCompareOctober 23, 2025 11:26

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new vite update command (with up alias) to provide a unified interface for updating package dependencies across different package managers (pnpm, yarn, npm). The command automatically detects the package manager and translates update operations to the appropriate syntax with support for various options like --latest, --recursive, workspace filtering, and interactive mode.

Key changes:

  • New update command implementation with comprehensive flag support for all package managers
  • Test utilities for handling unstable output from yarn and pnpm package managers
  • Extensive snap tests covering different scenarios across pnpm, yarn, and npm with workspace configurations

Reviewed Changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 4 comments.

Show a summary per file
FileDescription
rfcs/update-package-command.mdComprehensive RFC documenting the design, implementation, and rationale for the update command
packages/tools/src/utils.tsEnhanced output sanitization to handle yarn completion durations and pnpm request warnings
packages/tools/src/tests/utils.spec.tsAdded tests for new yarn and pnpm output pattern replacements
packages/tools/src/tests/snapshots/utils.spec.ts.snapSnapshots for new test cases validating output replacement patterns
packages/global/snap-tests/command-update-*/steps.jsonTest definitions for update command across different package managers
packages/global/snap-tests/command-update-*/snap.txtExpected output snapshots for update command tests
packages/global/snap-tests/command-update-*/package.jsonPackage configurations for test scenarios
packages/global/snap-tests/cli-helper-message/snap.txtUpdated CLI help to include the new update command
packages/cli/snap-tests/exit-non-zero-on-cmd-not-exists/snap.txtUpdated error message to include update command aliases
packages/cli/binding/src/commands/update.rsCore update command implementation with package manager detection
packages/cli/binding/src/commands/mod.rsModule export for update command
packages/cli/binding/src/cli.rsCLI argument parsing and command execution for update command
crates/vite_package_manager/src/lib.rsModule export for commands
crates/vite_package_manager/src/commands/update.rsPackage manager-specific update command resolution logic with comprehensive tests
crates/vite_package_manager/src/commands/mod.rsModule export for update functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment threadpackages/tools/src/utils.ts
Comment threadpackages/tools/src/utils.ts
Comment threadpackages/tools/src/__tests__/utils.spec.ts Outdated
Comment threadcrates/vite_package_manager/src/commands/update.rs
CopilotAI review requested due to automatic review settings October 24, 2025 03:58

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment threadpackages/tools/src/utils.ts
Comment threadpackages/tools/src/utils.ts
Comment threadpackages/tools/src/utils.ts
Comment threadpackages/cli/binding/src/cli.rs
Comment threadcrates/vite_package_manager/src/commands/update.rs
Comment threadcrates/vite_package_manager/src/commands/update.rs
CopilotAI review requested due to automatic review settings October 24, 2025 05:50

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@fengmk2
fengmk2 changed the base branch from main to graphite-base/238October 24, 2025 09:15
@graphite-app
graphite-appBot changed the base branch from graphite-base/238 to mainOctober 24, 2025 09:16
@graphite-app

graphite-appBot commented Oct 24, 2025

Copy link
Copy Markdown

Merge activity

  • Oct 24, 9:16 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Oct 24, 9:18 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Oct 24, 9:20 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Oct 24, 9:24 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Oct 25, 4:33 AM UTC: @fengmk2 merged this pull request with Graphite.

@fengmk2
fengmk2 changed the base branch from main to graphite-base/238October 24, 2025 09:18
@graphite-app
graphite-appBot changed the base branch from graphite-base/238 to mainOctober 24, 2025 09:18
@fengmk2
fengmk2 changed the base branch from main to graphite-base/238October 24, 2025 09:19
@graphite-app
graphite-appBot changed the base branch from graphite-base/238 to mainOctober 24, 2025 09:20
@fengmk2
fengmk2 changed the base branch from main to graphite-base/238October 24, 2025 09:24
@graphite-app
graphite-appBot changed the base branch from graphite-base/238 to mainOctober 24, 2025 09:24
CopilotAI review requested due to automatic review settings October 24, 2025 15:16

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment threadpackages/tools/src/utils.ts
Comment threadcrates/vite_package_manager/src/commands/update.rs
Comment threadcrates/vite_package_manager/src/commands/update.rs
@fengmk2
fengmk2 merged commit c4088c9 into mainOct 25, 2025
10 checks passed
@fengmk2
fengmk2 deleted the pm-update-command branch October 25, 2025 04:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@fengmk2@wan9chi