FE-1418: Build @apps/petrinaut-docs on Vercel - #9232
Draft
kube wants to merge 3 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
kube
force-pushed
the
cf/fe-1418-build-appspetrinaut-docs-on-vercel
branch
from
August 17, 2026 10:19
e05140a to
aa41f6f
Compare
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 is the purpose of this PR?
Adds the Vercel build for
@apps/petrinaut-docs. The app shipped in #9206 with novercel.jsonand no build or install script, so a Vercel project pointed at it has nothing to run.Follows up the two items #9206 left open: adding
d2to the Vercel install step, and deciding where the site deploys. The first is done here. The second is proposed rather than settled, covered under Known issues.This host serves the whole manifest behind SSO. FE-1157 publishes a subset of the same bundle to
hash.dev/docs/petrinaut. The two run side by side.🔗 Related links
hash.dev/docs/petrinaut. Runs alongside this host rather than replacing it.🔍 What does this change?
The build graph is three tasks:
tsx, anodecopy step, andastro build. Nothing compiles, and.yarnrc.ymlsetsenableScripts: false, so no dependency builds during install either.vercel-install.shinstalls Node, Turborepo andd2, and leaves out the Rust toolchain, wasm32 target, wasm-pack, binaryen, java, protoc and redocly thathash-frontendandpetrinaut-websiteinstall.d2renders the architecture diagrams.canRenderDiagramsprobes for it before pages are emitted, and a bundle built without it has no diagrams and exits 0, so dropping it loses all 44 SVGs behind a passing build.vercel-build.shrunsturbo buildrather than the package script, which alone skipssync:bundleand builds whatever content was last on disk. It also removes the repo-root.envfirst, matching the other two apps and the TODOs they link. The generator probesd2throughmise exec --env dev, which still resolves once that file is gone.cleanUrlsandtrailingSlash: falseinvercel.jsonfollowbuild.format: "file"andtrailingSlash: "never"inastro.config.mjs. The build writesarchitecture.htmlandarchitecture/core.htmlwith noindex.htmlinside a directory, and the bundle's inter-page links are relative, so Vercel serves/architecturefromarchitecture.htmland redirects/architecture/instead of 404ing.sitemoves frompetrinaut-docs.hash.devtoarchitecture.petrinaut.org, which sets the canonical URL and every sitemap entry.petrinaut.orgalready servesdemo.petrinaut.org.This host serves all 48 pages in the manifest, behind SSO. FE-1157 publishes a subset to
hash.dev/docs/petrinaut, so the two run side by side and a page can appear on one and not the other. The README says so explicitly, because the alternative reading, that one host replaces the other, changes whether SRE-955 is worth doing at all.The README gains a Deployment section covering what cannot live in the repo:
apps/petrinaut-docsarchitecture.petrinaut.org(proposed)Both scripts
cd ../.., so the build fails without the second.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
Adds build configuration to a private app.
@apps/*is in the changesets ignore list.📜 Does this require a change to the docs?
apps/petrinaut-docs/README.mdgains a Deployment section: the Vercel project settings, the domain and its gate, thathash.devserves a subset of the same manifest, why the install list is short, and the.envremoval.🕸️ Does this require a change to the Turbo Graph?
No
turbo.jsonorpackage.jsonscriptschanges.vercel-build.shcalls the existingbuildtask.architecture.petrinaut.orgis a proposal. It is written intoastro.config.mjsso the build produces consistent canonical and sitemap URLs, not because the host is agreed. Changing it later is a one-line edit plus a redeploy.ManifestPagecarries onlykind, which isgeneratedorauthored, a source distinction rather than an audience one. Until FE-1157 decides how pages are selected, the split lives in whatever consumes the manifest. This PR does not add a field for it, since the selection rule is FE-1157's to choose.sync:bundlecopiesarchitecture.mdandarchitecture.jsonintopublic/so any host of the bundle serves the same bytes an agent would read from a checkout. Behind Cloudflare Access, fetching either over HTTP needs a session. Both also describe the whole model rather than the public subset, so they cannot be reused as-is by thehash.devhost..htmlextension. Starlight emitsrel="canonical"pointing at/architecture.htmlwhile the sitemap lists/architecture, a consequence ofbuild.format: "file"that predates this PR. WithcleanUrlsthe canonical now redirects to the extensionless form rather than serving directly. Behind an SSO gate no crawler sees either, so this is left alone.d2stays probed rather than required. A deployment where themise installline silently fails still produces a site, without diagrams. SRE-955 asks whoever creates the project to check the first deployment renders them.rm .envis inherited fromhash-frontendandpetrinaut-website, with the same three TODO links. Worth knowing if you run the Vercel CLI locally and keep secrets there.🐾 Next steps
hash.dev/docs/petrinaut, and decides how a page is marked as belonging to it.🛡 What tests cover this?
None. CI does not run Vercel build configuration, and the two existing apps' scripts are not covered either.
Verified by hand:
turbo build --filter='@apps/petrinaut-docs' --env-mode=loosein a worktree with nonode_modules, afteryarn install --immutable. 3 tasks, 28s, 49 pages and 44 diagrams intoapps/petrinaut-docs/dist, with canonical and sitemap URLs on the new host. Separately, thed2probe with the repo-root.envdeleted, which is the state the build script leaves behind.❓ How to test this?
turbo build --filter='@apps/petrinaut-docs' --env-mode=looseapps/petrinaut-docs/distshould holdarchitecture.html,architecture/core.htmland 44 SVGs under_astro/, andsitemap-0.xmlshould listarchitecture.petrinaut.org. To see what a Vercel install withoutd2would produce, build with it off the path and check that the bundle has nodiagrams/and the command still exits 0.