Skip to content

Commit baa495b

Browse files
committed
feat: add support for starlight 0.32
1 parent 0f7b91b commit baa495b

File tree

6 files changed

+442
-424
lines changed

6 files changed

+442
-424
lines changed

.changeset/pretty-pumas-hang.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'starlight-openapi': minor
3+
---
4+
5+
⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now version `0.32.0`.
6+
7+
Please use the `@astrojs/upgrade` command to upgrade your project:
8+
9+
```sh
10+
npx @astrojs/upgrade
11+
```

docs/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"lint": "eslint . --cache --max-warnings=0"
1515
},
1616
"dependencies": {
17-
"@astrojs/starlight": "^0.30.2",
18-
"@hideoo/starlight-plugins-docs-components": "^0.3.0",
19-
"astro": "^5.0.9",
17+
"@astrojs/starlight": "^0.32.0",
18+
"@hideoo/starlight-plugins-docs-components": "^0.4.0",
19+
"astro": "^5.3.0",
2020
"sharp": "^0.33.5",
2121
"starlight-openapi": "workspace:*"
2222
},

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@hideoo/eslint-config": "^4.0.0",
1919
"@hideoo/prettier-config": "^2.0.0",
2020
"@hideoo/tsconfig": "^2.0.1",
21-
"astro": "^5.0.9",
21+
"astro": "^5.3.0",
2222
"eslint": "^9.17.0",
2323
"prettier": "^3.4.2",
2424
"prettier-plugin-astro": "^0.14.1",

packages/starlight-openapi/index.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function starlightOpenAPIPlugin(userConfig: StarlightOpenAPIUserC
1111
return {
1212
name: 'starlight-openapi-plugin',
1313
hooks: {
14-
setup: async ({ addIntegration, command, config: starlightConfig, logger, updateConfig }) => {
14+
'config:setup': async ({ addIntegration, command, config: starlightConfig, logger, updateConfig }) => {
1515
if (command !== 'build' && command !== 'dev') {
1616
return
1717
}
@@ -23,7 +23,20 @@ export default function starlightOpenAPIPlugin(userConfig: StarlightOpenAPIUserC
2323

2424
const sidebar = getSidebarFromSchemas(starlightConfig.sidebar, schemas)
2525

26-
updateConfig({ customCss: [...(starlightConfig.customCss ?? []), 'starlight-openapi/styles'], sidebar })
26+
const updatedConfig: Parameters<typeof updateConfig>[0] = {
27+
customCss: [...(starlightConfig.customCss ?? []), 'starlight-openapi/styles'],
28+
sidebar,
29+
}
30+
31+
if (updatedConfig.expressiveCode !== false) {
32+
updatedConfig.expressiveCode =
33+
updatedConfig.expressiveCode === true || updatedConfig.expressiveCode === undefined
34+
? {}
35+
: updatedConfig.expressiveCode
36+
updatedConfig.expressiveCode.removeUnusedThemes = false
37+
}
38+
39+
updateConfig(updatedConfig)
2740
},
2841
},
2942
}

packages/starlight-openapi/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"openapi-types": "^12.1.3"
2727
},
2828
"peerDependencies": {
29-
"@astrojs/markdown-remark": ">=6.0.0",
29+
"@astrojs/markdown-remark": ">=6.0.1",
3030
"@astrojs/starlight": ">=0.30.0",
31-
"astro": ">=5.0.0"
31+
"astro": ">=5.1.5"
3232
},
3333
"engines": {
3434
"node": ">=18.17.1"

0 commit comments

Comments
 (0)