Skip to content

Commit 2ee8704

Browse files
authored
feat(agora): migrate to pnpm and improve API type safety (#459)
* chore(agora): migrate frontend to pnpm * feat(shared): update zod types and sync DTOs * feat(agora): improve API response handling and type safety * chore: update dependencies
1 parent 52dafd0 commit 2ee8704

314 files changed

Lines changed: 24937 additions & 17419 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
1-
# name: build-ios-app
2-
# on:
3-
# push:
4-
# paths:
5-
# - 'services/app/**'
6-
# - '.github/workflows/build-ios-app.yml'
7-
# branches:
8-
# - 'main'
9-
# jobs:
10-
# build:
11-
# runs-on: macos-latest
12-
# defaults:
13-
# run:
14-
# working-directory: ./services/app
15-
# steps:
16-
# - uses: actions/checkout@v4
17-
# - uses: actions/setup-node@v4
18-
# with:
19-
# node-version: 20
20-
# cache: 'yarn'
21-
# cache-dependency-path: './services/app'
22-
# - name: Install dependencies
23-
# run: yarn install --production=false --frozen-lockfile
24-
# - name: Build Quasar Capacitor app for iOS
25-
# run: echo $PWD && yarn build:ci:ios
26-
# - name: Fastlane - build & upload to TestFlight
27-
# working-directory: './services/app/src-capacitor'
28-
# run: bundle exec fastlane beta --verbose
29-
# env:
30-
# MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
31-
# APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
32-
# APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}
33-
# APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
34-
# GIT_APPLE_KEYS_TOKEN_USER: ${{ secrets.GIT_APPLE_KEYS_TOKEN_USER }}
35-
# GIT_APPLE_KEYS_TOKEN_VALUE: ${{ secrets.GIT_APPLE_KEYS_TOKEN_VALUE }}
36-
# GIT_APPLE_KEYS_URL: ${{ secrets.GIT_APPLE_KEYS_URL }}
37-
# APPLE_ID: ${{ secrets.APPLE_ID }}
38-
# APPLE_DEVELOPER_PORTAL_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_PORTAL_TEAM_ID }}
39-
# APPLE_APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APPLE_APP_STORE_CONNECT_TEAM_ID }}
40-
# APPLE_DIST_PROFILE_NAME: ${{ secrets.APPLE_DIST_PROFILE_NAME }}
41-
# APPLE_DIST_PROFILE_UUID: ${{ secrets.APPLE_DIST_PROFILE_UUID }}
42-
# APPLE_DIST_CERTIFICATE_NAME: ${{ secrets.APPLE_DIST_CERTIFICATE_NAME }}
43-
# TEMP_KEYCHAIN_USER: ${{ secrets.TEMP_KEYCHAIN_USER }}
44-
# TEMP_KEYCHAIN_PASSWORD: ${{ secrets.TEMP_KEYCHAIN_PASSWORD }}
1+
name: build-ios-app
2+
on:
3+
push:
4+
paths:
5+
- 'services/app/**'
6+
- '.github/workflows/build-ios-app.yml'
7+
branches:
8+
- 'main'
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
defaults:
13+
run:
14+
working-directory: ./services/app
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: pnpm/action-setup@v2
18+
with:
19+
version: 9
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: 'pnpm'
24+
cache-dependency-path: './services/app/pnpm-lock.yaml'
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
- name: Build Quasar Capacitor app for iOS
28+
run: echo $PWD && pnpm build:ci:ios
29+
- name: Fastlane - build & upload to TestFlight
30+
working-directory: './services/app/src-capacitor'
31+
run: bundle exec fastlane beta --verbose
32+
env:
33+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
34+
APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}
35+
APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}
36+
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
37+
GIT_APPLE_KEYS_TOKEN_USER: ${{ secrets.GIT_APPLE_KEYS_TOKEN_USER }}
38+
GIT_APPLE_KEYS_TOKEN_VALUE: ${{ secrets.GIT_APPLE_KEYS_TOKEN_VALUE }}
39+
GIT_APPLE_KEYS_URL: ${{ secrets.GIT_APPLE_KEYS_URL }}
40+
APPLE_ID: ${{ secrets.APPLE_ID }}
41+
APPLE_DEVELOPER_PORTAL_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_PORTAL_TEAM_ID }}
42+
APPLE_APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APPLE_APP_STORE_CONNECT_TEAM_ID }}
43+
APPLE_DIST_PROFILE_NAME: ${{ secrets.APPLE_DIST_PROFILE_NAME }}
44+
APPLE_DIST_PROFILE_UUID: ${{ secrets.APPLE_DIST_PROFILE_UUID }}
45+
APPLE_DIST_CERTIFICATE_NAME: ${{ secrets.APPLE_DIST_CERTIFICATE_NAME }}
46+
TEMP_KEYCHAIN_USER: ${{ secrets.TEMP_KEYCHAIN_USER }}
47+
TEMP_KEYCHAIN_PASSWORD: ${{ secrets.TEMP_KEYCHAIN_PASSWORD }}

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ make dev-generate
9292

9393
```bash
9494
# Frontend
95-
cd services/agora && yarn lint && yarn test
95+
cd services/agora && pnpm lint && pnpm test
9696

9797
# Backend API
9898
cd services/api && pnpm lint && pnpm test
@@ -197,7 +197,7 @@ pnpm db:undo
197197

198198
```bash
199199
# Build images for each service
200-
cd services/agora && yarn image:build
200+
cd services/agora && pnpm image:build
201201
cd services/api && pnpm image:build
202202
cd services/math-updater && pnpm image:build
203203
```

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ all: dev
22

33
generate:
44
docker run --rm \
5-
-v ${PWD}:/local openapitools/openapi-generator-cli:v7.12.0 generate \
5+
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
66
-i /local/services/api/openapi-zkorum.json \
77
-g typescript-axios \
88
-o /local/services/agora/src/api
99
docker run --rm \
10-
-v ${PWD}:/local openapitools/openapi-generator-cli:v7.12.0 generate \
10+
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
1111
-i /local/services/api/openapi-zkorum.json \
1212
-g typescript-axios \
1313
-o /local/services/load-testing/src/api
@@ -36,7 +36,7 @@ dev-generate:
3636
watchman-make -p 'services/api/openapi-zkorum.json' -t generate
3737

3838
dev-app:
39-
cd services/agora && yarn dev
39+
cd services/agora && pnpm dev
4040

4141
dev-api:
4242
cd services/api && pnpm start:dev

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Install:
3636
- [pnpm](https://pnpm.io/)
3737
- [watchman](https://facebook.github.io/watchman/)
3838
- [docker](https://www.docker.com/)
39-
- [yarn](https://yarnpkg.com/)
4039

4140
## Services
4241

services/agora/Dockerfile.production

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ FROM node:22-alpine AS build
33
WORKDIR /app
44
ENV PATH=/app/node_modules/.bin:$PATH
55
COPY . ./
6-
RUN yarn install --frozen-lockfile
7-
RUN yarn build:production
6+
RUN npm install -g pnpm
7+
RUN pnpm install --frozen-lockfile
8+
RUN pnpm run build:production
89

910
# production environment
1011
FROM nginx:stable-alpine

services/agora/Dockerfile.staging

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ FROM node:22-alpine AS build
33
WORKDIR /app
44
ENV PATH=/app/node_modules/.bin:$PATH
55
COPY . ./
6-
RUN yarn install --frozen-lockfile
7-
RUN yarn build:staging
6+
RUN npm install -g pnpm
7+
RUN pnpm install --frozen-lockfile
8+
RUN pnpm run build:staging
89

910
# production environment
1011
FROM nginx:stable-alpine

services/agora/README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,20 @@ Recommended: Install [nvm](https://github.com/nvm-sh/nvm) and install npm LTS us
88

99
Or follow [npm documentation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm/)
1010

11-
### Yarn
12-
13-
Install [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable)
14-
1511
### Install dependencies
1612

1713
Then cd to this root directy and install the dependencies:
1814

1915
```bash
20-
yarn
16+
pnpm install
2117
```
2218

2319
### Prepare for IDE work
2420

2521
Run:
2622

2723
```bash
28-
yarn prepare
24+
pnpm prepare
2925
```
3026

3127
## Environment Variables
@@ -34,7 +30,7 @@ yarn prepare
3430

3531
The project uses separate environment files for different build modes:
3632

37-
- `.env.dev` - Development configuration (automatically loaded by `yarn dev`)
33+
- `.env.dev` - Development configuration (automatically loaded by `pnpm dev`)
3834
- `.env.staging` - Staging configuration (must include `VITE_STAGING=true`)
3935
- `.env.production` - Production configuration (must include `VITE_STAGING=false`)
4036

@@ -47,8 +43,8 @@ cp env.example .env.dev
4743
Edit the files with your configuration values. Environment variables are accessed via the typed `processEnv` export, which wraps `import.meta.env` at runtime.
4844

4945
**Build Process**:
50-
- Development: `yarn dev` automatically loads `.env.dev` via Quasar/Vite
51-
- Production builds: `yarn build:staging` and `yarn build:production` use `env-cmd` to load the appropriate env file before building
46+
- Development: `pnpm dev` automatically loads `.env.dev` via Quasar/Vite
47+
- Production builds: `pnpm build:staging` and `pnpm build:production` use `env-cmd` to load the appropriate env file before building
5248

5349
We use `env-cmd` because:
5450
- Quasar has no built-in support for staging environments (only dev/production)
@@ -69,7 +65,7 @@ Environment variables are validated using a multi-layer approach:
6965
- Provides IDE autocomplete and compile-time type checking
7066

7167
3. **Build-Time Validation** (custom Vite plugin in [quasar.config.ts](quasar.config.ts)):
72-
- Runs during `yarn dev` / `yarn build` before app starts
68+
- Runs during `pnpm dev` / `pnpm build` before app starts
7369
- Calls `validateEnv()` function during Vite's config phase
7470
- **Build fails immediately** if validation fails (missing/invalid variables)
7571
- Env object generated dynamically from schema keys (line 247-249)
@@ -84,7 +80,7 @@ For full documentation including variable descriptions and validation rules, see
8480
## Start the app in development mode (hot-code reloading, error reporting, etc.)
8581

8682
Start the app with:
87-
`yarn dev` in the `services/agora` directory or running `make dev-app` at the root of this project.
83+
`pnpm dev` in the `services/agora` directory or running `make dev-app` at the root of this project.
8884

8985
## Logos
9086

@@ -108,13 +104,13 @@ quasar dev -m capacitor -T ios
108104
## Lint the files
109105

110106
```bash
111-
yarn lint
107+
pnpm lint
112108
```
113109

114110
## Format the files
115111

116112
```bash
117-
yarn format
113+
pnpm format
118114
```
119115

120116
## Build the app for production

services/agora/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"build:ios": "quasar build -m capacitor -T ios --skip-pkg",
2222
"build:android": "quasar build -m capacitor -T android -- bundleRelease",
2323
"sign:android": "./scripts/artifact_sign.sh",
24-
"build:ci:ios": "yarn quasar build -m capacitor -T ios --skip-pkg",
24+
"build:ci:ios": "pnpm quasar build -m capacitor -T ios --skip-pkg",
2525
"image:build": "docker build -f Dockerfile.production -t agora-app .",
2626
"image:buildx": "docker buildx build -f Dockerfile.production --platform linux/amd64 -t agora-app --load .",
2727
"image:build:staging": "docker build -f Dockerfile.staging -t agora-app-staging .",
@@ -78,7 +78,7 @@
7878
"vue": "^3.5.25",
7979
"vue-i18n": "^11.1.12",
8080
"vue-router": "^4.6.4",
81-
"zod": "^4.1.9"
81+
"zod": "^4.3.5"
8282
},
8383
"devDependencies": {
8484
"@eslint/js": "^9.35.0",
@@ -101,7 +101,7 @@
101101
"prettier": "^3.4.2",
102102
"serve": "^14.2.5",
103103
"typescript": "5.9.3",
104-
"unplugin-vue-router": "^0.19.1",
104+
"unplugin-vue-router": "^0.19.2",
105105
"vite-plugin-checker": "^0.12.0",
106106
"vue-tsc": "^3.2.1"
107107
},

0 commit comments

Comments
 (0)