Skip to content
This repository was archived by the owner on Mar 18, 2026. It is now read-only.

Commit a7a7a33

Browse files
authored
Migrate from pnpm to Bun (#84)
1 parent b0a32a9 commit a7a7a33

7 files changed

Lines changed: 1451 additions & 6414 deletions

File tree

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

CLAUDE.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ This is the FashionUnited Developer Portal - a documentation site built with [As
1010

1111
### Development
1212
```bash
13-
pnpm dev # Start dev server (default: http://localhost:4321)
14-
pnpm start # Alias for pnpm dev
13+
bun dev # Start dev server (default: http://localhost:4321)
14+
bun start # Run production server
1515
```
1616

1717
### Building
1818
```bash
19-
pnpm build # Run type checking and build for production
19+
bun run build # Run type checking and build for production
2020
astro check # Type check without building
2121
```
2222

2323
### Testing
2424
```bash
25-
pnpm test:e2e # Run Playwright E2E tests
25+
bun test:e2e # Run Playwright E2E tests
2626
```
2727

2828
### Preview
2929
```bash
30-
pnpm preview # Preview production build locally
30+
bun run preview # Preview production build locally
3131
```
3232

3333
### Docker
@@ -46,7 +46,7 @@ docker build -t europe-west1-docker.pkg.dev/developers-fashionunited-com/develop
4646
- **Animations**: Framer Motion for interactive elements, astro-vtbot for page transitions
4747
- **Testing**: Playwright for E2E testing
4848
- **Analytics**: Plausible (loaded via Partytown)
49-
- **Deployment**: Google Cloud Run (see cloudbuild.yaml)
49+
- **Deployment**: Google Cloud Run (see Dockerfile)
5050

5151
### Project Structure
5252

@@ -88,8 +88,7 @@ src/
8888

8989
- **Output Mode**: Static site generation with optional Node.js middleware adapter
9090
- **Docker**: Multi-stage build with Sharp support for image optimization
91-
- **Cloud Build**: Automated builds using Google Cloud Build with buildpacks
92-
- **Runtime**: Node.js LTS in Alpine Linux container
91+
- **Runtime**: Bun in Alpine Linux container
9392
- **Port**: 8080 (configured in Dockerfile)
9493

9594
## Key Configuration Files
@@ -98,21 +97,20 @@ src/
9897
- `tailwind.config.mjs`: Tailwind with Starlight plugin, custom blue theme, shadcn/ui setup
9998
- `tsconfig.json`: TypeScript config with `@/*` path alias for `./src/*`
10099
- `playwright.config.ts`: E2E tests run against preview server on port 4321
101-
- `cloudbuild.yaml`: Google Cloud Build configuration for Cloud Run deployment
102-
- `Dockerfile`: Multi-stage Node.js build with vips-dev for Sharp image processing
100+
- `Dockerfile`: Multi-stage Bun build with vips-dev for Sharp image processing
103101

104102
## Package Manager
105103

106-
- **pnpm** is required (enforced via preinstall script)
107-
- Version: 10.13.1 (managed via corepack)
104+
- **Bun** is used as the package manager and JavaScript runtime
105+
- Install dependencies with `bun install`
108106

109107
## Development Environment
110108

111109
This project supports multiple development environments:
112110
- **Nix**: `nix develop` for reproducible environment (see flake.nix)
113111
- **devenv**: Alternative Nix-based development environment
114112
- **Docker**: For containerized builds
115-
- **Standard Node.js**: With pnpm 10.13.1
113+
- **Standard Bun**: Install Bun from https://bun.sh
116114

117115
## Important Patterns
118116

@@ -135,4 +133,4 @@ This project supports multiple development environments:
135133
The primary use case for this site is documenting the FashionUnited GraphQL API:
136134
- Endpoint: `https://fashionunited.com/graphql/`
137135
- Playground: `https://fashionunited.com/graphiql/`
138-
- Marketplace queries support pagination, locales, and brand filtering
136+
- Marketplace queries support pagination, locales, and brand filtering

Dockerfile

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
1-
FROM node:22-alpine AS base
1+
FROM oven/bun:1-alpine AS base
22
WORKDIR /app
33

44
# Install build dependencies and runtime libraries for Sharp
55
RUN apk add --no-cache python3 py3-setuptools make g++ vips-dev vips
66

7-
# Install pnpm globally
8-
RUN corepack enable && corepack prepare pnpm@10.18.1 --activate
9-
107
FROM base AS deps
11-
COPY package.json pnpm-lock.yaml .npmrc ./
12-
RUN pnpm install --frozen-lockfile && \
13-
cd node_modules/sharp && npm install --ignore-scripts=false --foreground-scripts && \
14-
cd /app && \
15-
rm -rf /root/.npm /root/.cache /tmp/*
8+
COPY package.json bun.lock ./
9+
RUN bun install --frozen-lockfile
1610

1711
FROM base AS prod-deps
18-
COPY package.json pnpm-lock.yaml .npmrc ./
19-
RUN pnpm install --prod --frozen-lockfile && \
20-
cd node_modules/sharp && npm install --ignore-scripts=false --foreground-scripts && \
21-
cd /app && \
22-
rm -rf /root/.npm /root/.cache /tmp/* && \
23-
pnpm store prune
12+
COPY package.json bun.lock ./
13+
RUN bun install --frozen-lockfile --production && \
14+
rm -rf /root/.bun/install/cache
2415

2516
FROM deps AS build
2617
COPY . .
27-
RUN pnpm run build
18+
RUN bun run build
2819

29-
FROM node:22-alpine AS runtime
20+
FROM oven/bun:1-alpine AS runtime
3021
WORKDIR /app
3122

3223
# Install only runtime dependencies for Sharp (vips, not vips-dev)
@@ -42,4 +33,4 @@ COPY --from=build /app/package.json ./
4233
ENV HOST=0.0.0.0
4334
ENV PORT=8080
4435
EXPOSE 8080
45-
CMD node ./dist/server/entry.mjs
36+
CMD ["bun", "./dist/server/entry.mjs"]

0 commit comments

Comments
 (0)