fix(repo): convert postbuild to explicit codegen #1778
Merged
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.
Description
This PR fixes build script issues and converts the
postbuildtype sync mechanism to an explicit codegen workflow with automated checks.What changed?
supabase-js,auth-js, andstorage-jsto usenpm runinstead ofnpx nxnpx nx build:main package-namecaused nested Nx processes that conflicted over the project graph[readCachedProjectGraph] ERROR: No cached ProjectGraph is availableerrorscommon/common/directory creationpostbuildscript inpostgrest-jswas usingcp -rf ./src/types/common ../supabase-js/src/lib/rest/types/commoncommon/common/common.tsandcommon/common/rpc.tsfilespostbuildscript frompostgrest-js/package.jsonscripts/sync-common-types.jsfor explicit type synchronizationnpm run codegenandnpm run codegen:checkcommandscodegen:check) inci-core.ymlto ensure types stay in syncWhy was this change needed?
Postbuild Issues:
The automatic
postbuildapproach had several issues:cp -rfbehavior created invalid directory structuresWhy Explicit Codegen is needed:
npm run codegen)Context from PR #1632:
These common types need to be copied (not imported across package boundaries) because TypeScript's structural typing requires exact type definitions for complex generics and conditional types to work correctly across
postgrest-jsandsupabase-js. The codegen approach maintains this requirement while making the process explicit and safe.Related Issues
common/common/directory creation during builds