| Human Note | RAPID is leaving package-lock.jsons around in my bun project |
| Version | 6.0.0 |
| Skill | start-set (worktree creation) |
Bug Description
detectPackageManager() in src/lib/worktree.cjs (line 70-76) checks for pnpm-lock.yaml, yarn.lock, and package-lock.json, but does not check for bun.lock or bun.lockb. When a Bun project has no matching lock file, it falls through to the package.json-only case and runs npm install, which creates a spurious package-lock.json in every worktree.
// Current detection order (line 70-76):
function detectPackageManager(dir) {
if (fs.existsSync(path.join(dir, 'pnpm-lock.yaml'))) return { manager: 'pnpm', command: 'pnpm install' };
if (fs.existsSync(path.join(dir, 'yarn.lock'))) return { manager: 'yarn', command: 'yarn install' };
if (fs.existsSync(path.join(dir, 'package-lock.json'))) return { manager: 'npm', command: 'npm ci' };
if (fs.existsSync(path.join(dir, 'package.json'))) return { manager: 'npm', command: 'npm install' };
return { manager: null, command: null };
}
Steps to Reproduce
- Create a Bun monorepo project with
bun.lock (no package-lock.json, no yarn.lock, no pnpm-lock.yaml)
- Run
/rapid:start-set to create a worktree
- Observe
package-lock.json appearing in the worktree
Root Cause / Suggested Fix
Add Bun detection before the npm fallback:
if (fs.existsSync(path.join(dir, 'bun.lock')) || fs.existsSync(path.join(dir, 'bun.lockb')))
return { manager: 'bun', command: 'bun install' };
Could also check the packageManager field in package.json as a secondary signal (e.g., "packageManager": "bun@1.3.11").
Workaround
Manually delete package-lock.json from each worktree after creation, or add package-lock.json to .gitignore.
Related Issues
None found.
Co-Authored-By: Claude Opus 4.6
Bug Description
detectPackageManager()insrc/lib/worktree.cjs(line 70-76) checks forpnpm-lock.yaml,yarn.lock, andpackage-lock.json, but does not check forbun.lockorbun.lockb. When a Bun project has no matching lock file, it falls through to thepackage.json-only case and runsnpm install, which creates a spuriouspackage-lock.jsonin every worktree.Steps to Reproduce
bun.lock(nopackage-lock.json, noyarn.lock, nopnpm-lock.yaml)/rapid:start-setto create a worktreepackage-lock.jsonappearing in the worktreeRoot Cause / Suggested Fix
Add Bun detection before the npm fallback:
Could also check the
packageManagerfield inpackage.jsonas a secondary signal (e.g.,"packageManager": "bun@1.3.11").Workaround
Manually delete
package-lock.jsonfrom each worktree after creation, or addpackage-lock.jsonto.gitignore.Related Issues
None found.
Co-Authored-By: Claude Opus 4.6