fix(docs): make the build self-contained for Vercel

Vercel's "Root Directory" setting limits the upload to docs/api/, so
the build cannot read sibling paths like ../../server/openapi.json or
../api-content/. A small prebuild script copies both into a vendored
folder inside the project tree (gitignored).

## Changes
- Add scripts/sync-sources.mjs to copy /docs/api-content/ and
  /server/openapi.json into docs/api/src/vendored/ before dev/build
- Wire predev/prebuild npm scripts so the sync runs automatically
- Update astro.config.mjs and src/content.config.ts to read from the
  vendored paths
- Gitignore src/vendored/ — contributors still edit the originals
This commit is contained in:
gorkem-bwl committed 2026-05-22 14:20:10 -04:00
1 parent 0d25973efb
commit 8e4e9dd87c
5 files changed
+72 -4

No files matched your search

+4 -1
View File
@@ -13,7 +13,10 @@ import { docsSchema } from "@astrojs/starlight/schema";
export const collections = {
docs: defineCollection({
loader: glob({
base: "../api-content",
// Vendored from /docs/api-content/ by scripts/sync-sources.mjs.
// This indirection keeps the build self-contained for Vercel
// (whose Root Directory setting limits the upload to docs/api/).
base: "./src/vendored/api-content",
// README is contributor-facing docs (how to build the site),
// not part of the published content.
pattern: ["**/[^_]*.{md,mdx}", "!README.md"],