feat: support self-update via pi-web update - #445
Open
Jyleaves wants to merge 6 commits into
Open
Conversation
- use pnpm add -g for pnpm global installs - dispatch update only when it is the first positional argument - check the latest version with the detected package manager instead of npm
- scan for the first semver line in yarn/bun output (yarn appends "Done in ..." noise that the last-line parser mistook for the version) - import getCommandPositionals in the entry script - add entry-point tests that execute bin/pi-web.js directly
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.
中文
本 PR 重新提交 #441,并已修复全部评审意见:pnpm 改用
pnpm add -g;仅当第一个位置参数为update时才触发;版本检查按检测到的包管理器分发。新增
pi-web update命令:检查新版本并自动更新 pi-web,无需手动执行npm install -g @agegr/pi-web。npm install -g、pnpm add -g、yarn global add、bun add -gnpm view/pnpm view/yarn info/bun pm view),与更新共用同一套 registry / 代理 / 超时配置lib/app-update.ts的稳定版语义(预发布版本不触发更新)npm test;并端到端验证了 npm / pnpm / yarn / bun 四种安装方式的更新流程English
This PR resubmits #441 with the review feedback addressed:
pnpm add -gfor pnpm, dispatch only when the first positional argument isupdate, and per-package-manager version checks.Adds a
pi-web updatecommand that checks for a newer release and updates pi-web without runningnpm install -g @agegr/pi-webmanually.npm install -g,pnpm add -g,yarn global add,bun add -gnpm view/pnpm view/yarn info/bun pm view) so the check shares the registry, proxy, and timeout configuration of the updatelib/app-update.ts(prereleases never trigger an update)npm test; the update flow was end-to-end tested for npm, pnpm, yarn, and bun installs