Skip to content

ci: generate TypeDoc JSON and publish to GitHub Pages#1034

Open
grdsdev wants to merge 8 commits into
mainfrom
feat/generate-swift-docs
Open

ci: generate TypeDoc JSON and publish to GitHub Pages#1034
grdsdev wants to merge 8 commits into
mainfrom
feat/generate-swift-docs

Conversation

@grdsdev

@grdsdev grdsdev commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds .github/workflows/generate-swift-docs.yml which runs on push to main (when Sources/ or Package.swift change) and on a daily schedule
  • Uses swift package dump-symbol-graph to extract public symbol graphs, then converts them to TypeDoc-compatible JSON via the supabase/sdk swift-docs tool
  • Publishes the result to GitHub Pages at supabase.github.io/supabase-swift/v2/spec.json

This powers the Swift v2 reference docs at supabase.com — the supabase/supabase pipeline downloads from that URL (see companion PR).

How it works

swift package dump-symbol-graph   →   .build/<arch>/symbolgraph/*.symbols.json
       ↓
supabase/sdk scripts/swift-docs   →   TypeDoc-compatible JSON
       ↓
GitHub Pages: supabase.github.io/supabase-swift/v2/spec.json
       ↓
supabase/supabase make download.swift.v2   →   docs site

Categories are mapped from Swift module names automatically:

Module Docs category
Auth Authentication
PostgREST Database
Realtime Realtime
Storage Storage
Functions Edge Functions
Supabase Client

Test plan

  • Verify the workflow runs successfully on this branch (trigger via workflow_dispatch)
  • Confirm supabase.github.io/supabase-swift/v2/spec.json is accessible after merge
  • Check that SupabaseClient, AuthClient and other public types appear in the JSON with correct categories

Adds a workflow that runs swift package dump-symbol-graph on push to main
and on a daily schedule, converts the symbol graphs to TypeDoc-compatible
JSON using supabase/sdk scripts/swift-docs, and publishes to GitHub Pages
at supabase.github.io/supabase-swift/v2/spec.json.

The supabase/supabase docs pipeline downloads from that URL to power the
Swift v2 reference at supabase.com/docs/reference/swift/v2.
grdsdev added 3 commits June 24, 2026 11:47
Moves the TypeScript tool that generates TypeDoc JSON from Swift Symbol
Graphs into scripts/swift-docs/ so it lives alongside the SDK it
serves, rather than requiring a cross-repo checkout at CI time.

Updates generate-swift-docs.yml to use the local tool directly;
removes the supabase/sdk checkout step and updates working-directory
paths accordingly. Also triggers on changes to scripts/swift-docs/**.
grdsdev added a commit to supabase/supabase that referenced this pull request Jun 24, 2026
Generated from supabase/supabase-swift#1034 workflow run 28107689217.
This file is normally gitignored and downloaded at build time via the
Makefile download.swift.v2 target once GitHub Pages is enabled.
Force-added here only to unblock e2e pipeline testing.
grdsdev added 3 commits June 24, 2026 13:48
build-reference-content.ts guards on node.variant === 'declaration'
before adding a symbol to the functions list (and thus category
navigation). Without this field, all 866 Swift symbols were in typeSpec
but none were emitted as function slugs, giving 0 categories.

Adds variant to the TypeDocDeclaration type and sets it on every
declaration object produced by the transform.
…c for named types

Parameter declarationFragments include the external argument label before the
": " separator — strip it so the type name is just the Swift type (e.g. UUID,
not uid: UUID).

Replace reference type fallback with intrinsic for simple identifiers. Using
reference caused TypeDoc's id-lookup path to collapse to nameOnly when there
was no id to dereference. The docs renderer's ReturnTypeDetails component skips
nameOnly types, hiding return type info for all Swift methods.
…gments

paramTypeFragments now handles two additional cases:
1. Array/dict types where Swift bundles the colon and opening bracket as
   one fragment (e.g. ": [" → keeps "[" prefix for the type).
2. Computed property accessor blocks ("? { get }", "{ get set }", etc.)
   that trail the type — truncate at the first "{" to keep only the type.

Adds a new test suite for paramTypeFragments covering all three forms.
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.

2 participants