Skip to content

feat!: 索引和校验切到插件契约 v0,撤下旧契约条目 - #58

Merged
xiaoyumuxi merged 1 commit into
mainfrom
feat/contract-v0
Nov 12, 2026
Merged

xiaoyumuxi merged 1 commit into
mainfrom
feat/contract-v0

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Collaborator

改动类型

  • 收录新插件
  • 新增版本
  • 修改插件信息
  • 撤回版本 / 下架插件(请写明原因)
  • 脚本、CI 或文档

撤回原因:插件契约在 Core PR Lithe-IDEA/Lithe-core-rust#17 把所有格式版本归零(索引 schemaVersion 0、清单 schemaVersion 0、pluginAPIVersion 0、能力版本 0)。现有条目都是旧契约(插件 API 1–4)的包,新版桌面端(desktop-v*)装不了,所以整份索引切到 v0 并撤下全部旧条目。各插件按 v0 重新发布后(从 0.0.1 开始)再逐个收录。

改动内容

  • scripts/validate-index.mjs
    • 索引 schemaVersion 必须是 0,否则报 plugin.index.schemaUnsupported。
    • 版本项 pluginAPIVersion 为非负整数,非 0 表示当前宿主不可用而不是无效,与 Core 的索引规则一致。
    • requires 必填且非空,能力 ID 匹配 ^[a-z][A-Za-z0-9]{0,63}$,版本为非负整数。
    • 归档校验(checkManifest)拒绝 schemaVersion 或 pluginAPIVersion 不是 0 的包,错误码为 plugin.schema.unsupported / plugin.api.unsupported。自动追踪逐个 Release 资产调用它,所以旧契约的 Release 不会被收录。
  • scripts/track-releases.mjs:版本项始终写入排好序的 requires,并按 v0 索引校验。
  • scripts/fixtures/{index,invalid-index-entries}.json:换成 Core shared/plugins/contract/v1/fixtures/marketplace 的 v0 副本。scripts/store.test.mjs 按 v0 重写。
  • .github/workflows/validate.yml:schema 改为对照 Core 仓库的 plugin-index.schema.json(固定 SHA-256),不再指向已退役的 lithe-plugin-docs。schema 取不到(404)时改为报错退出。
  • lithe-plugin-index.json:改为 {"schemaVersion": 0, "plugins": []}。README 的插件总览随之重新生成。
  • 文档:README.md、CONTRIBUTING.md、docs/publishing.md、docs/versioning-and-updates.md、docs/maintainers.md 改为指向 Core shared/plugins,写明 v0 规则、requires 字段和预发布手工收录流程。docs/maintainers.md 还记录了这次切换和它对旧版 Lithe 的影响。

影响:旧版 macOS Lithe 会拒绝整份索引,它的插件市场无法再读取 Lithe Store。已装的插件不受影响。

合并顺序:插件仓库的 CI 会克隆 Store main,并导入 checkManifest 检查包。所以这个 PR 要先合,Go、LLDB、Maven 的 v0 PR 才能通过 CI。

插件

  • 插件 ID:—(不收录新插件)
  • 来源仓库:—
  • 版本 / Release 链接:—

自检

  • 我是该插件的作者或维护者(或已获得授权)
  • plugin.json 的 vendor.signatureRequirement 为 "none",ID 不在 dev.lithe.*(索引为空)
  • 已在本地运行 node scripts/validate-index.mjs --verify-archives
  • 插件要运行的程序都已在 plugin.json 中声明,并在仓库 README 中说明(不适用)
  • 没有修改已发布版本的 downloadURL / sha256,没有删除历史版本(撤回除外)

本地验证:node --test scripts/store.test.mjs 52/52 通过;node scripts/validate-index.mjs --verify-archives 通过。

插件契约在 Core PR #17 把所有格式版本归零。Store 整份切到 v0:

- validate-index.mjs:索引 schemaVersion 必须是 0;版本项 pluginAPIVersion 为非负整数,
  requires 必填、非空、能力版本为非负整数;归档校验拒绝 schemaVersion 或
  pluginAPIVersion 不是 0 的包(plugin.schema.unsupported / plugin.api.unsupported)。
- track-releases.mjs:版本项始终写入 requires,按 v0 索引校验。
- fixtures 换成 Core shared/plugins/contract/v1/fixtures/marketplace 的 v0 副本,测试按 v0 重写。
- validate.yml 对照 Core 仓库的 plugin-index.schema.json,不再指向已退役的 lithe-plugin-docs。
- lithe-plugin-index.json 改为 schemaVersion 0,撤下全部旧契约(插件 API 1–4)条目;
  README 总览随之重新生成。
- 文档改指向 Core shared/plugins,并在 maintainers.md 记录这次切换与旧版 Lithe 的影响。

旧版 macOS Lithe 会拒绝整份索引,插件市场不再能读取 Lithe Store。
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