mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 23:49:03 +00:00
## Problem Agents have no single index of the docs markdown exports, unlike the KB's `sitemap.md`. www's `/llms.txt` and `/llms-full.txt` also read docs files from disk, which forces www's build to wait on the docs build. ## Solution **docs** - Add `build:markdown-sitemap`, which writes `public/markdown/sitemap.md`. It scans `public/markdown/**/*.md` and lists each file as `[title](url.md)`. Guide URLs are `/docs/guides/<page>.md` and the rest are `/docs/markdown/<page>.md`, built with the existing `internal-links` helpers. - Add `build:markdown-full`, which writes `public/markdown/full.md`. It concatenates the same files. - Both scripts share one file-list helper (`internals/markdown-files.ts`), so they always cover the same files and exclude `sitemap.md` and `full.md`. - Both tasks depend on `build:markdown` and are wired into `build` in turbo. - Search v2 ingestion and the `docs.tar.gz` archive now ignore both files. **www** - `/llms.txt` and `/llms-full.txt` now fetch `sitemap.md` and `full.md` from `NEXT_PUBLIC_DOCS_URL`, replacing only their docs parts. Pricing, product overviews, agent resources, the KB link and the customer stories link are unchanged. If docs is unreachable, the docs section is left out instead of returning a 404. - Remove the on-disk docs reads, the `outputFileTracingIncludes` entries, and the `docs#build:guides-markdown` dependency and docs input globs from www's turbo config. These routes were the only link between www and the docs build. `turbo-build.test.ts` is updated to match. - Add a `/docs.md` → `/docs/markdown/sitemap.md` redirect, next to the existing `/kb.md` one. Routes without a markdown export are not patched, they are simply absent from the sitemap. ## Review instructions From the Docs preview link: 1. Open /docs/markdown/sitemap.md it should show a file with all links to the docs pages available in markdown 1. Open /docs/markdown/full.md it should show a file with all the content from all the pages Sadly, only after deployed... 1. www project should return the content of both files when: a. supabase.com/llms.txt is queried should return docs sitemap.md content b. supabase.com/llms-full.txt is queried should return docs full.md content 1. supabase.com/docs.md should return sitemap.md file ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
241 lines
8.0 KiB
JSON
241 lines
8.0 KiB
JSON
{
|
|
"$schema": "./../../node_modules/turbo/schema.json",
|
|
"extends": ["//"],
|
|
"tasks": {
|
|
// Generated artifacts are gitignored, so tasks downstream of an uncached task list the
|
|
// files it writes in `inputs` explicitly, in "jit" mode so they're hashed after that task
|
|
// runs. Otherwise a cache hit could restore output built from stale remote content.
|
|
|
|
"codegen:graphql": {
|
|
"outputs": ["__generated__/**"],
|
|
},
|
|
"codegen:examples": {
|
|
"inputs": ["$TURBO_ROOT$/examples/**"],
|
|
"outputs": ["examples/**"],
|
|
},
|
|
// Downloads the TypeDoc dumps only when they're missing, so it depends on local state
|
|
// rather than on inputs.
|
|
"codegen:references:new:ensure": {
|
|
"cache": false,
|
|
},
|
|
"codegen:references:dart": {
|
|
"outputs": ["spec/reference/dart/v2/supabase_flutter.json"],
|
|
},
|
|
"codegen:references:new": {
|
|
"dependsOn": ["codegen:references:new:ensure", "codegen:references:dart"],
|
|
"inputs": ["$TURBO_DEFAULT$", { "mode": "jit", "globs": ["spec/reference/**"] }],
|
|
"outputs": ["content/reference/**"],
|
|
},
|
|
// Shares features/docs/generated/ with build:federated-content, so only claim this
|
|
// script's own files.
|
|
"codegen:references:legacy": {
|
|
"outputs": [
|
|
"features/docs/generated/*.functions.json",
|
|
"features/docs/generated/*.sections.json",
|
|
"features/docs/generated/*.flat.json",
|
|
"features/docs/generated/*.bySlug.json",
|
|
"features/docs/generated/*.endpointsById.json",
|
|
],
|
|
},
|
|
// No script: runs both reference codegen steps.
|
|
"codegen:references": {
|
|
"dependsOn": ["codegen:references:legacy", "codegen:references:new"],
|
|
},
|
|
|
|
// Fetches remote (GitHub) content and the JSON artifacts the markdown generator reads.
|
|
// Not cached: the inputs are remote, so a cache restore could resurrect stale content.
|
|
"build:federated-content": {
|
|
"cache": false,
|
|
"env": [
|
|
"DOCS_GITHUB_APP_ID",
|
|
"DOCS_GITHUB_APP_INSTALLATION_ID",
|
|
"DOCS_GITHUB_APP_PRIVATE_KEY",
|
|
],
|
|
// Local-run fallback credentials.
|
|
"passThroughEnv": ["GH_TOKEN", "GITHUB_TOKEN"],
|
|
},
|
|
"build:guides-markdown": {
|
|
"dependsOn": ["build:federated-content"],
|
|
"inputs": [
|
|
"$TURBO_DEFAULT$",
|
|
{ "mode": "jit", "globs": ["content/guides/**", "features/docs/generated/**"] },
|
|
],
|
|
"env": [
|
|
"CI",
|
|
"NODE_ENV",
|
|
"NEXT_PUBLIC_API_URL",
|
|
"NEXT_PUBLIC_BASE_PATH",
|
|
"NEXT_PUBLIC_IS_PLATFORM",
|
|
"NEXT_PUBLIC_MISC_URL",
|
|
"NEXT_PUBLIC_VERCEL_ENV",
|
|
"VERCEL_ENV",
|
|
"VERCEL_URL",
|
|
],
|
|
"outputs": ["public/markdown/guides/**", "public/markdown/manifest.json"],
|
|
},
|
|
"build:reference-markdown": {
|
|
"dependsOn": ["codegen:references"],
|
|
"env": [
|
|
"CI",
|
|
"NODE_ENV",
|
|
"ENABLED_FEATURES_OVERRIDE_DISABLE_ALL",
|
|
"NEXT_PUBLIC_API_URL",
|
|
"NEXT_PUBLIC_BASE_PATH",
|
|
"NEXT_PUBLIC_IS_PLATFORM",
|
|
"NEXT_PUBLIC_MISC_URL",
|
|
"NEXT_PUBLIC_VERCEL_ENV",
|
|
"VERCEL_ENV",
|
|
"VERCEL_URL",
|
|
],
|
|
"outputs": ["public/markdown/reference/**"],
|
|
},
|
|
// No script: generates the guide and reference markdown under public/markdown/.
|
|
"build:markdown": {
|
|
"dependsOn": ["build:guides-markdown", "build:reference-markdown"],
|
|
},
|
|
// Lists every file generated above in public/markdown/sitemap.md.
|
|
"build:markdown-sitemap": {
|
|
"dependsOn": ["build:markdown"],
|
|
"inputs": ["$TURBO_DEFAULT$", { "mode": "jit", "globs": ["public/markdown/**"] }],
|
|
"env": ["NEXT_PUBLIC_BASE_PATH", "VERCEL_ENV", "VERCEL_URL"],
|
|
"outputs": ["public/markdown/sitemap.md"],
|
|
},
|
|
// Concatenates every file listed in the sitemap into public/markdown/full.md.
|
|
"build:markdown-full": {
|
|
"dependsOn": ["build:markdown"],
|
|
"inputs": ["$TURBO_DEFAULT$", { "mode": "jit", "globs": ["public/markdown/**"] }],
|
|
"outputs": ["public/markdown/full.md"],
|
|
},
|
|
"build:gz-archive": {
|
|
"dependsOn": ["build:markdown"],
|
|
"outputs": ["public/docs.tar.gz"],
|
|
},
|
|
"build:sitemap": {
|
|
"dependsOn": ["build:federated-content", "codegen:references"],
|
|
"inputs": ["$TURBO_DEFAULT$", { "mode": "jit", "globs": ["content/guides/**"] }],
|
|
"outputs": ["public/sitemap.xml"],
|
|
},
|
|
"redirects:generate": {
|
|
"outputs": ["lib/redirects/generated/**"],
|
|
},
|
|
|
|
"dev": {
|
|
"dependsOn": ["codegen:graphql", "codegen:examples", "codegen:references"],
|
|
},
|
|
"typecheck": {
|
|
"dependsOn": ["^typecheck", "codegen:graphql"],
|
|
},
|
|
"test": {
|
|
"dependsOn": ["codegen:examples"],
|
|
// Lets the smoke tests target a preview deploy or localhost instead of production.
|
|
"env": ["DOCS_SMOKE_URL"],
|
|
},
|
|
"test:smoke": {
|
|
"dependsOn": ["codegen:references"],
|
|
"cache": false,
|
|
"env": ["DOCS_SMOKE_URL"],
|
|
},
|
|
|
|
// Write to remote databases, so never cached.
|
|
"embeddings": {
|
|
"dependsOn": ["codegen:references"],
|
|
"cache": false,
|
|
"passThroughEnv": [
|
|
"ENABLED_FEATURES_OVERRIDE_DISABLE_ALL",
|
|
"NEXT_PUBLIC_MISC_ANON_KEY",
|
|
"NEXT_PUBLIC_MISC_URL",
|
|
"NEXT_PUBLIC_SUPABASE_URL",
|
|
"OPENAI_API_KEY",
|
|
"SUPABASE_SECRET_KEY",
|
|
],
|
|
},
|
|
"ingest:search_v2": {
|
|
"dependsOn": ["build:guides-markdown", "codegen:references"],
|
|
"cache": false,
|
|
"passThroughEnv": ["NEXT_PUBLIC_SUPABASE_URL", "SUPABASE_SECRET_KEY"],
|
|
},
|
|
"sync": {
|
|
"dependsOn": ["codegen:graphql"],
|
|
"cache": false,
|
|
"passThroughEnv": [
|
|
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
|
|
"NEXT_PUBLIC_SUPABASE_URL",
|
|
"SUPABASE_SECRET_KEY",
|
|
],
|
|
},
|
|
|
|
"build": {
|
|
"dependsOn": [
|
|
"^build",
|
|
"codegen:graphql",
|
|
"codegen:examples",
|
|
"codegen:references",
|
|
"build:markdown",
|
|
"build:markdown-sitemap",
|
|
"build:markdown-full",
|
|
"build:gz-archive",
|
|
"build:sitemap",
|
|
"redirects:generate",
|
|
],
|
|
"env": [
|
|
"ANALYZE",
|
|
"NEXT_PUBLIC_SUPABASE_URL",
|
|
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
|
|
"NEXT_PUBLIC_MISC_URL",
|
|
"NEXT_PUBLIC_MISC_ANON_KEY",
|
|
"NEXT_PUBLIC_MARKETPLACE_API_URL",
|
|
"NEXT_PUBLIC_MARKETPLACE_PUBLISHABLE_KEY",
|
|
"NODE_ENV",
|
|
"NEXT_PUBLIC_API_URL",
|
|
"NEXT_PUBLIC_BASE_PATH",
|
|
"NEXT_PUBLIC_SITE_URL",
|
|
"NEXT_PUBLIC_DEV_AUTH_PAGE",
|
|
"NEXT_PUBLIC_IS_PLATFORM",
|
|
"NEXT_PUBLIC_SENTRY_DSN",
|
|
"NEXT_PUBLIC_VERCEL_ENV",
|
|
"NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA",
|
|
"VERCEL",
|
|
"VERCEL_ENV",
|
|
"VERCEL_GIT_COMMIT_SHA",
|
|
"VERCEL_URL",
|
|
// These envs are used in the packages
|
|
"NEXT_PUBLIC_STORAGE_KEY",
|
|
"NEXT_PUBLIC_AUTH_DEBUG_KEY",
|
|
"NEXT_PUBLIC_AUTH_PERSISTED_KEY",
|
|
"NEXT_PUBLIC_AUTH_NAVIGATOR_LOCK_KEY",
|
|
"NEXT_PUBLIC_AUTH_DETECT_SESSION_IN_URL",
|
|
"NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID",
|
|
"NEXT_PUBLIC_GOTRUE_URL",
|
|
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
|
|
"NEXT_PUBLIC_MCP_URL",
|
|
// These envs are technically passthrough env vars because they're only used on the server side of Nextjs
|
|
"CI",
|
|
"DOCS_GITHUB_APP_ID",
|
|
"DOCS_GITHUB_APP_INSTALLATION_ID",
|
|
"DOCS_GITHUB_APP_PRIVATE_KEY",
|
|
"DOCS_REVALIDATION_KEYS",
|
|
"DOCS_REVALIDATION_OVERRIDE_KEYS",
|
|
"ENABLED_FEATURES_OVERRIDE_DISABLE_ALL",
|
|
"GH_TOKEN",
|
|
"GITHUB_ACTIONS",
|
|
"GITHUB_TOKEN",
|
|
"LOGFLARE_INGESTION_API_KEY",
|
|
"LOGFLARE_SOURCE_TOKEN",
|
|
"OPENAI_API_KEY",
|
|
"SUPABASE_SECRET_KEY",
|
|
],
|
|
"passThroughEnv": ["SENTRY_AUTH_TOKEN"],
|
|
// Gitignored files written by the uncached fetch tasks, hashed after they run so new
|
|
// remote content invalidates the build.
|
|
"inputs": [
|
|
"$TURBO_DEFAULT$",
|
|
{
|
|
"mode": "jit",
|
|
"globs": ["content/guides/**", "features/docs/generated/**", "spec/reference/**"],
|
|
},
|
|
],
|
|
"outputs": [".next/**", "!.next/cache/**"],
|
|
},
|
|
},
|
|
}
|