feat: add npm publish readiness (task 0020) #20
Reference in New Issue
Block a user
Delete Branch "task-0020-npm-distribution"
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?
Task:
.claude/tasks/0020-npm-distribution.mdSummary
Publish readiness for the unscoped
gitea-axinpm package.repository(plus conventionalhomepage/bugs) topackage.json; the rest of the metadata (unscoped name, description,type: module, MIT,engines.node >=20, thegitea-axibin, and thedist+skillsfilesallowlist) already shipped.publishConfig(access: public, npmjs registry) and replacesprepublishOnlywithprepack: npm run build, sonpm publishis a genuine single command that always rebuildsdist/first (prepackalso fires onnpm pack).PUBLISHING.md.vitest.packaging.config.ts+test:pack, excluded from the fastnpm test) that packs the real tarball, installs it globally into a throwaway prefix, and drives the installed binary:--help, the dashboard header (against an in-process fixture Gitea), andsetupfinding the bundled skill. Distribution touches no Gitea API, so this stands in for the absent live-Gitea e2e tier.Deviations
package.json/PUBLISHING.mdedits, so its final run observed GREEN and it did not report a clean RED for the metadata/publish facets. The pre-edit tree was genuinely RED for those (norepository,prepack,publishConfig, orPUBLISHING.md); the file-presence and installed-binary facets were already GREEN from task 0018.npm pack --json's array-vs-object shape across npm majors, and uses a promisifiedexecFilefor the dashboard facet so the in-process fixture server isn't deadlocked by a synchronous spawn.Review
Risk
Overall: Low
vitest.config.tsgets a one-line exclude touching existing behavior.Standards (unaddressed)
run/runAsynchelpers (judgement call) — two near-identical wrappers differing only in sync vs. async; kept deliberately because the dashboard facet needs an async spawn to let the in-process fixture server respond while the others don't.ascasts of the packed manifest (judgement call, low severity) — each metadata assertion re-castspackedManifest; left as-is since it's idiomatic and readable for a test.(Addressed and not listed: the parent-env inheritance now carries a comment explaining why this subprocess tier diverges from the CLI-seam harness's env isolation.)
Spec
No findings — full spec fidelity across all four acceptance criteria.