From 142a13db36b7aa5e2df89d5b5b2a2b5ddeca4e44 Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 1 Dec 2026 07:42:33 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=E7=BD=91=E9=A1=B5?= =?UTF-8?q?=E7=89=88=E9=81=97=E7=95=99=EF=BC=88KV=20=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=84=9A=E6=9C=AC=20/=20verify-release=20/?= =?UTF-8?q?=20=E6=97=A7=E5=9F=9F=E5=90=8D=E5=BC=95=E7=94=A8=EF=BC=89?= =?UTF-8?q?=EF=BC=8C=E6=8F=92=E4=BB=B6=E7=BA=AF=E5=87=BD=E6=95=B0=E6=8A=BD?= =?UTF-8?q?=E5=88=B0=20scripts/plugin-integrity.mjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +- docs/reference/plugin-publish.md | 248 ++++-------------- docs/standards/engineering-rulebook.md | 4 +- .../project-engineering-standards.md | 4 +- package.json | 2 - scripts/plugin-integrity.mjs | 42 +++ tests/_plugin-host-probe.spec.js | 2 +- tests/plugin-integrity-test.js | 32 +-- 8 files changed, 97 insertions(+), 247 deletions(-) create mode 100644 scripts/plugin-integrity.mjs diff --git a/README.md b/README.md index 96cb72d..68190bf 100644 --- a/README.md +++ b/README.md @@ -66,12 +66,12 @@ npx serve dist ## 与独立版的关系 -独立版 `image-workbench-app`(Node 服务,本地 data/ 存储)功能保持一致且仍受支持;本 Web 版面向免服务器 / 免运维的部署场景。 +独立版 `image-workbench-app`(Node 服务,本地 data/ 存储)功能保持一致且仍受支持。 + +桌面版**不再提供网页版部署**:`functions/`、`wrangler.toml`、Cloudflare Pages 发布流程与 KV 插件通道均已移除;仓库里的 `npx serve dist` 只用于本地静态预览,不是发布形态。 ## 生产版本确认 -```bash -curl -fsSL https://iwb.maqiart.eu.org/version.json -``` +安装包是唯一发布形态:下载站 ,插件市场 。 -正式域名:`https://iwb.maqiart.eu.org`。稳定回滚标签的**现行语义**(`vX.Y.Z` / `stable-vX.Y.Z` / 移动可变 `stable` / `stable-verified-YYYY-MM-DD`)见 [`docs/standards/architecture-current-state.md`](docs/standards/architecture-current-state.md);历史锚点示例:`stable-v3.1.0-stability3` 等。 +客户端「检查更新」读 `https://download.maqiart.eu.org/updates/latest.json`(macOS)与 `latest-windows.json`(Windows);发布后按 `PUBLISHING.md` 回读 `latest.json` / `latest-windows.json` / 下载页三处一致。稳定回滚标签的**现行语义**(`vX.Y.Z` / `stable-vX.Y.Z` / 移动可变 `stable` / `stable-verified-YYYY-MM-DD`)见 [`docs/standards/architecture-current-state.md`](docs/standards/architecture-current-state.md)。 diff --git a/docs/reference/plugin-publish.md b/docs/reference/plugin-publish.md index 76c9652..cd69333 100644 --- a/docs/reference/plugin-publish.md +++ b/docs/reference/plugin-publish.md @@ -1,222 +1,62 @@ -# 插件发布契约(给插件源码项目的交接说明) +# 插件发布(桌面版) -> 适用对象:在**另一个项目**里写插件、需要发到 Image Workbench Web 线上的人 / agent。 -> 权威实现:`scripts/plugins-publish.mjs`(发布脚本)、`functions/plugins/[[path]].js`(KV 分发)、`src/plugin-host.js` + `app.js:9214`(加载与注册)。 -> 最后核对:2026-11-14(新增 §8 插件节点与自定义节点体) +> 2026-12-01 重写:网页版已停用,Cloudflare Pages / Functions / `PLUGINS` KV 通道一起下线, +> `scripts/plugins-publish.sh`、`scripts/plugins-publish.mjs` 已删除。桌面版插件只走**插件市场**。 ---- +## 两条链路 -## 0. 一句话 - -插件是**一个经典脚本文件**,上传到 Cloudflare KV 的 `plugins/` 下,由同源 `/plugins/index.json` 清单 + SRI 完整性校验驱动加载。**发布只用一条命令,不要手写清单。** - ---- - -## 1. 文件与命名(硬约束) - -| 约束 | 说明 | -|---|---| -| 源文件名 | **必须** `plugin-.js` —— 发布脚本从文件名解析 id,不符合直接报错 | -| id 规则 | `^[a-z][a-z0-9-]{2,31}$`(小写字母开头,3–32 字符,只含 `a-z 0-9 -`) | -| 模块形态 | **必须是经典脚本(IIFE),不能是 ES Module**。宿主用 `document.createElement('script')` 注入,没有 `type="module"`,`import`/`export` 会语法错误 | -| 存储名 | 由脚本生成:`plugin-..js`(内容寻址)。**不要自己造这个名字** | -| 注册 | 必须自我注册:`window.IWBPluginHost.register(manifest, factory)`;`manifest.id` 必须**等于**文件名里的 ``,否则加载后状态是 `not-registered` | -| 样式 | 用 JS 注入 `