Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JS support to @astrojs/starlight/expressive-code export #1440

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

hippotastic
Copy link
Contributor

Description

  • Converts Starlight's @astrojs/starlight/expressive-code export from a TS-only export to an .mjs+.d.ts pair, using the exact configuration and file structure also used by Astro's astro/config export.
    • Note: To keep this now .mjs-based export working in projects using Astro's strictest TypeScript configuration that contains allowJs: false, it was required to move the exporting files into the package root folder using names that are identical to the export's name.
  • This change allows using the recently introduced defineEcConfig helper function and all other re-exports from astro-expressive-code (which are important for advanced customization scenarios) to also work in ec.config.mjs outside of monorepos, where Astro's Vite instance does not process integration imports and therefore no TS support is available.
  • Moves the exported getStarlightEcConfigPreprocessor function to @astrojs/starlight/internal, because it uses TS and therefore cannot remain in the previous @astrojs/starlight/expressive-code export which now no longer depends on TS.

Copy link

changeset-bot bot commented Jan 30, 2024

🦋 Changeset detected

Latest commit: 05b4fb9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Jan 30, 2024 3:23pm

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for wrangling the complexity of these different environments 🫡

@delucis delucis merged commit 2ea1e88 into withastro:main Jan 30, 2024
10 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 30, 2024
@hippotastic hippotastic deleted the add-js-support-to-ec-export branch January 30, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants