Repository navigation
New website: Next.js, Fumadocs, Payload - #344
Merged
Merged
Conversation
Replaces the Astro site with Next.js 16 on Cloudflare Workers through OpenNext. Docs are MDX in content/docs, rendered with Fumadocs; blog, learning center and newsroom posts live in Payload CMS on D1 and R2. Production builds the sky design for pilotprotocol.network; the green design deploys to workers.dev with npm run deploy:green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Replaces the Astro site with the redesigned site: Next.js 16 on Cloudflare Workers through OpenNext. The production design (sky) is previewed at https://pilotprotocol-sky.marketized.io.
src/,astro.config.mjs,scripts/,public/,functions/,_headers,wrangler.toml,tsconfig.json), the notes indocs/(they describe the old/cloud-teaser,/cloud-landingand/pilot-filmpages), and.github/workflows/plain-sync.yml, which regenerated the/plaintwins.src/,content/,seed/,public/,scripts/,next.config.ts,wrangler.jsonc).LICENSE,worker/,sync-install-sh.yml. Updated for the new commands:README.md,CONTRIBUTING.md,AGENTS.md(the writing rules stay; the pre-PR checks changed and the Next.js block thatnext devwrites is appended),ci.yml, and oneCHANGELOG.mdentry.mainis inseed/posts(checked by slug), and every docs page is incontent/docs.public/_redirectscarries over the 79 old redirects whose targets exist in the new site./plain/docs/<page>goes to/docs/<page>, the rest of/plainto/llms.txt, and the/plainsection ofllms.txtnow points at the Markdown docs.SKILLS.mdandagents.txtstay at their URLs, sincellms.txtlinks them.How it's built
content/docs, rendered with Fumadocs. Search at/api/search; any page as Markdown at/docs/<page>.mdx./admin. The blog, learning center, newsroom,/about, the feed and the sitemap read Payload per request; everything else is prerendered.NEXT_PUBLIC_SITE_VARIANTat build time. Production builds sky; green deploys to a second Worker on workers.dev.Changes from the preview source, to fit this repo:
wrangler.jsonc: production Workerpilot-protocol-websitewithpilotprotocol.networkas a custom domain, andenv.greenon workers.dev only. Noaccount_id: Wrangler takes it fromCLOUDFLARE_ACCOUNT_ID, as CI does today.database_idisREPLACE_WITH_D1_DATABASE_ID. Binding names (D1,R2,ASSETS) are unchanged.package.json:deploy:appbuilds sky for pilotprotocol.network;deploy:greenreplacesdeploy:sky.next.config.ts: the noindex header covers*.workers.devonly (the marketized.io preview hosts are gone). The build runs one Next.js worker: with two or more, each opens the local D1 through Wrangler's platform proxy and the build fails withSQLITE_BUSY. Reproduced in a fresh clone with 13 and with 3 workers.scripts/sync-install.mjsrefreshespublic/install.shfrom pilot-protocol/release, the copysync-install-sh.ymlchecks against (the file is byte-identical today).tsconfig.jsonandeslint.config.mjsskipworker/, which has its own setup.How to run it
How to deploy
One time, on the account that holds the pilotprotocol.network zone:
wrangler d1 create pilot-protocol-websiteandwrangler r2 bucket create pilot-protocol-website-media, then put the database id in the threedatabase_idfields.wrangler secret put PAYLOAD_SECRET, and again with--env green.npm run deploy:database, thennpm run seed:productionto import the posts.pilot-releaseroutepilotprotocol.network/api/*topilotprotocol.network/api/changelog. That Worker answers 404 for every other/apipath, so as it stands docs search, uploaded images and the Payload admin would break on the production domain.pilotprotocol.networkfrom the Pages projectpilotprotocol, then runnpm run deploy./install.shand/.well-known/*keep coming frompilot-release: Worker routes run in front of a custom domain.After the first deploy, CI deploys when the
ciworkflow is started by hand onmain. It runsnpm run deploywith theCLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_IDsecrets. The current token is scoped to Pages; it needs Workers Scripts, Workers Routes, D1 and R2 edit rights.What reviewers should check
/api/*route in particular.ci.yml: type check, lint and the production build on every PR and push. Deploys are manual. PR preview deploys, the daily rebuild and thepilot-skills-updatedrebuild are gone (the site no longer fetches skills.json at build time)./cookiesand/privacystill describe GA4 and PostHog.npm audit --omit=devlists 15 transitive advisories, among them dompurify (critical) through monaco-editor in the Payload admin, happy-dom through Lexical, and glob through OpenNext's minifier.worker/(pilot-publish) still publishes by committing Astro pages andsrc/data/blogPosts.ts, which nothing reads now. It needs to post to Payload's REST API, or be retired./adminand listings incontent/apps.Left out
/cloud-teaser,/cloud-landingand/pilot-filmpages.functions/. The contact and disclosure forms now open the visitor's mail app, soRESEND_API_KEYand the Turnstile keys are unused./research/polo/protocol-comparison.pdf,/demo/pilot-demo.mp4, the oldog/images.public/.well-known/was already shadowed bypilot-release.Checks run
npm install,npx next typegen && npx tsc --noEmit,npm run lint: pass.npx opennextjs-cloudflare buildwithNEXT_PUBLIC_SITE_VARIANT=sky, in a fresh clone: pass.npx wrangler deploy --dry-run, default and--env green: pass.wrangler devon that build: home, docs,/docs/*.mdx, search, blog, learn, news, feed, sitemap and/adminreturn 200, and the redirects return 301 to their targets.ci.ymlon this branch: pass.