Skip to content

Migrate monorepo to pnpm and add Expo React Native mobile client - #12

Merged
BODMAT merged 3 commits into
masterfrom
chore/migrate-to-pnpm
Jul 27, 2026
Merged

Migrate monorepo to pnpm and add Expo React Native mobile client#12
BODMAT merged 3 commits into
masterfrom
chore/migrate-to-pnpm

Conversation

@BODMAT

@BODMAT BODMAT commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Three related changes on this branch:

  1. Migrate the monorepo from npm workspaces to pnpm. npm's hoisting is
    incompatible with Expo/Metro (it splits the package tree), which blocked
    adding a mobile app to the workspace.
  2. Add an Expo (React Native) mobile client under apps/mobile, reusing
    the existing backend API.
  3. Move CI/CD to pnpm so the pipeline installs and builds again.

What changed

pnpm migration (61f2ea2)

  • pnpm-workspace.yaml (apps/*) replaces the workspaces field in package.json
  • .npmrc with node-linker=hoisted — flat node_modules required by Metro/React Native
  • packageManager: pnpm@11; package-lock.json removed in favor of pnpm-lock.yaml
  • dev:mobile now runs pnpm --filter mobile run start
  • Drift fixes surfaced by regenerating the lockfile:
    • add missing dotenv dependency to backend (phantom dep, exposed by pnpm strictness)
    • pin @types/express-serve-static-core to 5.1.0 (5.1.2 types query/params as string | string[])
    • bump frontend lib/target to ES2022 (for Array.at)
    • make the coin other schema field optional (zod 4.4 treats z.any() keys as required)
    • disable backend .d.ts emit to avoid TS2742 non-portable-type errors under pnpm

Mobile client (4c62fea)

  • Expo SDK 54 app (expo-router, TypeScript) in apps/mobile
  • Monorepo metro.config.js (resolves deps from local + workspace-root node_modules)
  • No babel.config.js — SDK 54 auto-configures babel-preset-expo; a hand-written
    one breaks expo-router's EXPO_ROUTER_APP_ROOT inlining

CI/CD to pnpm (8b05bae)

  • ci.yml and deploy.yml: add pnpm/action-setup, switch setup-node cache to pnpm
  • npm cipnpm install --frozen-lockfile; npm run …pnpm run …
  • Bump node-version 20 → 22 (pnpm 11 requires Node ≥ 22.13; Node 20 is also deprecated on runners)
  • Fixes the CI failures "Dependencies lock file is not found" and the node:sqlite crash on Node 20

Verification

  • pnpm install --frozen-lockfile + native builds (bcrypt, esbuild, prisma) OK
  • pnpm build (turbo) — backend + frontend green
  • expo export --platform android — mobile bundles successfully
  • dev servers (pnpm dev) unaffected

Notes

  • pnpm requires approving dependency build scripts — handled via allowBuilds in pnpm-workspace.yaml
  • ssh2's optional native binding may skip compilation on machines without build tools; it falls back to pure JS and is only used by integration tests

BODMAT added 2 commits July 27, 2026 14:09
- Replace npm workspaces with pnpm-workspace.yaml (apps/*)
- Add .npmrc node-linker=hoisted (required by Metro/React Native)
- Set packageManager to pnpm@11; drop package-lock.json for pnpm-lock.yaml
- Point dev:mobile at pnpm filter
- Fix fresh-resolution drift: add dotenv dep, pin @types/express-serve-static-core 5.1.0, bump frontend lib to ES2022, make coin 'other' field optional (zod), disable backend .d.ts emit to avoid TS2742
Scaffold Expo (SDK 54, expo-router) app in apps/mobile as the CoinRadar mobile client. Includes monorepo metro.config.js; no babel.config.js since SDK 54 auto-configures babel-preset-expo.
@BODMAT
BODMAT force-pushed the chore/migrate-to-pnpm branch from 536f1f5 to 4c62fea Compare July 27, 2026 11:10
Add pnpm/action-setup, use pnpm cache, replace npm ci / npm run with pnpm install --frozen-lockfile and pnpm run.
@BODMAT
BODMAT force-pushed the chore/migrate-to-pnpm branch from 83b80f4 to 8b05bae Compare July 27, 2026 11:14
@BODMAT
BODMAT merged commit 1f426d8 into master Jul 27, 2026
1 check passed
@BODMAT
BODMAT deleted the chore/migrate-to-pnpm branch July 27, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant