- scripts/validate.mjs:逐个插件校验
· package.json 的 ibwPlugin(id 须 ^[a-z][a-z0-9-]{2,31}$、apiVersion 正整数、entry 存在)
· entry 语法(node --check)+ 必须调用 IWBPluginHost.register(
· entry 内 manifest 与契约一致(id / apiVersion 对齐、name/version/capabilities 齐备)
· 仓库内 id 不得重复
只读源码、不构建 ⇒ CI 无需网络或依赖
- .github/workflows/ci.yml:push / PR 跑 node scripts/validate.mjs
- package.json(根,private):npm run validate
- README:补「校验(本地 + CI)」段
本地验证:node scripts/validate.mjs → 2/2 通过(template-demo / xianyi-cutout)
10 lines
216 B
JSON
10 lines
216 B
JSON
{
|
|
"name": "@iwb-plugin/workspace",
|
|
"private": true,
|
|
"version": "1.0.0",
|
|
"description": "IWB 插件仓:只写插件,不复制宿主契约",
|
|
"scripts": {
|
|
"validate": "node scripts/validate.mjs"
|
|
}
|
|
}
|