@astrojs/starlight 0.8.0 → 0.9.0

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,21 @@
1
1
  # @astrojs/starlight
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#626](https://github.com/withastro/starlight/pull/626) [`5dd22b8`](https://github.com/withastro/starlight/commit/5dd22b875dc19a32c48692082fbd934e2b70da63) Thanks [@delucis](https://github.com/delucis)! - Throw an error for duplicate MDX or sitemap integrations
8
+
9
+ - [#615](https://github.com/withastro/starlight/pull/615) [`7b75b3e`](https://github.com/withastro/starlight/commit/7b75b3eb7e6f7870a0adef2d6534ff48309fdb0e) Thanks [@delucis](https://github.com/delucis)! - Bump minimum required Astro version to 3.0
10
+
11
+ ⚠️ **BREAKING CHANGE** Astro v2 is no longer supported. Make sure you [update Astro](https://docs.astro.build/en/guides/upgrade-to/v3/) and any other integrations at the same time as updating Starlight.
12
+
13
+ ## 0.8.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [#612](https://github.com/withastro/starlight/pull/612) [`1b367e3`](https://github.com/withastro/starlight/commit/1b367e3f65e3736b5f91c9853a487f7f5d174a6f) Thanks [@KubaJastrz](https://github.com/KubaJastrz)! - Avoid applying hovered `<select>` text color to its `<options>`
18
+
3
19
  ## 0.8.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -8,9 +8,9 @@ Starlight is a documentation website framework for [Astro][astro].
8
8
 
9
9
  ## Support
10
10
 
11
- Get help in the [Astro Discord](discord). Post questions in our `#support` forum with the “starlight” tag, or visit our dedicated `#starlight` channel to discuss current development and more!
11
+ Get help in the [Astro Discord][discord]. Post questions in our `#support` forum with the “starlight” tag, or visit our dedicated `#starlight` channel to discuss current development and more!
12
12
 
13
- You can also submit bug reports and feature requests as [GitHub issues](issues).
13
+ You can also submit bug reports and feature requests as [GitHub issues][issues].
14
14
 
15
15
  ## Contributing
16
16
 
@@ -19,7 +19,7 @@ Join us as a Starlight contributor! These links will help you get started:
19
19
  - [Contributor Manual][contributing]
20
20
  - [Code of Conduct][coc]
21
21
  - [Community Guide][community]
22
- - [Join the `#starlight` channel on Discord](discord)
22
+ - [Join the `#starlight` channel on Discord][discord]
23
23
 
24
24
  ## License
25
25
 
@@ -28,7 +28,7 @@ try {
28
28
  {
29
29
  date && (
30
30
  <p>
31
- {t('page.lastUpdated')}
31
+ {t('page.lastUpdated')}{' '}
32
32
  <time datetime={date.toISOString()}>
33
33
  {date.toLocaleDateString(lang, { dateStyle: 'medium' })}
34
34
  </time>
@@ -73,6 +73,7 @@ interface Props {
73
73
 
74
74
  option {
75
75
  background-color: var(--sl-color-bg-nav);
76
+ color: var(--sl-color-gray-1);
76
77
  }
77
78
 
78
79
  @media (min-width: 50rem) {
@@ -21,10 +21,13 @@ interface Props {
21
21
  >
22
22
  <span>{entry.label}</span>
23
23
  {entry.badge && (
24
- <Badge
25
- text={entry.badge.text}
26
- variant={entry.isCurrent ? 'outline' : entry.badge.variant}
27
- />
24
+ <>
25
+ {' '}
26
+ <Badge
27
+ text={entry.badge.text}
28
+ variant={entry.isCurrent ? 'outline' : entry.badge.variant}
29
+ />
30
+ </>
28
31
  )}
29
32
  </a>
30
33
  ) : (
package/index.ts CHANGED
@@ -7,7 +7,7 @@ import { starlightAsides } from './integrations/asides';
7
7
  import { starlightSitemap } from './integrations/sitemap';
8
8
  import { vitePluginStarlightUserConfig } from './integrations/virtual-user-config';
9
9
  import { errorMap } from './utils/error-map';
10
- import { StarlightConfigSchema, StarlightUserConfig } from './utils/user-config';
10
+ import { StarlightConfigSchema, type StarlightUserConfig } from './utils/user-config';
11
11
  import { rehypeRtlCodeSupport } from './integrations/code-rtl-support';
12
12
 
13
13
  export default function StarlightIntegration(opts: StarlightUserConfig): AstroIntegration[] {
@@ -45,16 +45,24 @@ export default function StarlightIntegration(opts: StarlightUserConfig): AstroIn
45
45
  // Configure Shiki theme if the user is using the default github-dark theme.
46
46
  config.markdown.shikiConfig.theme !== 'github-dark' ? {} : { theme: 'css-variables' },
47
47
  },
48
- build: { inlineStylesheets: 'auto' },
49
- experimental: {
50
- assets: true,
51
- // @ts-ignore - Needed for older versions of Astro, but an error since astro@2.6.0
52
- inlineStylesheets: 'auto',
53
- },
48
+ scopedStyleStrategy: 'where',
54
49
  };
55
50
  updateConfig(newConfig);
56
51
  },
57
52
 
53
+ 'astro:config:done': ({ config }) => {
54
+ const integrations = config.integrations.map(({ name }) => name);
55
+ for (const builtin of ['@astrojs/mdx', '@astrojs/sitemap']) {
56
+ if (integrations.filter((name) => name === builtin).length > 1) {
57
+ throw new Error(
58
+ `Found more than one instance of ${builtin}.\n` +
59
+ `Starlight includes ${builtin} by default.\n` +
60
+ 'Please remove it from your integrations array in astro.config.mjs'
61
+ );
62
+ }
63
+ }
64
+ },
65
+
58
66
  'astro:build:done': ({ dir }) => {
59
67
  const targetDir = fileURLToPath(dir);
60
68
  const cwd = dirname(fileURLToPath(import.meta.url));
@@ -1,5 +1,5 @@
1
1
  import type { AstroUserConfig } from 'astro';
2
- import { h as _h, s as _s, Properties } from 'hastscript';
2
+ import { h as _h, s as _s, type Properties } from 'hastscript';
3
3
  import type { Paragraph as P, Root } from 'mdast';
4
4
  import remarkDirective from 'remark-directive';
5
5
  import type { Plugin, Transformer } from 'unified';
@@ -1,4 +1,4 @@
1
- import sitemap, { SitemapOptions } from '@astrojs/sitemap';
1
+ import sitemap, { type SitemapOptions } from '@astrojs/sitemap';
2
2
  import type { StarlightConfig } from '../types';
3
3
 
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -28,17 +28,17 @@
28
28
  "./404.astro": "./404.astro"
29
29
  },
30
30
  "peerDependencies": {
31
- "astro": "^2.5.0"
31
+ "astro": "^3.0.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^18.16.19",
35
35
  "@vitest/coverage-v8": "^0.33.0",
36
- "astro": "^2.10.5",
36
+ "astro": "^3.0.6",
37
37
  "vitest": "^0.33.0"
38
38
  },
39
39
  "dependencies": {
40
- "@astrojs/mdx": "^0.19.7",
41
- "@astrojs/sitemap": "^1.3.3",
40
+ "@astrojs/mdx": "^1.0.0",
41
+ "@astrojs/sitemap": "^3.0.0",
42
42
  "@pagefind/default-ui": "^1.0.0-alpha.5",
43
43
  "@types/mdast": "^3.0.11",
44
44
  "bcp-47": "^2.1.0",