chore(deps): upgrade to Astro 7 and Starlight 0.41 - #339
Merged
Conversation
Bumps [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) and [@astrojs/starlight](https://github.com/withastro/starlight/tree/HEAD/packages/starlight). These dependencies needed to be updated together. Updates `astro` from 6.3.2 to 7.1.6 - [Release notes](https://github.com/withastro/astro/releases) - [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md) - [Commits](https://github.com/withastro/astro/commits/astro@7.1.6/packages/astro) Updates `@astrojs/starlight` from 0.38.1 to 0.41.6 - [Release notes](https://github.com/withastro/starlight/releases) - [Changelog](https://github.com/withastro/starlight/blob/main/packages/starlight/CHANGELOG.md) - [Commits](https://github.com/withastro/starlight/commits/@astrojs/starlight@0.41.6/packages/starlight) --- updated-dependencies: - dependency-name: astro dependency-version: 7.1.6 dependency-type: direct:production - dependency-name: "@astrojs/starlight" dependency-version: 0.41.6 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Starlight 0.39 removed support for autogenerated sidebar groups that carry a `label`; the autogenerate config must now sit inside an `items` array. Without this the build fails at the `astro:config:setup` hook. - sidebar.mjs: wrap all 13 autogenerate configs. Groups marked `collapsed: true` also set `collapsed` on the autogenerate config, since autogenerated subgroups no longer inherit the parent's collapsed state. - scripts/postprocess-motoko.mjs: normalise both shapes in transformEntry, so sidebar-motoko.mjs stays valid whichever shape upstream caffeinelabs/motoko emits. Without this the next Motoko sync regenerates the pre-0.39 shape and breaks the build again. - sidebar-motoko.mjs: regenerated with the fixed generator. - plugins/astro-agent-docs.mjs: deriveSections() read the label off the autogenerate node, which is now unlabelled, so every autogenerated section in llms.txt rendered as "undefined". Unwrap the nested config and use the group's label. This failed silently, without a build error. Verified against a main baseline: sidebar structure (38 groups, labels and collapsed states), llms.txt and llms-full.txt are byte-identical.
Astro 7 defaults to the Sätteri markdown processor and deprecates
`markdown.remarkPlugins` / `markdown.rehypePlugins`, which the build warned
about. Opt back into the remark/rehype pipeline explicitly via
`processor: unified({ ... })`.
@astrojs/markdown-remark is added as a direct dependency rather than relying on
Astro's transitive copy. Only the root dependency entry is added to the
lockfile; the package itself was already resolved there.
All 209 pages render identically to a main baseline.
deriveSections() infers llms.txt section labels from the sidebar tree's shape, so a change to that shape degrades them instead of failing. Starlight 0.39 moving `autogenerate` inside `items` did exactly that: every autogenerated section's label became `undefined` and would have shipped as "## undefined" in llms.txt with a clean build log and a zero exit code. Validate the derived sections at module load and throw with the offending directory and the function to update. Verified by reintroducing the original bug: the build fails immediately with the new message. Also aligns validate.yml on Node 22, matching the other five workflows. Astro 7 requires ^20.19.0 || >=22.12.0; the previous '20' pin resolved to a satisfying 20.x and this job does not run Astro, so this is consistency rather than a fix.
lwshang
approved these changes
Aug 4, 2026
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.
Summary
Replaces #337 (dependabot), which could not merge as-is: Astro 7 / Starlight 0.41 need repo-side changes. Dependabot's bump commit is preserved here, with the required fixes on top.
astro6.3.2 → 7.1.6,@astrojs/starlight0.38.1 → 0.41.6 (cherry-picked from chore(deps): bump astro and @astrojs/starlight #337)itemsarrays (Starlight 0.39 removed labelled autogenerated groups)scripts/postprocess-motoko.mjsso synced Motoko pages keep workingderiveSections()inplugins/astro-agent-docs.mjsso llms.txt keeps its section labels, and make the same class of failure fail the build in futuremarkdown.remarkPlugins/rehypePluginstoprocessor: unified({ ... })validate.ymlon Node 22Why the extra changes
Sidebar (build blocker). Starlight 0.39 requires the autogenerate config to sit inside an
itemsarray:{ label: "Backends", collapsed: true, - autogenerate: { directory: "guides/backends" }, + items: [{ autogenerate: { directory: "guides/backends", collapsed: true } }], }collapsedis set on the autogenerate config too, because autogenerated subgroups no longer inherit the parent's collapsed state as of 0.39. No autogenerate directory currently has subdirectories, so this is a no-op today and keeps behaviour correct if one is added.Motoko sidebar (would regress on the next sync).
sidebar-motoko.mjsis generated fromdoc/site/sidebar.mjsin the pinned.sources/motokosubmodule, which still uses the pre-0.39 shape. Hand-editing the generated file alone would be undone by the next Motoko sync, breaking the build again. InsteadtransformEntry()now normalises both shapes, so the output is valid whichever shape upstream emits and no coordination withcaffeinelabs/motokois required. Verified: both shapes produce byte-identical output, and regeneration is idempotent.llms.txt (silent break, now guarded).
deriveSections()read the section label off the autogenerate node. Once nested, that node is unlabelled and the label lives on the parent group, so all 15 autogenerated sections rendered as## undefinedin llms.txt — with a clean build log and a zero exit code. Beyond fixing the derivation, the derived sections are now validated at module load and the build throws with the offending directory and the function to update. Verified by reintroducing the original bug: the build fails immediately instead of shipping. This guards the whole class of failure, since these labels are inferred from the sidebar's shape and future Starlight majors can change it again.Markdown processor. Astro 7 defaults to the Sätteri processor and deprecates the top-level plugin arrays (the build warned about it).
processor: unified({ ... })opts back into the remark/rehype pipeline the 5 remark and 2 rehype plugins need.@astrojs/markdown-remarkis declared as a direct dependency instead of relying on Astro's transitive copy; only the root dependency entry is added to the lockfile.Node 22 in
validate.yml. Astro 7 requires^20.19.0 || >=22.12.0. The previous'20'pin resolved to a satisfying 20.x and that job does not run Astro, so this aligns it with the other five workflows rather than fixing a break.Verification
Built against a
mainbaseline and compared output:llms.txt,llms-full.txt,feed.xmland all 209 markdown endpoints byte-identical”Canister is not ready”→“Canister is not ready”) and one whitespace change between flex items in a Starlight LinkCard on the homepage, which does not renderfile=includes render in full, andllms.txtis byte-identical to the local buildNotes
caffeinelabs/motokopins Starlight ^0.41.3 indoc/site/package.jsonwhile itssidebar.mjsstill uses the pre-0.39 shape, and no workflow there buildsdoc/site, so their own preview site hits this same error unnoticed. Worth a separate upstream PR; this branch does not depend on it.