Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,18 @@ To test changes locally before publishing to npm:
# 1. Build (Tower stays up during this)
pnpm build

# 2. Pack both tarballs
pnpm --filter @cluesmith/codev-core pack
pnpm --filter @cluesmith/codev pack

# 3. Install globally (Tower stays up)
pnpm local-install

# 3. Restart (only this step needs downtime)
afx tower stop && afx tower start
# 2. Pack, install globally, and restart Tower (one command)
pnpm -w run local-install
```

- `pnpm build` builds core first, then codev (including dashboard)
- `pnpm --filter <package> pack` creates tarballs (run for core and codev separately)
- `pnpm local-install` installs both tarballs in a single `npm install -g` command — separate installs fail because `@cluesmith/codev-core` isn't on the public npm registry
- Install while Tower is running — it doesn't affect the running process
- Do NOT stop Tower before installing — unnecessary downtime
- Do NOT delete the tarballs — keep them for debugging if restart fails
- Do NOT build between stop and start
- `pnpm -w run local-install` runs `scripts/local-install.sh`, which:
- Packs both `@cluesmith/codev-core` and `@cluesmith/codev` tarballs into their package directories
- Globally installs both in one `npm install -g` (separate installs fail because `@cluesmith/codev-core` isn't on the public npm registry)
- Restores the executable bit on `scripts/forge/**/*.sh` (pnpm pack strips it, causing "GitHub CLI unavailable" errors otherwise)
- Restarts Tower so it picks up the new code
- Install runs while Tower is up — only the final restart causes downtime
- Do NOT stop Tower yourself before running the script — the script handles restart at the end
- Do NOT use `npm link` or `pnpm link` — it breaks global installs

### Testing
Expand Down
24 changes: 9 additions & 15 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,18 @@ To test changes locally before publishing to npm:
# 1. Build (Tower stays up during this)
pnpm build

# 2. Pack both tarballs
pnpm --filter @cluesmith/codev-core pack
pnpm --filter @cluesmith/codev pack

# 3. Install globally (Tower stays up)
pnpm local-install

# 3. Restart (only this step needs downtime)
afx tower stop && afx tower start
# 2. Pack, install globally, and restart Tower (one command)
pnpm -w run local-install
```

- `pnpm build` builds core first, then codev (including dashboard)
- `pnpm --filter <package> pack` creates tarballs (run for core and codev separately)
- `pnpm local-install` installs both tarballs in a single `npm install -g` command — separate installs fail because `@cluesmith/codev-core` isn't on the public npm registry
- Install while Tower is running — it doesn't affect the running process
- Do NOT stop Tower before installing — unnecessary downtime
- Do NOT delete the tarballs — keep them for debugging if restart fails
- Do NOT build between stop and start
- `pnpm -w run local-install` runs `scripts/local-install.sh`, which:
- Packs both `@cluesmith/codev-core` and `@cluesmith/codev` tarballs into their package directories
- Globally installs both in one `npm install -g` (separate installs fail because `@cluesmith/codev-core` isn't on the public npm registry)
- Restores the executable bit on `scripts/forge/**/*.sh` (pnpm pack strips it, causing "GitHub CLI unavailable" errors otherwise)
- Restarts Tower so it picks up the new code
- Install runs while Tower is up — only the final restart causes downtime
- Do NOT stop Tower yourself before running the script — the script handles restart at the end
- Do NOT use `npm link` or `pnpm link` — it breaks global installs

### Testing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"scripts": {
"build": "pnpm --filter @cluesmith/codev-core build && pnpm --filter @cluesmith/codev build",
"test": "pnpm --filter @cluesmith/codev test",
"local-install": "npm install -g ./packages/core/cluesmith-codev-core-*.tgz ./packages/codev/cluesmith-codev-*.tgz"
"local-install": "scripts/local-install.sh"
}
}
33 changes: 33 additions & 0 deletions scripts/local-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
# Pack workspace packages into tarballs and install them globally for testing.
# Run from the monorepo root: pnpm -w run local-install

set -e

REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$REPO_ROOT"

# Pack — clear stale tarballs first so the install glob matches exactly one file.
rm -f packages/core/*.tgz packages/codev/*.tgz
pnpm --filter @cluesmith/codev-core pack --pack-destination packages/core
pnpm --filter @cluesmith/codev pack --pack-destination packages/codev

# Uninstall first — `npm install -g` over an existing same-name package
# is sometimes a silent no-op, leaving the previous version installed.
npm uninstall -g @cluesmith/codev @cluesmith/codev-core 2>/dev/null || true

npm install -g \
"$REPO_ROOT/packages/core/cluesmith-codev-core-"*.tgz \
"$REPO_ROOT/packages/codev/cluesmith-codev-"*.tgz

# pnpm pack strips the executable bit from shell scripts in the tarball,
# which causes "GitHub CLI unavailable" errors when overview.ts tries to
# spawn scripts/forge/github/*.sh. Restore +x after install.
chmod -R +x "$(npm root -g)/@cluesmith/codev/scripts/forge"

echo "Installed: $(codev --version)"

# Restart Tower so it picks up the new code.
afx tower stop && afx tower start

echo "Tower restarted — new code is now live."
Loading