fix(kds-mobile): run api-contract codegen without the nx project graph - #532
Merged
Merged
Conversation
`nx run api-contract:generate:ts` builds the project graph first, which makes @nx-go/nx-go shell out to `go list -m -json`. The EAS build image has no Go toolchain, so eas-build-post-install died with "go: not found" before the TypeScript contract was generated. Invoke kubb directly instead — it is the entire body of the generate:ts target and needs nothing but node. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MPSwsKvPMpTwJQ5PD5pWZ2
|
Deployment failed for project gatherloop-pos with the following error: Learn More: https://vercel.com/m-nindra-zakas-projects-ae6b8849?upgradeToPro=build-rate-limit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Follow-up to #531, which was squash-merged and captured only the first of its two commits. The eager-bundle fix landed on
main; this one-line codegen fix did not, soeas buildforkds-mobilestill fails.Problem
eas-build-post-installonmainruns:nx runconstructs the Nx project graph before executing anything, and graph construction runs every plugin innx.json— including@nx-go/nx-go, which shells out togo list -m -json. The EAS build image ships Node but no Go toolchain, so the hook dies before the TypeScript contract is generated:The hook needs the generated contract because
libs/api-contract/src/index.tsre-exports./__generated__/ts, and__generated__is gitignored — so it is never uploaded to EAS and has to be regenerated there.Change
Invoke
kubbdirectly. It is the entire body of thegenerate:tstarget minus therm -rf, which is pointless on a fresh EAS checkout, and it needs nothing but node:Verification
Ran the real
npm run eas-build-post-installfromapps/kds-mobilewithgostripped fromPATH, reproducing the EAS image's condition:which go→ nothing found0libs/api-contract/src/__generated__/tsTradeoff
The kubb invocation is now duplicated between
libs/api-contract/project.jsonand this hook, so a future change to thegenerate:tstarget needs the same change here. The alternative — a root.easignoreshipping the generated files instead of regenerating them — relies on gitignore-style negation through an already-excluded__generated__directory, which is fragile and untestable without a real EAS run.CI only runs the path-filtered unit suites, and this file has no test coverage; the real check is the next
nx build kds-mobile.🤖 Generated with Claude Code
https://claude.ai/code/session_01MPSwsKvPMpTwJQ5PD5pWZ2
Generated by Claude Code