fix(npm): add registry fallback + sync package versions#44
Merged
Conversation
added 3 commits
June 19, 2026 16:30
The release workflow updates versions during CI but doesn't commit the changes back. This syncs the local package.json files to match the published npm versions.
Adds a step to the release workflow that commits the updated package.json versions back to the repository after publishing to npm. This prevents version mismatch between local files and published packages.
…user's registry When the user's npm registry (e.g., npmmirror.com) doesn't have the required platform package version due to mirror sync lag, the postinstall now falls back to installing from the official npmjs.org registry. This fixes the issue where users with Chinese mirror registries couldn't install cli-box-skill when new versions were just published.
🔒 门禁检查结果
Rust 测试覆盖率
前端测试覆盖率
✅ 所有检查通过,可以合入
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Users with Chinese npm mirror (
registry.npmmirror.com) cannot installcli-box-skillwhen new versions are published, because the mirror has sync lag. Thenpm installfails withNo matching version foundfor the platform packages (cli-box-darwin-arm64,cli-box-electron-darwin-arm64).Additionally, the local
package.jsonfiles in thepackages/directory were never updated after CI publishing — the release workflow updates versions during npm publish but never commits the changes back to the repository.Solution
1. Postinstall registry fallback (
47b0cff)When the user's configured registry (e.g., npmmirror) doesn't have the required platform package version, the postinstall script now automatically falls back to installing from the official
npmjs.orgregistry.Flow:
2. Sync package.json versions (
7da1a8f)Updated all
packages/*/package.jsonto version0.2.8to match what's published on npm.3. Auto-commit version changes in CI (
2e50ace)Added a step to
.github/workflows/release.ymlthat commits the updatedpackage.jsonversions back to the repository after npm publish, preventing future version drift.Test Plan