ci: 插件仓校验(P4-15 之三)——契约校验器 + GitHub Actions
- 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)
This commit is contained in:
1 parent
8b4749ba1f
commit
a2ead34483
4 files changed
+114
No files matched your search
@@ -0,0 +1,13 @@
|
||||
name: validate
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- run: node scripts/validate.mjs
|
||||
Reference in new issue
Block a user