SpecsCLIBun Global Upgrade Symlink Detection
Implementation Notes: Bun Global Upgrade Symlink Detection
Implementation Notes: Bun Global Upgrade Symlink Detection
Summary
Made CLI self-update install-manager detection symlink-aware so Bun global installs can upgrade themselves even when the invoked dp path is only the bin symlink.
Changes
apps/cli/src/core/self-update.tsignores non-path argv entries and resolves the entrypoint withrealpathSync.- Bun detection now recognizes
install/global/node_modules/@punks/clibefore generic npmnode_modulesdetection. apps/cli/src/core/self-update.test.tscovers a temporary Bun-stylebin/dpsymlink.CHANGELOG.md,apps/cli/package.json, andbun.lockmove the next executable release to2.2.3.docs/README.mdanddocs/runbooks/dp-cli-scaffolding.mddocument the symlink-aware upgrade behavior.
Validation Evidence
- RED: isolated
@punks/cli@2.2.1Bun-global repro returnedmanager-not-detected. - RED: worker regression failed before the fix with expected
bun, receivednull. - GREEN:
npm --prefix apps/cli test - GREEN:
npm --prefix apps/cli run check-types - GREEN:
npm --prefix apps/cli run check - GREEN: publish-shaped temp Bun global install of local
2.2.3returnedpackageManager: "bun"fordp upgrade --force --json
Manual Review Checklist
| Check | Result | Evidence |
|---|---|---|
| Bun symlink detection covered | Pass | Focused regression creates the bin/dp symlink. |
| Local dist manager guessing preserved | Pass | Existing local dist test remains green. |
| Generic npm detection preserved | Pass | Existing global path tests remain green. |
| Release metadata ready for publish | Pass | @punks/cli version and changelog are 2.2.3. |
| Backlog mirror | None | No backlog issue was provided for this debt. |