Skip to content

chore(repo): declare supabase-js compliance with SDK capability matrix - #2441

Merged
mandarini merged 8 commits into
masterfrom
chore/sdk-compliance-plumbing
Jun 17, 2026
Merged

mandarini merged 8 commits into
masterfrom
chore/sdk-compliance-plumbing

Conversation

@mandarini

@mandarini mandarini commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Wires supabase-js into the per-SDK capability compliance model introduced in supabase/sdk#15. Adds a root-level sdk-compliance.yaml declaring which capability IDs supabase-js implements, a CI workflow that validates that file against the canonical registry, and two scripts plus a mapping file that keep both sides in sync.

What changed?

New files:

  • sdk-compliance.yaml -- 168 feature entries declaring implemented status for each public method supabase-js exposes, grouped by area (auth, database, storage, realtime, functions). Generated by the audit script. Unlisted IDs default to not_implemented.
  • .github/workflows/validate-capabilities.yml -- calls the reusable validate-sdk-compliance.yml workflow from supabase/sdk on every PR that touches sdk-compliance.yaml. Rejects unknown feature IDs. Declares a minimal contents: read token permission.
  • scripts/audit-sdk-compliance.ts -- walks each package's typedoc spec.json, collects public methods on the main client classes (with a small DENYLIST for boilerplate like then, toJSON, dispose), dedupes duplicate method names across classes (e.g. signOut on both GoTrueClient and GoTrueAdminApi), applies the canonical mapping, snake_cases the names, and emits <area>.<group>.<snake_method>: implemented entries. Re-run whenever public methods change.
  • scripts/sync-canon.ts -- one-direction "JS to canon" pipeline. Reads the same spec.json files plus their JSDoc summaries and writes feature entries into ../sdk/capabilities/<area>.yaml. Two modes: --bootstrap replaces canon files wholesale (used once to seed the registry); default mode is additive (only appends IDs that don't already exist, leaves existing entries untouched so registry maintainers and other SDKs can edit freely). Canon path is configurable via --canon-path flag or SUPABASE_SDK_CAPABILITIES_PATH env var, defaulting to a sibling checkout.
  • scripts/canonical-mapping.yaml -- hand-maintained map from auto-derived JS feature IDs to their canonical IDs in supabase/sdk, for the cases where they diverge (JS-isms renamed in canon, group renames such as filters to using_filters, methods that collapse into one capability, and a null value to drop JS-only methods with no canonical counterpart). Without an entry, the auto-derived ID flows through unchanged.

Source changes (documentation only, no behavior change):

  • packages/core/postgrest-js/src/{PostgrestClient,PostgrestFilterBuilder,PostgrestTransformBuilder}.ts and packages/core/realtime-js/src/RealtimeChannel.ts -- reposition JSDoc comments onto the implementation signatures and add @category tags so the typedoc spec.json attributes method summaries correctly for the audit and sync scripts.
  • .gitignore -- ignore the audit script's sdk-compliance.draft.yaml working file.

Additional notes

  • sync-canon.ts defaults to additive on the canon side so concurrent edits from registry maintainers and other SDKs don't get clobbered. The bootstrap mode is one-shot.
  • One method (signInWithOAuth) snake_cases to sign_in_with_o_auth due to a heuristic ambiguity in the camelCase to snake_case conversion (the same regex that correctly splits regexIMatch to regex_i_match also splits OAuth to O_Auth). Left as-is; documented in the script comments.
  • Baseline for the audit: @supabase/supabase-js v2.108.1.

@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@supabase/auth-js

npm i https://pkg.pr.new/@supabase/auth-js@2441

@supabase/functions-js

npm i https://pkg.pr.new/@supabase/functions-js@2441

@supabase/postgrest-js

npm i https://pkg.pr.new/@supabase/postgrest-js@2441

@supabase/realtime-js

npm i https://pkg.pr.new/@supabase/realtime-js@2441

@supabase/storage-js

npm i https://pkg.pr.new/@supabase/storage-js@2441

@supabase/supabase-js

npm i https://pkg.pr.new/@supabase/supabase-js@2441

commit: de5dff5

@mandarini mandarini self-assigned this Jun 11, 2026
@mandarini
mandarini force-pushed the chore/sdk-compliance-plumbing branch from 5dc9da4 to 9ade4c8 Compare June 12, 2026 06:50
@mandarini
mandarini force-pushed the chore/sdk-compliance-plumbing branch 2 times, most recently from 829bf20 to 27958bc Compare June 16, 2026 12:50
@mandarini
mandarini marked this pull request as ready for review June 16, 2026 12:51
@mandarini
mandarini requested review from a team as code owners June 16, 2026 12:51

@grdsdev grdsdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep the changed scripts/* files and the sdk-compliance.draft.yaml? Or was that a bootstrap thing we can remove?

@mandarini

Copy link
Copy Markdown
Contributor Author

@grdsdev i wanted to keep them, but you're right, they do not want to be so many and i can drop the bootstrapping one. did so

@mandarini
mandarini merged commit 6d2d952 into master Jun 17, 2026
40 of 43 checks passed
@mandarini
mandarini deleted the chore/sdk-compliance-plumbing branch June 17, 2026 14:17
spydon added a commit to supabase/supabase-flutter that referenced this pull request Jun 17, 2026
## Description

Wires supabase-flutter into the per-SDK capability compliance model used
across the Supabase SDKs (see
[supabase-js#2441](supabase/supabase-js#2441)
for the reference implementation). Adds a root-level
`sdk-compliance.yaml` declaring which canonical capability IDs
supabase-flutter implements, plus a CI workflow that validates the file
against the canonical registry in
[supabase/sdk](https://github.com/supabase/sdk).

Linear: SDK-1034

### What changed?

Two new files:

- **`sdk-compliance.yaml`** — declares the status of all 216 canonical
capability IDs (auth, database, storage, realtime, functions, client).
Statuses are `implemented`, `partially_implemented` (with a note
describing the divergence from supabase-js), or `not_implemented`.
Unlisted IDs default to `not_implemented`.
- **`.github/workflows/validate-capabilities.yml`** — calls the reusable
`validate-sdk-compliance.yml` workflow from `supabase/sdk` on every PR
that touches the compliance file. Rejects unknown feature IDs and
invalid statuses.

### How statuses were determined

Every capability was verified against the actual Dart source in this
repository, not just against the [gaps
document](https://linear.app/supabase/document/gaps-in-supabase-flutter-dee88c3c1179).
Because the repo has moved on since that document was written, several
capabilities it lists as missing are in fact implemented now:

- **OAuth client admin** (`auth.oauth_admin.*`) — fully implemented via
`admin.oauth`.
- **Passkeys** (`auth.passkey.*`, `auth.passkey_admin.*`) — implemented
(experimental); marked `implemented` rather than `not_applicable` since
passkeys do apply to Flutter mobile/desktop.
- **Edge Function streaming**
(`functions.invocation.streaming_response`) — implemented;
`text/event-stream` responses are passed through as a raw byte stream.

### Status summary

- ~146 `implemented`
- ~26 `partially_implemented` (each carries a note, e.g. `signOut`
defaulting to `local` scope, `listUsers` dropping pagination metadata,
`explain` lacking JSON format)
- ~44 `not_implemented` (Web3 sign-in, OAuth server consent flow, custom
SSO providers, vector/analytics storage, request cancellation/timeouts,
etc.)

### Notes

- This file is hand-maintained. As gaps tracked in
[SDK-973](https://linear.app/supabase/issue/SDK-973) are closed, update
the corresponding entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants