mirror of
https://github.com/supabase/supabase.git
synced 2026-09-06 09:59:03 +08:00
## What Routes the **Dart/Flutter v2** reference through the new reference-content pipeline (`scripts/build-reference-content.ts` + `spec/reference/dart/v2/`), the same one JavaScript v2 already uses. Dart v1 stays on the legacy YAML pipeline. ## How Dart has no upstream TypeDoc dump, so this follows the reference README's "adapt other formats as a pre-step" approach: - **`scripts/generate-dart-reference.ts`** converts the committed legacy spec (`spec/supabase_dart_v2.yml`) plus the shared section tree into a TypeDoc-shaped dump at `spec/reference/dart/v2/supabase_flutter.json` (gitignored, like every other dump). Each Dart method becomes a `variant: 'declaration'` node tagged with `@category`/`@subcategory` and carries the legacy function shape (description, notes, params, examples) on a non-TypeDoc `content` field. - **`build-reference-content.ts`** gains a small, backward-compatible addition: it spreads a declaration's `content` straight onto the `functions.json` entry. The renderer then shows params/examples/notes exactly as the legacy YAML did, with no typeSpec round-trip. The field is absent for real TypeDoc dumps, so **JavaScript output is unchanged** (existing JS snapshot still passes). - `dart-v2` added to `SUPPORTS_NEW_REFERENCE_PROCESS`; the v2 `specFile` is dropped from the nav entry so the legacy generator skips it. - Dart search ingest switched to the new-pipeline loader. - `config.json` + hand-authored partials (intro markdown, `initializing`, and subcategory overviews like `using-filters`, `auth-mfa`) added under `spec/reference/dart/v2/partials/`, mirroring the JS lib. - The dart dump is regenerated in `codegen:references:new` and in CI; a self-contained `dart/v2` snapshot test covers the full YAML → dump → content path. ## Verification - `vitest run scripts/build-reference-content.test.ts` — both JS and Dart snapshots pass. - 112 function sections all resolve to renderable `functions.json` entries (104 methods + 7 subcategory overviews + `initializing`). - `tsc --noEmit` clean for all changed files. - Legacy generator confirmed to skip dart v2 (only `dart.v1.*` regenerated). > Note: the live dev server (which needs the Supabase backend) was not run; verification was done at the data-pipeline level plus parity with the production JS pipeline behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Dart v2 reference documentation sections, including Installing, Initializing, Filters, Modifiers, Auth Admin, MFA, Passkeys, File Buckets, Introduction, and Upgrade guidance. * Expanded the Dart v2 reference pipeline so Dart API pages are generated from the newer reference content flow. * **Bug Fixes** * Improved Dart reference rendering by preserving legacy descriptions, notes, params, and examples in generated function entries. * Updated Dart v2 reference search to use the new pipeline’s generated content so results and navigation stay in sync. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Jeremias Menichelli <jmenichelli@gmail.com>
118 lines
4.2 KiB
JSON
118 lines
4.2 KiB
JSON
{
|
|
"id": "initializing",
|
|
"title": "Initializing",
|
|
"description": "You can initialize Supabase with the static `initialize()` method of the `Supabase` class.\n\nThe Supabase client is your entrypoint to the rest of the Supabase functionality\nand is the easiest way to interact with everything we offer within the Supabase ecosystem.\n",
|
|
"params": [
|
|
{
|
|
"name": "url",
|
|
"isOptional": false,
|
|
"type": "string",
|
|
"description": "The unique Supabase URL which is supplied when you create a new project in your project dashboard."
|
|
},
|
|
{
|
|
"name": "publishableKey",
|
|
"isOptional": false,
|
|
"type": "string",
|
|
"description": "The publishable (anon) key supplied when you create a new project in your project dashboard. Use this for client-side apps. The deprecated `anonKey` parameter is still accepted but `publishableKey` takes precedence when both are supplied."
|
|
},
|
|
{
|
|
"name": "headers",
|
|
"isOptional": true,
|
|
"type": "Map<String, String>",
|
|
"description": "Custom header to be passed to the Supabase client."
|
|
},
|
|
{
|
|
"name": "httpClient",
|
|
"isOptional": true,
|
|
"type": "Client",
|
|
"description": "Custom http client to be used by the Supabase client."
|
|
},
|
|
{
|
|
"name": "authOptions",
|
|
"isOptional": true,
|
|
"type": "FlutterAuthClientOptions",
|
|
"description": "Options to change the Auth behaviors.",
|
|
"subContent": [
|
|
{
|
|
"name": "authFlowType",
|
|
"isOptional": true,
|
|
"type": "AuthFlowType",
|
|
"description": "Whether to use the `pkce` flow or the `implicit` flow. Defaults to `pkce`."
|
|
},
|
|
{
|
|
"name": "localStorage",
|
|
"isOptional": true,
|
|
"type": "LocalStorage",
|
|
"description": "Parameter to override the local storage to store auth tokens."
|
|
},
|
|
{
|
|
"name": "autoRefreshToken",
|
|
"isOptional": true,
|
|
"type": "bool",
|
|
"description": "Whether to automatically refresh the token when it expires. Defaults to `true`."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "postgrestOptions",
|
|
"isOptional": true,
|
|
"type": "PostgrestClientOptions",
|
|
"description": "Options to change the Postgrest behaviors.",
|
|
"subContent": [
|
|
{
|
|
"name": "schema",
|
|
"isOptional": true,
|
|
"type": "String",
|
|
"description": "Schema to query with the Supabase client. Defaults to `public`."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "realtimeClientOptions",
|
|
"isOptional": true,
|
|
"type": "RealtimeClientOptions",
|
|
"description": "Options to change the Realtime behaviors.",
|
|
"subContent": [
|
|
{
|
|
"name": "logLevel",
|
|
"isOptional": true,
|
|
"type": "RealtimeLogLevel",
|
|
"description": "Level of realtime server logs to to be logged."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "storageOptions",
|
|
"isOptional": true,
|
|
"type": "StorageClientOptions",
|
|
"description": "Options to change the Storage behaviors.",
|
|
"subContent": [
|
|
{
|
|
"name": "retryAttempts",
|
|
"isOptional": true,
|
|
"type": "int",
|
|
"description": "The number of times to retry a failed upload request. Defaults to `0`."
|
|
},
|
|
{
|
|
"name": "useNewHostname",
|
|
"isOptional": true,
|
|
"type": "bool",
|
|
"description": "Whether to rewrite legacy storage URLs to use the dedicated storage host (`<ref>.storage.supabase.co`). Set to `true` only if your project has the dedicated storage host enabled. Defaults to `false`."
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"examples": [
|
|
{
|
|
"id": "flutter-initialize",
|
|
"name": "For Flutter",
|
|
"code": "```dart\nFuture<void> main() async {\n await Supabase.initialize(\n url: 'https://xyzcompany.supabase.co',\n publishableKey: 'your-publishable-key',\n );\n\n runApp(MyApp());\n}\n\n// Get a reference your Supabase client\nfinal supabase = Supabase.instance.client;\n```\n"
|
|
},
|
|
{
|
|
"id": "for-other-dart-projects",
|
|
"name": "For other Dart projects",
|
|
"code": "```dart\nfinal supabase = SupabaseClient(\n 'https://xyzcompany.supabase.co',\n 'your-secret-key', // use your secret key for server-side usage\n);\n```\n"
|
|
}
|
|
]
|
|
}
|