Fix production docs deployment#18
Conversation
|
@greptile review |
Greptile SummaryThis PR wires up production deployment for the Fumadocs docs app and resolves a Vercel build-bundling problem by moving schema JSON files inside the
Confidence Score: 4/5Safe to merge with one follow-up: the schema-drift test should be wired into CI to actually run. The workflow change and schema relocation are straightforward and correct. The one real gap is that scripts/docs-schema-copies.test.ts is never executed — neither production.yml nor preview.yml has a bun test step — so the drift guard added to address a previous review concern provides no automatic enforcement. Everything else (VERCEL_ORG_ID inheritance, fumadocs having no workspace:* deps, local schema copies being bundled correctly) checks out. scripts/docs-schema-copies.test.ts — the test exists but is never invoked in CI, making the schema-copy guard ineffective until a test step is added to the workflow. Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant Vercel as Vercel (web)
participant VercelDocs as Vercel (docs)
participant Convex as Convex
GH->>Convex: bun convex deploy (production)
GH->>GH: bun scripts/vercel-preview-build.ts (build web)
GH->>Vercel: vercel deploy --prebuilt --prod (web app)
Note over GH,Vercel: VERCEL_PROJECT_ID = secrets.VERCEL_PROJECT_ID
GH->>VercelDocs: "cd apps/fumadocs && vercel deploy --prod (no --prebuilt)"
Note over GH,VercelDocs: VERCEL_PROJECT_ID overridden to secrets.VERCEL_DOCS_PROJECT_ID
VercelDocs->>VercelDocs: bun install (from vercel.json)
VercelDocs->>VercelDocs: bun run build (Next.js)
VercelDocs-->>GH: Docs deployed to docs.amend.sh
Reviews (4): Last reviewed commit: "fix: deploy docs production app" | Re-trigger Greptile |
Greptile SummaryThis PR wires the Fumadocs docs app into the production CI workflow and makes the schema route handlers self-contained by co-locating the JSON schema data files inside the app rather than importing them from the repository-root
Confidence Score: 3/5The docs deployment step is new and has an untested dependency on Vercel's monorepo upload behavior for the --frozen-lockfile install to succeed; failure would only block docs, not the web deploy. The workflow change deploys to a separate Vercel project using a source (non-prebuilt) deploy where bun install --frozen-lockfile runs remotely. Because bun.lock only exists at the monorepo root and not in apps/fumadocs/, the remote build succeeds only if Vercel uploads the full git tree and bun correctly traverses to the workspace root — behavior that depends on the Vercel project's Root Directory configuration, which is not visible in this diff. The schema duplication between docs/ and _data/ adds a secondary maintenance concern: both sets of files will need to stay in sync manually going forward. .github/workflows/production.yml and apps/fumadocs/vercel.json together control the remote build; confirm the Vercel project's Root Directory setting matches expectations before merging. Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant Convex as Convex Cloud
participant VercelDocs as Vercel (Docs Project)
participant VercelWeb as Vercel (Web Project)
GH->>GH: "Checkout & Install deps"
GH->>GH: Typecheck
GH->>Convex: Deploy backend (convex deploy)
GH->>VercelDocs: "cd apps/fumadocs && vercel deploy --prod"
Note over VercelDocs: Remote build using vercel.json
VercelDocs-->>GH: Docs deployed
GH->>GH: Build web (vercel-preview-build.ts)
GH->>VercelWeb: vercel deploy --prebuilt --prod
VercelWeb-->>GH: Web deployed
Reviews (2): Last reviewed commit: "fix: deploy docs production app" | Re-trigger Greptile |
f02849e to
f1baea4
Compare
|
@greptile review |
| describe("docs schema route copies", () => { | ||
| for (const schemaName of schemaNames) { | ||
| test(`${schemaName} matches the canonical docs schema`, async () => { | ||
| const canonical = await Bun.file(`docs/${schemaName}`).text(); | ||
| const routeCopy = await Bun.file(`apps/fumadocs/src/app/schemas/_data/${schemaName}`).text(); | ||
|
|
||
| expect(routeCopy).toBe(canonical); | ||
| }); | ||
| } |
There was a problem hiding this comment.
Schema drift test never executed in CI
This test was added to guard against the _data/ copies diverging from the canonical docs/ schemas, but neither workflow (production.yml nor preview.yml) has a bun test step. The root package.json wires "test": "bun test", but CI only calls bun run check-types (via turbo). The test file is never invoked automatically, so the protection it provides is illusory — a schema edit in docs/ would pass every CI check unnoticed.
Score: 3/5 — the intent is right and the fix is a one-liner, but without execution the test is dead code.
Summary\n- deploy the Fumadocs app as part of the production workflow\n- add app-local Vercel config for the docs deployment\n- keep schema route JSON inside the docs app so Vercel app-directory builds include it\n\n## Verification\n- bun run --cwd apps/fumadocs check-types\n- bun run --cwd apps/fumadocs build\n- curl -I -L https://amend.sh/docs\n- curl -I -L https://docs.amend.sh/docs