Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1f2617c
feat(realtime-v3): add PhoenixMessage and PhoenixPayload
grdsdev Jun 27, 2026
f2c7b81
chore: add swift-openapi-runtime and codegen Makefile targets
grdsdev Jun 30, 2026
59484f2
chore: add .PHONY for codegen Makefile targets
grdsdev Jun 30, 2026
319483b
feat(codegen): add Smithy models for Storage and Functions
grdsdev Jun 30, 2026
32675b3
chore(codegen): track smithy output directory in git
grdsdev Jun 30, 2026
dfc7368
feat(codegen): generate OpenAPI specs and Swift clients from Smithy m…
grdsdev Jun 30, 2026
5c9aebf
fix(codegen): resolve Types.swift SPM conflict and portable Makefile …
grdsdev Jun 30, 2026
74d7202
feat(helpers): add SupabaseClientTransport for generated API clients
grdsdev Jun 30, 2026
cf4a2db
fix(helpers): use URLSessionTransport for streaming in SupabaseClient…
grdsdev Jun 30, 2026
2ef6d10
feat(storage): wire bucket operations to generated client (Task 5)
grdsdev Jun 30, 2026
3c1ba25
fix(storage): address code review findings from task 5
grdsdev Jun 30, 2026
9cd501f
fix(storage): make generatedClient private
grdsdev Jun 30, 2026
bb6d97b
feat(functions): delegate invoke to generated Smithy client
grdsdev Jun 30, 2026
9ce8648
fix(functions): preserve raw error bytes on 400 badRequest response
grdsdev Jun 30, 2026
71f393c
fix(codegen): wire SupabaseClientTransport in production init; exclud…
grdsdev Jun 30, 2026
8b29046
feat(helpers): add SupabaseMiddleware; simplify SupabaseClientTransport
grdsdev Jun 30, 2026
a39829b
refactor(helpers): delete SupabaseClientTransport; use URLSessionTran…
grdsdev Jun 30, 2026
895b91d
feat(functions): add RelayErrorMiddleware; wire SupabaseMiddleware in…
grdsdev Jun 30, 2026
8050e9a
feat(functions): add RelayErrorMiddleware; wire SupabaseMiddleware in…
grdsdev Jun 30, 2026
10f895e
spike(storage): add uploadObject/updateObject multipart operations wi…
grdsdev Jun 30, 2026
e6aee66
spike(storage): add TUS operations to Smithy model; patch streaming b…
grdsdev Jun 30, 2026
4039867
spike(storage): wire generated client into upload/update/TUS methods
grdsdev Jun 30, 2026
be1f5af
spike(functions): supersede _HTTPClient with generated client entirely
grdsdev Jun 30, 2026
61350d4
spike(functions): add GET/PUT/PATCH/DELETE invoke methods via multi-o…
grdsdev Jun 30, 2026
57b3603
spike(postgrest): generate Swift client from shared DatabaseService m…
grdsdev Jul 1, 2026
41584cc
spike(typespec): generate Swift clients from TypeSpec OpenAPI (PR #53…
grdsdev Jul 1, 2026
744dac5
spike(typespec): regenerate PostgREST Swift client from fixed TypeSpe…
grdsdev Jul 1, 2026
4f29a3b
spike(typespec): regenerate Storage and PostgREST Swift clients from …
grdsdev Jul 1, 2026
ed14e50
spike(typespec): regenerate PostgREST client with HTTPBody response/r…
grdsdev Jul 1, 2026
7c171a8
spike(typespec): regenerate Functions and PostgREST clients with corr…
grdsdev Jul 1, 2026
16406b4
spike(typespec): regenerate Functions client with multi-type response…
grdsdev Jul 1, 2026
e29d814
spike(typespec): regenerate Functions client with generic HTTPBody (*…
grdsdev Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ yarn-debug.log*
yarn-error.log*
.jj/
.treq/
smithy/build/
2 changes: 2 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
brew "smithy-language-server" # provides smithy CLI, pin via brew pin if needed
brew "swift-openapi-generator" # or install via mint/artifact
53 changes: 53 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,56 @@ coverage:
define udid_for
$(shell xcrun simctl list --json devices available '$(1)' | jq -r '[.devices|to_entries|sort_by(.key)|reverse|.[].value|select(length > 0)|.[0]][0].udid')
endef

# ── Code generation ────────────────────────────────────────────────────────────

.PHONY: sync-models generate-smithy generate-swift-storage generate-swift-functions generate-swift-postgrest generate check-generate check-swift-openapi-generator

# Path to a local checkout of supabase/sdk (override with SDK_REPO=/path/to/sdk)
SDK_REPO ?= $(shell git rev-parse --show-toplevel)/../../sdk

check-swift-openapi-generator:
@which swift-openapi-generator > /dev/null 2>&1 || \
(echo "Error: swift-openapi-generator not found in PATH. Build from source: https://github.com/apple/swift-openapi-generator" && exit 1)

# Copy pre-generated OpenAPI artifacts from supabase/sdk (no Smithy install needed)
sync-models:
@test -d "$(SDK_REPO)/smithy/openapi" || \
(echo "Error: supabase/sdk repo not found at $(SDK_REPO). Clone it or set SDK_REPO=/path/to/sdk" && exit 1)
cp "$(SDK_REPO)/smithy/openapi/StorageService.openapi.json" smithy/output/openapi/StorageService.openapi.json
cp "$(SDK_REPO)/smithy/openapi/FunctionsService.openapi.json" smithy/output/openapi/FunctionsService.openapi.json
cp "$(SDK_REPO)/smithy/openapi/DatabaseService.openapi.json" smithy/output/openapi/DatabaseService.openapi.json
python3 smithy/patch-openapi.py smithy/output/openapi/StorageService.openapi.json
@echo "Models synced from $(SDK_REPO)"

# Build Smithy models locally (requires Smithy CLI; use sync-models instead if not installed)
generate-smithy:
cd "$(SDK_REPO)/smithy" && smithy build
cp "$(SDK_REPO)/smithy/build/smithy/storage-openapi/openapi/StorageService.openapi.json" smithy/output/openapi/StorageService.openapi.json
cp "$(SDK_REPO)/smithy/build/smithy/functions-openapi/openapi/FunctionsService.openapi.json" smithy/output/openapi/FunctionsService.openapi.json
cp "$(SDK_REPO)/smithy/build/smithy/database-openapi/openapi/DatabaseService.openapi.json" smithy/output/openapi/DatabaseService.openapi.json
python3 smithy/patch-openapi.py smithy/output/openapi/StorageService.openapi.json

generate-swift-storage: check-swift-openapi-generator
swift-openapi-generator generate \
--config Sources/Storage/openapi-generator-config.yaml \
--output-directory Sources/Storage/Generated \
smithy/output/openapi/StorageService.openapi.json

generate-swift-functions: check-swift-openapi-generator
swift-openapi-generator generate \
--config Sources/Functions/openapi-generator-config.yaml \
--output-directory Sources/Functions/Generated \
smithy/output/openapi/FunctionsService.openapi.json

generate-swift-postgrest: check-swift-openapi-generator
swift-openapi-generator generate \
--config Sources/PostgREST/openapi-generator-config.yaml \
--output-directory Sources/PostgREST/Generated \
smithy/output/openapi/DatabaseService.openapi.json

generate: sync-models generate-swift-storage generate-swift-functions generate-swift-postgrest

check-generate:
$(MAKE) generate
git diff --exit-code || (echo "Generated artifacts are out of date. Run 'make generate' and commit." && exit 1)
29 changes: 28 additions & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ let package = Package(
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.2.2"),
.package(url: "https://github.com/WeTransfer/Mocker", from: "3.0.0"),
.package(url: "https://github.com/mattt/Replay.git", from: "0.4.0"),
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.0"),
],
targets: [
.target(
Expand All @@ -41,11 +43,13 @@ let package = Package(
.product(name: "Clocks", package: "swift-clocks"),
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"),
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
]
),
.testTarget(
name: "HelpersTests",
dependencies: [
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "CustomDump", package: "swift-custom-dump"),
"Helpers",
]
Expand Down Expand Up @@ -79,10 +83,11 @@ let package = Package(
.target(
name: "Functions",
dependencies: [
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "HTTPTypes", package: "swift-http-types"),
"Helpers",
]
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
],
exclude: ["openapi-generator-config.yaml"]
),
.testTarget(
name: "FunctionsTests",
Expand All @@ -91,6 +96,8 @@ let package = Package(
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"),
.product(name: "Replay", package: "Replay"),
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"),
"Functions",
"Mocker",
Expand Down Expand Up @@ -162,17 +169,19 @@ let package = Package(
.target(
name: "Storage",
dependencies: [
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "HTTPTypes", package: "swift-http-types"),
"Helpers",
]
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
],
exclude: ["openapi-generator-config.yaml"]
),
.testTarget(
name: "StorageTests",
dependencies: [
.product(name: "CustomDump", package: "swift-custom-dump"),
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"),
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"),
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
"Mocker",
"TestHelpers",
"Storage",
Expand Down
Loading
Loading