Skip to content

Commit 96a5f7f

Browse files
committed
chore: Migrate project from pnpm to bun for dependency management and scripts
This commit transitions the project from using pnpm to bun for dependency management and script execution. Key changes include updating installation commands, modifying script definitions in package.json, and adjusting documentation to reflect the new setup. The migration aims to streamline the development process and improve performance. Additionally, the removal of pnpm-related files enhances project clarity and maintainability.
1 parent 22d15b0 commit 96a5f7f

37 files changed

+4825
-17269
lines changed

.cursor/rules/deployment.mdc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,19 @@ cast send $CONTRACT_ADDRESS \
107107

108108
```bash
109109
# 1. Deploy to testnet
110-
pnpm deploy:base-sepolia
110+
bun deploy:base-sepolia
111111

112112
# 2. Verify deployment
113-
pnpm verify:deployment
113+
bun verify:deployment
114114

115115
# 3. Seed test data (if needed)
116-
pnpm seed:testnet
116+
bun seed:testnet
117117

118118
# 4. Test frontend integration
119-
pnpm dev:base-sepolia
119+
bun dev:base-sepolia
120120

121121
# 5. Run E2E tests against testnet
122-
pnpm test:e2e:testnet
122+
bun test:e2e:testnet
123123
```
124124

125125
## Deployment Script Pattern
@@ -200,7 +200,7 @@ contract Deploy is Script {
200200
### Vercel Deployment
201201
```bash
202202
# Build and verify locally first
203-
pnpm build
203+
bun build
204204

205205
# Check for build errors
206206
# Verify environment variables in Vercel dashboard

.cursor/rules/root-standards.mdc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ alwaysApply: true
1313
- Web3-native with ethical considerations
1414

1515
## Monorepo Structure
16-
- **pnpm workspaces** for package management
16+
- **bun workspaces** for package management
1717
- **Conventional commits**: `feat:`, `fix:`, `chore:`, `docs:`, `test:`
1818
- **Quality gates**: All PRs require passing build, test, lint, type-check
1919
- **Coverage requirements**: Never decrease below current levels (90%+ for new code)
@@ -22,16 +22,16 @@ alwaysApply: true
2222

2323
```bash
2424
# Full stack development
25-
pnpm dev # Local with fresh Anvil chain
26-
pnpm dev:ethereum # Fork Ethereum mainnet
27-
pnpm dev:base # Fork Base network
25+
bun dev # Local with fresh Anvil chain
26+
bun dev:ethereum # Fork Ethereum mainnet
27+
bun dev:base # Fork Base network
2828

2929
# Testing & quality
30-
pnpm test # All tests across packages
31-
pnpm test:coverage # Coverage report
32-
pnpm lint # Lint all packages
33-
pnpm type-check # Fast TypeScript validation (preferred)
34-
pnpm build # Build all packages
30+
bun test # All tests across packages
31+
bun test:coverage # Coverage report
32+
bun lint # Lint all packages
33+
bun type-check # Fast TypeScript validation (preferred)
34+
bun build # Build all packages
3535
```
3636

3737
## Tech Stack Standards
@@ -74,9 +74,9 @@ pnpm build # Build all packages
7474

7575
### Pre-Commit Requirements
7676
```bash
77-
pnpm type-check # Must pass (no TypeScript errors)
78-
pnpm lint # Must pass (no ESLint errors)
79-
pnpm build # Must complete successfully
77+
bun type-check # Must pass (no TypeScript errors)
78+
bun lint # Must pass (no ESLint errors)
79+
bun build # Must complete successfully
8080
```
8181

8282
### Common Patterns

.cursor/rules/testing-patterns.mdc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,14 @@ export const TEST_CONTRACTS = {
214214
## Testing Commands
215215
```bash
216216
# Unit tests
217-
pnpm test # All tests
218-
pnpm test:watch # Watch mode
219-
pnpm test:coverage # Coverage report
217+
bun test # All tests
218+
bun test:watch # Watch mode
219+
bun test:coverage # Coverage report
220220

221221
# E2E tests
222-
pnpm test:e2e # Full E2E suite
223-
pnpm test:e2e:ui # Visual test runner
224-
pnpm test:e2e:debug # Debug mode
222+
bun test:e2e # Full E2E suite
223+
bun test:e2e:ui # Visual test runner
224+
bun test:e2e:debug # Debug mode
225225

226226
# Contract tests
227227
cd contracts && forge test # All contract tests
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: 'Setup Node.js and pnpm'
2-
description: 'Setup Node.js, pnpm, and install dependencies for Cookie Jar project'
1+
name: 'Setup Node.js and bun'
2+
description: 'Setup Node.js, bun, and install dependencies for Cookie Jar project'
33

44
inputs:
55
node-version:
66
description: 'Node.js version to use'
77
required: false
88
default: '18'
9-
pnpm-version:
10-
description: 'pnpm version to use'
9+
bun-version:
10+
description: 'bun version to use'
1111
required: false
12-
default: '8'
12+
default: '1.0'
1313
working-directory:
1414
description: 'Working directory to run commands'
1515
required: false
@@ -22,13 +22,11 @@ runs:
2222
uses: actions/setup-node@v4
2323
with:
2424
node-version: ${{ inputs.node-version }}
25-
cache: 'npm'
26-
cache-dependency-path: '${{ inputs.working-directory }}/pnpm-lock.yaml'
2725

28-
- name: Setup pnpm
29-
uses: pnpm/action-setup@v3
26+
- name: Setup bun
27+
uses: oven-sh/setup-bun@v2
3028
with:
31-
version: ${{ inputs.pnpm-version }}
29+
bun-version: ${{ inputs.bun-version }}
3230

3331
- name: Install dependencies
3432
shell: bash
@@ -37,8 +35,8 @@ runs:
3735
# Try frozen lockfile first, fallback to regular install in CI
3836
if [ "$CI" = "true" ] || [ "$GITHUB_ACTIONS" = "true" ]; then
3937
echo "🤖 CI environment detected"
40-
pnpm install --no-frozen-lockfile || pnpm install
38+
bun install --no-frozen-lockfile || bun install
4139
else
4240
echo "🔒 Using frozen lockfile for local consistency"
43-
pnpm install --frozen-lockfile
41+
bun install --frozen-lockfile
4442
fi

.github/workflows/accessibility.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
env:
1313
NODE_VERSION: '18'
14-
PNPM_VERSION: '8'
14+
BUN_VERSION: '1.0'
1515

1616
jobs:
1717
accessibility-tests:
@@ -25,11 +25,11 @@ jobs:
2525
with:
2626
submodules: recursive
2727

28-
- name: Setup Node.js and pnpm
28+
- name: Setup Node.js and bun
2929
uses: ./.github/actions/setup-node-pnpm
3030
with:
3131
node-version: ${{ env.NODE_VERSION }}
32-
pnpm-version: ${{ env.PNPM_VERSION }}
32+
bun-version: ${{ env.BUN_VERSION }}
3333

3434
- name: Install Foundry
3535
uses: foundry-rs/foundry-toolchain@v1
@@ -74,7 +74,7 @@ jobs:
7474
7575
# Start client
7676
cd client
77-
pnpm generate
77+
bun run generate
7878
npm run dev &
7979
CLIENT_PID=$!
8080
echo "CLIENT_PID=$CLIENT_PID" >> $GITHUB_ENV

.github/workflows/code-quality.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
NODE_VERSION: '18'
11-
PNPM_VERSION: '8'
11+
BUN_VERSION: '1.0'
1212

1313
jobs:
1414
code-quality:
@@ -20,19 +20,19 @@ jobs:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
2222

23-
- name: Setup Node.js and pnpm
23+
- name: Setup Node.js and bun
2424
uses: ./.github/actions/setup-node-pnpm
2525
with:
2626
node-version: ${{ env.NODE_VERSION }}
27-
pnpm-version: ${{ env.PNPM_VERSION }}
27+
bun-version: ${{ env.BUN_VERSION }}
2828

2929
- name: Lint client code
3030
run: |
3131
cd client
3232
echo "🔍 Running ESLint..."
3333
3434
# Use Next.js lint - allow warnings but fail on errors
35-
if pnpm run lint 2>&1 | tee lint-output.log; then
35+
if bun run lint 2>&1 | tee lint-output.log; then
3636
echo "✅ ESLint completed successfully"
3737
else
3838
# Check if there are actual errors (not just warnings)
@@ -50,20 +50,20 @@ jobs:
5050
- name: TypeScript type checking
5151
run: |
5252
cd client
53-
pnpm run type-check
53+
bun run type-check
5454
5555
- name: Format check
5656
run: |
5757
cd client
5858
echo "🎨 Checking code formatting..."
5959
60-
if pnpm run format:check 2>&1 | tee format-output.log; then
60+
if bun run format:check 2>&1 | tee format-output.log; then
6161
echo "✅ Code formatting is consistent"
6262
else
6363
echo ""
6464
echo "⚠️ Code formatting issues found in some files"
6565
echo "📝 This is not critical, but helps maintain code consistency"
66-
echo "💡 To fix locally: 'pnpm run format' or 'npx prettier --write .'"
66+
echo "💡 To fix locally: 'bun run format' or 'npx prettier --write .'"
6767
echo ""
6868
echo "🔍 Consider setting up Prettier in your IDE for auto-formatting on save"
6969
echo " • VS Code: Install 'Prettier' extension"

.github/workflows/contract-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
version: nightly
3232

33-
# Skip all pnpm/Node.js dependencies - contracts tests don't need them
33+
# Skip all bun/Node.js dependencies - contracts tests don't need them
3434

3535
- name: Build contracts
3636
run: |

.github/workflows/e2e-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
env:
1313
NODE_VERSION: '18'
14-
PNPM_VERSION: '8'
14+
BUN_VERSION: '1.0'
1515

1616
jobs:
1717
e2e-tests:
@@ -25,11 +25,11 @@ jobs:
2525
with:
2626
submodules: recursive
2727

28-
- name: Setup Node.js and pnpm
28+
- name: Setup Node.js and bun
2929
uses: ./.github/actions/setup-node-pnpm
3030
with:
3131
node-version: ${{ env.NODE_VERSION }}
32-
pnpm-version: ${{ env.PNPM_VERSION }}
32+
bun-version: ${{ env.BUN_VERSION }}
3333

3434
- name: Install Foundry
3535
uses: foundry-rs/foundry-toolchain@v1
@@ -86,7 +86,7 @@ jobs:
8686
8787
# Start client dev server
8888
cd client
89-
pnpm generate
89+
bun run generate
9090
npm run dev &
9191
CLIENT_PID=$!
9292
echo "CLIENT_PID=$CLIENT_PID" >> $GITHUB_ENV

.github/workflows/integration-tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
NODE_VERSION: '18'
11-
PNPM_VERSION: '8'
11+
BUN_VERSION: '1.0'
1212

1313
jobs:
1414
integration-tests:
@@ -22,11 +22,11 @@ jobs:
2222
with:
2323
submodules: recursive
2424

25-
- name: Setup Node.js and pnpm
25+
- name: Setup Node.js and bun
2626
uses: ./.github/actions/setup-node-pnpm
2727
with:
2828
node-version: ${{ env.NODE_VERSION }}
29-
pnpm-version: ${{ env.PNPM_VERSION }}
29+
bun-version: ${{ env.BUN_VERSION }}
3030

3131
- name: Install Foundry
3232
uses: foundry-rs/foundry-toolchain@v1
@@ -117,7 +117,7 @@ jobs:
117117
run: |
118118
echo "⚙️ Generating client types..."
119119
cd client
120-
pnpm run generate
120+
bun run generate
121121
122122
if [ $? -ne 0 ]; then
123123
echo "❌ Client type generation failed"
@@ -134,17 +134,17 @@ jobs:
134134
# Check if integration test script exists
135135
if grep -q "test:integration" package.json; then
136136
echo "Running integration test suite..."
137-
pnpm run test:integration
137+
bun run test:integration
138138
else
139139
echo "⚠️ No specific integration test script found"
140140
echo "Running tests that can work with blockchain environment..."
141141
142142
# Run vitest with proper syntax for integration tests
143-
if pnpm run test -- --run --testTimeout 60000 2>/dev/null; then
143+
if bun run test -- --run --testTimeout 60000 2>/dev/null; then
144144
echo "✅ Integration tests completed with vitest"
145145
else
146146
echo "⚠️ Fallback: Running basic unit tests..."
147-
pnpm run test || echo "⚠️ Some tests may have failed due to missing blockchain context"
147+
bun run test || echo "⚠️ Some tests may have failed due to missing blockchain context"
148148
fi
149149
fi
150150

.github/workflows/security-scan.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616

1717
env:
1818
NODE_VERSION: '18'
19-
PNPM_VERSION: '8'
19+
BUN_VERSION: '1.0'
2020

2121
jobs:
2222
codeql-analysis:
@@ -40,11 +40,11 @@ jobs:
4040
# Optional: specify queries for more comprehensive analysis
4141
queries: security-and-quality
4242

43-
- name: Setup Node.js and pnpm for autobuild
43+
- name: Setup Node.js and bun for autobuild
4444
uses: ./.github/actions/setup-node-pnpm
4545
with:
4646
node-version: ${{ env.NODE_VERSION }}
47-
pnpm-version: ${{ env.PNPM_VERSION }}
47+
bun-version: ${{ env.BUN_VERSION }}
4848

4949
- name: Autobuild
5050
uses: github/codeql-action/autobuild@v2
@@ -63,19 +63,19 @@ jobs:
6363
- name: Checkout code
6464
uses: actions/checkout@v4
6565

66-
- name: Setup Node.js and pnpm
66+
- name: Setup Node.js and bun
6767
uses: ./.github/actions/setup-node-pnpm
6868
with:
6969
node-version: ${{ env.NODE_VERSION }}
70-
pnpm-version: ${{ env.PNPM_VERSION }}
70+
bun-version: ${{ env.BUN_VERSION }}
7171

7272
- name: Run dependency audit (Client)
7373
run: |
7474
echo "🔍 Scanning client dependencies for vulnerabilities..."
7575
cd client
7676
77-
echo "📋 Running pnpm audit..."
78-
pnpm audit --audit-level=moderate --json > audit-results.json || true
77+
echo "📋 Running npm audit (bun doesn't have native audit yet)..."
78+
npm audit --audit-level=moderate --json > audit-results.json || true
7979
8080
# Show results in readable format
8181
echo ""
@@ -84,7 +84,7 @@ jobs:
8484
# Check if we have any vulnerabilities
8585
if jq -e '.advisories | length > 0' audit-results.json > /dev/null 2>&1; then
8686
echo "⚠️ Vulnerabilities found!"
87-
pnpm audit --audit-level=moderate
87+
npm audit --audit-level=moderate
8888
else
8989
echo "✅ No vulnerabilities found"
9090
fi
@@ -108,7 +108,7 @@ jobs:
108108
echo ""
109109
echo "❌ Critical or high severity vulnerabilities found!"
110110
echo "💡 Please update dependencies or add exceptions if needed"
111-
echo "📋 Run 'pnpm audit' locally for detailed information"
111+
echo "📋 Run 'npm audit' locally for detailed information (bun audit support coming soon)"
112112
exit 1
113113
}
114114

0 commit comments

Comments
 (0)