Update and rebuild spikectl or ctl packages in the monorepo
Invoke when:
packages/spikectl/ or packages/ctl/| Observable | How to Check |
|---|---|
| Source modified | git status packages/{spikectl,ctl}/src/ |
| Binary stale | Compare bin/ mtime vs src/ mtime |
| TypeScript valid | bunx tsc --noEmit |
| Action | Command | From Directory |
|---|---|---|
compile |
bun build --compile --minify src/index.ts --outfile bin/<name> |
packages/<pkg>/ |
build-nix |
nix build '.?dir=packages/tmnl#<pkg>' |
repo root |
test-binary |
./result/bin/<pkg> --version |
repo root |
update-lock |
nix flake update <pkg> |
packages/tmnl/ |
STATE: source_changed β§ Β¬binary_updated
β ACTION: compile
STATE: binary_updated β§ need_nix_build
β ACTION: build-nix
STATE: flake_deps_changed
β ACTION: update-lock β build-nix
STATE: build_complete
β ACTION: test-binary β TERMINATE
| Condition | Exit |
|---|---|
./result/bin/<pkg> --version succeeds |
SUCCESS |
| TypeScript errors | FAIL: fix errors |
| Nix build fails | FAIL: check flake.nix |
| Situation | Guidance |
|---|---|
| Source-only changes | Skip nix flake update - path: inputs evaluate live |
| New dependencies in flake.nix | Must run nix flake update <pkg> |
| Binary size changed significantly | Verify correct bundling |
cd packages/spikectl
bun build --compile --minify src/index.ts --outfile bin/spikectl
cd packages/spikectl
bun build --compile --minify src/index.ts --outfile bin/spikectl
git add bin/spikectl
git commit -m "build(spikectl): v0.x.x"
cd ../..
nix build '.?dir=packages/tmnl#spikectl'
./result/bin/spikectl --version
nix develop '.?dir=packages/tmnl#tmnl-ctl'
# Now spikectl and ctl are in PATH
The tmnl flake uses path: inputs:
spikectl = { url = "path:../spikectl"; }
No hash lock β changes picked up on rebuild.