Skip to content

fix: use real package name for global local packages installation#1685

Draft
liangmiQwQ wants to merge 7 commits into
voidzero-dev:mainfrom
liangmiQwQ:fix/check-real-package-json-for-global-install
Draft

fix: use real package name for global local packages installation#1685
liangmiQwQ wants to merge 7 commits into
voidzero-dev:mainfrom
liangmiQwQ:fix/check-real-package-json-for-global-install

Conversation

@liangmiQwQ
Copy link
Copy Markdown
Contributor

Related to #664.

The current Vite+ will just treat the path inputed as the package name, and because Vite+ uses package name to create directories and manage installation, it will make Vite+ broken as it can be a bad path.

This PR fixes it by resolving the true package name by reading the package.json under the entered path.

@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

@codex

@netlify
Copy link
Copy Markdown

netlify Bot commented May 26, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit f1daa27
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a15b34c59a7850008ca8efc

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f017f86dd6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vite_global_cli/src/commands/global/mod.rs Outdated
Comment thread crates/vite_global_cli/src/commands/global/install.rs Outdated
@liangmiQwQ liangmiQwQ marked this pull request as draft May 26, 2026 14:14
@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1daa2779f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +402 to +406
if is_local_package_spec(package_name) {
// We can't resolve local packages for uninstall, follow npm's behavior
return Err(Error::ConfigError(
format!(
"Local path {} can't be resolved, please enter a package name instead",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve uninstall support for legacy local-path package IDs

Rejecting all local-looking specs in uninstall breaks migration for users who already installed globals with older versions that stored ./path (or absolute path) as the package identifier in metadata/bin configs. In that state, reinstalling the same package now reports a binary conflict against the legacy path ID, and even --force cannot recover because conflict cleanup calls uninstall with that path-like ID and immediately errors here, leaving users unable to remove/replace the old install through the CLI.

Useful? React with 👍 / 👎.

Sign up for free to 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.

1 participant