Repository navigation
chore(web): upgrade docs site to astro 7 - #59845
Conversation
There was a problem hiding this comment.
The upgrade looks sound. I ran bun install and bun run build in packages/web on the PR head and both succeed. The build writes the new dist/server + dist/client layout that SST reads, and config.json and tui.json end up in dist/client/. I also checked that the share page's hide-first-panel rule no longer appears in any shared _astro stylesheet, and that the theme's header links still render with prerenderEnvironment: "node". I didn't test an actual deploy; as you note, the dev deploy after merge is the real check.
Public API: unchanged. This is a docs-site build change, and the SST_WRANGLER_PATH it reads is set by SST's own Astro component.
One small point inline: the Hero.astro check can never match the home page now.
There was a problem hiding this comment.
The new commit only changes CSS and looks fine. Each override matches what Starlight 0.41.11 changed: overflow-wrap: break-word in its base styles, the tab underline drawn as a box shadow from --sl-tab-color-border, and the new bottom margin on nested lists. Starlight's styles are all in @layer starlight.* blocks, so the unlayered rules in custom.css take effect. bun run build still passes and the rules are in the shared common stylesheet.
Public API: unchanged.
The earlier Hero.astro point (entry.id is never "" for the home page) isn't addressed yet.
There was a problem hiding this comment.
The build still passes. The ru/providers.mdx fix is a real content fix: :::примечание isn't a valid aside type, so those blocks didn't render as asides before. With :::note they do now. The CSS overrides look fine.
Public API: unchanged.
One point inline: the Danish [Caution] titles swap Starlight's Danish label for English. The earlier Hero.astro point is still open.
| Når grænsen er nået, modtager agenten en speciel systemprompt, der instruerer den om at svare med en opsummering af sit arbejde og anbefalede resterende opgaver. | ||
|
|
||
| :::caution | ||
| :::caution[Caution] |
There was a problem hiding this comment.
Starlight 0.41 translates aside.caution to Danish as "Bemærk" (see its translations/da.json), so adding [Caution] hardcodes an English title on Danish pages just to match the old screenshots. The same applies to the other six Danish :::caution[Caution] changes. I'd keep plain :::caution and accept the localized title, like the Thai asides you already accepted.
There was a problem hiding this comment.
The new CSS commits look fine. bun run build still passes, and the site-search dialog rules land in the shared stylesheet with the theme's fadeInScaleUp/fadeInBackdrop keyframes. That makes the search dialog look the same in every language, not just on pages where the label is the English "Search".
Public API: unchanged.
The earlier Hero.astro and Danish [Caution] points are still open.
There was a problem hiding this comment.
The new commit is fine. On Node 24.21 in this environment, bun run build in packages/web finished and the process exited on its own (exit 0, ~78s). One run can't confirm an intermittent hang is gone, so your 0-in-36 result is the stronger evidence. Node documents that changing V8 flags after startup can behave unpredictably, but given your numbers it's a reasonable stopgap until the Node fix lands.
Public API: unchanged.
The earlier Hero.astro and Danish [Caution] threads aren't touched by this commit. The description's reasoning for the Danish titles is fair, so I'll leave that one to you.
I moved the docs site (
packages/web) from Astro 5 to Astro 7, matchingpackages/postsandservices/www.Versions
astro@astrojs/starlight@astrojs/cloudflare@astrojs/solid-js@astrojs/markdown-remark@astrojs/checkStarlight stays on 0.41.11 on purpose. 0.42 makes
Tabs,StepsandFileTreeparse HTML with Sätteri at render time, and Sätteri can't run in workerd, so the server bundle fails to build. The Starlight maintainers recommend staying on 0.41.11 for Cloudflare until that's fixed: withastro/starlight#4194Config and code changes
markdown.rehypePlugins→markdown.processor: unified({ rehypePlugins }). Astro 7 uses Sätteri for Markdown by default, so remark/rehype plugins need the unified processor.content.config.tsimportszfromastro/zod; Astro 6 deprecatedzfromastro:content.configPath: process.env.SST_WRANGLER_PATH. SST'scloudflare.Astrocomponent checks for this line on Astro 6+ and won't deploy without it. Duringsst deployit points the build at the wrangler config SST generates, withnodejs_compatand the worker vars.prerenderEnvironment: "node". Adapter 13+ prerenders in workerd by default. The theme hands itsheaderLinksoption to its components throughglobalThis, which only works if pages prerender in the same Node process as the config. Without this, the header links disappear from every page. This also matches how Astro 5 prerendered.config.jsonandtui.jsonare now written todist/client/, the new assets directory, so they're still served at/config.jsonand/tui.json.s/[id].astro: the share page's page-wideis:globalstyles ended up in a stylesheet shared with 91 docs pages (all the ones that useTabs). The rule that hides the first content panel then removed the page title on those pages. I moved the styles into an inline<style is:inline>inside the page. I also reset the top margin that Starlight 0.36+ adds before client islands, so the share page stays where it was.Hero.astrousesentry.idinstead ofentry.slug, which is no longer on Starlight's entry type. No page setshero, so this doesn't change any output..wrangler/is gitignored; the adapter now creates it during builds.custom.csskeeps the old look wherever Starlight 0.41 changed its CSS:overflow-wrap: anywhereonp, headings and inlinecode(0.41 usesbreak-word). Without it, long inline code stops shrinking, so the SDK option tables reflow and the Japanese config page scrolls sideways on phones.text-autospace: no-autospace. 0.41 adds automatic spacing between CJK and Latin text.text-size-adjuststays at the browser default.backdrop-filternow comes before the unprefixed one. The new CSS minifier keeps only the last one of the pair, so the theme's 2px search blur and 8px mobile TOC blur had disappeared.site-search dialog. The theme selectsdialog[aria-label="Search"], which only matches English, and 0.41 now translates the Thai label too. Translated pages now get the same dialog as English, which is a small fix compared withdev.:::cautionasides get an explicit[Caution]title. 0.41 adds Danish strings ("Bemærk", which means "Note"). Ourda.jsoncan't override them, because Starlight looks translations up byda-DK.:::примечаниеblocks inru/providers.mdxare now:::note. The old site showed them as literal text, and the new markdown parser turned them into plain divs.astro.config.mjsturns off V8's Maglev compiler and concurrent Sparkplug. Under Node 24+,astro buildsometimes printed "Complete!" and never exited (Hang at shutdown nodejs/node#64274). It reproduced in 2 of 28 builds, and 0 of 36 hung with the flags. The deploy job has no timeout, so a hang would hold it for hours.Theme
toolbeam-docs-theme@0.4.8is the latest release. Its peer ranges are stillastro ^5.7.13and@astrojs/starlight ^0.34.3. Its code works unchanged with Astro 7 and Starlight 0.41: it uses theconfig:setuphook,astro/zodand Starlight's virtual modules, and its mobile menu CSS still matches 0.41's markup. Because the peers don't match, bun recorded a nested Astro 5 and Starlight 0.34 tree for it inbun.lock. I addedastroand@astrojs/starlightto the root catalog and tooverrides(the same pattern assolid-js), so the theme's peers resolve to the workspace versions. posts and www now useastro: "catalog:"too, so the version lives in one place. A patch wouldn't help: bun resolves peers from the registry manifest, not from patched files.Deploy
The docs still deploy via
sst.cloudflare.x.Astroininfra/app.ts, and I didn't change anything there. Adapter 14 producesdist/server/entry.mjs,dist/server/wrangler.jsonanddist/client/instead ofdist/_worker.jsanddist. SST 4.13.1 already detects this layout: it readsdist/server/wrangler.jsonand deploysentry.mjswithdist/clientas the assets._routes.jsonis gone. SST ignored it before because Workers static assets don't use it, so routing doesn't change. The first real check is thedevdeploy after merge.Verification
bun run buildinpackages/websucceeds, both plain and withSST_WRANGLER_PATHpointing at a wrangler config shaped like the one SST writes (nodejs_compat, vars). Warnings match the old build apart from one new info-level Starlight warning (Entry docs → 404 was not found), and the 404 page renders the same.dist/server/entry.mjswith esbuild using the conditions SST uses for workers (workerd,worker,browser). It resolves everything; the only imports left unbundled are node built-ins andcloudflare:workers._routes.json(dropped),_headersand.assetsignore(added by the adapter).x-defaulthreflang link, tab IDs liketab-0-1, and one French heading ID that now keeps a trailing hyphen. Nothing links to that heading.<head>tags, heading ids, a full internal link and anchor check (the 112 broken links already ondevare unchanged), fonts, console errors, the accessibility tree, sitemap, robots and the pagefind index. I also compared the computed style of every element on 33 pages in 6 configurations./docs/s/<id>against a mock share API, served the way SST deploys each build, at 390, 1280 and 1440px in light and dark mode. It's pixel-identical./docs/config.md,/config.jsonand/tui.jsonreturn 200 on the preview;/docs/s/<id>renders through the worker.astro devserves/docs/,/docs/config/,/docs/ja/and/docs/config.md.astro check: 17 errors before, 17 after. The newHero.astrotype error is fixed; the rest already existed.bun install --frozen-lockfilepasses. In the lockfile, the only packages added or removed belong to the docs site's dependency tree. The other changed lines are bun moving shared packages up or down a level after Astro 5's dependencies left; each consumer resolves the same version as before.bun run buildinpackages/postsstill passes withastro: "catalog:".