Skip to content

Commit 6611732

Browse files
committed
chore(frontend): migrate workflows to pnpm via corepack
1 parent 36c78d7 commit 6611732

10 files changed

Lines changed: 34 additions & 7390 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ RUN apk add --no-cache \
1616
yaml-dev \
1717
tzdata
1818

19+
RUN if ! command -v corepack >/dev/null 2>&1; then npm install -g corepack; fi \
20+
&& corepack enable \
21+
&& corepack prepare "pnpm@latest" --activate
22+
1923
ARG USER=vscode
2024
ARG UID=1000
2125
ARG GID=1000

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@
5353

5454
.yardoc
5555
frontend/.astro
56+
.pnpm-store

Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ setup: ## Full development setup
1818
fi
1919
@mkdir -p tmp/rack-cache-body tmp/rack-cache-meta
2020
@echo "Setting up frontend..."
21-
@cd frontend && npm install
21+
@cd frontend && CI=1 pnpm install --frozen-lockfile
2222
@echo "Setup complete!"
2323

2424
dev: ## Start development server with live reload
@@ -29,26 +29,26 @@ dev-ruby: ## Start Ruby server only
2929
@bin/dev-ruby
3030

3131
dev-frontend: ## Start frontend dev server only
32-
@cd frontend && npm run dev
32+
@cd frontend && pnpm run dev
3333

3434
test: ## Run all tests (Ruby + Frontend)
3535
bundle exec rspec
36-
@cd frontend && npm run test:ci
36+
@cd frontend && pnpm run test:ci
3737

3838
test-ruby: ## Run Ruby tests only
3939
bundle exec rspec
4040

4141
test-frontend: ## Run frontend tests only
42-
@cd frontend && npm run test:ci
42+
@cd frontend && pnpm run test:ci
4343

4444
test-frontend-unit: ## Run frontend unit tests only
45-
@cd frontend && npm run test:unit
45+
@cd frontend && pnpm run test:unit
4646

4747
test-frontend-contract: ## Run frontend contract tests only
48-
@cd frontend && npm run test:contract
48+
@cd frontend && pnpm run test:contract
4949

5050
test-frontend-e2e: ## Run frontend Playwright smoke tests
51-
@cd frontend && npm run test:e2e
51+
@cd frontend && pnpm run test:e2e
5252

5353
check-frontend: ## Run frontend typecheck, format, and test checks
5454
$(MAKE) lint-js
@@ -69,13 +69,13 @@ lint-ruby: ## Run Ruby linter (RuboCop) - errors when issues found
6969

7070
lint-js: ## Run JavaScript/Frontend linting (TypeScript + ESLint + Stylelint + Prettier) - errors when issues found
7171
@echo "Running TypeScript typecheck..."
72-
@cd frontend && npm run typecheck
72+
@cd frontend && pnpm run typecheck
7373
@echo "Running ESLint..."
74-
@cd frontend && npm run lint
74+
@cd frontend && pnpm run lint
7575
@echo "Running Stylelint..."
76-
@cd frontend && (pnpm dlx stylelint "**/*.css" || npx stylelint "**/*.css")
76+
@cd frontend && pnpm exec stylelint "../public/shared-ui.css" "**/*.css"
7777
@echo "Running Prettier format check..."
78-
@cd frontend && npm run format:check
78+
@cd frontend && pnpm run format:check
7979
@echo "JavaScript linting complete!"
8080

8181
lintfix: lintfix-ruby lintfix-js ## Auto-fix all linting issues (Ruby + Frontend)
@@ -88,9 +88,9 @@ lintfix-ruby: ## Auto-fix Ruby linting issues
8888

8989
lintfix-js: ## Auto-fix JavaScript/Frontend linting issues
9090
@echo "Running ESLint auto-fix..."
91-
@cd frontend && npm run lint:fix
91+
@cd frontend && pnpm run lint:fix
9292
@echo "Running Prettier formatting..."
93-
@cd frontend && npm run format
93+
@cd frontend && pnpm run format
9494
@echo "JavaScript lintfix complete!"
9595

9696
quick-check: ## Fast local checks (Ruby lint/docs + frontend format/typecheck)
@@ -116,10 +116,10 @@ openapi-verify: ## Regenerate OpenAPI and fail if public/openapi.yaml or fronten
116116
$(MAKE) openapi-client-verify
117117

118118
openapi-client: ## Generate frontend OpenAPI client/types from public/openapi.yaml
119-
@cd frontend && npm run openapi:generate
119+
@cd frontend && pnpm run openapi:generate
120120

121121
openapi-client-verify: ## Generate frontend OpenAPI client and fail if generated files are stale
122-
@cd frontend && npm run openapi:verify
122+
@cd frontend && pnpm run openapi:verify
123123

124124
openapi-lint: openapi-lint-redocly openapi-lint-spectral ## Lint public/openapi.yaml with Redocly and Spectral
125125

@@ -138,5 +138,5 @@ clean: ## Clean temporary files
138138

139139
frontend-setup: ## Setup frontend dependencies
140140
@echo "Setting up frontend dependencies..."
141-
@cd frontend && npm install
141+
@cd frontend && CI=1 pnpm install --frozen-lockfile
142142
@echo "Frontend setup complete!"

bin/dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cleanup() {
2828

2929
# Kill frontend dev server and its children
3030
if [ ! -z "$FRONTEND_PID" ]; then
31-
# Kill the npm process and its children
31+
# Kill the frontend package-manager process and its children
3232
pkill -P $FRONTEND_PID 2>/dev/null || true
3333
kill $FRONTEND_PID 2>/dev/null || true
3434
wait $FRONTEND_PID 2>/dev/null || true
@@ -79,7 +79,7 @@ fi
7979

8080
# Start frontend dev server
8181
cd frontend
82-
npm run dev &
82+
pnpm run dev &
8383
FRONTEND_PID=$!
8484

8585
# Verify frontend server started

bin/dev-with-frontend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ echo "Starting frontend dev server with API proxy..."
4949
cd frontend
5050

5151
# Start frontend dev server (it will proxy API calls to Ruby server)
52-
npm run dev &
52+
pnpm run dev &
5353
FRONTEND_PID=$!
5454

5555
# Wait a moment for the frontend server to start

docs/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ Running the app directly on the host is not supported.
4747
| `make yard-verify-public-docs` | Enforce typed YARD docs for public methods in `app/`. |
4848
| `make openapi` | Regenerate `public/openapi.yaml` from request specs. |
4949

50-
### Frontend npm Scripts
50+
### Frontend pnpm Scripts
5151

5252
| Command | Purpose |
5353
| ----------------------- | -------------------------------------------- |
54-
| `npm run dev` | Vite dev server with hot reload (port 4001). |
55-
| `npm run build` | Build static assets into `frontend/dist/`. |
56-
| `npm run lint` | Run ESLint across the frontend workspace. |
57-
| `npm run test:run` | Unit tests (Vitest). |
58-
| `npm run test:contract` | Contract tests with MSW. |
54+
| `pnpm run dev` | Vite dev server with hot reload (port 4001). |
55+
| `pnpm run build` | Build static assets into `frontend/dist/`. |
56+
| `pnpm run lint` | Run ESLint across the frontend workspace. |
57+
| `pnpm run test:run` | Unit tests (Vitest). |
58+
| `pnpm run test:contract`| Contract tests with MSW. |
5959

6060
---
6161

frontend/.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Frontend package files
2-
package-lock.json
2+
pnpm-lock.yaml
33
yarn.lock
44

55
# Generated and transient frontend output

0 commit comments

Comments
 (0)