Repository navigation
Conversation
…ase-swift commit supabase gen types --lang swift now builds supabase-typegen from the supabase-swift commit in the app's nearest Package.resolved, with the generator's committed dependency versions and the user's toolchain, instead of downloading the prebuilt release binary. The binary is cached per commit. Linux builds link the Swift runtime statically, and the build steps remove git's repository variables so a git hook cannot point them at the user's repository. Fixes SDK-3043
GitHub serves every commit of the fork network through the upstream URL, pull request heads included, so fetching the pinned SHA alone let a Package.resolved get a fork's code built and run. A version pin's tag must now point at the revision, and any other pin's revision must be on its upstream branch, checked in a commits-only clone before the fetch. The Package.resolved lookup also skips files the user does not own and non-regular files, treats malformed JSON as no pin, and rejects a version or branch that is not a plain value before git or the terminal sees it. Refs SDK-3043
…ource supabase gen types --lang swift now picks the supabase-swift commit it builds supabase-typegen from in this order: the new swift-typegen-source option, the supabase-swift pin of the nearest Package.resolved, then the latest 3.x release with a notice on stderr. Every run prints the commit it uses. The option takes a local checkout (./, ../, / or ~/, built in place in its own .build folder and never cached), a full commit SHA, a version resolved through its tag, or a branch resolved with git ls-remote on every run. Abbreviated SHAs, other path forms, versions below 3 and branch names git could read as an option or a refspec are refused before git runs. The lockfile walk skips lockfiles without a supabase-swift pin and, when no parent has one, looks up to two levels below cwd, failing when those pins disagree. Without any pin it builds the highest stable 3.x release, or the highest 3.x prerelease before one exists. BREAKING CHANGE: SUPABASE_TYPEGEN and the supabase-typegen on PATH are no longer read; pass a local checkout to --swift-typegen-source instead. Windows, which only had the PATH fallback, is refused. Fixes SDK-3045
|
No actionable comments were generated in the recent review. Summary
Change: Feature Merge Risk:
|
Supersedes #360 (SDK-3043). This branch keeps #360's two commits and adds the SDK-3045 design on top, so the history and the review context stay.
What changes
supabase gen types --lang swiftstill buildssupabase-typegenfrom source at a supabase-swift commit. This PR changes which commit, and removes the old fallbacks:swift-typegen-source(the CLI will expose it as--swift-typegen-source <version|branch|sha|path>):./path,../path,/path,~/path: build the local checkout in place, in its own.build. No cache, no git. This is for the dev loop where the macros and the emitter change in one supabase-swift PR.v: the tag (v<version>, then<version>), peeled for annotated tags. The--versioncheck applies.refs/heads/<name>, resolved on every run.Removed:
SUPABASE_TYPEGENand thePATHfallback. The error hints now point to the option.PATHfallback.Every run prints the commit it uses on stderr.
The provenance rules from #360 stay:
Decisions to review
PATH../is read as a branch. If that branch does not exist and a folder with that name does, the error suggests./<name>.--disable-automatic-resolutionand--static-swift-stdlib. The checkout is the user's own, and it is never cached.feat(typegen)!, with aBREAKING CHANGE:footer. Underbump-minor-pre-major, this bumps the minor version.Test evidence
bun testinpackages/typegen: 123 pass, 0 fail.swift.test.tshas 69 of them.gitandswiftscripts.SUPABASE_TYPEGENandPATHare ignored.parseTypegenSource,parseRefs,compareVersionsandlatestRelease.check-types,check-types:consumer,format-and-lintandknipare clean.Follow-ups
--swift-typegen-sourceand take the new@supabase/typegen. fix(cli): pass HOME and XDG_CACHE_HOME to the Swift typegen driver cli#7608 (CLI-3138) already stops passingSUPABASE_TYPEGENand passesHOMEandXDG_CACHE_HOME.Fixes SDK-3045