Skip to content

Commit 7db3f89

Browse files
committed
Add pnpm
1 parent 8a7cb52 commit 7db3f89

33 files changed

Lines changed: 17759 additions & 38840 deletions

.dockerignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.git
2+
.github
3+
.deepsec
4+
**/node_modules
5+
**/.next
6+
**/dist
7+
**/.turbo
8+
**/.cache
9+
.env
10+
.env.*
11+
npm-debug.log
12+
yarn-debug.log
13+
yarn-error.log
14+
.pnpm-debug.log
15+
.DS_Store

.github/dependabot.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
version: 2
22
updates:
33
- package-ecosystem: "npm"
4-
directory: "/client"
5-
schedule:
6-
interval: "daily"
7-
8-
- package-ecosystem: "npm"
9-
directory: "/server"
4+
directory: "/"
105
schedule:
116
interval: "daily"

.github/workflows/translate-docs.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ jobs:
2525
uses: actions/setup-node@v4
2626
with:
2727
node-version: 20
28+
cache: pnpm
29+
30+
- name: Enable Corepack
31+
run: corepack enable
2832

2933
- name: Install dependencies
30-
run: cd docs && npm ci
34+
run: pnpm install --frozen-lockfile --filter docs-v2...
3135

3236
- name: Extract messages
33-
run: cd docs && node scripts/extract-messages.mjs
37+
run: pnpm --filter docs-v2 extract
3438

3539
- name: Check for untranslated strings
3640
id: changes
@@ -71,12 +75,16 @@ jobs:
7175
uses: actions/setup-node@v4
7276
with:
7377
node-version: 20
78+
cache: pnpm
79+
80+
- name: Enable Corepack
81+
run: corepack enable
7482

7583
- name: Install dependencies
76-
run: cd docs && npm ci
84+
run: pnpm install --frozen-lockfile --filter docs-v2...
7785

7886
- name: Extract messages
79-
run: cd docs && node scripts/extract-messages.mjs
87+
run: pnpm --filter docs-v2 extract
8088

8189
- name: Run Claude Code
8290
uses: anthropics/claude-code-action@v1

.github/workflows/translate.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ jobs:
2525
uses: actions/setup-node@v4
2626
with:
2727
node-version: 20
28+
cache: pnpm
29+
30+
- name: Enable Corepack
31+
run: corepack enable
2832

2933
- name: Install dependencies
30-
run: cd client && npm ci
34+
run: pnpm install --frozen-lockfile --filter client...
3135

3236
- name: Extract messages
33-
run: cd client && node scripts/extract-messages.mjs
37+
run: pnpm --filter client extract
3438

3539
- name: Check for untranslated strings
3640
id: changes
@@ -71,12 +75,16 @@ jobs:
7175
uses: actions/setup-node@v4
7276
with:
7377
node-version: 20
78+
cache: pnpm
79+
80+
- name: Enable Corepack
81+
run: corepack enable
7482

7583
- name: Install dependencies
76-
run: cd client && npm ci
84+
run: pnpm install --frozen-lockfile --filter client...
7785

7886
- name: Extract messages
79-
run: cd client && node scripts/extract-messages.mjs
87+
run: pnpm --filter client extract
8088

8189
- name: Run Claude Code
8290
uses: anthropics/claude-code-action@v1

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
auto-install-peers=true
2+
strict-peer-dependencies=false

client/CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ This file provides guidance to Claude Code when working in the `/client` directo
44

55
## Commands
66

7-
- `npm run dev` – Start dev server (Next.js + Turbopack, port 3002)
8-
- `npm run build` – Production build
9-
- `npm run lint` – ESLint
10-
- `npm run format` – Prettier format
7+
- `pnpm --filter client dev` – Start dev server (Next.js + Turbopack, port 3002)
8+
- `pnpm --filter client build` – Production build
9+
- `pnpm --filter client lint` – ESLint
10+
- `pnpm --filter client format` – Prettier format
1111
- `tsc --noEmit` – Type-check without emitting
1212

1313
## Stack

client/Dockerfile

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
FROM node:20-alpine AS base
2+
ENV PNPM_HOME="/pnpm"
3+
ENV PATH="$PNPM_HOME:$PATH"
4+
RUN corepack enable
25

36
# Install dependencies only when needed
47
FROM base AS deps
58
RUN apk add --no-cache libc6-compat
69
WORKDIR /app
710

8-
# Copy shared package first
9-
COPY shared ./shared
10-
WORKDIR /app/shared
11-
RUN npm install && npm run build
12-
13-
# Install client dependencies
14-
WORKDIR /app/client
15-
COPY client/package.json client/package-lock.json* ./
16-
RUN npm ci --legacy-peer-deps
11+
# Install workspace dependencies
12+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
13+
COPY client/package.json ./client/package.json
14+
COPY server/package.json ./server/package.json
15+
COPY docs/package.json ./docs/package.json
16+
COPY monitor-agent/package.json ./monitor-agent/package.json
17+
COPY shared/package.json ./shared/package.json
18+
RUN pnpm install --frozen-lockfile --filter client... --filter @rybbit/shared
1719

1820
# Rebuild the source code only when needed
1921
FROM base AS builder
2022
WORKDIR /app
21-
COPY --from=deps /app/shared ./shared
22-
COPY --from=deps /app/client/node_modules ./client/node_modules
23+
COPY --from=deps /app ./
24+
COPY shared/ ./shared
2325
COPY client/ ./client
2426

2527
# Next.js collects completely anonymous telemetry data about general usage.
@@ -37,7 +39,8 @@ ENV NEXT_PUBLIC_TURNSTILE_SITE_KEY=${NEXT_PUBLIC_TURNSTILE_SITE_KEY}
3739
ENV NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=${NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY}
3840

3941
WORKDIR /app/client
40-
RUN npm run build
42+
RUN pnpm --filter @rybbit/shared build
43+
RUN pnpm --filter client build
4144

4245
# Production image, copy all the files and run next
4346
FROM base AS runner
@@ -49,16 +52,16 @@ ENV NEXT_TELEMETRY_DISABLED=1
4952
RUN addgroup --system --gid 1001 nodejs
5053
RUN adduser --system --uid 1001 nextjs
5154

52-
COPY --from=builder /app/client/public ./public
55+
COPY --from=builder /app/client/public ./client/public
5356

5457
# Set the correct permission for prerender cache
55-
RUN mkdir .next
56-
RUN chown nextjs:nodejs .next
58+
RUN mkdir -p client/.next
59+
RUN chown nextjs:nodejs client/.next
5760

5861
# Automatically leverage output traces to reduce image size
5962
# https://nextjs.org/docs/advanced-features/output-file-tracing
6063
COPY --from=builder --chown=nextjs:nodejs /app/client/.next/standalone ./
61-
COPY --from=builder --chown=nextjs:nodejs /app/client/.next/static ./.next/static
64+
COPY --from=builder --chown=nextjs:nodejs /app/client/.next/static ./client/.next/static
6265

6366
USER nextjs
6467

@@ -67,4 +70,4 @@ EXPOSE 3002
6770
ENV PORT=3002
6871
ENV HOSTNAME="0.0.0.0"
6972

70-
CMD ["node", "server.js"]
73+
CMD ["node", "client/server.js"]

client/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-
55
First, run the development server:
66

77
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
8+
pnpm --filter client dev
159
```
1610

1711
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

client/next.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { NextConfig } from "next";
22
import createNextIntlPlugin from "next-intl/plugin";
3+
import path from "node:path";
34

45
const withNextIntl = createNextIntlPlugin({
56
experimental: {
@@ -15,6 +16,7 @@ const withNextIntl = createNextIntlPlugin({
1516

1617
const nextConfig: NextConfig = {
1718
output: "standalone",
19+
outputFileTracingRoot: path.join(process.cwd(), ".."),
1820
env: {
1921
NEXT_PUBLIC_BACKEND_URL: process.env.NEXT_PUBLIC_BACKEND_URL,
2022
NEXT_PUBLIC_DISABLE_SIGNUP: process.env.NEXT_PUBLIC_DISABLE_SIGNUP,

0 commit comments

Comments
 (0)