feat(cli): add update command for ESEngine packages (#359)

* feat(cli): add update command for ESEngine packages

- Add 'update' command to check and update @esengine/* packages
- Support --check flag to only show available updates without installing
- Support --yes flag to skip confirmation prompt
- Display package update status with current vs latest version comparison
- Preserve version prefix (^ or ~) when updating
- Bump version to 1.4.0

* chore: add changeset for CLI update command

* fix(cli): handle 'latest' tag in update command

- Treat 'latest' and '*' version tags as needing update
- Pin to specific version (^x.x.x) when updating from 'latest'
- Show '(pin version)' hint in update status output

* fix(cli): minimize file system race condition in update command

Re-read package.json immediately before writing to reduce the window
for potential race conditions between reading and writing.

* fix(cli): use atomic file write to avoid race condition

Write to temp file first, then rename for atomic update.
This commit is contained in:
YHH
2025-12-27 10:54:04 +08:00
committed by GitHub
parent c7f8208b6f
commit aed91dbe45
3 changed files with 197 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
---
"@esengine/cli": minor
---
feat(cli): 添加 update 命令用于更新 ESEngine 包
- 新增 `esengine update` 命令检查并更新 @esengine/* 包到最新版本
- 支持 `--check` 参数仅检查可用更新而不安装
- 支持 `--yes` 参数跳过确认提示
- 显示包更新状态,对比当前版本与最新版本
- 更新时保留版本前缀(^ 或 ~