Make pi-loop an installable CLI (Phase 1) #26

Merged
david merged 1 commit from issue-25/installable-cli into main 2026-07-27 02:50:30 +00:00
Owner

Summary

Phase 1 of making pi-loop an installable CLI (maintainer-only local install).
pi-loop now compiles to dist/ and installs as a global pi-loop command,
mirroring how pi itself is packaged. Publishing to Verdaccio is deferred to
Phase 2.

Closes #25.

Changes

  • M1 — Emit compiled JS: added tsconfig.build.json (outDir: dist,
    NodeNext module/resolution, excludes *.test.ts); build now runs
    tsc -p tsconfig.build.json; added a typecheck script (tsc --noEmit).
  • M2 — Entrypoint: bindist/cli.js; shebang changed from
    #!/usr/bin/env -S npx tsx to #!/usr/bin/env node; build marks
    dist/cli.js executable via shx chmod +x (added shx devDep + clean).
  • M3 — Package hygiene: files allowlist (dist, README.md) and a
    prepare build hook; npm pack --dry-run ships only dist/ + README.md.
  • M4 — Local install: added install:local (build && npm i -g .); the
    tsx/npm start dev workflow is preserved.
  • M5 — README: global Install + reinstall-to-update, a Development section
    with a scripts table, updated Prerequisites (Node >= 22.19.0), a Roadmap
    (Phase 2 Verdaccio), and Usage now shows pi-loop <ISSUE-REF>.
  • Help text (HELP_TEXT) updated to document pi-loop <ISSUE-REF> /
    pi-loop --help instead of npm start (with a new unit test).

Testing

  • npm run build emits dist/ (with executable dist/cli.js)
  • npm i -g . succeeds; installed pi-loop runs from an unrelated repo
    (no tsx/npx)
  • npm pack --dry-run excludes src/ and .pi-loop/ (ships dist/ +
    README.md only)
  • npm run typecheck, npm run lint, npm test (613 tests) all green
  • Full end-to-end run of the installed pi-loop producing a Draft MR
    (manual acceptance — requires live creds + LLM)

Checklist

  • Self-reviewed the diff
  • Code follows project conventions
  • Descriptive naming (no single-character variables)
  • Documentation updated (README)
## Summary Phase 1 of making pi-loop an installable CLI (maintainer-only local install). pi-loop now compiles to `dist/` and installs as a global `pi-loop` command, mirroring how pi itself is packaged. Publishing to Verdaccio is deferred to Phase 2. Closes #25. ## Changes - **M1 — Emit compiled JS:** added `tsconfig.build.json` (`outDir: dist`, `NodeNext` module/resolution, excludes `*.test.ts`); `build` now runs `tsc -p tsconfig.build.json`; added a `typecheck` script (`tsc --noEmit`). - **M2 — Entrypoint:** `bin` → `dist/cli.js`; shebang changed from `#!/usr/bin/env -S npx tsx` to `#!/usr/bin/env node`; build marks `dist/cli.js` executable via `shx chmod +x` (added `shx` devDep + `clean`). - **M3 — Package hygiene:** `files` allowlist (`dist`, `README.md`) and a `prepare` build hook; `npm pack --dry-run` ships only `dist/` + `README.md`. - **M4 — Local install:** added `install:local` (`build && npm i -g .`); the `tsx`/`npm start` dev workflow is preserved. - **M5 — README:** global Install + reinstall-to-update, a Development section with a scripts table, updated Prerequisites (Node >= 22.19.0), a Roadmap (Phase 2 Verdaccio), and Usage now shows `pi-loop <ISSUE-REF>`. - Help text (`HELP_TEXT`) updated to document `pi-loop <ISSUE-REF>` / `pi-loop --help` instead of `npm start` (with a new unit test). ## Testing - [x] `npm run build` emits `dist/` (with executable `dist/cli.js`) - [x] `npm i -g .` succeeds; installed `pi-loop` runs from an unrelated repo (no `tsx`/`npx`) - [x] `npm pack --dry-run` excludes `src/` and `.pi-loop/` (ships `dist/` + `README.md` only) - [x] `npm run typecheck`, `npm run lint`, `npm test` (613 tests) all green - [ ] Full end-to-end run of the installed `pi-loop` producing a Draft MR (manual acceptance — requires live creds + LLM) ## Checklist - [x] Self-reviewed the diff - [x] Code follows project conventions - [x] Descriptive naming (no single-character variables) - [x] Documentation updated (README)
Phase 1 maintainer-only local install: pi-loop now builds to dist/ and
installs as a global `pi-loop` command, mirroring how pi is packaged.

- M1: add tsconfig.build.json (emit dist/, NodeNext resolution, exclude
  tests); build = 'tsc -p tsconfig.build.json'; add typecheck script.
- M2: bin -> dist/cli.js; shebang -> '#!/usr/bin/env node'; add shx and
  chmod +x dist/cli.js in build; add clean script.
- M3: files allowlist [dist, README.md]; prepare build hook; npm pack
  ships only dist/ + README (no src/, no .pi-loop/, no test files).
- M4: add install:local (build + npm i -g .); tsx/npm start dev flow kept.
- M5: README — global Install + reinstall-to-update, Development section,
  Prerequisites (Node >=22.19.0), Roadmap (Phase 2 Verdaccio), Usage.
- Help text now documents 'pi-loop <ISSUE-REF>' instead of 'npm start'.

Verified: npm run build emits dist/; npm i -g . installs a working global
binary that runs from an unrelated repo; npm pack --dry-run excludes src/
and .pi-loop/. typecheck, lint, and 613 unit tests green.
david merged commit 936749be7c into main 2026-07-27 02:50:30 +00:00
david deleted branch issue-25/installable-cli 2026-07-27 02:50:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-loop!26
No description provided.