Skip to content

Configure kds-mobile build to generate TypeScript API contract - #531

Merged
mnindrazaka merged 1 commit into
mainfrom
claude/affectionate-franklin-lbafqz
Sep 17, 2026
Merged

mnindrazaka merged 1 commit into
mainfrom
claude/affectionate-franklin-lbafqz

Conversation

@mnindrazaka

Copy link
Copy Markdown
Collaborator

Summary

Ensures the kds-mobile app generates TypeScript API contract types before building, and pins the Expo SDK version to match the configured SDK version.

Changes

  • Build task dependency: Added api-contract:generate:ts as a dependency of the build target in project.json, ensuring codegen runs before the build starts
  • EAS post-install script: Extended the eas-build-post-install script to explicitly run api-contract:generate:ts with NX_DAEMON=false to guarantee type generation in the EAS build environment
  • Expo SDK version: Pinned expo to ~51.0.39 in package.json and added matching sdkVersion: "51.0.0" to app.json for consistency

Implementation details

The changes follow the pattern established in the codebase where codegen must run before dependent code compiles (as noted in CLAUDE.md). The EAS script modification ensures the build succeeds in the cloud environment where the NX daemon may not persist across build phases. The Expo version pinning prevents SDK mismatches that could cause runtime issues.

https://claude.ai/code/session_01MPSwsKvPMpTwJQ5PD5pWZ2

EAS Build enables its eager bundle phase when the build metadata reports
Expo SDK >= 52, which runs `expo export:embed --eager`. This app is on
SDK 51, whose @expo/cli (0.18.31) has no --eager flag, so `nx build
kds-mobile` failed with "CommandError: Unknown arguments: --eager".

The reported SDK version is derived from whichever `expo` resolves from
the app directory, and the app declared `"expo": "*"`, so any install
from this manifest could pull a newer SDK than the workspace. Pin `expo`
to the workspace range and declare sdkVersion in app.json so the version
EAS sees is deterministic.

Also generate the api-contract TS during eas-build-post-install, since
src/__generated__ is gitignored and therefore never uploaded to EAS, and
depend on that codegen from the nx build target for local builds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MPSwsKvPMpTwJQ5PD5pWZ2
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
gatherloop-order Building Building Preview Sep 17, 2026 11:40am UTC
gatherloop-pos Building Building Preview Sep 17, 2026 11:40am UTC

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.

2 participants