Skip to content

Upgrade to Astro v7 and widen dependabot astro group#57

Merged
mcgroarty merged 2 commits into
mainfrom
fix/astro-v7-upgrade
Jul 16, 2026
Merged

Upgrade to Astro v7 and widen dependabot astro group#57
mcgroarty merged 2 commits into
mainfrom
fix/astro-v7-upgrade

Conversation

@mcgroarty

Copy link
Copy Markdown
Contributor

Context

The most recent Dependabot PR (#54) bumped @astrojs/starlight from 0.40.0 to 0.41.3. Starlight 0.41 dropped support for Astro v6 and requires v7. However, astro is still pinned to ^6.4.8 in package.json, so after that merge the transitive @astrojs/mdx@7.0.3 fails to import chunkToString from Astro's runtime and the build errors out:

This PR

This PR contains only the Dependabot config change to prevent a recurrence: the astro group now also accepts major bumps, so Astro-ecosystem packages upgrade together in a single reviewable PR rather than fragmenting.

The Astro v6 → v7 upgrade itself (and the required pnpm-lock.yaml regeneration) will be added on top of this branch via the GitHub Copilot coding agent — see the follow-up comment on this PR.

After merge

Once Astro is on v7 and CI is green, everything is unblocked and future Starlight / Astro moves will be grouped together.

Astro and @astrojs/* packages share tight peer-dependency requirements
(e.g. Starlight 0.41 requires Astro v7). Excluding major bumps from the
astro group means a Starlight minor bump can land without the required
Astro major bump, producing an incompatible dependency set that breaks
the build (see run 29535495086: @astrojs/mdx 7 imports chunkToString
which does not exist in astro v6).

Include "major" in the astro group so the ecosystem upgrades together.
@mcgroarty

Copy link
Copy Markdown
Contributor Author

@copilot Upgrade this repo from Astro v6 to Astro v7 on this branch to unblock CI.

Root cause: PR #54 bumped @astrojs/starlight to 0.41.3, which requires Astro v7 and pulled in @astrojs/mdx@7.0.3. astro is still pinned to ^6.4.8 in package.json, so the MDX integration fails to import chunkToString at build time. See the failed run: https://github.com/secondlife/create/actions/runs/29535495086

Please do:

  1. Bump astro in package.json to ^7.1.0 (or the latest v7).
  2. Run pnpm install to regenerate pnpm-lock.yaml.
  3. Follow the official migration guide and apply any required changes: https://docs.astro.build/en/guides/upgrade-to/v7/ — pay attention to astro.config.mjs, content collections (src/content.config.ts), and any custom components under src/components/.
  4. If Astro's @astrojs/upgrade codemod is applicable, prefer that: pnpm dlx @astrojs/upgrade.
  5. Also bump @astrojs/check to the latest version compatible with Astro v7 if needed.

Verify before pushing:

  • pnpm install --frozen-lockfile succeeds
  • pnpm astro check passes
  • pnpm build produces dist/ without errors
  • pnpm generate:docs still works (this project regenerates LSL/Lua reference pages from src/definitions/lsl_definitions.yaml)

Do not modify anything under src/content/docs/ or src/definitions/ — those are content, not infrastructure. Keep the dependabot config change already in this PR.

If Astro v7 introduces breaking changes that require content or component updates, list them in the PR description rather than silently rewriting docs.

- Bump astro from ^6.4.8 to ^7.1.0 in package.json
- Downgrade js-yaml from ^5.x to ^4.1.0 to resolve runtime ESM default
  import conflict (Starlight bundles js-yaml with a default import; at
  prerender time Node.js was resolving to our v5 package which has no
  default export — aligning both to v4 fixes this)
- Update src/utils/lsl-definitions.ts to use named import { load } from
  'js-yaml' (cleaner regardless of version)
- Fix pnpm-workspace.yaml: remove placeholder allowBuilds stanza and
  approve esbuild build scripts; add minimumReleaseAgeExclude for
  astro@7.1.0 (added automatically by pnpm)
- Regenerate pnpm-lock.yaml

Verified:
  pnpm install --frozen-lockfile  ✓
  pnpm astro check                ✓  (0 errors)
  pnpm build                      ✓  (3153 pages)
  pnpm generate:docs              ✓  (1050 function + 86 event + 2020 constant pages)

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@copilot Upgrade this repo from Astro v6 to Astro v7 on this branch to unblock CI.

Root cause: PR #54 bumped @astrojs/starlight to 0.41.3, which requires Astro v7 and pulled in `@astrojs/mdx@...

Done — Astro is now on v7.1.0. Commit: feat: upgrade Astro v6 to v7, fix js-yaml compatibility.

What was changed:

File Change
package.json astro bumped to ^7.1.0; js-yaml downgraded to ^4.1.0
src/utils/lsl-definitions.ts import yaml from 'js-yaml'import { load } from 'js-yaml'
pnpm-workspace.yaml Replaced placeholder allowBuilds stanza with proper esbuild approval
pnpm-lock.yaml Regenerated

Non-obvious breaking change fixed: js-yaml had to be downgraded from v5 to v4, not just upgraded Astro. The root cause: Starlight 0.41 bundles a import yaml from 'js-yaml' call as an external reference. At prerender time, Node.js ESM-resolves that to the project-root js-yaml, which was our v5 package. js-yaml@5.x is ESM-only with no default export → fatal import error. Aligning to ^4.1.0 (same range Starlight uses) deduplicates the install and restores the working CJS-with-default-export behavior.

Verified locally:

  • pnpm install --frozen-lockfile
  • pnpm astro check ✅ (0 errors)
  • pnpm build ✅ (3153 pages)
  • pnpm generate:docs

@mcgroarty
mcgroarty merged commit f036a1c into main Jul 16, 2026
5 checks passed
@mcgroarty
mcgroarty deleted the fix/astro-v7-upgrade branch July 16, 2026 21:51
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.

2 participants