Skip to content

Commit 4071cbc

Browse files
authored
chore: migrate from pnpm workspace to individual npm package management (#475)
1 parent fcf1f2a commit 4071cbc

12 files changed

Lines changed: 8571 additions & 13134 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2626
with:
2727
ref: ${{ github.event.pull_request.head.sha }}
28-
28+
2929

3030
- name: Detect changed files
3131
id: detect
@@ -55,25 +55,27 @@ jobs:
5555
with:
5656
node-version: 22
5757

58-
- uses: pnpm/action-setup@v6.0.8
58+
- name: Install shared dependencies
59+
run: npm --prefix packages/shared install
5960

60-
- run: pnpm install
61+
- name: Install backend dependencies
62+
run: npm --prefix apps/backend install
6163

6264
- name: Backend lint
6365
id: backend_lint
6466
continue-on-error: true
65-
run: cd apps/backend && pnpm eslint ${{ needs.detect-changes.outputs.backendFiles }}
67+
run: cd apps/backend && npx eslint ${{ needs.detect-changes.outputs.backendFiles }}
6668

6769
- name: Backend test
6870
id: backend_test
6971
if: needs.detect-changes.outputs.backendTestFiles != ''
7072
continue-on-error: true
71-
run: cd apps/backend && pnpm test --passWithNoTests ${{ needs.detect-changes.outputs.backendTestFiles }}
73+
run: npm --prefix apps/backend run test -- --passWithNoTests ${{ needs.detect-changes.outputs.backendTestFiles }}
7274

7375
- name: Backend typecheck
7476
id: backend_typecheck
7577
continue-on-error: true
76-
run: cd apps/backend && pnpm typecheck
78+
run: npm --prefix apps/backend run typecheck
7779

7880
- name: Fail job if any check failed
7981
if: >
@@ -100,19 +102,18 @@ jobs:
100102
with:
101103
node-version: 22
102104

103-
- uses: pnpm/action-setup@v6.0.8
104-
105-
- run: pnpm install
105+
- name: Install web dependencies
106+
run: npm --prefix apps/web install
106107

107108
- name: Web check
108109
id: web_check
109110
continue-on-error: true
110-
run: cd apps/web && pnpm check
111+
run: npm --prefix apps/web run lint
111112

112113
- name: Web build
113114
id: web_build
114115
continue-on-error: true
115-
run: cd apps/web && pnpm build
116+
run: npm --prefix apps/web run build
116117

117118
- name: Fail job if any check failed
118119
if: >
@@ -138,20 +139,22 @@ jobs:
138139
with:
139140
node-version: 22
140141

141-
- uses: pnpm/action-setup@v6.0.8
142+
- name: Install shared dependencies
143+
run: npm --prefix packages/shared install
142144

143-
- run: pnpm install
145+
- name: Install mobile dependencies
146+
run: npm --prefix apps/mobile install
144147

145148
- name: Mobile lint
146149
id: mobile_lint
147150
continue-on-error: true
148-
run: cd apps/mobile && pnpm eslint ${{ needs.detect-changes.outputs.mobileFiles }}
151+
run: cd apps/mobile && npx eslint ${{ needs.detect-changes.outputs.mobileFiles }}
149152

150153
- name: Mobile test
151154
id: mobile_test
152155
if: needs.detect-changes.outputs.mobileTestFiles != ''
153156
continue-on-error: true
154-
run: cd apps/mobile && pnpm test --passWithNoTests ${{ needs.detect-changes.outputs.mobileTestFiles }}
157+
run: npm --prefix apps/mobile run test -- --passWithNoTests ${{ needs.detect-changes.outputs.mobileTestFiles }}
155158

156159
- name: Fail job if any check failed
157160
if: >

CONTRIBUTING.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
### Prerequisites
1414

1515
- **Node.js** >= 20
16-
- **pnpm** >= 9
16+
- **npm** >= 10 (bundled with Node.js)
1717
- **Docker** & Docker Compose
1818
- **React Native** dev environment — follow the [official setup guide](https://reactnative.dev/docs/environment-setup)
1919

@@ -25,7 +25,11 @@ git clone https://github.com/Dev-Card/DevCard.git
2525
cd devcard
2626

2727
# 2. Install dependencies
28-
pnpm install
28+
npm install # root (orchestrator)
29+
npm --prefix packages/shared install # shared types/utils
30+
npm --prefix apps/backend install # backend API
31+
npm --prefix apps/web install # web app
32+
npm --prefix apps/mobile install # mobile app (if working on mobile)
2933

3034
# 3. Start PostgreSQL + Redis
3135
docker compose up -d
@@ -35,34 +39,34 @@ cp .env.example .env
3539
# Edit .env with your OAuth credentials
3640

3741
# 5. Run database migrations and seed
38-
pnpm db:migrate
39-
pnpm db:seed
42+
npm run db:migrate
43+
npm run db:seed
4044

4145
# 6. Start development
42-
pnpm dev:backend # Backend API on :3000
43-
pnpm dev:mobile # React Native app
46+
npm run dev:backend # Backend API on :3000
47+
npm run dev:mobile # React Native app
4448
```
4549

4650
### Running Tests
4751

48-
This project uses `pnpm` to run tests across different parts of the codebase.
52+
This project uses `npm` to run tests across different parts of the codebase.
4953

5054
#### Run all tests
51-
To execute all available tests:
55+
To execute backend tests:
5256
```bash
53-
pnpm -r test
57+
npm run test
5458
```
5559

5660
#### apps/backend
5761
The backend uses Vitest:
5862
```bash
59-
pnpm --filter @devcard/backend test
60-
pnpm --filter @devcard/backend test:watch
63+
npm --prefix apps/backend run test
64+
npm --prefix apps/backend run test:watch
6165
```
6266
#### apps/mobile
6367
The mobile app uses Jest:
6468
```bash
65-
pnpm --filter @devcard/mobile test
69+
npm --prefix apps/mobile run test
6670
```
6771
#### apps/web
6872
Currently, the web app does not define a test script.
@@ -84,16 +88,16 @@ devcard/
8488
## Coding Standards
8589

8690
- **TypeScript** for all new code
87-
- **ESLint + Prettier** for formatting (run `pnpm lint` before committing)
91+
- **ESLint + Prettier** for formatting (run `npm run lint` before committing)
8892
- **Conventional Commits** for commit messages (`feat:`, `fix:`, `docs:`, `chore:`)
8993
- Write tests for new features and bug fixes
9094

9195
## Pull Request Process
9296

9397
1. Create a feature branch from `main`: `git checkout -b feat/your-feature`
9498
2. Make your changes with clear, descriptive commits
95-
3. Ensure all tests pass: `pnpm test`
96-
4. Ensure linting passes: `pnpm lint`
99+
3. Ensure all tests pass: `npm run test`
100+
4. Ensure linting passes: `npm run lint`
97101
5. Open a PR against `main` with a clear description of the change
98102
6. Wait for review — maintainers will respond within 48 hours
99103

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ Each exchange is manual, error-prone, and slow. DevCard fixes this.
5252

5353
### Prerequisites
5454

55-
- Node.js >= 20
56-
- pnpm >= 9
55+
- Node.js >= 20 (includes npm)
5756
- Docker & Docker Compose
5857
- React Native development environment ([setup guide](https://reactnative.dev/docs/environment-setup))
5958

@@ -65,7 +64,11 @@ git clone https://github.com/Dev-Card/DevCard.git
6564
cd devcard
6665

6766
# Install dependencies
68-
pnpm install
67+
npm install # root orchestrator
68+
npm --prefix packages/shared install # shared types/utils
69+
npm --prefix apps/backend install # backend API
70+
npm --prefix apps/web install # web app
71+
npm --prefix apps/mobile install # mobile app (if needed)
6972

7073
# Start infrastructure (PostgreSQL + Redis)
7174
docker compose up -d
@@ -79,30 +82,30 @@ cp .env.example .env
7982
# Paste the generated values into your .env file. Never use placeholders in production.
8083

8184
# Run database migrations
82-
pnpm db:migrate
85+
npm run db:migrate
8386

8487
# Seed sample data
85-
pnpm db:seed
88+
npm run db:seed
8689

8790
# Start the backend
88-
pnpm dev:backend
91+
npm run dev:backend
8992

9093
# In another terminal — start the mobile app
91-
pnpm dev:mobile
94+
npm run dev:mobile
9295
```
9396

9497
## Architecture
9598

9699
```
97100
devcard/
98101
├── apps/
99-
│ ├── backend/ # Fastify + TypeScript API
100-
│ ├── mobile/ # React Native (Bare) mobile app
101-
│ └── web/ # SvelteKit web backup
102+
│ ├── backend/ # Fastify + TypeScript API (independent npm)
103+
│ ├── mobile/ # React Native (Bare) mobile app (independent npm)
104+
│ └── web/ # Vite + React web app (independent npm)
102105
├── packages/
103106
│ └── shared/ # Shared types, platform registry, utils
104107
├── docker-compose.yml # PostgreSQL + Redis
105-
└── pnpm-workspace.yaml # Monorepo config
108+
└── package.json # Root orchestrator (npm scripts)
106109
```
107110

108111
### Tech Stack

0 commit comments

Comments
 (0)