@astrojs/starlight 0.38.3 → 0.38.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @astrojs/starlight
2
2
 
3
+ ## 0.38.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3854](https://github.com/withastro/starlight/pull/3854) [`ccf6000`](https://github.com/withastro/starlight/commit/ccf6000549c580796a8a8730637074c25e3ccc44), [#3877](https://github.com/withastro/starlight/pull/3877) [`47451bc`](https://github.com/withastro/starlight/commit/47451bc56d84ed19bee73e3d4dbb58d28951ef38) Thanks [@delucis](https://github.com/delucis)! - Updates internal dependencies
8
+
9
+ ## 0.38.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#3828](https://github.com/withastro/starlight/pull/3828) [`342038b`](https://github.com/withastro/starlight/commit/342038b60b35c0e8cd4489e6a3ee16902445cfce) Thanks [@MangelMaxime](https://github.com/MangelMaxime)! - Fixes aside styling when used without any content
14
+
15
+ - [#3853](https://github.com/withastro/starlight/pull/3853) [`563e11b`](https://github.com/withastro/starlight/commit/563e11b71f5c23d0ca982f7e061ade0796101ffb) Thanks [@delucis](https://github.com/delucis)! - Fixes a type-checking issue for users on newer versions of TypeScript
16
+
3
17
  ## 0.38.3
4
18
 
5
19
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.38.3",
3
+ "version": "0.38.5",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -45,42 +45,42 @@
45
45
  "astro": "^6.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@playwright/test": "^1.57.0",
49
- "@types/node": "^22.19.3",
50
- "@vitest/coverage-v8": "^4.1.0",
51
- "astro": "^6.0.1",
52
- "linkedom": "^0.18.4",
53
- "vitest": "^4.1.0"
48
+ "@playwright/test": "^1.59.1",
49
+ "@types/node": "^22.19.17",
50
+ "@vitest/coverage-v8": "^4.1.5",
51
+ "astro": "^6.2.2",
52
+ "linkedom": "^0.18.12",
53
+ "vitest": "^4.1.5"
54
54
  },
55
55
  "dependencies": {
56
- "@astrojs/markdown-remark": "^7.0.0",
57
- "@astrojs/mdx": "^5.0.0",
58
- "@astrojs/sitemap": "^3.7.1",
56
+ "@astrojs/markdown-remark": "^7.1.1",
57
+ "@astrojs/mdx": "^5.0.4",
58
+ "@astrojs/sitemap": "^3.7.2",
59
59
  "@pagefind/default-ui": "^1.3.0",
60
60
  "@types/hast": "^3.0.4",
61
61
  "@types/js-yaml": "^4.0.9",
62
62
  "@types/mdast": "^4.0.4",
63
- "astro-expressive-code": "^0.41.6",
63
+ "astro-expressive-code": "^0.42.0",
64
64
  "bcp-47": "^2.1.0",
65
- "hast-util-from-html": "^2.0.1",
66
- "hast-util-select": "^6.0.2",
67
- "hast-util-to-string": "^3.0.0",
68
- "hastscript": "^9.0.0",
65
+ "hast-util-from-html": "^2.0.3",
66
+ "hast-util-select": "^6.0.4",
67
+ "hast-util-to-string": "^3.0.1",
68
+ "hastscript": "^9.0.1",
69
69
  "i18next": "^23.11.5",
70
- "js-yaml": "^4.1.0",
70
+ "js-yaml": "^4.1.1",
71
71
  "klona": "^2.0.6",
72
- "magic-string": "^0.30.17",
73
- "mdast-util-directive": "^3.0.0",
74
- "mdast-util-to-markdown": "^2.1.0",
72
+ "magic-string": "^0.30.21",
73
+ "mdast-util-directive": "^3.1.0",
74
+ "mdast-util-to-markdown": "^2.1.2",
75
75
  "mdast-util-to-string": "^4.0.0",
76
76
  "pagefind": "^1.3.0",
77
- "rehype": "^13.0.1",
78
- "rehype-format": "^5.0.0",
79
- "remark-directive": "^3.0.0",
77
+ "rehype": "^13.0.2",
78
+ "rehype-format": "^5.0.1",
79
+ "remark-directive": "^4.0.0",
80
80
  "ultrahtml": "^1.6.0",
81
81
  "unified": "^11.0.5",
82
- "unist-util-visit": "^5.0.0",
83
- "vfile": "^6.0.2"
82
+ "unist-util-visit": "^5.1.0",
83
+ "vfile": "^6.0.3"
84
84
  },
85
85
  "publishConfig": {
86
86
  "provenance": true
package/style/asides.css CHANGED
@@ -45,6 +45,10 @@
45
45
  margin-top: 0.5rem;
46
46
  }
47
47
 
48
+ .starlight-aside__content:empty {
49
+ display: none;
50
+ }
51
+
48
52
  .starlight-aside__content a {
49
53
  color: var(--sl-color-asides-text-accent);
50
54
  }
@@ -34,7 +34,11 @@ if (!title) {
34
34
  <p class="starlight-aside__title" aria-hidden="true">
35
35
  <Icon name={icon || icons[type]} class="starlight-aside__icon" />{title}
36
36
  </p>
37
- <div class="starlight-aside__content">
38
- <slot />
39
- </div>
37
+ {
38
+ /*
39
+ The slot is intentionally not wrapped in newlines/whitespace to ensure CSS `:empty`
40
+ can match when no content is provided.
41
+ */
42
+ }
43
+ <div class="starlight-aside__content"><slot /></div>
40
44
  </aside>
package/utils/i18n.ts CHANGED
@@ -187,13 +187,17 @@ function getLocaleDir(locale: Intl.Locale): 'ltr' | 'rtl' {
187
187
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
188
188
  return locale.textInfo.direction;
189
189
  } else if ('getTextInfo' in locale) {
190
- // @ts-expect-error - `getTextInfo` is not typed but is available in some non-v8 based environments.
191
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
190
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
191
+ // @ts-ignore - `getTextInfo` is not typed in older versions of TypeScript but is available in some browsers and newer versions of Node.
192
+ // TODO: remove or switch to @ts-expect-error in #3572
192
193
  return locale.getTextInfo().direction;
193
194
  }
194
195
  // Firefox does not support `textInfo` or `getTextInfo` yet so we fallback to a well-known list
195
196
  // of right-to-left languages.
196
- return wellKnownRTL.includes(locale.language) ? 'rtl' : 'ltr';
197
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
198
+ // @ts-ignore — This is a type error with newer versions of TypeScript’s DOM types.
199
+ // TODO: remove or switch to @ts-expect-error in #3572
200
+ return wellKnownRTL.includes((locale as Intl.Locale).language) ? 'rtl' : 'ltr';
197
201
  }
198
202
 
199
203
  /**
package/utils/plugins.ts CHANGED
@@ -199,6 +199,8 @@ const baseStarlightPluginSchema = z.object({
199
199
  type StarlightConfigUpdate = Partial<Omit<StarlightUserConfig, 'routeMiddleware'>>;
200
200
  type StarlightI18nTFactory = Awaited<ReturnType<typeof createTranslationSystemFromFs>>;
201
201
 
202
+ /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion --
203
+ The configSetupHookSchema casts `z.any()` to provide types but this rule can’t understand that. */
202
204
  const configSetupHookSchema = z
203
205
  .function({
204
206
  input: [