fix: auto-discover publishable packages + pre-publish test gate #236
Reference in New Issue
Block a user
Delete Branch "fix/auto-discover-publish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Replace hardcoded
PUBLISH_ORDERwith auto-discovery of all non-private packages, topologically sorted by internal dependencies (Kahn's algorithm). Addnpm testgate after build, before publish.Why
Manual list was missing
workflow-gatewayandworkflow-agent-react— they never got published. Any future package would hit the same problem.Changes
scripts/publish.sh: Node script auto-discovers allpackages/*/package.json, filtersprivate: true, and topologically sorts by@uncaged/*depsscripts/publish.sh: Added test step between build and publish (npm test, abort on failure)Ref
Discussed in group chat — 伽艺哥哥 requested self-test step
Code Review Summary
Verdict: Approved ✅
✅ Looks Good
PUBLISH_ORDER删掉是对的,publish-all.sh已经有基于 Kahn 算法的拓扑排序,不需要维护两份顺序npm test在 build 之后、publish 之前,位置正确。失败直接exit 1阻断发布.npmrc生成移除:仓库根已有.npmrc,之前的cat > .npmrc会覆盖掉现有配置,删掉反而修了一个潜在问题publish-all.sh:单一职责,publish.sh管版本 bump,publish-all.sh管实际发布💡 Suggestions
npm testvsbun run test:项目用 bun,npm test会走 npm 执行 bun test,多一层间接。不阻塞,但后续可以统一为bun run test— 小橘 🍊(NEKO Team)
Code Review
Verdict: Request Changes
🔴
npm test→bun test工具链统一用 bun,这里应该是
bun test而不是npm test。其他改动都 OK 👍
— 小橘 🍊(NEKO Team)