Skip to content

Commit 874fe04

Browse files
authored
Merge pull request #4 from astrowq/dev/frontend
Migrate to pnpm and update development instructions
2 parents 78708cb + 09eca10 commit 874fe04

File tree

9 files changed

+2067
-3188
lines changed

9 files changed

+2067
-3188
lines changed

.cursor/rules/aperture-project.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ alwaysApply: true
1818

1919
**Commits:** Conventional — `feat:`, `fix:`, `docs:`, `test:`, `refactor:`, `chore:`.
2020

21-
**Run:** `docker compose up -d` (UI :3000, API :8000). Dev: backend `uvicorn app.main:app --reload`, frontend `npm run dev`. Tests: `cd backend && pytest tests/ -v`. Build check: `cd frontend && npm run build`.
21+
**Run:** `docker compose up -d` (UI :3000, API :8000). Dev: backend `uvicorn app.main:app --reload`, frontend `pnpm run dev`. Tests: `cd backend && pytest tests/ -v`. Build check: `cd frontend && pnpm run build`.

.github/workflows/frontend-ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Frontend CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- 'frontend/**'
8+
- '.github/workflows/frontend-ci.yml'
9+
pull_request:
10+
branches: [main, master]
11+
paths:
12+
- 'frontend/**'
13+
- '.github/workflows/frontend-ci.yml'
14+
15+
defaults:
16+
run:
17+
working-directory: frontend
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up pnpm
26+
uses: pnpm/action-setup@v4
27+
with:
28+
version: 10.32.1
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '22'
34+
cache: 'pnpm'
35+
cache-dependency-path: frontend/pnpm-lock.yaml
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Build
41+
run: pnpm run build

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
- **Full stack:** `docker compose up -d` → UI http://localhost:3000, API http://localhost:8000
2525
- **Backend dev:** `cd backend && pip install -r requirements.txt && uvicorn app.main:app --reload`
26-
- **Frontend dev:** `cd frontend && npm install && npm run dev`
26+
- **Frontend dev:** `cd frontend && pnpm install && pnpm run dev`
2727
- **Backend tests:** `cd backend && pytest tests/ -v`
28-
- **Frontend build:** `cd frontend && npm run build`
28+
- **Frontend build:** `cd frontend && pnpm run build`
2929

3030
## Conventions
3131

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Open a GitHub issue with the `enhancement` label. Describe:
2525
2. Create a feature branch: `git checkout -b feature/your-feature-name`
2626
3. Make your changes following the guidelines below
2727
4. Run tests: `cd backend && pytest tests/ -v`
28-
5. Build the frontend: `cd frontend && npm run build`
28+
5. Build the frontend: `cd frontend && pnpm run build`
2929
6. Open a pull request with a clear description of your changes
3030

3131
## Development Setup

DOCS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ API docs available at http://localhost:8000/docs
173173

174174
```bash
175175
cd frontend
176-
npm install
177-
npm run dev
176+
pnpm install
177+
pnpm run dev
178178
```
179179

180180
UI available at http://localhost:5173

frontend/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
FROM node:20-alpine AS builder
22

3+
RUN corepack enable && corepack prepare pnpm@10.32.1 --activate
4+
35
WORKDIR /app
46

5-
COPY package*.json ./
6-
RUN npm ci
7+
COPY package.json pnpm-lock.yaml ./
8+
RUN pnpm install --frozen-lockfile
79

810
COPY . .
9-
RUN npm run build
11+
RUN pnpm run build
1012

1113
FROM nginx:alpine
1214
COPY --from=builder /app/dist /usr/share/nginx/html

0 commit comments

Comments
 (0)