How to make a change: conventions for commits, public API, and the usual workflows.
See DEVELOPMENT.md to set up, build, and test, and CODE_STYLE.md for code conventions.
This project uses Conventional Commits with release-please for automated versioning:
feat:- New features (minor version bump)fix:- Bug fixes (patch version bump)docs:- Documentation changestest:- Test changesrefactor:- Code refactoringperf:- Performance improvementschore:- Build/tooling changesfeat!:orBREAKING CHANGE:- Breaking changes (major version bump)
Example: feat(auth): add PKCE flow support
The !/BREAKING CHANGE: marker is the same one release-please and the API stability check key
off to bump majors and flag reviewers. Every commit carrying it also requires an entry in the
major-version migration guide (V<N>_MIGRATION.md and docs/migrations/v<N>/) — see the writing-migration-guides skill for the format.
sdk-compliance.yaml declares this SDK's public API against the
supabase/sdk capability matrix.
.github/workflows/validate-capabilities.yml calls supabase/sdk's reusable
compliance workflow on every PR, and it does check for both newly added
public API not listed in the manifest and registered symbols the code no
longer has. That workflow is not a required status check on main. Only
CI Success (this repo's own ci.yml) and the WIP/draft gate are. The
"SDK compliance" job in ci.yml is part of CI Success, and it runs
./scripts/check-compliance.sh.
Any change to public API — adding, removing, renaming, or moving a
symbol — updates sdk-compliance.yaml in the same commit. This includes
symbols a refactor deletes: a stale entry for a symbol that no longer
exists is as much a compliance failure as a missing one. See the file's
own comments and
https://github.com/supabase/sdk/blob/main/CONTRIBUTING.md for the
format.
# Check sdk-compliance.yaml against the current public API
./scripts/check-compliance.shIt needs no network access and no checkout of supabase/sdk. It fails when:
sdk-compliance.yamldeclares a symbol the public API no longer has.- The undeclared public symbols differ from
scripts/compliance-baseline.txt. A symbol that is not in the baseline is new public API: declare it. A baseline symbol that is now declared means the baseline is out of date: run./scripts/check-compliance.sh --update-baselineand commit the result. An update only removes symbols from the baseline. It never adds one.
Only symbols declared under Sources/ count, minus the files that
.sdk-parse-ignore matches. Only Auth still has undeclared symbols
(SDK-2091).
The symbol graph depends on the platform and the SDK. CI runs the check on macOS with Xcode 27.0, so run it there too. On Linux or another Xcode, some Apple-only APIs drop out and the check reports false results.
What to declare: a type together with its public init and its members.
Do not declare a member without its owning type. Declare every public macro.
Every version string that users copy (the README install snippet,
V3_MIGRATION.md, the typegen install snippet, both Version.swift files)
sits in a file listed in release-please-config.json extra-files, with an
x-release-please-version marker. The README library list matches the
.library products in Package.swift.
- Create feature branch from
main - Implement feature with tests
- If the feature adds or changes public API, update
sdk-compliance.yamlin the same commit (see "Capability Compliance" above) and run./scripts/check-compliance.sh - Run
./scripts/format.shto format code - Run
swift testto verify tests pass - Add documentation if needed
- Create PR with conventional commit title
- Ensure CI passes
- Add a failing test that reproduces the bug
- Fix the bug
- If the fix adds, removes, or renames public API, update
sdk-compliance.yamlin the same commit and run./scripts/check-compliance.sh - Verify test now passes
- Run full test suite
- Create PR with
fix:prefix
release/v2 ships v2 patch releases while main moves toward v3. Fix a bug on main first, then
backport it:
- Open the fix PR against
main, as in "Fixing a Bug". - After it merges, branch from
release/v2and rungit cherry-pick -x <sha>. The-xflag records the original commit in the message. - Adapt the change to v2. Module names, file paths, and APIs differ between the two lines, and
the cherry-pick may not apply cleanly. Run
swift teston the branch. - Open the backport PR against
release/v2with afix:title. Link themainPR in the body.
A fix that only release/v2 needs, because the code no longer exists on main, is the one
exception. Open it directly against release/v2 and say so in the PR body.
Release-please publishes the patch release from release/v2 (see RELEASE.md).
Dependencies are managed in Package.swift. Use version ranges when possible to allow flexibility.