Repository navigation
docs: wire @supabase/server v1 into the reference pipeline - #47570
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR adds a new Server reference section for ChangesServer Reference Docs
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a6b9b27 to
f3e3d69
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
apps/docs/spec/Makefile (1)
12-12: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
downloadtarget still not declared.PHONY.Static analysis flags this; since
downloadnever produces a file nameddownload, missing.PHONYrisks skipped execution if such a file/dir is ever created. Pre-existing pattern, not introduced by this change, but worth cleaning up while touching this line.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/docs/spec/Makefile` at line 12, The Makefile’s download target is still missing a .PHONY declaration, so it can be skipped if a file or directory named download appears. Update the Makefile near the download target definition to add download to the existing .PHONY list, following the same pattern used for the other non-file targets.Source: Linters/SAST tools
apps/docs/scripts/build-reference-content.ts (1)
31-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove
KIND_TYPE_ALIASnext to the otherKIND_*constants.
It matches TypeDoc’s currentReflectionKind.TypeAlias, but keeping the mapping in one place makes future updates less error-prone.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/docs/scripts/build-reference-content.ts` around lines 31 - 32, The KIND_TYPE_ALIAS mapping is separated from the other KIND_* constants, which makes the ReflectionKind-to-KIND mapping harder to maintain. Move KIND_TYPE_ALIAS into the existing KIND_* constant समूह in build-reference-content.ts so it sits alongside the other ReflectionKind-related constants, keeping all kind mappings grouped in one place for easier updates.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/scripts/build-reference-content.ts`:
- Around line 362-387: The reference-content snapshot coverage is currently
disabled, so the new type-alias and interface handling in
build-reference-content.ts is not exercised in CI. Re-enable the skipped test in
build-reference-content.test.ts so collectReferenceContent('javascript', 'v2')
runs again, or replace it with equivalent active coverage that asserts the
out.typeSpec.variables and out.typeSpec.methods output for the KIND_TYPE_ALIAS
and KIND_INTERFACE branches.
In `@apps/docs/spec/Makefile`:
- Around line 47-49: The spec download target is using curl in a way that can
silently save HTTP error pages into server.json; update the download command in
the download.server.v1 Makefile target to fail on non-2xx responses by adding
curl’s fail behavior alongside the existing flags. Keep the change scoped to the
download.server.v1 rule so scripts/build-reference-content.ts only ever reads a
valid spec file.
---
Nitpick comments:
In `@apps/docs/scripts/build-reference-content.ts`:
- Around line 31-32: The KIND_TYPE_ALIAS mapping is separated from the other
KIND_* constants, which makes the ReflectionKind-to-KIND mapping harder to
maintain. Move KIND_TYPE_ALIAS into the existing KIND_* constant समूह in
build-reference-content.ts so it sits alongside the other ReflectionKind-related
constants, keeping all kind mappings grouped in one place for easier updates.
In `@apps/docs/spec/Makefile`:
- Line 12: The Makefile’s download target is still missing a .PHONY declaration,
so it can be skipped if a file or directory named download appears. Update the
Makefile near the download target definition to add download to the existing
.PHONY list, following the same pattern used for the other non-file targets.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 113a869e-7b03-4524-9a1a-946d0a2f4cf1
📒 Files selected for processing (13)
apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.tsapps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsxapps/docs/content/navigation.references.tsapps/docs/docs/ref/server/installing.mdxapps/docs/docs/ref/server/introduction.mdxapps/docs/features/docs/Reference.constants.tsapps/docs/layouts/MainSkeleton.tsxapps/docs/package.jsonapps/docs/scripts/build-reference-content.tsapps/docs/spec/Makefileapps/docs/spec/reference/server/v1/config.jsonapps/docs/spec/reference/server/v1/partials/installing.mdxapps/docs/spec/reference/server/v1/partials/introduction.mdx
f3e3d69 to
77d9e32
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
apps/docs/spec/Makefile (1)
47-49: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winAdd
--failto the curl download.
curl -sScan exit 0 on HTTP errors, silently writing an error page intoserver.jsonthat only breaks later whenbuild-reference-content.tsparses it.🐛 Proposed fix
download.server.v1: - curl -sS https://supabase.github.io/server/spec.json > $(REPO_DIR)/reference/server/v1/server.json + curl -fsS https://supabase.github.io/server/spec.json > $(REPO_DIR)/reference/server/v1/server.json🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/docs/spec/Makefile` around lines 47 - 49, The download step for download.server.v1 in the Makefile should fail fast on HTTP errors instead of silently saving an error page into server.json. Update the curl invocation to include --fail alongside the existing flags so the target stops immediately when the spec fetch returns a bad status, preventing build-reference-content.ts from parsing invalid JSON later.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@apps/docs/spec/Makefile`:
- Around line 47-49: The download step for download.server.v1 in the Makefile
should fail fast on HTTP errors instead of silently saving an error page into
server.json. Update the curl invocation to include --fail alongside the existing
flags so the target stops immediately when the spec fetch returns a bad status,
preventing build-reference-content.ts from parsing invalid JSON later.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8f0891ac-7b1a-495a-bcf9-9758ccb5beb2
📒 Files selected for processing (13)
apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.tsapps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsxapps/docs/content/navigation.references.tsapps/docs/docs/ref/server/installing.mdxapps/docs/docs/ref/server/introduction.mdxapps/docs/features/docs/Reference.constants.tsapps/docs/layouts/MainSkeleton.tsxapps/docs/package.jsonapps/docs/scripts/build-reference-content.tsapps/docs/spec/Makefileapps/docs/spec/reference/server/v1/config.jsonapps/docs/spec/reference/server/v1/partials/installing.mdxapps/docs/spec/reference/server/v1/partials/introduction.mdx
✅ Files skipped from review due to trivial changes (5)
- apps/docs/spec/reference/server/v1/config.json
- apps/docs/docs/ref/server/introduction.mdx
- apps/docs/spec/reference/server/v1/partials/installing.mdx
- apps/docs/spec/reference/server/v1/partials/introduction.mdx
- apps/docs/docs/ref/server/installing.mdx
🚧 Files skipped from review as they are similar to previous changes (6)
- apps/docs/layouts/MainSkeleton.tsx
- apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx
- apps/docs/scripts/build-reference-content.ts
- apps/docs/content/navigation.references.ts
- apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
- apps/docs/package.json
21563c6 to
753365b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/docs/ref/server/installing.mdx`:
- Around line 50-66: The JSR install section in RefSubLayout.Examples only
includes the Deno command, but the heading says “Deno / Bun”; update this
example block in the installing.mdx content to also include a Bun copy-pasteable
install command alongside the existing deno add jsr:`@supabase/server` example so
both environments are covered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c1212f3e-bb05-45ee-aaec-855ba32adf4f
📒 Files selected for processing (17)
apps/docs/components/Navigation/Navigation.types.tsapps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsxapps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsxapps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.tsapps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsxapps/docs/content/navigation.references.tsapps/docs/docs/ref/server/installing.mdxapps/docs/docs/ref/server/introduction.mdxapps/docs/features/docs/Reference.constants.tsapps/docs/features/docs/Reference.typeSpec.tsapps/docs/layouts/MainSkeleton.tsxapps/docs/package.jsonapps/docs/scripts/build-reference-content.tsapps/docs/spec/Makefileapps/docs/spec/reference/server/v1/config.jsonapps/docs/spec/reference/server/v1/partials/installing.mdxapps/docs/spec/reference/server/v1/partials/introduction.mdx
✅ Files skipped from review due to trivial changes (6)
- apps/docs/spec/reference/server/v1/partials/introduction.mdx
- apps/docs/spec/reference/server/v1/partials/installing.mdx
- apps/docs/spec/reference/server/v1/config.json
- apps/docs/components/Navigation/Navigation.types.ts
- apps/docs/docs/ref/server/introduction.mdx
- apps/docs/package.json
🚧 Files skipped from review as they are similar to previous changes (9)
- apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx
- apps/docs/features/docs/Reference.constants.ts
- apps/docs/features/docs/Reference.typeSpec.ts
- apps/docs/content/navigation.references.ts
- apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx
- apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
- apps/docs/layouts/MainSkeleton.tsx
- apps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsx
- apps/docs/scripts/build-reference-content.ts
|
@jeremenichelli re: empty definitions: oops! :D Fixed it! Reasons:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/docs/scripts/build-reference-content.ts (1)
381-417: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate property→param mapping between
KIND_INTERFACEandKIND_CLASSbranches.Both branches build an identical
paramsarray fromKIND_PROPERTYchildren and construct an identicalMethodTypesshape. Extracting a small shared helper would avoid the two copies drifting apart later.♻️ Suggested refactor
+function collectPropertyParams(children: any[], idMap: Map<number, any>) { + return (children as any[]) + .filter((child: any) => child.kind === KIND_PROPERTY) + .map((prop: any) => ({ + name: prop.name, + comment: prop.comment ? normalizeComment(prop.comment as any) : undefined, + isOptional: prop.flags?.isOptional ?? false, + type: prop.type ? parseType(prop.type, idMap) : undefined, + })) +} + } else if (node.kind === KIND_INTERFACE && node.children) { // Interface — store as a method-like entry so the renderer shows properties as a param table - const params = (node.children as any[]) - .filter((child: any) => child.kind === KIND_PROPERTY) - .map((prop: any) => ({ - name: prop.name, - comment: prop.comment ? normalizeComment(prop.comment as any) : undefined, - isOptional: prop.flags?.isOptional ?? false, - type: prop.type ? parseType(prop.type, idMap) : undefined, - })) + const params = collectPropertyParams(node.children, idMap) const methodEntry: MethodTypes = { name: ref, params, ret: undefined, comment: node.comment ? normalizeComment(node.comment as any) : undefined, } out.typeSpec.methods[ref] = methodEntry } else if (node.kind === KIND_CLASS && node.children) { // Class — ... - const params = (node.children as any[]) - .filter((child: any) => child.kind === KIND_PROPERTY) - .map((prop: any) => ({ - name: prop.name, - comment: prop.comment ? normalizeComment(prop.comment as any) : undefined, - isOptional: prop.flags?.isOptional ?? false, - type: prop.type ? parseType(prop.type, idMap) : undefined, - })) + const params = collectPropertyParams(node.children, idMap) const methodEntry: MethodTypes = { name: ref, params, ret: undefined, comment: node.comment ? normalizeComment(node.comment as any) : undefined, } out.typeSpec.methods[ref] = methodEntry }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/docs/scripts/build-reference-content.ts` around lines 381 - 417, Both the KIND_INTERFACE and KIND_CLASS branches in build-reference-content.ts duplicate the same property-to-params mapping and MethodTypes construction, so extract that shared logic into a small helper and reuse it from both branches. Keep the helper responsible for filtering KIND_PROPERTY children, normalizing comments, setting isOptional, and parsing types with parseType/idMap, then have each branch only pass the node and ref into it before assigning to out.typeSpec.methods[ref].
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/docs/features/docs/Reference.typeSpec.ts`:
- Around line 263-281: The deprecated-note escaping in Reference.typeSpec.ts
only handles angle brackets, so MDX can still fail on literal curly braces in
`@deprecated` text. Update the deprecated block in the comment handling logic that
builds comment.text from deprecatedTag.content to also escape { and } alongside
< and >, keeping the note safe for MDX rendering and preserving the existing
fallback behavior for inline links and empty notes.
---
Nitpick comments:
In `@apps/docs/scripts/build-reference-content.ts`:
- Around line 381-417: Both the KIND_INTERFACE and KIND_CLASS branches in
build-reference-content.ts duplicate the same property-to-params mapping and
MethodTypes construction, so extract that shared logic into a small helper and
reuse it from both branches. Keep the helper responsible for filtering
KIND_PROPERTY children, normalizing comments, setting isOptional, and parsing
types with parseType/idMap, then have each branch only pass the node and ref
into it before assigning to out.typeSpec.methods[ref].
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c417618c-6e9a-45c7-a165-bb8392fc9fdb
📒 Files selected for processing (17)
apps/docs/components/Navigation/Navigation.types.tsapps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsxapps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsxapps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.tsapps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsxapps/docs/content/navigation.references.tsapps/docs/docs/ref/server/installing.mdxapps/docs/docs/ref/server/introduction.mdxapps/docs/features/docs/Reference.constants.tsapps/docs/features/docs/Reference.typeSpec.tsapps/docs/layouts/MainSkeleton.tsxapps/docs/package.jsonapps/docs/scripts/build-reference-content.tsapps/docs/spec/Makefileapps/docs/spec/reference/server/v1/config.jsonapps/docs/spec/reference/server/v1/partials/installing.mdxapps/docs/spec/reference/server/v1/partials/introduction.mdx
✅ Files skipped from review due to trivial changes (6)
- apps/docs/spec/reference/server/v1/config.json
- apps/docs/docs/ref/server/introduction.mdx
- apps/docs/features/docs/Reference.constants.ts
- apps/docs/spec/reference/server/v1/partials/introduction.mdx
- apps/docs/spec/reference/server/v1/partials/installing.mdx
- apps/docs/docs/ref/server/installing.mdx
🚧 Files skipped from review as they are similar to previous changes (8)
- apps/docs/layouts/MainSkeleton.tsx
- apps/docs/components/Navigation/Navigation.types.ts
- apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx
- apps/docs/content/navigation.references.ts
- apps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsx
- apps/docs/package.json
- apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx
- apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
|
Looks like all the empty boxes are gone, so good with me now. @jeremenichelli any final opinions? |
|
if @jeremenichelli is ok, then can i merge? |
|
Sorry @mandarini I was reviewing this and the power went out on my neighborhood, just re-connected. After seeing the preview, it looks awesome, great job.GO ahead 💪 |
Braintrust eval report
|



I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Docs update.
What is the current behavior?
@supabase/serverhas no reference documentation page in the Supabase docs. The library publishes a TypeDoc spec to GitHub Pages but the docs pipeline was not wired up to consume it.What is the new behavior?
spec/reference/server/v1/with aconfig.json(category order: Middleware, Primitives, Adapters, Errors, Types) andpartials/for the introduction and installing pages.download.server.v1Makefile target that fetcheshttps://supabase.github.io/server/spec.jsonintospec/reference/server/v1/server.json, and wires it into the top-leveldownloadtarget so it runs with the rest.server-v1inSUPPORTS_NEW_REFERENCE_PROCESSso the build pipeline picks up the new spec directory and generatescontent/reference/server/v1/at build time.docs/ref/server/partials (introduction and installing) that the reference router serves.Additional context
The TypeDoc spec is produced by
@supabase/server'sdocs.ymlworkflow on every push tomain, somake download.server.v1will always pull the latest published API surface. The companion PR in the server repo (supabase/server#95) adds the@categorytags that the pipeline requires for symbols to appear in navigation.Summary by CodeRabbit
New Features
/reference/serverand marked with a New badge.@supabase/server, including Introduction and Installing pages.Chores / Improvements