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
postbuild
type sync mechanism to an explicit codegen workflow with automated checks.What changed?
supabase-js
,auth-js
, andstorage-js
to usenpm run
instead ofnpx nx
npx nx build:main package-name
caused nested Nx processes that conflicted over the project graph[readCachedProjectGraph] ERROR: No cached ProjectGraph is available
errorscommon/common/
directory creationpostbuild
script inpostgrest-js
was usingcp -rf ./src/types/common ../supabase-js/src/lib/rest/types/common
common/common/common.ts
andcommon/common/rpc.ts
filespostbuild
script frompostgrest-js/package.json
scripts/sync-common-types.js
for explicit type synchronizationnpm run codegen
andnpm run codegen:check
commandscodegen:check
) inci-core.yml
to ensure types stay in syncWhy was this change needed?
Postbuild Issues:
The automatic
postbuild
approach had several issues:cp -rf
behavior 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-js
andsupabase-js
. The codegen approach maintains this requirement while making the process explicit and safe.Related Issues
common/common/
directory creation during builds