diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 3307c0525..88948bccb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -27,7 +27,7 @@ body: - postgrest - realtime_client - storage_client - - functions_client + - supabase_functions - yet_another_json_isolate - unsure/all/other validations: @@ -58,10 +58,10 @@ body: Output of `flutter doctor -v`, plus the versions of the affected packages. On Linux/macOS: - `dart pub deps | grep -E "supabase|postgrest|storage_client|realtime_client|functions_client"` + `dart pub deps | grep -E "supabase|postgrest|storage_client|realtime_client"` On Windows: - `dart pub deps | findstr "supabase postgrest storage_client realtime_client functions_client"` + `dart pub deps | findstr "supabase postgrest storage_client realtime_client"` render: shell placeholder: Flutter, Dart and package versions validations: diff --git a/.github/workflows/label-issues.yml b/.github/workflows/label-issues.yml index ff32e0499..ec5949f1b 100644 --- a/.github/workflows/label-issues.yml +++ b/.github/workflows/label-issues.yml @@ -30,6 +30,7 @@ jobs: "postgrest": "postgrest", "functions": "functions", "functions_client": "functions", + "supabase_functions": "functions", "auth_ui": "auth-ui", "supabase": "supabase", "supabase_flutter": "supabase_flutter" diff --git a/.github/workflows/release-pana.yml b/.github/workflows/release-pana.yml index 7248398cf..25686b227 100644 --- a/.github/workflows/release-pana.yml +++ b/.github/workflows/release-pana.yml @@ -25,7 +25,6 @@ jobs: fail-fast: false matrix: package: - - functions_client - postgrest - realtime_client - storage_client @@ -33,6 +32,7 @@ jobs: - supabase_auth - supabase_common - supabase_flutter + - supabase_functions - supabase_typegen - yet_another_json_isolate steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0568bed2f..9c6dd331b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,7 +64,7 @@ jobs: echo "Affected packages:" echo "$CHANGED" - DART_PACKAGES="functions_client postgrest realtime_client storage_client supabase supabase_auth supabase_common supabase_typegen yet_another_json_isolate" + DART_PACKAGES="postgrest realtime_client storage_client supabase supabase_auth supabase_common supabase_functions supabase_typegen yet_another_json_isolate" entries=() for package in $DART_PACKAGES; do @@ -344,7 +344,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true - carryforward: 'functions_client,postgrest,realtime_client,storage_client,supabase,supabase_auth,supabase_common,supabase_typegen,yet_another_json_isolate,supabase_flutter' + carryforward: 'postgrest,realtime_client,storage_client,supabase,supabase_auth,supabase_common,supabase_functions,supabase_typegen,yet_another_json_isolate,supabase_flutter' fail-on-error: false test-result: diff --git a/AGENTS.md b/AGENTS.md index e9ef41dfd..bfa09b8ae 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,7 +16,7 @@ The repository follows a layered dependency structure: - **postgrest**: Database query client with ORM-style API - **realtime_client**: WebSocket client for real-time subscriptions - **storage_client**: File storage client with retry logic -- **functions_client**: Edge functions invocation client +- **supabase_functions**: Edge functions invocation client - **yet_another_json_isolate**: JSON parsing in separate isolate for performance Key architectural patterns: diff --git a/MIGRATION.md b/MIGRATION.md index 91d065165..23365ba1c 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -5,7 +5,7 @@ versions of the Supabase Flutter SDK, together with the steps required to migrat All packages in this repository are released together for a major version, so a single section covers `supabase_flutter`, `supabase`, `supabase_auth`, `postgrest`, `realtime_client`, `storage_client` -and `functions_client`. Every symbol mentioned here is re-exported from `supabase_flutter`, so the +and `supabase_functions`. Every symbol mentioned here is re-exported from `supabase_flutter`, so the snippets apply whether you depend on the individual package or on the Flutter one. ## Migrating from v2 to v3 @@ -114,6 +114,39 @@ themselves can drop the `Uri.parse()`. The URL the server receives is unchanged, only the Dart type differs. +### The `functions_client` package is now `supabase_functions` + +`functions_client` says nothing about Supabase and does not match how the rest of the packages are +named. The package is published as `supabase_functions` from v3 onwards, and the `functions_client` +package is discontinued on pub.dev when v3 ships. + +If you depend on `supabase_flutter` or `supabase` you do not need to change anything, both pull in +`supabase_functions` for you and re-export it. + +If you depend on the functions client directly, rename the dependency and the import: + +```yaml +# Before +dependencies: + functions_client: ^2.7.1 + +# After +dependencies: + supabase_functions: ^3.0.0 +``` + +```dart +// Before +import 'package:functions_client/functions_client.dart'; + +// After +import 'package:supabase_functions/supabase_functions.dart'; +``` + +No types are renamed, `FunctionsClient` and everything around it keep their names. Nothing about +the wire format changes either: the `X-Client-Info` header still identifies this client as +`functions-dart`. + ### `RealtimeClient.connectionState` is now typed `RealtimeClient` used to expose the socket state twice: a typed `connState` field and a stringly @@ -528,7 +561,7 @@ you can also branch on the response of `exchangeCodeForSession()` directly. ### `HttpMethod` is one shared enum -`functions_client` and `postgrest` each declared their own `HttpMethod`. There is now one, shaped +`supabase_functions` and `postgrest` each declared their own `HttpMethod`. There is now one, shaped like postgrest's and re-exported from both, so imports are unchanged and postgrest callers are unaffected. For `functions.invoke`, two things changed: diff --git a/packages/functions_client/lib/src/version.dart b/packages/functions_client/lib/src/version.dart deleted file mode 100644 index 955618186..000000000 --- a/packages/functions_client/lib/src/version.dart +++ /dev/null @@ -1 +0,0 @@ -const version = '2.7.1'; diff --git a/packages/supabase/lib/supabase.dart b/packages/supabase/lib/supabase.dart index ecaa9d377..3a44ec097 100644 --- a/packages/supabase/lib/supabase.dart +++ b/packages/supabase/lib/supabase.dart @@ -3,7 +3,7 @@ /// to build secure and scalable products. library; -export 'package:functions_client/functions_client.dart'; +export 'package:supabase_functions/supabase_functions.dart'; export 'package:supabase_auth/supabase_auth.dart'; export 'package:postgrest/postgrest.dart'; export 'package:realtime_client/realtime_client.dart'; diff --git a/packages/supabase/pubspec.yaml b/packages/supabase/pubspec.yaml index 7fbae5b84..394b9b486 100644 --- a/packages/supabase/pubspec.yaml +++ b/packages/supabase/pubspec.yaml @@ -18,7 +18,6 @@ environment: resolution: workspace dependencies: - functions_client: 2.7.1 http: ^1.6.0 meta: ^1.7.0 postgrest: 2.9.1 @@ -26,6 +25,7 @@ dependencies: storage_client: 2.8.0 supabase_auth: 3.0.0-dev.1 supabase_common: 0.1.2 + supabase_functions: 3.0.0-dev.1 yet_another_json_isolate: 2.1.1 logging: ^1.3.0 diff --git a/packages/supabase_common/README.md b/packages/supabase_common/README.md index a0d8d1507..485f19c16 100644 --- a/packages/supabase_common/README.md +++ b/packages/supabase_common/README.md @@ -8,7 +8,7 @@ Shared internal utilities used across the Supabase Dart and Flutter client packages (`supabase_auth`, `postgrest`, `realtime_client`, `storage_client`, -`functions_client`, `supabase`, `supabase_flutter`). +`supabase_functions`, `supabase`, `supabase_flutter`). This package holds code that would otherwise be duplicated across those packages: the `SupabaseException` base class the auth, postgrest, storage and diff --git a/packages/supabase_flutter/README.md b/packages/supabase_flutter/README.md index ca4078c30..4127136e7 100644 --- a/packages/supabase_flutter/README.md +++ b/packages/supabase_flutter/README.md @@ -593,7 +593,7 @@ supabaseLogger.onRecord.listen((record) { - `supabase_auth`: `Logger('supabase.auth')` - `realtime_client`: `Logger('supabase.realtime')` - `storage_client`: `Logger('supabase.storage')` -- `functions_client`: `Logger('supabase.functions')` +- `supabase_functions`: `Logger('supabase.functions')` --- diff --git a/packages/functions_client/CHANGELOG.md b/packages/supabase_functions/CHANGELOG.md similarity index 100% rename from packages/functions_client/CHANGELOG.md rename to packages/supabase_functions/CHANGELOG.md diff --git a/packages/functions_client/LICENSE b/packages/supabase_functions/LICENSE similarity index 100% rename from packages/functions_client/LICENSE rename to packages/supabase_functions/LICENSE diff --git a/packages/functions_client/README.md b/packages/supabase_functions/README.md similarity index 78% rename from packages/functions_client/README.md rename to packages/supabase_functions/README.md index d2f938af2..b6e3ae817 100644 --- a/packages/functions_client/README.md +++ b/packages/supabase_functions/README.md @@ -4,7 +4,7 @@ Supabase Logo -

functions_client

+

supabase_functions

Dart client library to interact with Supabase Edge Functions. @@ -19,11 +19,15 @@

-[![pub package](https://img.shields.io/pub/v/functions_client.svg)](https://pub.dev/packages/functions_client) +[![pub package](https://img.shields.io/pub/v/supabase_functions.svg)](https://pub.dev/packages/supabase_functions) [![pub test](https://github.com/supabase/supabase-flutter/workflows/Test/badge.svg)](https://github.com/supabase/supabase-flutter/actions?query=workflow%3ATest)
+> **Note** +> +> This package was published as `functions_client` up to and including v2. That package is discontinued in favour of `supabase_functions`. + ## Docs The docs can be found on the official Supabase website. diff --git a/packages/functions_client/analysis_options.yaml b/packages/supabase_functions/analysis_options.yaml similarity index 100% rename from packages/functions_client/analysis_options.yaml rename to packages/supabase_functions/analysis_options.yaml diff --git a/packages/functions_client/example/functions_dart_example.dart b/packages/supabase_functions/example/functions_dart_example.dart similarity index 92% rename from packages/functions_client/example/functions_dart_example.dart rename to packages/supabase_functions/example/functions_dart_example.dart index 105e9b29e..503b627f8 100644 --- a/packages/functions_client/example/functions_dart_example.dart +++ b/packages/supabase_functions/example/functions_dart_example.dart @@ -1,6 +1,6 @@ // ignore_for_file: avoid_print -import 'package:functions_client/functions_client.dart'; +import 'package:supabase_functions/supabase_functions.dart'; /// Example to use with Supabase Edge Functions https://supabase.com/ Future main() async { diff --git a/packages/functions_client/lib/src/constants.dart b/packages/supabase_functions/lib/src/constants.dart similarity index 80% rename from packages/functions_client/lib/src/constants.dart rename to packages/supabase_functions/lib/src/constants.dart index 451132ae5..1206ceeb7 100644 --- a/packages/functions_client/lib/src/constants.dart +++ b/packages/supabase_functions/lib/src/constants.dart @@ -1,4 +1,4 @@ -import 'package:functions_client/src/version.dart'; +import 'package:supabase_functions/src/version.dart'; import 'package:supabase_common/supabase_common.dart'; import 'package:meta/meta.dart'; diff --git a/packages/functions_client/lib/src/functions_client.dart b/packages/supabase_functions/lib/src/functions_client.dart similarity index 98% rename from packages/functions_client/lib/src/functions_client.dart rename to packages/supabase_functions/lib/src/functions_client.dart index e5afafcfe..7e01755ce 100644 --- a/packages/functions_client/lib/src/functions_client.dart +++ b/packages/supabase_functions/lib/src/functions_client.dart @@ -1,9 +1,9 @@ import 'dart:convert'; import 'dart:typed_data'; -import 'package:functions_client/src/constants.dart'; -import 'package:functions_client/src/types.dart'; -import 'package:functions_client/src/version.dart'; +import 'package:supabase_functions/src/constants.dart'; +import 'package:supabase_functions/src/types.dart'; +import 'package:supabase_functions/src/version.dart'; import 'package:http/http.dart' as http; import 'package:http/http.dart' show MultipartRequest; import 'package:logging/logging.dart'; diff --git a/packages/functions_client/lib/src/types.dart b/packages/supabase_functions/lib/src/types.dart similarity index 100% rename from packages/functions_client/lib/src/types.dart rename to packages/supabase_functions/lib/src/types.dart diff --git a/packages/supabase_functions/lib/src/version.dart b/packages/supabase_functions/lib/src/version.dart new file mode 100644 index 000000000..7f2f1c7d4 --- /dev/null +++ b/packages/supabase_functions/lib/src/version.dart @@ -0,0 +1 @@ +const version = '3.0.0-dev.1'; diff --git a/packages/functions_client/lib/functions_client.dart b/packages/supabase_functions/lib/supabase_functions.dart similarity index 100% rename from packages/functions_client/lib/functions_client.dart rename to packages/supabase_functions/lib/supabase_functions.dart diff --git a/packages/functions_client/pubspec.yaml b/packages/supabase_functions/pubspec.yaml similarity index 88% rename from packages/functions_client/pubspec.yaml rename to packages/supabase_functions/pubspec.yaml index 9f856980f..18f574475 100644 --- a/packages/functions_client/pubspec.yaml +++ b/packages/supabase_functions/pubspec.yaml @@ -1,8 +1,8 @@ -name: functions_client +name: supabase_functions description: A dart client library for the Supabase functions. -version: 2.7.1 +version: 3.0.0-dev.1 homepage: 'https://supabase.com' -repository: 'https://github.com/supabase/supabase-flutter/tree/main/packages/functions_client' +repository: 'https://github.com/supabase/supabase-flutter/tree/main/packages/supabase_functions' issue_tracker: 'https://github.com/supabase/supabase-flutter/issues' documentation: 'https://supabase.com/docs/reference/dart/functions-invoke' topics: diff --git a/packages/functions_client/test/custom_http_client.dart b/packages/supabase_functions/test/custom_http_client.dart similarity index 100% rename from packages/functions_client/test/custom_http_client.dart rename to packages/supabase_functions/test/custom_http_client.dart diff --git a/packages/functions_client/test/functions_dart_test.dart b/packages/supabase_functions/test/functions_dart_test.dart similarity index 99% rename from packages/functions_client/test/functions_dart_test.dart rename to packages/supabase_functions/test/functions_dart_test.dart index 0dbba6e34..7908f41ca 100644 --- a/packages/functions_client/test/functions_dart_test.dart +++ b/packages/supabase_functions/test/functions_dart_test.dart @@ -2,8 +2,8 @@ import 'dart:async'; import 'dart:convert'; import 'dart:typed_data'; -import 'package:functions_client/src/functions_client.dart'; -import 'package:functions_client/src/types.dart'; +import 'package:supabase_functions/src/functions_client.dart'; +import 'package:supabase_functions/src/types.dart'; import 'package:http/http.dart'; import 'package:logging/logging.dart'; import 'package:supabase_common/supabase_common.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 587abb511..10bd97f80 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: '>=3.9.0 <4.0.0' workspace: - - packages/functions_client + - packages/supabase_functions - packages/supabase_auth - packages/postgrest - packages/realtime_client diff --git a/sdk-compliance.yaml b/sdk-compliance.yaml index ff023f2a4..7274d43b7 100644 --- a/sdk-compliance.yaml +++ b/sdk-compliance.yaml @@ -15,7 +15,7 @@ # explains why. # # Verified against the source in this repository (packages/supabase_auth, postgrest, -# storage_client, realtime_client, functions_client, supabase, supabase_flutter). +# storage_client, realtime_client, supabase_functions, supabase, supabase_flutter). # Unlisted features default to not_implemented. sdk: flutter