Skip to content

Fix production docs deployment#18

Merged
leoisadev1 merged 1 commit into
mainfrom
fix/docs-production-deploy
May 31, 2026
Merged

Fix production docs deployment#18
leoisadev1 merged 1 commit into
mainfrom
fix/docs-production-deploy

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

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

@leoisadev1

Copy link
Copy Markdown
Member Author

@greptile review

@greptile-apps

greptile-apps Bot commented May 31, 2026

Copy link
Copy Markdown

Greptile Summary

This PR wires up production deployment for the Fumadocs docs app and resolves a Vercel build-bundling problem by moving schema JSON files inside the apps/fumadocs directory tree instead of importing them from a deep monorepo path.

  • Workflow: Adds a "Deploy docs production" step that overrides VERCEL_PROJECT_ID at the step level and calls vercel deploy (non-prebuilt) from apps/fumadocs, letting Vercel build remotely with the new vercel.json.
  • Schema relocation: Four schema JSON files are copied into apps/fumadocs/src/app/schemas/_data/ and route imports are updated accordingly; all four route files point to their local copies.
  • Drift guard: scripts/docs-schema-copies.test.ts is added to assert the _data/ copies stay in sync with the canonical docs/ originals, but no CI step currently runs bun test, so the guard is never enforced automatically.

Confidence Score: 4/5

Safe 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

Filename Overview
.github/workflows/production.yml Adds 'Deploy docs production' step that overrides VERCEL_PROJECT_ID at step level and builds/deploys the fumadocs app from its subdirectory without --prebuilt; relies on Vercel remote build
apps/fumadocs/vercel.json New Vercel config specifying Next.js framework, bun install, and bun run build; no workspace:* deps in fumadocs so remote build should work cleanly
scripts/docs-schema-copies.test.ts New test verifying _data/ schema copies match canonical docs/ schemas, but no CI step runs bun test so the guard is never enforced
apps/fumadocs/src/app/schemas/agent-ready-completion-audit-report.schema.json/route.ts Import path updated from deep ../../../../../../docs/ path to local ../_data/ copy, fixing the Vercel app-directory build bundling issue
apps/fumadocs/src/app/schemas/_data/agent-ready-completion-audit-report.schema.json App-local copy of the canonical schema; now bundled with the fumadocs app for Vercel builds; drift vs docs/ guarded only by a currently-unenforced test

Sequence Diagram

sequenceDiagram
    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
Loading

Fix All in Claude Code

Reviews (4): Last reviewed commit: "fix: deploy docs production app" | Re-trigger Greptile

Comment thread .github/workflows/production.yml Outdated
Comment thread .github/workflows/production.yml Outdated
@greptile-apps

greptile-apps Bot commented May 31, 2026

Copy link
Copy Markdown

Greptile Summary

This 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 docs/ directory.

  • A new "Deploy docs production" CI step runs bunx vercel deploy --prod from apps/fumadocs, overriding VERCEL_PROJECT_ID at the step level so it targets the separate docs Vercel project without affecting the subsequent web deploy step.
  • Four JSON schema files are copied into apps/fumadocs/src/app/schemas/_data/, and the four route.ts handlers are updated to import from those local copies instead of the six-level-deep relative path into docs/.
  • A new apps/fumadocs/vercel.json sets framework, installCommand, and buildCommand for app-local Vercel configuration.

Confidence Score: 3/5

The 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

Filename Overview
.github/workflows/production.yml Adds a "Deploy docs production" step that overrides VERCEL_PROJECT_ID at the step level and runs bunx vercel deploy --prod from apps/fumadocs; the lockfile concern makes this step's remote build reliability uncertain.
apps/fumadocs/vercel.json New app-local Vercel config specifying framework, installCommand, and buildCommand; the installCommand: bun install --frozen-lockfile could fail if the remote build environment doesn't have access to the root-level bun.lock.
apps/fumadocs/src/app/schemas/_data/agent-ready-completion-audit-report.schema.json New schema data file, duplicating the canonical version from docs/; no sync mechanism between the two copies.
apps/fumadocs/src/app/schemas/_data/agent-ready-live-report.schema.json New schema data file duplicating docs/agent-ready-live-report.schema.json; same drift concern as sibling files.
apps/fumadocs/src/app/schemas/_data/agent-ready-production-report.schema.json New schema data file duplicating docs/agent-ready-production-report.schema.json; same drift concern as sibling files.
apps/fumadocs/src/app/schemas/_data/agent-ready-status-report.schema.json New schema data file duplicating docs/agent-ready-status-report.schema.json; same drift concern as sibling files.
apps/fumadocs/src/app/schemas/agent-ready-completion-audit-report.schema.json/route.ts Import path updated from the deep relative path into docs/ to the local _data/ sibling; logic is unchanged and correct.
apps/fumadocs/src/app/schemas/agent-ready-live-report.schema.json/route.ts Same import path fix as the completion-audit route; clean change.
apps/fumadocs/src/app/schemas/agent-ready-production-report.schema.json/route.ts Same import path fix as the completion-audit route; clean change.
apps/fumadocs/src/app/schemas/agent-ready-status-report.schema.json/route.ts Same import path fix as the completion-audit route; clean change.

Sequence Diagram

sequenceDiagram
    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
Loading

Fix All in Claude Code

Reviews (2): Last reviewed commit: "fix: deploy docs production app" | Re-trigger Greptile

Comment thread .github/workflows/production.yml Outdated
@leoisadev1 leoisadev1 force-pushed the fix/docs-production-deploy branch from f02849e to f1baea4 Compare May 31, 2026 18:51
@leoisadev1

Copy link
Copy Markdown
Member Author

@greptile review

Comment on lines +10 to +18
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);
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Fix in Claude Code

@leoisadev1 leoisadev1 merged commit 3fa1ea6 into main May 31, 2026
4 checks passed
@leoisadev1 leoisadev1 deleted the fix/docs-production-deploy branch May 31, 2026 18:56
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.

1 participant