Skip to content

feat(#6): Detect and support Bun package manager - #48

Merged
admarble merged 1 commit into
mainfrom
feature/6-detect-and-support-bun-package-manager
Jan 10, 2026
Merged

admarble merged 1 commit into
mainfrom
feature/6-detect-and-support-bun-package-manager

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add package manager detection from lockfiles (bun > yarn > pnpm > npm priority)
  • Store detected package manager in manifest
  • Use correct install/run commands for each package manager
  • Expand hook detection patterns for all package managers

Changes

  • src/lib/stacks.ts: Add PackageManager type, PM_CONFIG, detectPackageManager(), getPackageManagerCommands()
  • src/lib/manifest.ts: Add optional packageManager field to Manifest interface
  • src/commands/init.ts: Detect and display PM, pass to manifest creation
  • src/commands/run.ts: Use manifest PM for worktree dependency installation
  • src/commands/update.ts: Use manifest PM for post-update install
  • templates/hooks/post-tool.sh: Support test/build detection for npm, bun, yarn, pnpm

Test plan

  • Unit tests for detectPackageManager() with each lockfile type
  • Unit tests for lockfile priority (bun > yarn > pnpm > npm)
  • Unit tests for getPackageManagerCommands()
  • Unit tests for fallback to npm when only package.json exists
  • All 171 tests passing
  • Build succeeds with no type errors

Closes #6

🤖 Generated with Claude Code

- Add PackageManager type and PM_CONFIG for npm/bun/yarn/pnpm
- Add detectPackageManager() with lockfile-based detection
- Add getPackageManagerCommands() helper for command lookup
- Store packageManager in manifest during init
- Use correct install command in worktree setup (run.ts)
- Use correct install command in update (update.ts)
- Display detected package manager in init output
- Expand test/build failure patterns in hooks for all PMs
- Add comprehensive unit tests for detection and commands

Closes #6

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble
admarble merged commit 343712e into main Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect and support Bun package manager

1 participant