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

Update astro-expressive-code #1720

Merged
merged 14 commits into from Apr 30, 2024
Merged
7 changes: 7 additions & 0 deletions .changeset/strong-moose-jam.md
@@ -0,0 +1,7 @@
---
'@astrojs/starlight': minor
---

Updates `astro-expressive-code` dependency to the latest minor release (0.35) and exposes a new `@astrojs/starlight/expressive-code/hast` module for users who need to use Expressive Code’s version of `hast`.

This includes a potentially breaking change if you use custom Expressive Code plugins. See the [Expressive Code release notes](https://expressive-code.com/releases/#0340) for full details.
5 changes: 5 additions & 0 deletions packages/starlight/integrations/expressive-code/hast.d.ts
@@ -0,0 +1,5 @@
/**
* @file This file provides the types for Starlight's `@astrojs/starlight/expressive-code/hast` export.
*/

export * from 'astro-expressive-code/hast';
9 changes: 9 additions & 0 deletions packages/starlight/integrations/expressive-code/hast.mjs
@@ -0,0 +1,9 @@
/**
* @file This file is exported by Starlight as `@astrojs/starlight/expressive-code/hast`.
*
* Note: This file is intentionally not a TypeScript module to allow access to all exported
* functionality even if TypeScript is not available, e.g. from the `ec.config.mjs` file
* that does not get processed by Vite.
*/

export * from 'astro-expressive-code/hast';
6 changes: 5 additions & 1 deletion packages/starlight/package.json
Expand Up @@ -166,6 +166,10 @@
"types": "./expressive-code.d.ts",
"default": "./expressive-code.mjs"
},
"./expressive-code/hast": {
"types": "./integrations/expressive-code/hast.d.ts",
"default": "./integrations/expressive-code/hast.mjs"
},
"./index.astro": "./index.astro",
"./404.astro": "./404.astro",
"./style/markdown.css": "./style/markdown.css"
Expand All @@ -186,7 +190,7 @@
"@pagefind/default-ui": "^1.0.3",
"@types/hast": "^3.0.3",
"@types/mdast": "^4.0.3",
"astro-expressive-code": "^0.33.4",
"astro-expressive-code": "^0.35.2",
"bcp-47": "^2.1.0",
"hast-util-from-html": "^2.0.1",
"hast-util-select": "^6.0.2",
Expand Down