Conservative OpenAPI 3.0.3 request compatibility analysis
git clone https://github.com/WeiR-h/moonapi-check.git
cd moonapi-check
npm run check
npm test
node scripts/scenarios.mjs
node dist/moonapi-check.js check examples/compatibility-demo/old.openapi.json examples/compatibility-demo/new.openapi.json --format textnode dist/moonapi-check.js check old.json new.json
node dist/moonapi-check.js check old.json new.json --format json
node dist/moonapi-check.js --help
node dist/moonapi-check.js --version| 退出码 | 含义 |
|---|---|
| 0 | 支持的检查完成,未发现破坏 |
| 1 | 支持的检查完成,发现破坏 |
| 2 | 输入无效、执行失败或分析不完整;优先于 1 |
moon add WeiR-h/moonapi_check@0.1.1import {
"WeiR-h/moonapi_check" @check,
}fn main {
let before = "{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Demo\",\"version\":\"1\"},\"paths\":{}}"
let report = @check.check_json(before, before)
println(report.to_text())
println(report.exit_code()) // 0
}| 场景 | 目录 | 预期 |
|---|---|---|
| 发布检查 | compatibility-demo | 3 项破坏,退出 1 |
| 客户端升级评估 | client-upgrade | 0 项破坏,退出 0 |
| 共享组件影响排查 | shared-components | 2 个受影响操作,退出 1 |
npm run check
npm run test:moon
npm run build
npm run test:cli
node scripts/moon.mjs fmt --check
node scripts/check-package.mjs| 目录 | 内容 |
|---|---|
| src/ | MoonBit 分析库、报告、测试、JS 导出桥接 |
| cmd/ | Node 文件与进程入口 |
| tests/ | CLI 与外部行为验证 |
| examples/ | 三个人工场景 |
| scripts/ | 构建、验证、发布包检查 |
| docs/ | 设计、支持矩阵、赛事资料、交付证据 |
Install
Download zipConservative OpenAPI 3.0.3 request compatibility analysis