Skip to content

feat: check and sync strict_max_version in manifest.json#178

Open
northword wants to merge 1 commit intomainfrom
strict-max-version
Open

feat: check and sync strict_max_version in manifest.json#178
northword wants to merge 1 commit intomainfrom
strict-max-version

Conversation

@northword
Copy link
Copy Markdown
Member

概述

实现自动检查 Zotero 版本并同步 manifest.json 中的 strict_max_version 字段。

修复 #177

功能特性

  • ✅ 从 Zotero 官方 API 获取最新版本(beta 和 release 通道)
  • ✅ 实现 3 天有效期的版本缓存机制
  • ✅ 自动填充缺失的 strict_max_version(使用最新 beta 主版本号 + 1)
  • ✅ 当 strict_max_version 过时时发出警告
  • ✅ 新增 CLI 命令:manifest:update-max-version [path]
  • ✅ 构建过程中自动检查版本

核心变更

  1. src/utils/zotero-version.ts - 新增版本获取工具

    • getZoteroVersionInfo() - 从 API 获取版本信息并缓存
    • parseMajorVersion() - 提取主版本号
    • compareVersions() - 语义版本比较
  2. src/core/manifest-command.ts - 新增 CLI 命令类

    • updateMaxVersion() - 更新 manifest.json 中的 strict_max_version
  3. src/core/builder/manifest.ts - 集成版本检查

    • 构建时自动检查和更新 strict_max_version
  4. src/cli.ts - 注册新命令

    • 添加 manifest:update-max-version [path] 命令
  5. src/utils/zotero-version.test.ts - 单元测试

    • 10 个测试用例,全部通过

API 端点

缓存位置

  • ~/.scaffold/cache/zotero-version.json - 版本信息缓存

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 17, 2026

npm i https://pkg.pr.new/zotero-plugin-scaffold@178

commit: 597f429

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