Skip to content

Convert from npm to bun#608

Open
MaxGhenis wants to merge 5 commits intomainfrom
convert-to-bun
Open

Convert from npm to bun#608
MaxGhenis wants to merge 5 commits intomainfrom
convert-to-bun

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • Convert the project from npm to bun for faster dependency installation and builds
  • Update all CI workflows to use oven-sh/setup-bun@v2 and bun install --frozen-lockfile
  • Update Makefile and documentation to reference bun commands

Test plan

  • Verify CI passes (lint, typecheck, test, build jobs)
  • Verify local development works with make install && make dev
  • Verify build works with make build

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

- Remove package-lock.json and generate bun.lock
- Update all CI workflows to use oven-sh/setup-bun@v2 and bun commands
- Update Makefile to use bun instead of npm
- Update package.json scripts and packageManager field
- Update README.md and CLAUDE.md documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment Jan 31, 2026 1:01am
policyengine-calculator Ready Ready Preview, Comment Jan 31, 2026 1:01am
policyengine-website Ready Ready Preview, Comment Jan 31, 2026 1:01am

Request Review

React Query now passes additional context parameters (client, meta, mutationKey)
to mutation functions. Updated test assertions to check only the first argument
(the actual payload) instead of exact parameter matching.

Changes:
- Check mock was called, then verify first argument with .mock.calls[0][0]
- This allows tests to pass regardless of additional React Query context

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change installCommand to use bun install --frozen-lockfile
- Change buildCommand to use bun run commands
- Applies to root vercel.json (website) and calculator/vercel.json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update app/package.json scripts to use 'bun run' instead of previous package manager
- Simplify Vercel build commands to cd into app directory and run build scripts directly
- Remove workspace flags that don't work with Bun
- Ensure design-system builds before calculator and website

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Collaborator

@anth-volk anth-volk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm able to install this code, but when attempting to run make dev, I get an endless loop of bun attempting to build the design package file, and the number of times the package invokes the policyengine-app-v2 filter increases each time the loop attempts to build. I'm going to guess there's a circular dependency somewhere in this setup.

The --filter flag must come before the script name in bun run commands.
When placed after (e.g., `bun run dev --filter=pkg`), it's passed as an
argument to the script rather than being interpreted as a workspace filter,
causing infinite recursion.

Fixes the issue where `make dev` would loop endlessly, accumulating
--filter arguments with each iteration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@MaxGhenis
Copy link
Contributor Author

Fixed the infinite loop issue. The problem was the --filter flag position in bun commands.

Root cause: In bun, --filter must come before the script name:

  • bun run dev --filter=pkg — filter passed as argument to script, causes recursion
  • bun run --filter=pkg dev — filter interpreted correctly as workspace filter

The output showed the bug clearly — each iteration accumulated another --filter argument:

bun run dev --filter=policyengine-app-v2
bun run dev --filter=policyengine-app-v2 "--filter=policyengine-app-v2"
bun run dev --filter=policyengine-app-v2 "--filter=policyengine-app-v2" "--filter=policyengine-app-v2"
...

After the fix, make dev starts both servers correctly:

policyengine-app-v2 dev: [website]   VITE v6.4.1  ready in 371 ms
policyengine-app-v2 dev: [website]   ➜  Local:   http://localhost:3000/
policyengine-app-v2 dev: [calc]   VITE v6.4.1  ready in 369 ms
policyengine-app-v2 dev: [calc]   ➜  Local:   http://localhost:3002/

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.

2 participants