fix(docs): resolve Astro 6 build errors and modernize Starlight dependencies#197
fix(docs): resolve Astro 6 build errors and modernize Starlight dependencies#197Pega88 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the astro-d2 and starlight-links-validator dependencies and enables the experimental useD2js feature in the Astro configuration to reduce reliance on local binaries. Feedback suggests increasing the minimum Node.js version requirement to 22.12.0 to satisfy new dependency constraints and addressing the check-d2.sh script which still mandates a local binary despite the configuration changes.
| "astro-d2": "^0.10.0" | ||
| }, | ||
| "engines": { | ||
| "node": ">=22" |
There was a problem hiding this comment.
The Node.js engine requirement is set to >=22, but Astro 6 and the updated plugins (astro-d2, starlight-links-validator) specifically require Node.js version 22.12.0 or higher. This discrepancy can lead to installation warnings or runtime errors on older Node 22 releases. Please update the engines field in package.json to >=22.12.0 and regenerate the lockfile.
| "node": ">=22" | |
| "node": ">=22.12.0" |
| base: '/scion', | ||
| integrations: [ | ||
| d2(), | ||
| d2({ experimental: { useD2js: true } }), |
There was a problem hiding this comment.
While enabling useD2js removes the requirement for a local d2 binary during the Astro build process, the project still includes a check-d2.sh script (referenced in package.json) that explicitly checks for and requires the d2 CLI. To fully achieve the PR's goal of removing system-level binary requirements for all developer workflows, consider updating or removing that validation script.
This PR addresses several build-breaking issues in the docs-site introduced by the migration to Astro 6. It resolves Zod-related configuration errors and streamlines the diagram generation process.
Root Causes
The primary failure was a
z.function(...).args is not a functionerror during the Astro configuration phase. This was caused by an incompatibility between the older versions of Starlight plugins and the version of Zod bundled with Astro 6. Additionally, the astro-d2 integration encountered issues parsing configuration defaults in the new environment.Changes
Verification Results
Checklist