Skip to content

Rework docs for production routing and launch flow#15

Merged
leoisadev1 merged 2 commits into
mainfrom
t3code/73213971
May 31, 2026
Merged

Rework docs for production routing and launch flow#15
leoisadev1 merged 2 commits into
mainfrom
t3code/73213971

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Summary

  • Expanded the docs IA with new pages for customer surfaces, source events, automation, API reference, and production routing.
  • Reorganized the core docs to better explain the product loop, integration paths, and the production launch sequence.
  • Updated production defaults and examples to use https://amend.sh/docs for product links while keeping https://docs.amend.sh as the canonical docs origin.
  • Added routing and build support for serving /docs from the main site through Vercel while preserving the canonical docs deployment.
  • Refreshed SDK, auth, and launch snippets to reflect the current project/token model and production readiness checks.

Testing

  • Not run (docs and configuration updates only).
  • Not run: build or preview validation of the docs app.
  • Not run: production routing verification for amend.sh/docs and docs.amend.sh.

@leoisadev1

Copy link
Copy Markdown
Member Author

@greptile review

- Expand Fumadocs with API, automation, customer surface, and source event docs
- Update production/docs URLs, launch checklist, and env examples
- Refresh web docs links and agent-ready validation expectations
@leoisadev1

Copy link
Copy Markdown
Member Author

@greptile review

1 similar comment
@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 expands the docs IA with five new pages (customer surfaces, source events, automation, API reference, production routing), reorganises existing content, and wires the production routing contract so amend.sh/docs proxies to docs.amend.sh through Vercel's Build Output API. Supporting code changes update production URL defaults from docs.amend.sh/docs to amend.sh/docs everywhere and add multi-path build-output resolution across the readiness scripts.

  • Production routing: vercel-preview-build.ts injects docs proxy routes into .vercel/output/config.json; next.config.mjs sets assetPrefix to the canonical docs origin so proxied pages still load _next/ assets from docs.amend.sh.
  • Script hardening: readFirst and readBundleContainingAny in agent-ready-built-utils.ts, and firstExistingDirectory in build-size.ts, now try multiple candidate build-output paths and emit clear errors when none exist.
  • Sign-in form: joinSeededDemoWorkspaceMutation is moved from a lazy dynamic import to a module-level makeFunctionReference call, making convex/server an eager import in the client component.

Confidence Score: 5/5

Safe to merge; changes are docs content, URL convention updates, and build-script hardening with no correctness gaps in the routing or readiness logic.

The routing injection, asset-prefix configuration, multi-path build resolution, and URL-convention update are all internally consistent and correctly cross-validated by the updated readiness scripts. The only non-trivial code change is functionally equivalent and carries only a build-time question the team should confirm on first build.

Confirm convex/server resolves cleanly in the Vite browser bundle after the sign-in-form.tsx change; all other files are straightforward.

Important Files Changed

Filename Overview
scripts/vercel-preview-build.ts Adds injectDocsProxyRoutes() that writes docs proxy rules into .vercel/output/config.json, correctly prepending them before existing routes and deduplicating by src.
apps/fumadocs/next.config.mjs Adds assetPrefix pointing to the canonical docs origin in production, ensuring proxied docs pages load _next/ assets from docs.amend.sh.
apps/web/src/components/sign-in-form.tsx Moves joinSeededDemoWorkspaceMutation to module-level makeFunctionReference from convex/server; functionally equivalent but adds convex/server to the eager client import graph.
scripts/agent-ready-built-utils.ts Adds readFirst and readBundleContainingAny for multi-path build resolution; missing[] array in readBundleContainingAny is collected but unused in the final error.
scripts/build-size.ts Replaces hardcoded path with firstExistingDirectory that throws a descriptive error when neither candidate exists.
apps/web/src/lib/docs-url.ts Single-line URL change from docs.amend.sh/docs to amend.sh/docs; consistent with all validator and env-example changes across the PR.
apps/web/vite.config.ts Adds vendor chunk splits for zod, posthog-js, OG image libs, radix-ui, and react-grab; pure bundling optimization.
vercel.json Only adds the $schema field; routing is handled by injectDocsProxyRoutes in the build script.
apps/fumadocs/content/docs/production-routing.mdx New page documenting the dual-origin routing contract, asset prefix rationale, and verification steps.
apps/fumadocs/content/docs/meta.json Adds five new page entries to the docs navigation in correct order.

Sequence Diagram

sequenceDiagram
    participant Browser
    participant Vercel as Vercel Edge (amend.sh)
    participant Docs as docs.amend.sh (Fumadocs/Next.js)

    Browser->>Vercel: GET amend.sh/docs/quickstart
    Note over Vercel: injectDocsProxyRoutes wrote into .vercel/output/config.json
    Vercel->>Docs: proxy GET docs.amend.sh/docs/quickstart
    Docs-->>Vercel: "HTML (assetPrefix = https://docs.amend.sh)"
    Vercel-->>Browser: HTML (URL stays amend.sh/docs/quickstart)
    Browser->>Docs: GET docs.amend.sh/_next/static/
    Docs-->>Browser: JS / CSS assets
Loading

Fix All in Claude Code

Reviews (3): Last reviewed commit: "fix: address Greptile review feedback" | Re-trigger Greptile

Comment thread apps/web/src/components/sign-in-form.tsx Outdated
Comment thread vercel.json
Comment thread scripts/build-size.ts
Comment thread vercel.json Outdated
@leoisadev1

Copy link
Copy Markdown
Member Author

@greptile review

@leoisadev1 leoisadev1 merged commit 372700a into main May 31, 2026
5 of 6 checks passed
@leoisadev1 leoisadev1 deleted the t3code/73213971 branch May 31, 2026 18:33
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