Skip to content

fix(cli): remove stale global package shims#1765

Merged
fengmk2 merged 7 commits into
voidzero-dev:mainfrom
liangmiQwQ:codex/fix-global-stale-shims
Jun 5, 2026
Merged

fix(cli): remove stale global package shims#1765
fengmk2 merged 7 commits into
voidzero-dev:mainfrom
liangmiQwQ:codex/fix-global-stale-shims

Conversation

@liangmiQwQ

@liangmiQwQ liangmiQwQ commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The current vp install -g flow backs up and replaces the package installation directory, then writes shims for binaries declared by the newly installed package. If a package update removes a binary from its package.json#bin, the old shim and per-binary config can remain in VP_HOME/bin and VP_HOME/bins. It seems introduced in #524.

This PR removes stale managed binary shims during successful global package reinstall. It compares the package's previous metadata and bin configs against the newly installed bin list, then deletes shims/configs for binaries that the package no longer declares.

This keeps existing behavior where vp install -g does not remove shims before invoking npm; cleanup only happens after the new package has installed and its current binaries have been finalized.

This PR also adds a global snapshot case with two local package fixtures that share the same package name: v1 declares two bins, v2 declares one bin, and the test verifies the removed bin's shim and config are gone after reinstall.

🤖 Generated with Codex

@netlify

netlify Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

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

@liangmiQwQ

Copy link
Copy Markdown
Contributor Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

@liangmiQwQ liangmiQwQ marked this pull request as ready for review June 4, 2026 13:42

@fengmk2 fengmk2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@liangmiQwQ Thanks! 💯

@fengmk2 fengmk2 merged commit 9c06959 into voidzero-dev:main Jun 5, 2026
40 checks passed
@liangmiQwQ liangmiQwQ deleted the codex/fix-global-stale-shims branch June 5, 2026 12:56
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.

2 participants