This file applies to the whole argue repository.
This repository is a monorepo with three workspace packages under unified versioning — root package.json holds the canonical version and every package carries the same number:
@onevcat/argue: reusable library (published)@onevcat/argue-cli: CLI host (published)@onevcat/argue-viewer: result viewer web app (private,private: true, never published)
The CLI depends on the library through a real semver dependency in packages/argue-cli/package.json. The viewer also consumes @onevcat/argue through a real semver range so its local build graph matches published reality.
Use normal monorepo development flow for day-to-day work:
npm install
npm run devUseful commands:
npm run check: workspace typechecknpm run test: workspace testsnpm run build: workspace buildnpm run ci:check + test + buildnpm run smoke:pack: tarball install smoke tests for both packagesnpm run release:check:ci + smoke:packnpm run lint: ESLint across reponpm run format:check: Prettier validationnpm run format: format repo
Viewer-only shortcuts (for frontend iteration without rebuilding the library/CLI):
npm run dev:viewer: start the viewer Vite dev servernpm run build:viewer: build the viewer onlynpm run check:viewer: typecheck the viewer onlynpm run test:viewer: run the viewer test suite only
Recommended daily loop:
npm install- make code changes
npm run testnpm run release:checkbefore merging changes that affect packaging, dependency shape, or CLI installability
All workspace packages share one version. Do not bump packages individually — every release bumps root + every packages/*/package.json together and @onevcat/argue-cli / @onevcat/argue-viewer always depend on the exact same @onevcat/argue version.
Workflow for any change that will be released:
- Update code under whichever packages are affected (
packages/argue,packages/argue-cli,packages/argue-viewer) - Run
node scripts/bump-version.mjs X.Y.Z— bumps root and every package, and rewrites internal@onevcat/arguedeps - Run
npm install - Run
npm run release:check
Day-to-day edits that are not yet releasing do not need a version bump — just work on the code.
Do not change the CLI dependency back to local-only references such as:
file:workspace:
@onevcat/argue-cli must always depend on @onevcat/argue through a real semver range so the published tarball remains installable outside this repo.
Reference doc:
docs/release.md
Workflow:
- GitHub Actions:
.github/workflows/ci.ymlruns typecheck + tests + build on every PR and push tomaster..github/workflows/release.ymlpublishes on tag push.
- Triggered on
v*tag push (one tag = one unified release) - Publishes
@onevcat/arguethen@onevcat/argue-cliin a single run @onevcat/argue-viewerstays private and is never published
Pre-flight checklist:
npm install
npm run release:checknpm run smoke:pack validates:
@onevcat/arguecan be packed, installed, and imported in a fresh temp project@onevcat/argue-clican be packed, installed with the packed library, and executeargue --version
If package metadata, dependency wiring, or bin entry changes, run this command.
For this repository, the practical equivalent of /init is:
npm run build # required: builds dist/cli.js
node packages/argue-cli/dist/cli.js config init --localThis creates ./argue.config.json in the repo root when missing.
@onevcat/argue-viewer is deployed to Cloudflare Pages. The build output packages/argue-viewer/dist/ is published as a static site; client-side routes (/example, /report) rely on SPA fallback via packages/argue-viewer/public/_redirects. Do not remove that file, and do not introduce host-specific config for other platforms (Vercel, Netlify, etc.) without updating this section.
- Root
README.mdis the main human-facing documentation. - Published packages (
@onevcat/argue,@onevcat/argue-cli) keep a minimal README that points back to the repo README.@onevcat/argue-vieweris private and intentionally has no README. - Release process details belong in
docs/release.md. - Architecture decision records live under
docs/adr/(numbered, append-only). - Implementation plans for larger features live under
docs/plan/.
The repo uses husky + lint-staged to enforce quality automatically:
- pre-commit:
lint-stagedrunsprettier --write+eslint --fixon staged files (~2.7s) - pre-push: full
check + test + build(~13s)
Run npm install after cloning to activate hooks (husky prepare script).
Before creating a pull request, always run the full local CI pipeline and ensure it passes:
npm run format:check # prettier validation
npm run lint # eslint
npm run ci # typecheck + test + buildThe pre-push hook runs check + test + build automatically, but format:check and lint must also pass. Do not push or open a PR if any command fails.
- Keep
@onevcat/argue-cli --versionderived from package metadata instead of hardcoded strings. - Keep CI validating packaging through
npm run smoke:pack. - If release automation changes, update both
.github/workflows/release.ymlanddocs/release.md.