;
- };
- }
-}
diff --git a/packages/starlight/integrations/expressive-code/hast.d.ts b/packages/starlight/integrations/expressive-code/hast.d.ts
deleted file mode 100644
index e2d67796b77..00000000000
--- a/packages/starlight/integrations/expressive-code/hast.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * @file This file provides the types for Starlight's `@astrojs/starlight/expressive-code/hast` export.
- */
-
-export * from 'astro-expressive-code/hast';
diff --git a/packages/starlight/integrations/expressive-code/hast.mjs b/packages/starlight/integrations/expressive-code/hast.mjs
deleted file mode 100644
index 3b6549fe47b..00000000000
--- a/packages/starlight/integrations/expressive-code/hast.mjs
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * @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';
diff --git a/packages/starlight/locals.d.ts b/packages/starlight/locals.d.ts
deleted file mode 100644
index 12ae5fad26d..00000000000
--- a/packages/starlight/locals.d.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * This namespace is reserved for Starlight (only used for i18n at the moment).
- * It can be extended by plugins using module augmentation and interface merging.
- * For an example, see: https://starlight.astro.build/reference/plugins/#injecttranslations
- */
-declare namespace StarlightApp {
- interface I18n {}
-}
-
-/**
- * Extending Astro’s `App.Locals` interface registers types for the middleware added by Starlight.
- */
-declare namespace App {
- interface Locals {
- /**
- * Starlight’s localization API, powered by i18next.
- *
- * @see https://starlight.astro.build/guides/i18n/#using-ui-translations
- *
- * @example
- * // Render a UI string for the current locale.
- * {Astro.locals.t('404.text')}
- */
- t: import('./utils/createTranslationSystem').I18nT;
-
- /**
- * Starlight’s data for the current route.
- *
- * @see https://starlight.astro.build/guides/route-data/
- *
- * @throws Will throw an error if accessed on non-Starlight routes.
- *
- * @example
- * // Render the title for the current page
- * {Astro.locals.starlightRoute.entry.data.title}
- *
- * @example
- * // Check if the current page should render the sidebar
- * const { hasSidebar } = Astro.locals.starlightRoute;
- */
- starlightRoute: import('./utils/routing/types').StarlightRouteData;
- }
-}
diff --git a/packages/starlight/package.json b/packages/starlight/package.json
index a15e788ca57..1c4d588d9da 100644
--- a/packages/starlight/package.json
+++ b/packages/starlight/package.json
@@ -3,6 +3,7 @@
"version": "0.38.2",
"description": "Build beautiful, high-performance documentation websites with Astro",
"scripts": {
+ "build": "tsdown",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"test:e2e": "pnpm test:e2e:chrome",
@@ -20,33 +21,27 @@
"license": "MIT",
"repository": {
"type": "git",
- "url": "https://github.com/withastro/starlight",
+ "url": "git+https://github.com/withastro/starlight.git",
"directory": "packages/starlight"
},
"bugs": "https://github.com/withastro/starlight/issues",
"homepage": "https://starlight.astro.build",
"type": "module",
"exports": {
- ".": "./index.ts",
- "./locals": "./locals.ts",
- "./components": "./components.ts",
- "./components/*": "./components/*",
- "./internal": "./internal.ts",
- "./props": "./props.ts",
- "./schema": "./schema.ts",
- "./loaders": "./loaders.ts",
- "./route-data": "./route-data.ts",
- "./types": "./types.ts",
- "./expressive-code": {
- "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"
- },
- "./routes/*": "./routes/*",
- "./style/markdown.css": "./style/markdown.css"
+ ".": "./src/index.ts",
+ "./locals": "./src/locals.ts",
+ "./components": "./src/components.ts",
+ "./components/*": "./src/components/*",
+ "./internal": "./src/internal.ts",
+ "./props": "./src/props.ts",
+ "./schema": "./src/schema.ts",
+ "./loaders": "./src/loaders.ts",
+ "./route-data": "./src/route-data.ts",
+ "./types": "./src/types.ts",
+ "./expressive-code": "./src/expressive-code.ts",
+ "./expressive-code/hast": "./src/integrations/expressive-code/hast.ts",
+ "./routes/*": "./src/routes/*",
+ "./style/markdown.css": "./src/style/markdown.css"
},
"peerDependencies": {
"astro": "^6.0.0"
@@ -57,6 +52,8 @@
"@vitest/coverage-v8": "^4.1.0",
"astro": "^6.0.1",
"linkedom": "^0.18.4",
+ "publint": "^0.3.15",
+ "tinyglobby": "^0.2.15",
"vitest": "^4.1.0"
},
"dependencies": {
@@ -89,7 +86,55 @@
"unist-util-visit": "^5.0.0",
"vfile": "^6.0.2"
},
+ "files": [
+ "dist"
+ ],
"publishConfig": {
- "provenance": true
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.mts",
+ "import": "./dist/index.mjs"
+ },
+ "./locals": {
+ "types": "./dist/locals.d.mts",
+ "import": "./dist/locals.mjs"
+ },
+ "./components": "./dist/components.ts",
+ "./components/*": "./dist/components/*",
+ "./internal": {
+ "types": "./dist/internal.d.mts",
+ "import": "./dist/internal.mjs"
+ },
+ "./props": {
+ "types": "./dist/props.d.mts",
+ "import": "./dist/props.mjs"
+ },
+ "./schema": {
+ "types": "./dist/schema.d.mts",
+ "import": "./dist/schema.mjs"
+ },
+ "./loaders": {
+ "types": "./dist/loaders.d.mts",
+ "import": "./dist/loaders.mjs"
+ },
+ "./route-data": {
+ "types": "./dist/route-data.d.mts",
+ "import": "./dist/route-data.mjs"
+ },
+ "./types": {
+ "types": "./dist/types.d.mts",
+ "import": "./dist/types.mjs"
+ },
+ "./expressive-code": {
+ "types": "./dist/expressive-code.d.mts",
+ "import": "./dist/expressive-code.mjs"
+ },
+ "./expressive-code/hast": {
+ "types": "./dist/integrations/expressive-code/hast.d.mts",
+ "import": "./dist/integrations/expressive-code/hast.mjs"
+ },
+ "./routes/*": "./dist/routes/*",
+ "./style/markdown.css": "./dist/style/markdown.css"
+ }
}
}
diff --git a/packages/starlight/schemas/logo.ts b/packages/starlight/schemas/logo.ts
deleted file mode 100644
index 3ab99929688..00000000000
--- a/packages/starlight/schemas/logo.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { z } from 'astro/zod';
-
-export const LogoConfigSchema = () =>
- z
- .union([
- z.object({
- /** Source of the image file to use. */
- src: z.string(),
- /** Alternative text description of the logo. */
- alt: z.string().default(''),
- /** Set to `true` to hide the site title text and only show the logo. */
- replacesTitle: z.boolean().default(false),
- }),
- z.object({
- /** Source of the image file to use in dark mode. */
- dark: z.string(),
- /** Source of the image file to use in light mode. */
- light: z.string(),
- /** Alternative text description of the logo. */
- alt: z.string().default(''),
- /** Set to `true` to hide the site title text and only show the logo. */
- replacesTitle: z.boolean().default(false),
- }),
- ])
- .optional();
-
-export type LogoUserConfig = z.input>;
-export type LogoConfig = z.output>;
diff --git a/packages/starlight/components-internals/Icons.ts b/packages/starlight/src/components-internals/Icons.ts
similarity index 95%
rename from packages/starlight/components-internals/Icons.ts
rename to packages/starlight/src/components-internals/Icons.ts
index e0cde48b409..d72c6a62c29 100644
--- a/packages/starlight/components-internals/Icons.ts
+++ b/packages/starlight/src/components-internals/Icons.ts
@@ -1,4 +1,4 @@
-import { FileIcons } from '../user-components/file-tree-icons';
+import { FileIcons, type FileIcon } from '../user-components/file-tree-icons';
export const BuiltInIcons = {
'up-caret':
@@ -202,9 +202,134 @@ export const BuiltInIcons = {
'',
};
+// The icon names type is hand-written rather than using `keyof typeof Icons` as the latter is an
+// inferred type which would cause TypeScript to inline the resulting union type in many places
+// when emitting declaration files. Most of the time, this is not a big deal, but with such a large
+// union, which is also used in a Zod object schema (which with Zod v3 would duplicate the union
+// type 3 times), this causes a massive increase in emitted file size.
+//
+// @see https://github.com/microsoft/TypeScript/issues/37151#issuecomment-756232934
+// @see https://github.com/colinhacks/zod/issues/4227
+//
+// To avoid any possible divergence between the actual icon names and this type, we have type tests
+// in place that will fail if they ever get out of sync.
+//
+// @see {@link file://./../../__tests__/basics/icon.test-d.ts}
+export type BuiltInIcon =
+ | 'up-caret'
+ | 'down-caret'
+ | 'right-caret'
+ | 'left-caret'
+ | 'up-arrow'
+ | 'down-arrow'
+ | 'right-arrow'
+ | 'left-arrow'
+ | 'bars'
+ | 'translate'
+ | 'pencil'
+ | 'pen'
+ | 'document'
+ | 'add-document'
+ | 'setting'
+ | 'external'
+ | 'download'
+ | 'cloud-download'
+ | 'moon'
+ | 'sun'
+ | 'laptop'
+ | 'open-book'
+ | 'information'
+ | 'magnifier'
+ | 'forward-slash'
+ | 'close'
+ | 'error'
+ | 'warning'
+ | 'approve-check-circle'
+ | 'approve-check'
+ | 'rocket'
+ | 'star'
+ | 'puzzle'
+ | 'list-format'
+ | 'random'
+ | 'comment'
+ | 'comment-alt'
+ | 'heart'
+ | 'github'
+ | 'gitlab'
+ | 'bitbucket'
+ | 'codePen'
+ | 'farcaster'
+ | 'discord'
+ | 'gitter'
+ | 'twitter'
+ | 'x.com'
+ | 'mastodon'
+ | 'codeberg'
+ | 'youtube'
+ | 'threads'
+ | 'linkedin'
+ | 'twitch'
+ | 'azureDevOps'
+ | 'microsoftTeams'
+ | 'instagram'
+ | 'stackOverflow'
+ | 'telegram'
+ | 'rss'
+ | 'facebook'
+ | 'email'
+ | 'phone'
+ | 'reddit'
+ | 'patreon'
+ | 'signal'
+ | 'slack'
+ | 'matrix'
+ | 'hackerOne'
+ | 'openCollective'
+ | 'blueSky'
+ | 'discourse'
+ | 'zulip'
+ | 'pinterest'
+ | 'tiktok'
+ | 'astro'
+ | 'alpine'
+ | 'pnpm'
+ | 'biome'
+ | 'bun'
+ | 'mdx'
+ | 'apple'
+ | 'linux'
+ | 'homebrew'
+ | 'nix'
+ | 'starlight'
+ | 'pkl'
+ | 'node'
+ | 'cloudflare'
+ | 'vercel'
+ | 'netlify'
+ | 'deno'
+ | 'jsr'
+ | 'nostr'
+ | 'backstage'
+ | 'confluence'
+ | 'jira'
+ | 'storybook'
+ | 'vscode'
+ | 'jetbrains'
+ | 'zed'
+ | 'vim'
+ | 'figma'
+ | 'sketch'
+ | 'npm'
+ | 'sourcehut'
+ | 'substack'
+ | 'chrome'
+ | 'edge'
+ | 'firefox'
+ | 'safari';
+
export const Icons = {
...BuiltInIcons,
...FileIcons,
};
-export type StarlightIcon = keyof typeof Icons;
+export type StarlightIcon = BuiltInIcon | FileIcon;
diff --git a/packages/starlight/components-internals/SidebarPersistState.ts b/packages/starlight/src/components-internals/SidebarPersistState.ts
similarity index 100%
rename from packages/starlight/components-internals/SidebarPersistState.ts
rename to packages/starlight/src/components-internals/SidebarPersistState.ts
diff --git a/packages/starlight/components-internals/TableOfContents/TableOfContentsList.astro b/packages/starlight/src/components-internals/TableOfContents/TableOfContentsList.astro
similarity index 100%
rename from packages/starlight/components-internals/TableOfContents/TableOfContentsList.astro
rename to packages/starlight/src/components-internals/TableOfContents/TableOfContentsList.astro
diff --git a/packages/starlight/components-internals/TableOfContents/starlight-toc.ts b/packages/starlight/src/components-internals/TableOfContents/starlight-toc.ts
similarity index 100%
rename from packages/starlight/components-internals/TableOfContents/starlight-toc.ts
rename to packages/starlight/src/components-internals/TableOfContents/starlight-toc.ts
diff --git a/packages/starlight/components.ts b/packages/starlight/src/components.ts
similarity index 100%
rename from packages/starlight/components.ts
rename to packages/starlight/src/components.ts
diff --git a/packages/starlight/components/AnchorHeading.astro b/packages/starlight/src/components/AnchorHeading.astro
similarity index 100%
rename from packages/starlight/components/AnchorHeading.astro
rename to packages/starlight/src/components/AnchorHeading.astro
diff --git a/packages/starlight/components/Banner.astro b/packages/starlight/src/components/Banner.astro
similarity index 100%
rename from packages/starlight/components/Banner.astro
rename to packages/starlight/src/components/Banner.astro
diff --git a/packages/starlight/components/ContentNotice.astro b/packages/starlight/src/components/ContentNotice.astro
similarity index 100%
rename from packages/starlight/components/ContentNotice.astro
rename to packages/starlight/src/components/ContentNotice.astro
diff --git a/packages/starlight/components/ContentPanel.astro b/packages/starlight/src/components/ContentPanel.astro
similarity index 100%
rename from packages/starlight/components/ContentPanel.astro
rename to packages/starlight/src/components/ContentPanel.astro
diff --git a/packages/starlight/components/DraftContentNotice.astro b/packages/starlight/src/components/DraftContentNotice.astro
similarity index 100%
rename from packages/starlight/components/DraftContentNotice.astro
rename to packages/starlight/src/components/DraftContentNotice.astro
diff --git a/packages/starlight/components/EditLink.astro b/packages/starlight/src/components/EditLink.astro
similarity index 100%
rename from packages/starlight/components/EditLink.astro
rename to packages/starlight/src/components/EditLink.astro
diff --git a/packages/starlight/components/FallbackContentNotice.astro b/packages/starlight/src/components/FallbackContentNotice.astro
similarity index 100%
rename from packages/starlight/components/FallbackContentNotice.astro
rename to packages/starlight/src/components/FallbackContentNotice.astro
diff --git a/packages/starlight/components/Footer.astro b/packages/starlight/src/components/Footer.astro
similarity index 100%
rename from packages/starlight/components/Footer.astro
rename to packages/starlight/src/components/Footer.astro
diff --git a/packages/starlight/components/Head.astro b/packages/starlight/src/components/Head.astro
similarity index 100%
rename from packages/starlight/components/Head.astro
rename to packages/starlight/src/components/Head.astro
diff --git a/packages/starlight/components/Header.astro b/packages/starlight/src/components/Header.astro
similarity index 100%
rename from packages/starlight/components/Header.astro
rename to packages/starlight/src/components/Header.astro
diff --git a/packages/starlight/components/Hero.astro b/packages/starlight/src/components/Hero.astro
similarity index 100%
rename from packages/starlight/components/Hero.astro
rename to packages/starlight/src/components/Hero.astro
diff --git a/packages/starlight/components/LanguageSelect.astro b/packages/starlight/src/components/LanguageSelect.astro
similarity index 100%
rename from packages/starlight/components/LanguageSelect.astro
rename to packages/starlight/src/components/LanguageSelect.astro
diff --git a/packages/starlight/components/LastUpdated.astro b/packages/starlight/src/components/LastUpdated.astro
similarity index 100%
rename from packages/starlight/components/LastUpdated.astro
rename to packages/starlight/src/components/LastUpdated.astro
diff --git a/packages/starlight/components/MarkdownContent.astro b/packages/starlight/src/components/MarkdownContent.astro
similarity index 100%
rename from packages/starlight/components/MarkdownContent.astro
rename to packages/starlight/src/components/MarkdownContent.astro
diff --git a/packages/starlight/components/MobileMenuFooter.astro b/packages/starlight/src/components/MobileMenuFooter.astro
similarity index 100%
rename from packages/starlight/components/MobileMenuFooter.astro
rename to packages/starlight/src/components/MobileMenuFooter.astro
diff --git a/packages/starlight/components/MobileMenuToggle.astro b/packages/starlight/src/components/MobileMenuToggle.astro
similarity index 100%
rename from packages/starlight/components/MobileMenuToggle.astro
rename to packages/starlight/src/components/MobileMenuToggle.astro
diff --git a/packages/starlight/components/MobileTableOfContents.astro b/packages/starlight/src/components/MobileTableOfContents.astro
similarity index 100%
rename from packages/starlight/components/MobileTableOfContents.astro
rename to packages/starlight/src/components/MobileTableOfContents.astro
diff --git a/packages/starlight/components/Page.astro b/packages/starlight/src/components/Page.astro
similarity index 100%
rename from packages/starlight/components/Page.astro
rename to packages/starlight/src/components/Page.astro
diff --git a/packages/starlight/components/PageFrame.astro b/packages/starlight/src/components/PageFrame.astro
similarity index 100%
rename from packages/starlight/components/PageFrame.astro
rename to packages/starlight/src/components/PageFrame.astro
diff --git a/packages/starlight/components/PageSidebar.astro b/packages/starlight/src/components/PageSidebar.astro
similarity index 100%
rename from packages/starlight/components/PageSidebar.astro
rename to packages/starlight/src/components/PageSidebar.astro
diff --git a/packages/starlight/components/PageTitle.astro b/packages/starlight/src/components/PageTitle.astro
similarity index 100%
rename from packages/starlight/components/PageTitle.astro
rename to packages/starlight/src/components/PageTitle.astro
diff --git a/packages/starlight/components/Pagination.astro b/packages/starlight/src/components/Pagination.astro
similarity index 100%
rename from packages/starlight/components/Pagination.astro
rename to packages/starlight/src/components/Pagination.astro
diff --git a/packages/starlight/components/Search.astro b/packages/starlight/src/components/Search.astro
similarity index 100%
rename from packages/starlight/components/Search.astro
rename to packages/starlight/src/components/Search.astro
diff --git a/packages/starlight/components/Select.astro b/packages/starlight/src/components/Select.astro
similarity index 100%
rename from packages/starlight/components/Select.astro
rename to packages/starlight/src/components/Select.astro
diff --git a/packages/starlight/components/Sidebar.astro b/packages/starlight/src/components/Sidebar.astro
similarity index 100%
rename from packages/starlight/components/Sidebar.astro
rename to packages/starlight/src/components/Sidebar.astro
diff --git a/packages/starlight/components/SidebarPersister.astro b/packages/starlight/src/components/SidebarPersister.astro
similarity index 100%
rename from packages/starlight/components/SidebarPersister.astro
rename to packages/starlight/src/components/SidebarPersister.astro
diff --git a/packages/starlight/components/SidebarRestorePoint.astro b/packages/starlight/src/components/SidebarRestorePoint.astro
similarity index 100%
rename from packages/starlight/components/SidebarRestorePoint.astro
rename to packages/starlight/src/components/SidebarRestorePoint.astro
diff --git a/packages/starlight/components/SidebarSublist.astro b/packages/starlight/src/components/SidebarSublist.astro
similarity index 100%
rename from packages/starlight/components/SidebarSublist.astro
rename to packages/starlight/src/components/SidebarSublist.astro
diff --git a/packages/starlight/components/SiteTitle.astro b/packages/starlight/src/components/SiteTitle.astro
similarity index 100%
rename from packages/starlight/components/SiteTitle.astro
rename to packages/starlight/src/components/SiteTitle.astro
diff --git a/packages/starlight/components/SkipLink.astro b/packages/starlight/src/components/SkipLink.astro
similarity index 100%
rename from packages/starlight/components/SkipLink.astro
rename to packages/starlight/src/components/SkipLink.astro
diff --git a/packages/starlight/components/SocialIcons.astro b/packages/starlight/src/components/SocialIcons.astro
similarity index 100%
rename from packages/starlight/components/SocialIcons.astro
rename to packages/starlight/src/components/SocialIcons.astro
diff --git a/packages/starlight/components/StarlightPage.astro b/packages/starlight/src/components/StarlightPage.astro
similarity index 100%
rename from packages/starlight/components/StarlightPage.astro
rename to packages/starlight/src/components/StarlightPage.astro
diff --git a/packages/starlight/components/TableOfContents.astro b/packages/starlight/src/components/TableOfContents.astro
similarity index 100%
rename from packages/starlight/components/TableOfContents.astro
rename to packages/starlight/src/components/TableOfContents.astro
diff --git a/packages/starlight/components/ThemeProvider.astro b/packages/starlight/src/components/ThemeProvider.astro
similarity index 100%
rename from packages/starlight/components/ThemeProvider.astro
rename to packages/starlight/src/components/ThemeProvider.astro
diff --git a/packages/starlight/components/ThemeSelect.astro b/packages/starlight/src/components/ThemeSelect.astro
similarity index 100%
rename from packages/starlight/components/ThemeSelect.astro
rename to packages/starlight/src/components/ThemeSelect.astro
diff --git a/packages/starlight/components/TwoColumnContent.astro b/packages/starlight/src/components/TwoColumnContent.astro
similarity index 100%
rename from packages/starlight/components/TwoColumnContent.astro
rename to packages/starlight/src/components/TwoColumnContent.astro
diff --git a/packages/starlight/constants.ts b/packages/starlight/src/constants.ts
similarity index 100%
rename from packages/starlight/constants.ts
rename to packages/starlight/src/constants.ts
diff --git a/packages/starlight/expressive-code.d.ts b/packages/starlight/src/expressive-code.ts
similarity index 69%
rename from packages/starlight/expressive-code.d.ts
rename to packages/starlight/src/expressive-code.ts
index d03f5cc66a7..ebaf5d29334 100644
--- a/packages/starlight/expressive-code.d.ts
+++ b/packages/starlight/src/expressive-code.ts
@@ -1,11 +1,18 @@
/**
- * @file This file provides the types for Starlight's `@astrojs/starlight/expressive-code` export.
+ * @file This file is exported by Starlight as `@astrojs/starlight/expressive-code`.
+ *
+ * It is required by the `` component to access the same configuration preprocessor
+ * function as the one used by the integration.
+ *
+ * It also provides access to all of the Expressive Code classes and functions without having
+ * to install `astro-expressive-code` as an additional dependency into a user's project
+ * (and thereby risiking version conflicts).
*/
-export * from 'astro-expressive-code';
-
import type { StarlightExpressiveCodeOptions } from './integrations/expressive-code';
+export * from 'astro-expressive-code';
+
export type { StarlightExpressiveCodeOptions };
/**
@@ -34,4 +41,6 @@ export type { StarlightExpressiveCodeOptions };
*/
export function defineEcConfig(
config: StarlightExpressiveCodeOptions
-): StarlightExpressiveCodeOptions;
+): StarlightExpressiveCodeOptions {
+ return config;
+}
diff --git a/packages/starlight/src/global.ts b/packages/starlight/src/global.ts
new file mode 100644
index 00000000000..8f87ae76ba3
--- /dev/null
+++ b/packages/starlight/src/global.ts
@@ -0,0 +1,65 @@
+import 'i18next';
+import type { StarlightRouteData } from './route-data';
+import type { I18nextNamespace, I18nKeys, I18nT } from './utils/createTranslationSystem';
+
+declare global {
+ /**
+ * This namespace is reserved for Starlight (only used for i18n at the moment).
+ * It can be extended by plugins using module augmentation and interface merging.
+ * For an example, see: https://starlight.astro.build/reference/plugins/#injecttranslations
+ */
+ namespace StarlightApp {
+ interface I18n {}
+ }
+
+ /**
+ * Extending Astro’s `App.Locals` interface registers types for the middleware added by Starlight.
+ */
+ namespace App {
+ interface Locals {
+ /**
+ * Starlight’s localization API, powered by i18next.
+ *
+ * @see https://starlight.astro.build/guides/i18n/#using-ui-translations
+ *
+ * @example
+ * // Render a UI string for the current locale.
+ * {Astro.locals.t('404.text')}
+ */
+ t: I18nT;
+
+ /**
+ * Starlight’s data for the current route.
+ *
+ * @see https://starlight.astro.build/guides/route-data/
+ *
+ * @throws Will throw an error if accessed on non-Starlight routes.
+ *
+ * @example
+ * // Render the title for the current page
+ * {Astro.locals.starlightRoute.entry.data.title}
+ *
+ * @example
+ * // Check if the current page should render the sidebar
+ * const { hasSidebar } = Astro.locals.starlightRoute;
+ */
+ starlightRoute: StarlightRouteData;
+ }
+ }
+
+ var StarlightThemeProvider: {
+ updatePickers(theme?: string): void;
+ };
+}
+
+/**
+ * Extend the imported `i18next` types to configure Starlight’s namespace.
+ */
+declare module 'i18next' {
+ interface CustomTypeOptions {
+ defaultNS: I18nextNamespace;
+ resources: {
+ starlight: Record;
+ };
+ }
+}
diff --git a/packages/starlight/index.ts b/packages/starlight/src/index.ts
similarity index 94%
rename from packages/starlight/index.ts
rename to packages/starlight/src/index.ts
index 9f86bd7e0cc..2cfb96a0882 100644
--- a/packages/starlight/index.ts
+++ b/packages/starlight/src/index.ts
@@ -1,11 +1,8 @@
/**
- * These triple-slash directives defines dependencies to various declaration files that will be
- * loaded when a user imports the Starlight integration in their Astro configuration file. These
- * directives must be first at the top of the file and can only be preceded by this comment.
+ * This import emits declaration that will be loaded when a user imports the Starlight integration
+ * in their Astro configuration file.
*/
-///
-///
-///
+import './global';
import mdx from '@astrojs/mdx';
import type { AstroIntegration } from 'astro';
diff --git a/packages/starlight/integrations/asides-error.ts b/packages/starlight/src/integrations/asides-error.ts
similarity index 100%
rename from packages/starlight/integrations/asides-error.ts
rename to packages/starlight/src/integrations/asides-error.ts
diff --git a/packages/starlight/integrations/asides.ts b/packages/starlight/src/integrations/asides.ts
similarity index 100%
rename from packages/starlight/integrations/asides.ts
rename to packages/starlight/src/integrations/asides.ts
diff --git a/packages/starlight/integrations/code-rtl-support.ts b/packages/starlight/src/integrations/code-rtl-support.ts
similarity index 100%
rename from packages/starlight/integrations/code-rtl-support.ts
rename to packages/starlight/src/integrations/code-rtl-support.ts
diff --git a/packages/starlight/src/integrations/expressive-code/hast.ts b/packages/starlight/src/integrations/expressive-code/hast.ts
new file mode 100644
index 00000000000..904c24c7523
--- /dev/null
+++ b/packages/starlight/src/integrations/expressive-code/hast.ts
@@ -0,0 +1,5 @@
+/**
+ * @file This file is exported by Starlight as `@astrojs/starlight/expressive-code/hast`.
+ */
+
+export * from 'astro-expressive-code/hast';
diff --git a/packages/starlight/integrations/expressive-code/index.ts b/packages/starlight/src/integrations/expressive-code/index.ts
similarity index 100%
rename from packages/starlight/integrations/expressive-code/index.ts
rename to packages/starlight/src/integrations/expressive-code/index.ts
diff --git a/packages/starlight/integrations/expressive-code/preprocessor.ts b/packages/starlight/src/integrations/expressive-code/preprocessor.ts
similarity index 100%
rename from packages/starlight/integrations/expressive-code/preprocessor.ts
rename to packages/starlight/src/integrations/expressive-code/preprocessor.ts
diff --git a/packages/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc b/packages/starlight/src/integrations/expressive-code/themes/night-owl-dark.jsonc
similarity index 100%
rename from packages/starlight/integrations/expressive-code/themes/night-owl-dark.jsonc
rename to packages/starlight/src/integrations/expressive-code/themes/night-owl-dark.jsonc
diff --git a/packages/starlight/integrations/expressive-code/themes/night-owl-light.jsonc b/packages/starlight/src/integrations/expressive-code/themes/night-owl-light.jsonc
similarity index 100%
rename from packages/starlight/integrations/expressive-code/themes/night-owl-light.jsonc
rename to packages/starlight/src/integrations/expressive-code/themes/night-owl-light.jsonc
diff --git a/packages/starlight/integrations/expressive-code/theming.ts b/packages/starlight/src/integrations/expressive-code/theming.ts
similarity index 100%
rename from packages/starlight/integrations/expressive-code/theming.ts
rename to packages/starlight/src/integrations/expressive-code/theming.ts
diff --git a/packages/starlight/integrations/expressive-code/translations.ts b/packages/starlight/src/integrations/expressive-code/translations.ts
similarity index 100%
rename from packages/starlight/integrations/expressive-code/translations.ts
rename to packages/starlight/src/integrations/expressive-code/translations.ts
diff --git a/packages/starlight/integrations/heading-links.ts b/packages/starlight/src/integrations/heading-links.ts
similarity index 100%
rename from packages/starlight/integrations/heading-links.ts
rename to packages/starlight/src/integrations/heading-links.ts
diff --git a/packages/starlight/integrations/pagefind.ts b/packages/starlight/src/integrations/pagefind.ts
similarity index 100%
rename from packages/starlight/integrations/pagefind.ts
rename to packages/starlight/src/integrations/pagefind.ts
diff --git a/packages/starlight/integrations/remark-rehype.ts b/packages/starlight/src/integrations/remark-rehype.ts
similarity index 100%
rename from packages/starlight/integrations/remark-rehype.ts
rename to packages/starlight/src/integrations/remark-rehype.ts
diff --git a/packages/starlight/integrations/shared/absolutePathToLang.ts b/packages/starlight/src/integrations/shared/absolutePathToLang.ts
similarity index 100%
rename from packages/starlight/integrations/shared/absolutePathToLang.ts
rename to packages/starlight/src/integrations/shared/absolutePathToLang.ts
diff --git a/packages/starlight/integrations/shared/localeToLang.ts b/packages/starlight/src/integrations/shared/localeToLang.ts
similarity index 100%
rename from packages/starlight/integrations/shared/localeToLang.ts
rename to packages/starlight/src/integrations/shared/localeToLang.ts
diff --git a/packages/starlight/integrations/shared/slugToLocale.ts b/packages/starlight/src/integrations/shared/slugToLocale.ts
similarity index 100%
rename from packages/starlight/integrations/shared/slugToLocale.ts
rename to packages/starlight/src/integrations/shared/slugToLocale.ts
diff --git a/packages/starlight/integrations/sitemap.ts b/packages/starlight/src/integrations/sitemap.ts
similarity index 100%
rename from packages/starlight/integrations/sitemap.ts
rename to packages/starlight/src/integrations/sitemap.ts
diff --git a/packages/starlight/integrations/virtual-user-config.ts b/packages/starlight/src/integrations/virtual-user-config.ts
similarity index 93%
rename from packages/starlight/integrations/virtual-user-config.ts
rename to packages/starlight/src/integrations/virtual-user-config.ts
index 35be3200ea4..9363ce4f3b3 100644
--- a/packages/starlight/integrations/virtual-user-config.ts
+++ b/packages/starlight/src/integrations/virtual-user-config.ts
@@ -50,9 +50,14 @@ export function vitePluginStarlightUserConfig(
/**
* Resolves a path to a Starlight file relative to this file.
+ * When used with TypeScript files, makes sure to not include the `.ts` extension to ensure
+ * proper resolution when transpiled to JavaScript.
* @example
- * resolveLocalPath('../utils/git.ts');
- * // => '"/users/houston/docs/node_modules/@astrojs/starlight/utils/git.ts"'
+ * resolveLocalPath('../utils/git');
+ * // => '"/users/houston/docs/node_modules/@astrojs/starlight/utils/git"'
+ * @example
+ * resolveLocalPath('../style/global.css');
+ * // => '"/users/houston/docs/node_modules/@astrojs/starlight/style/global.css"'
*/
const resolveLocalPath = (path: string) =>
JSON.stringify(fileURLToPath(new URL(path, import.meta.url)));
@@ -87,9 +92,9 @@ export function vitePluginStarlightUserConfig(
})}`,
'virtual:starlight/git-info':
(command !== 'build' && isNodeCompatibleEnv
- ? `import { makeAPI } from ${resolveLocalPath('../utils/git.ts')};` +
+ ? `import { makeAPI } from ${resolveLocalPath('../utils/git')};` +
`const api = makeAPI(${JSON.stringify(rootPath)});`
- : `import { makeAPI } from ${resolveLocalPath('../utils/gitInlined.ts')};` +
+ : `import { makeAPI } from ${resolveLocalPath('../utils/gitInlined')};` +
`const api = makeAPI(${JSON.stringify(getAllNewestCommitDate(rootPath, docsPath))});`) +
'export const getNewestCommitDate = api.getNewestCommitDate;',
/**
diff --git a/packages/starlight/integrations/vite-layer-order.ts b/packages/starlight/src/integrations/vite-layer-order.ts
similarity index 100%
rename from packages/starlight/integrations/vite-layer-order.ts
rename to packages/starlight/src/integrations/vite-layer-order.ts
diff --git a/packages/starlight/internal.ts b/packages/starlight/src/internal.ts
similarity index 100%
rename from packages/starlight/internal.ts
rename to packages/starlight/src/internal.ts
diff --git a/packages/starlight/loaders.ts b/packages/starlight/src/loaders.ts
similarity index 100%
rename from packages/starlight/loaders.ts
rename to packages/starlight/src/loaders.ts
diff --git a/packages/starlight/locals.ts b/packages/starlight/src/locals.ts
similarity index 100%
rename from packages/starlight/locals.ts
rename to packages/starlight/src/locals.ts
diff --git a/packages/starlight/props.ts b/packages/starlight/src/props.ts
similarity index 100%
rename from packages/starlight/props.ts
rename to packages/starlight/src/props.ts
diff --git a/packages/starlight/route-data.ts b/packages/starlight/src/route-data.ts
similarity index 100%
rename from packages/starlight/route-data.ts
rename to packages/starlight/src/route-data.ts
diff --git a/packages/starlight/routes/common.astro b/packages/starlight/src/routes/common.astro
similarity index 100%
rename from packages/starlight/routes/common.astro
rename to packages/starlight/src/routes/common.astro
diff --git a/packages/starlight/routes/ssr/404.astro b/packages/starlight/src/routes/ssr/404.astro
similarity index 100%
rename from packages/starlight/routes/ssr/404.astro
rename to packages/starlight/src/routes/ssr/404.astro
diff --git a/packages/starlight/routes/ssr/index.astro b/packages/starlight/src/routes/ssr/index.astro
similarity index 100%
rename from packages/starlight/routes/ssr/index.astro
rename to packages/starlight/src/routes/ssr/index.astro
diff --git a/packages/starlight/routes/static/404.astro b/packages/starlight/src/routes/static/404.astro
similarity index 100%
rename from packages/starlight/routes/static/404.astro
rename to packages/starlight/src/routes/static/404.astro
diff --git a/packages/starlight/routes/static/index.astro b/packages/starlight/src/routes/static/index.astro
similarity index 100%
rename from packages/starlight/routes/static/index.astro
rename to packages/starlight/src/routes/static/index.astro
diff --git a/packages/starlight/schema.ts b/packages/starlight/src/schema.ts
similarity index 100%
rename from packages/starlight/schema.ts
rename to packages/starlight/src/schema.ts
diff --git a/packages/starlight/schemas/badge.ts b/packages/starlight/src/schemas/badge.ts
similarity index 83%
rename from packages/starlight/schemas/badge.ts
rename to packages/starlight/src/schemas/badge.ts
index d8567e59d90..24db37aacdd 100644
--- a/packages/starlight/schemas/badge.ts
+++ b/packages/starlight/src/schemas/badge.ts
@@ -33,6 +33,15 @@ export const BadgeConfigSchema = () =>
})
.optional();
+export type I18nBadgeUserConfig =
+ | string
+ | {
+ variant?: 'note' | 'danger' | 'success' | 'caution' | 'tip' | 'default' | undefined;
+ class?: string | undefined;
+ text: string | Record;
+ }
+ | undefined;
+
export const I18nBadgeConfigSchema = () => z.union([z.string(), i18nBadgeSchema]).optional();
export type Badge = z.output;
diff --git a/packages/starlight/schemas/components.ts b/packages/starlight/src/schemas/components.ts
similarity index 70%
rename from packages/starlight/schemas/components.ts
rename to packages/starlight/src/schemas/components.ts
index b9864915d39..baccdde4c74 100644
--- a/packages/starlight/schemas/components.ts
+++ b/packages/starlight/src/schemas/components.ts
@@ -1,8 +1,7 @@
import { z } from 'astro/zod';
-export function ComponentConfigSchema() {
- return z
- .object({
+export type ComponentUserConfig =
+ | {
/*
HEAD ----------------------------------------------------------------------------------------
*/
@@ -13,18 +12,17 @@ export function ComponentConfigSchema() {
*
* Override this component as a last resort. Prefer the `head` option Starlight config if possible.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/Head.astro `Head` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/Head.astro `Head` default implementation}
*/
- Head: z.string().default('@astrojs/starlight/components/Head.astro'),
-
+ Head?: string | undefined;
/**
* Component rendered inside `` that sets up dark/light theme support.
* The default implementation includes an inline script and a `` used by the
* script in `ThemeSelect.astro`.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/ThemeProvider.astro `ThemeProvider` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/ThemeProvider.astro `ThemeProvider` default implementation}
*/
- ThemeProvider: z.string().default('@astrojs/starlight/components/ThemeProvider.astro'),
+ ThemeProvider?: string | undefined;
/*
BODY ----------------------------------------------------------------------------------------
@@ -35,9 +33,9 @@ export function ComponentConfigSchema() {
* content for accessibility. The default implementation is hidden until a user focuses it
* by tabbing with their keyboard.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/SkipLink.astro `SkipLink` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/SkipLink.astro `SkipLink` default implementation}
*/
- SkipLink: z.string().default('@astrojs/starlight/components/SkipLink.astro'),
+ SkipLink?: string | undefined;
/*
LAYOUT --------------------------------------------------------------------------------------
@@ -50,25 +48,24 @@ export function ComponentConfigSchema() {
* It also renders `` to support toggling the sidebar navigation
* on small (mobile) viewports.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/PageFrame.astro `PageFrame` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/PageFrame.astro `PageFrame` default implementation}
*/
- PageFrame: z.string().default('@astrojs/starlight/components/PageFrame.astro'),
+ PageFrame?: string | undefined;
/**
* Component rendered inside `` that is responsible for toggling the
* sidebar navigation on small (mobile) viewports.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/MobileMenuToggle.astro `MobileMenuToggle` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/MobileMenuToggle.astro `MobileMenuToggle` default implementation}
*/
- MobileMenuToggle: z.string().default('@astrojs/starlight/components/MobileMenuToggle.astro'),
-
+ MobileMenuToggle?: string | undefined;
/**
* Layout component wrapped around the main content column and right sidebar (table of contents).
* The default implementation handles the switch between a single-column, small-viewport layout
* and a two-column, larger-viewport layout.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/TwoColumnContent.astro `TwoColumnContent` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/TwoColumnContent.astro `TwoColumnContent` default implementation}
*/
- TwoColumnContent: z.string().default('@astrojs/starlight/components/TwoColumnContent.astro'),
+ TwoColumnContent?: string | undefined;
/*
HEADER --------------------------------------------------------------------------------------
@@ -79,42 +76,42 @@ export function ComponentConfigSchema() {
* The default implementation displays ``, ``, ``,
* ``, and ``.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/Header.astro `Header` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/Header.astro `Header` default implementation}
*/
- Header: z.string().default('@astrojs/starlight/components/Header.astro'),
+ Header?: string | undefined;
/**
* Component rendered at the start of the site header to render the site title.
* The default implementation includes logic for rendering logos defined in Starlight config.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/SiteTitle.astro `SiteTitle` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/SiteTitle.astro `SiteTitle` default implementation}
*/
- SiteTitle: z.string().default('@astrojs/starlight/components/SiteTitle.astro'),
+ SiteTitle?: string | undefined;
/**
* Component used to render Starlight’s search UI. The default implementation includes the
* button in the header and the code for displaying a search modal when it is clicked.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/Search.astro `Search` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/Search.astro `Search` default implementation}
*/
- Search: z.string().default('@astrojs/starlight/components/Search.astro'),
+ Search?: string | undefined;
/**
* Component rendered in the site header including social icon links. The default
* implementation uses the `social` option in Starlight config to render icons and links.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/SocialIcons.astro `SocialIcons` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/SocialIcons.astro `SocialIcons` default implementation}
*/
- SocialIcons: z.string().default('@astrojs/starlight/components/SocialIcons.astro'),
+ SocialIcons?: string | undefined;
/**
* Component rendered in the site header that allows users to select their preferred color scheme.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/ThemeSelect.astro `ThemeSelect` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/ThemeSelect.astro `ThemeSelect` default implementation}
*/
- ThemeSelect: z.string().default('@astrojs/starlight/components/ThemeSelect.astro'),
+ ThemeSelect?: string | undefined;
/**
* Component rendered in the site header that allows users to switch to a different language.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/LanguageSelect.astro `LanguageSelect` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/LanguageSelect.astro `LanguageSelect` default implementation}
*/
- LanguageSelect: z.string().default('@astrojs/starlight/components/LanguageSelect.astro'),
+ LanguageSelect?: string | undefined;
/*
SIDEBAR -------------------------------------------------------------------------------------
@@ -126,16 +123,16 @@ export function ComponentConfigSchema() {
* drop-down menu on small (mobile) viewports. It also renders `` to
* show additional items inside the mobile menu.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/Sidebar.astro `Sidebar` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/Sidebar.astro `Sidebar` default implementation}
*/
- Sidebar: z.string().default('@astrojs/starlight/components/Sidebar.astro'),
+ Sidebar?: string | undefined;
/**
* Component rendered at the bottom of the mobile drop-down menu.
* The default implementation renders `` and ``.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/MobileMenuFooter.astro `MobileMenuFooter` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/MobileMenuFooter.astro `MobileMenuFooter` default implementation}
*/
- MobileMenuFooter: z.string().default('@astrojs/starlight/components/MobileMenuFooter.astro'),
+ MobileMenuFooter?: string | undefined;
/*
TOC -----------------------------------------------------------------------------------------
@@ -145,23 +142,21 @@ export function ComponentConfigSchema() {
* Component rendered before the main page’s content to display a table of contents.
* The default implementation renders `` and ``.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/PageSidebar.astro `PageSidebar` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/PageSidebar.astro `PageSidebar` default implementation}
*/
- PageSidebar: z.string().default('@astrojs/starlight/components/PageSidebar.astro'),
+ PageSidebar?: string | undefined;
/**
* Component that renders the current page’s table of contents on wider viewports.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/TableOfContents.astro `TableOfContents` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/TableOfContents.astro `TableOfContents` default implementation}
*/
- TableOfContents: z.string().default('@astrojs/starlight/components/TableOfContents.astro'),
+ TableOfContents?: string | undefined;
/**
* Component that renders the current page’s table of contents on small (mobile) viewports.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/MobileTableOfContents.astro `MobileTableOfContents` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/MobileTableOfContents.astro `MobileTableOfContents` default implementation}
*/
- MobileTableOfContents: z
- .string()
- .default('@astrojs/starlight/components/MobileTableOfContents.astro'),
+ MobileTableOfContents?: string | undefined;
/*
CONTENT HEADER ------------------------------------------------------------------------------
@@ -171,53 +166,44 @@ export function ComponentConfigSchema() {
* Banner component rendered at the top of each page. The default implementation uses the
* page’s `banner` frontmatter value to decide whether or not to render.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/Banner.astro `Banner` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/Banner.astro `Banner` default implementation}
*/
- Banner: z.string().default('@astrojs/starlight/components/Banner.astro'),
-
+ Banner?: string | undefined;
/**
* Layout component used to wrap sections of the main content column.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/ContentPanel.astro `ContentPanel` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/ContentPanel.astro `ContentPanel` default implementation}
*/
- ContentPanel: z.string().default('@astrojs/starlight/components/ContentPanel.astro'),
-
+ ContentPanel?: string | undefined;
/**
* Component containing the `` element for the current page.
*
* Implementations should ensure they set `id="_top"` on the `` element as in the default
* implementation.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/PageTitle.astro `PageTitle` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/PageTitle.astro `PageTitle` default implementation}
*/
- PageTitle: z.string().default('@astrojs/starlight/components/PageTitle.astro'),
-
+ PageTitle?: string | undefined;
/**
* Notice displayed to users on pages where a translation for the current language is not
* available. Only used on multilingual sites.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/FallbackContentNotice.astro `FallbackContentNotice` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/FallbackContentNotice.astro `FallbackContentNotice` default implementation}
*/
- FallbackContentNotice: z
- .string()
- .default('@astrojs/starlight/components/FallbackContentNotice.astro'),
-
+ FallbackContentNotice?: string | undefined;
/**
* Notice displayed to users on draft pages. Only used in development mode.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/DraftContentNotice.astro `DraftContentNotice` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/DraftContentNotice.astro `DraftContentNotice` default implementation}
*/
- DraftContentNotice: z
- .string()
- .default('@astrojs/starlight/components/DraftContentNotice.astro'),
-
+ DraftContentNotice?: string | undefined;
/**
* Component rendered at the top of the page when `hero` is set in frontmatter. The default
* implementation shows a large title, tagline, and call-to-action links alongside an optional image.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/Hero.astro `Hero` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/Hero.astro `Hero` default implementation}
*/
- Hero: z.string().default('@astrojs/starlight/components/Hero.astro'),
+ Hero?: string | undefined;
/*
CONTENT -------------------------------------------------------------------------------------
@@ -227,9 +213,9 @@ export function ComponentConfigSchema() {
* Component rendered around each page’s main content.
* The default implementation sets up basic styles to apply to Markdown content.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/MarkdownContent.astro `MarkdownContent` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/MarkdownContent.astro `MarkdownContent` default implementation}
*/
- MarkdownContent: z.string().default('@astrojs/starlight/components/MarkdownContent.astro'),
+ MarkdownContent?: string | undefined;
/*
CONTENT FOOTER ------------------------------------------------------------------------------
@@ -239,26 +225,110 @@ export function ComponentConfigSchema() {
* Footer component displayed at the bottom of each documentation page.
* The default implementation displays ``, ``, and ``.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/Footer.astro `Footer` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/Footer.astro `Footer` default implementation}
*/
- Footer: z.string().default('@astrojs/starlight/components/Footer.astro'),
+ Footer?: string | undefined;
/**
* Component rendered in the page footer to display the last-updated date.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/LastUpdated.astro `LastUpdated` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/LastUpdated.astro `LastUpdated` default implementation}
*/
- LastUpdated: z.string().default('@astrojs/starlight/components/LastUpdated.astro'),
+ LastUpdated?: string | undefined;
/**
* Component rendered in the page footer to display navigation arrows between previous/next pages.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/Pagination.astro `Pagination` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/Pagination.astro `Pagination` default implementation}
*/
- Pagination: z.string().default('@astrojs/starlight/components/Pagination.astro'),
+ Pagination?: string | undefined;
/**
* Component rendered in the page footer to display a link to where the page can be edited.
*
- * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/components/EditLink.astro `EditLink` default implementation}
+ * @see {@link https://github.com/withastro/starlight/blob/main/packages/starlight/src/components/EditLink.astro `EditLink` default implementation}
*/
+ EditLink?: string | undefined;
+ }
+ | undefined;
+
+export function ComponentConfigSchema() {
+ return z
+ .object({
+ /*
+ HEAD ----------------------------------------------------------------------------------------
+ */
+
+ Head: z.string().default('@astrojs/starlight/components/Head.astro'),
+ ThemeProvider: z.string().default('@astrojs/starlight/components/ThemeProvider.astro'),
+
+ /*
+ BODY ----------------------------------------------------------------------------------------
+ */
+
+ SkipLink: z.string().default('@astrojs/starlight/components/SkipLink.astro'),
+
+ /*
+ LAYOUT --------------------------------------------------------------------------------------
+ */
+
+ PageFrame: z.string().default('@astrojs/starlight/components/PageFrame.astro'),
+ MobileMenuToggle: z.string().default('@astrojs/starlight/components/MobileMenuToggle.astro'),
+ TwoColumnContent: z.string().default('@astrojs/starlight/components/TwoColumnContent.astro'),
+
+ /*
+ HEADER --------------------------------------------------------------------------------------
+ */
+
+ Header: z.string().default('@astrojs/starlight/components/Header.astro'),
+ SiteTitle: z.string().default('@astrojs/starlight/components/SiteTitle.astro'),
+ Search: z.string().default('@astrojs/starlight/components/Search.astro'),
+ SocialIcons: z.string().default('@astrojs/starlight/components/SocialIcons.astro'),
+ ThemeSelect: z.string().default('@astrojs/starlight/components/ThemeSelect.astro'),
+ LanguageSelect: z.string().default('@astrojs/starlight/components/LanguageSelect.astro'),
+
+ /*
+ SIDEBAR -------------------------------------------------------------------------------------
+ */
+
+ Sidebar: z.string().default('@astrojs/starlight/components/Sidebar.astro'),
+ MobileMenuFooter: z.string().default('@astrojs/starlight/components/MobileMenuFooter.astro'),
+
+ /*
+ TOC -----------------------------------------------------------------------------------------
+ */
+
+ PageSidebar: z.string().default('@astrojs/starlight/components/PageSidebar.astro'),
+ TableOfContents: z.string().default('@astrojs/starlight/components/TableOfContents.astro'),
+ MobileTableOfContents: z
+ .string()
+ .default('@astrojs/starlight/components/MobileTableOfContents.astro'),
+
+ /*
+ CONTENT HEADER ------------------------------------------------------------------------------
+ */
+
+ Banner: z.string().default('@astrojs/starlight/components/Banner.astro'),
+ ContentPanel: z.string().default('@astrojs/starlight/components/ContentPanel.astro'),
+ PageTitle: z.string().default('@astrojs/starlight/components/PageTitle.astro'),
+ FallbackContentNotice: z
+ .string()
+ .default('@astrojs/starlight/components/FallbackContentNotice.astro'),
+ DraftContentNotice: z
+ .string()
+ .default('@astrojs/starlight/components/DraftContentNotice.astro'),
+ Hero: z.string().default('@astrojs/starlight/components/Hero.astro'),
+
+ /*
+ CONTENT -------------------------------------------------------------------------------------
+ */
+
+ MarkdownContent: z.string().default('@astrojs/starlight/components/MarkdownContent.astro'),
+
+ /*
+ CONTENT FOOTER ------------------------------------------------------------------------------
+ */
+
+ Footer: z.string().default('@astrojs/starlight/components/Footer.astro'),
+ LastUpdated: z.string().default('@astrojs/starlight/components/LastUpdated.astro'),
+ Pagination: z.string().default('@astrojs/starlight/components/Pagination.astro'),
EditLink: z.string().default('@astrojs/starlight/components/EditLink.astro'),
})
.prefault({});
diff --git a/packages/starlight/schemas/expressiveCode.ts b/packages/starlight/src/schemas/expressiveCode.ts
similarity index 78%
rename from packages/starlight/schemas/expressiveCode.ts
rename to packages/starlight/src/schemas/expressiveCode.ts
index 5bedbf1f9ce..ee7fb13ac3d 100644
--- a/packages/starlight/schemas/expressiveCode.ts
+++ b/packages/starlight/src/schemas/expressiveCode.ts
@@ -1,6 +1,8 @@
import { z } from 'astro/zod';
import type { StarlightExpressiveCodeOptions } from '../integrations/expressive-code';
+export type ExpressiveCodeUserConfig = boolean | StarlightExpressiveCodeOptions | undefined;
+
export const ExpressiveCodeSchema = () =>
z
.union([
diff --git a/packages/starlight/schemas/favicon.ts b/packages/starlight/src/schemas/favicon.ts
similarity index 94%
rename from packages/starlight/schemas/favicon.ts
rename to packages/starlight/src/schemas/favicon.ts
index a014c190efb..c4db3813fd5 100644
--- a/packages/starlight/schemas/favicon.ts
+++ b/packages/starlight/src/schemas/favicon.ts
@@ -10,6 +10,8 @@ const faviconTypeMap = {
'.svg': 'image/svg+xml',
};
+export type FaviconUserConfig = string | undefined;
+
export const FaviconSchema = () =>
z
.string()
diff --git a/packages/starlight/schemas/head.ts b/packages/starlight/src/schemas/head.ts
similarity index 77%
rename from packages/starlight/schemas/head.ts
rename to packages/starlight/src/schemas/head.ts
index 0ecb634f932..bb53a1b77b3 100644
--- a/packages/starlight/schemas/head.ts
+++ b/packages/starlight/src/schemas/head.ts
@@ -1,6 +1,17 @@
import { z } from 'astro/zod';
import yaml from 'js-yaml';
+export type HeadUserConfig =
+ | {
+ /** Name of the HTML tag to add to ``, e.g. `'meta'`, `'link'`, or `'script'`. */
+ tag: 'title' | 'base' | 'link' | 'style' | 'meta' | 'script' | 'noscript' | 'template';
+ /** Attributes to set on the tag, e.g. `{ rel: 'stylesheet', href: '/custom.css' }`. */
+ attrs?: Record | undefined;
+ /** Content to place inside the tag (optional). */
+ content?: string | undefined;
+ }[]
+ | undefined;
+
export const HeadConfigSchema = ({
source,
}: {
@@ -14,7 +25,6 @@ export const HeadConfigSchema = ({
.array(
z
.object({
- /** Name of the HTML tag to add to ``, e.g. `'meta'`, `'link'`, or `'script'`. */
tag: z.enum(['title', 'base', 'link', 'style', 'meta', 'script', 'noscript', 'template']),
/** Attributes to set on the tag, e.g. `{ rel: 'stylesheet', href: '/custom.css' }`. */
attrs: z.record(z.string(), z.union([z.string(), z.boolean(), z.undefined()])).optional(),
@@ -46,5 +56,4 @@ export const HeadConfigSchema = ({
)
.default([]);
-export type HeadUserConfig = z.input>;
export type HeadConfig = z.output>;
diff --git a/packages/starlight/schemas/hero.ts b/packages/starlight/src/schemas/hero.ts
similarity index 100%
rename from packages/starlight/schemas/hero.ts
rename to packages/starlight/src/schemas/hero.ts
diff --git a/packages/starlight/schemas/i18n.ts b/packages/starlight/src/schemas/i18n.ts
similarity index 100%
rename from packages/starlight/schemas/i18n.ts
rename to packages/starlight/src/schemas/i18n.ts
diff --git a/packages/starlight/schemas/icon.ts b/packages/starlight/src/schemas/icon.ts
similarity index 87%
rename from packages/starlight/schemas/icon.ts
rename to packages/starlight/src/schemas/icon.ts
index 90de556ce39..bb3f725b249 100644
--- a/packages/starlight/schemas/icon.ts
+++ b/packages/starlight/src/schemas/icon.ts
@@ -1,7 +1,9 @@
import { z } from 'astro/zod';
import { Icons, type StarlightIcon } from '../components-internals/Icons';
+/** String that matches the name of one of Starlight’s built-in icons. */
+export type IconUserConfig = StarlightIcon;
+
const iconNames = Object.keys(Icons) as [StarlightIcon, ...StarlightIcon[]];
-/** String that matches the name of one of Starlight’s built-in icons. */
export const IconSchema = () => z.enum(iconNames);
diff --git a/packages/starlight/src/schemas/locale.ts b/packages/starlight/src/schemas/locale.ts
new file mode 100644
index 00000000000..33c4335db11
--- /dev/null
+++ b/packages/starlight/src/schemas/locale.ts
@@ -0,0 +1,31 @@
+import { z } from 'astro/zod';
+
+export interface LocaleUserConfig {
+ /** The label for this language to show in UI, e.g. `"English"`, `"العربية"`, or `"简体中文"`. */
+ label: string;
+ /** The BCP-47 tag for this language, e.g. `"en"`, `"ar"`, or `"zh-CN"`. */
+ lang?: string | undefined;
+ /** The writing direction of this language; `"ltr"` for left-to-right (the default) or `"rtl"` for right-to-left. */
+ dir?: 'rtl' | 'ltr' | undefined;
+}
+
+export function LocaleConfigSchema() {
+ return z.object({
+ label: z
+ .string()
+ .describe(
+ 'The label for this language to show in UI, e.g. `"English"`, `"العربية"`, or `"简体中文"`.'
+ ),
+ lang: z
+ .string()
+ .optional()
+ .describe('The BCP-47 tag for this language, e.g. `"en"`, `"ar"`, or `"zh-CN"`.'),
+ dir: z
+ .enum(['rtl', 'ltr'])
+ .optional()
+ .default('ltr')
+ .describe(
+ 'The writing direction of this language; `"ltr"` for left-to-right (the default) or `"rtl"` for right-to-left.'
+ ),
+ });
+}
diff --git a/packages/starlight/src/schemas/logo.ts b/packages/starlight/src/schemas/logo.ts
new file mode 100644
index 00000000000..e14530a4317
--- /dev/null
+++ b/packages/starlight/src/schemas/logo.ts
@@ -0,0 +1,41 @@
+import { z } from 'astro/zod';
+
+export type LogoUserConfig =
+ | {
+ /** Source of the image file to use. */
+ src: string;
+ /** Alternative text description of the logo. */
+ alt?: string | undefined;
+ /** Set to `true` to hide the site title text and only show the logo. */
+ replacesTitle?: boolean | undefined;
+ }
+ | {
+ /** Source of the image file to use in dark mode. */
+ dark: string;
+ /** Source of the image file to use in light mode. */
+ light: string;
+ /** Alternative text description of the logo. */
+ alt?: string | undefined;
+ /** Set to `true` to hide the site title text and only show the logo. */
+ replacesTitle?: boolean | undefined;
+ }
+ | undefined;
+
+export const LogoConfigSchema = () =>
+ z
+ .union([
+ z.object({
+ src: z.string(),
+ alt: z.string().default(''),
+ replacesTitle: z.boolean().default(false),
+ }),
+ z.object({
+ dark: z.string(),
+ light: z.string(),
+ alt: z.string().default(''),
+ replacesTitle: z.boolean().default(false),
+ }),
+ ])
+ .optional();
+
+export type LogoConfig = z.output>;
diff --git a/packages/starlight/schemas/pagefind.ts b/packages/starlight/src/schemas/pagefind.ts
similarity index 62%
rename from packages/starlight/schemas/pagefind.ts
rename to packages/starlight/src/schemas/pagefind.ts
index 3a470b1ca98..a2a3bb21eb3 100644
--- a/packages/starlight/schemas/pagefind.ts
+++ b/packages/starlight/src/schemas/pagefind.ts
@@ -1,7 +1,67 @@
import { z } from 'astro/zod';
-const indexWeightSchema = z.number().nonnegative().optional();
-const pagefindRankingWeightsSchema = z.object({
+export interface PagefindUserConfig {
+ /**
+ * Configure how search results from the current website are weighted by Pagefind
+ * compared to results from other sites when using the `mergeIndex` option.
+ *
+ * @see https://pagefind.app/docs/multisite/#changing-the-weighting-of-individual-indexes
+ */
+ indexWeight?: number | undefined;
+ /** Configure how search result rankings are calculated by Pagefind. */
+ ranking?: PagefindRankingUserConfig | undefined;
+ /**
+ * Configure how search indexes from different sites are merged by Pagefind.
+ * Each entry of this array represents a `PagefindIndexOptions` from pagefind.
+ *
+ * @see https://pagefind.app/docs/multisite/#searching-additional-sites-from-pagefind-ui
+ * @see https://github.com/CloudCannon/pagefind/blob/v1.3.0/pagefind_web_js/lib/coupled_search.ts#L549
+ */
+ mergeIndex?:
+ | {
+ /**
+ * Set Pagefind’s `bundlePath` mergeIndex option.
+ *
+ * @see https://pagefind.app/docs/multisite/#searching-additional-sites-from-pagefind-ui
+ */
+ bundlePath: string;
+ /**
+ * Overrides the URL path that Pagefind uses to load its search bundle
+ */
+ basePath?: string | undefined;
+ /**
+ * Appends the given baseURL to all search results. May be a path, or a full domain
+ */
+ baseUrl?: string | undefined;
+ /**
+ * Multiply all rankings for this index by the given weight.
+ *
+ * @see https://pagefind.app/docs/multisite/#changing-the-weighting-of-individual-indexes
+ */
+ indexWeight?: number | undefined;
+ /**
+ * Apply this filter configuration to all search results from this index.
+ *
+ * Only applies in multisite setups.
+ *
+ * @see https://pagefind.app/docs/multisite/#filtering-results-by-index
+ */
+ mergeFilter?: Record | undefined;
+ /**
+ * Language of this index.
+ *
+ * @see https://pagefind.app/docs/multisite/#merging-a-specific-language-index
+ */
+ language?: string | undefined;
+ /**
+ * Configure how search result rankings are calculated by Pagefind.
+ */
+ ranking?: PagefindRankingUserConfig | undefined;
+ }[]
+ | undefined;
+}
+
+interface PagefindRankingUserConfig {
/**
* Set Pagefind’s `pageLength` ranking option.
*
@@ -9,7 +69,7 @@ const pagefindRankingWeightsSchema = z.object({
*
* @see https://pagefind.app/docs/ranking/#configuring-page-length
*/
- pageLength: z.number().min(0).max(1).default(0.1),
+ pageLength?: number | undefined;
/**
* Set Pagefind’s `termFrequency` ranking option.
*
@@ -17,7 +77,7 @@ const pagefindRankingWeightsSchema = z.object({
*
* @see https://pagefind.app/docs/ranking/#configuring-term-frequency
*/
- termFrequency: z.number().min(0).max(1).default(0.1),
+ termFrequency?: number | undefined;
/**
* Set Pagefind’s `termSaturation` ranking option.
*
@@ -25,7 +85,7 @@ const pagefindRankingWeightsSchema = z.object({
*
* @see https://pagefind.app/docs/ranking/#configuring-term-saturation
*/
- termSaturation: z.number().min(0).max(2).default(2),
+ termSaturation?: number | undefined;
/**
* Set Pagefind’s `termSimilarity` ranking option.
*
@@ -33,73 +93,33 @@ const pagefindRankingWeightsSchema = z.object({
*
* @see https://pagefind.app/docs/ranking/#configuring-term-similarity
*/
+ termSimilarity?: number | undefined;
+}
+
+const indexWeightSchema = z.number().nonnegative().optional();
+const pagefindRankingWeightsSchema = z.object({
+ pageLength: z.number().min(0).max(1).default(0.1),
+ termFrequency: z.number().min(0).max(1).default(0.1),
+ termSaturation: z.number().min(0).max(2).default(2),
termSimilarity: z.number().min(0).default(9),
});
const pagefindIndexOptionsSchema = z.object({
- /**
- * Overrides the URL path that Pagefind uses to load its search bundle
- */
basePath: z.string().optional(),
- /**
- * Appends the given baseURL to all search results. May be a path, or a full domain
- */
baseUrl: z.string().optional(),
- /**
- * Multiply all rankings for this index by the given weight.
- *
- * @see https://pagefind.app/docs/multisite/#changing-the-weighting-of-individual-indexes
- */
indexWeight: indexWeightSchema,
- /**
- * Apply this filter configuration to all search results from this index.
- *
- * Only applies in multisite setups.
- *
- * @see https://pagefind.app/docs/multisite/#filtering-results-by-index
- */
mergeFilter: z.record(z.string(), z.string().or(z.tuple([z.string()], z.string()))).optional(),
- /**
- * Language of this index.
- *
- * @see https://pagefind.app/docs/multisite/#merging-a-specific-language-index
- */
language: z.string().optional(),
- /**
- * Configure how search result rankings are calculated by Pagefind.
- */
// We apply a default value to merged indexes in order to share the same ranking for them and the current site when not set explicitly.
ranking: pagefindRankingWeightsSchema.prefault({}),
});
const pagefindSchema = z.object({
- /**
- * Configure how search results from the current website are weighted by Pagefind
- * compared to results from other sites when using the `mergeIndex` option.
- *
- * @see https://pagefind.app/docs/multisite/#changing-the-weighting-of-individual-indexes
- */
indexWeight: indexWeightSchema,
- /** Configure how search result rankings are calculated by Pagefind. */
ranking: pagefindRankingWeightsSchema.prefault({}),
- /**
- * Configure how search indexes from different sites are merged by Pagefind.
- *
- * @see https://pagefind.app/docs/multisite/#searching-additional-sites-from-pagefind-ui
- */
mergeIndex: z
.array(
- /**
- * Each entry of this array represents a `PagefindIndexOptions` from pagefind.
- *
- * @see https://github.com/CloudCannon/pagefind/blob/v1.3.0/pagefind_web_js/lib/coupled_search.ts#L549
- */
z.object({
...pagefindIndexOptionsSchema.shape,
- /**
- * Set Pagefind’s `bundlePath` mergeIndex option.
- *
- * @see https://pagefind.app/docs/multisite/#searching-additional-sites-from-pagefind-ui
- */
bundlePath: z.string(),
})
)
diff --git a/packages/starlight/schemas/prevNextLink.ts b/packages/starlight/src/schemas/prevNextLink.ts
similarity index 100%
rename from packages/starlight/schemas/prevNextLink.ts
rename to packages/starlight/src/schemas/prevNextLink.ts
diff --git a/packages/starlight/schemas/sidebar.ts b/packages/starlight/src/schemas/sidebar.ts
similarity index 78%
rename from packages/starlight/schemas/sidebar.ts
rename to packages/starlight/src/schemas/sidebar.ts
index 54dae52245b..c675f93ff23 100644
--- a/packages/starlight/schemas/sidebar.ts
+++ b/packages/starlight/src/schemas/sidebar.ts
@@ -1,20 +1,25 @@
import type { AstroBuiltinAttributes } from 'astro';
import type { HTMLAttributes } from 'astro/types';
import { z } from 'astro/zod';
-import { I18nBadgeConfigSchema } from './badge';
+import { I18nBadgeConfigSchema, type I18nBadgeUserConfig } from './badge';
import { stripLeadingAndTrailingSlashes } from '../utils/path';
-const SidebarBaseSchema = z.object({
+interface SidebarBaseUserConfig {
/** The visible label for this item in the sidebar. */
- label: z.string(),
+ label: string;
/** Translations of the `label` for each supported language. */
- translations: z.record(z.string(), z.string()).default({}),
+ translations?: Record | undefined;
/** Adds a badge to the item */
+ badge?: I18nBadgeUserConfig;
+}
+
+const SidebarBaseSchema = z.object({
+ label: z.string(),
+ translations: z.record(z.string(), z.string()).default({}),
badge: I18nBadgeConfigSchema(),
});
-const SidebarGroupSchema = z.object({
- ...SidebarBaseSchema.shape,
+interface SidebarGroupUserConfig extends SidebarBaseUserConfig {
/**
* Explicitly prevent custom attributes on groups as the final type for supported sidebar item
* is a non-discriminated union where TypeScript will not perform excess property checks.
@@ -22,8 +27,14 @@ const SidebarGroupSchema = z.object({
* TypeScript error, and only have it fail at runtime.
* @see https://github.com/microsoft/TypeScript/issues/20863
*/
- attrs: z.never().optional(),
+ attrs?: never;
/** Whether this item should be collapsed by default. */
+ collapsed?: boolean | undefined;
+}
+
+const SidebarGroupSchema = z.object({
+ ...SidebarBaseSchema.shape,
+ attrs: z.never().optional(),
collapsed: z.boolean().default(false),
});
@@ -41,31 +52,44 @@ export type LinkHTMLAttributes = Omit<
export const SidebarLinkItemHTMLAttributesSchema = () => linkHTMLAttributesSchema.default({});
+interface SidebarLinkItemUserConfig extends SidebarBaseUserConfig {
+ /** The link to this item’s content. Can be a relative link to local files or the full URL of an external page. */
+ link: string;
+ /** HTML attributes to add to the link item. */
+ attrs?: LinkHTMLAttributes | undefined;
+}
+
const SidebarLinkItemSchema = z.strictObject({
...SidebarBaseSchema.shape,
- /** The link to this item’s content. Can be a relative link to local files or the full URL of an external page. */
link: z.string(),
- /** HTML attributes to add to the link item. */
attrs: SidebarLinkItemHTMLAttributesSchema(),
});
export type SidebarLinkItem = z.infer;
-const AutoSidebarGroupSchema = z.strictObject({
- ...SidebarGroupSchema.shape,
+interface AutoSidebarGroupUserConfig extends SidebarGroupUserConfig {
/** Enable autogenerating a sidebar category from a specific docs directory. */
- autogenerate: z.object({
+ autogenerate: {
/** The directory to generate sidebar items for. */
- directory: z.string().transform(stripLeadingAndTrailingSlashes),
+ directory: string;
/**
* Whether the autogenerated subgroups should be collapsed by default.
* Defaults to the `AutoSidebarGroup` `collapsed` value.
*/
- collapsed: z.boolean().optional(),
+ collapsed?: boolean | undefined;
/** HTML attributes to add to the autogenerated link items. */
- attrs: SidebarLinkItemHTMLAttributesSchema(),
+ attrs?: LinkHTMLAttributes | undefined;
// TODO: not supported by Docusaurus but would be good to have
/** How many directories deep to include from this directory in the sidebar. Default: `Infinity`. */
- // depth: z.number().optional(),
+ // depth?: number | undefined;
+ };
+}
+
+const AutoSidebarGroupSchema = z.strictObject({
+ ...SidebarGroupSchema.shape,
+ autogenerate: z.object({
+ directory: z.string().transform(stripLeadingAndTrailingSlashes),
+ collapsed: z.boolean().optional(),
+ attrs: SidebarLinkItemHTMLAttributesSchema(),
}),
});
export type AutoSidebarGroup = z.infer;
@@ -92,6 +116,11 @@ type ManualSidebarGroupOutput = z.output & {
>;
};
+type ManualSidebarGroupUserConfig = SidebarGroupUserConfig & {
+ /** Array of links and subcategories to display in this category. */
+ items: SidebarItemUserConfig[];
+};
+
const ManualSidebarGroupSchema: z.ZodType =
z.strictObject({
...SidebarGroupSchema.shape,
@@ -109,18 +138,35 @@ const ManualSidebarGroupSchema: z.ZodType {
+ /** The visible label for this item in the sidebar. */
+ label?: SidebarBaseUserConfig['label'];
+ /** The link to this item’s content. Must be a slug of a Content Collection entry. */
+ slug: string;
+ /** HTML attributes to add to the link item. */
+ attrs?: LinkHTMLAttributes | undefined;
+}
+
const InternalSidebarLinkItemSchema = z.object({
...SidebarBaseSchema.partial({ label: true }).shape,
- /** The link to this item’s content. Must be a slug of a Content Collection entry. */
slug: z.string(),
- /** HTML attributes to add to the link item. */
attrs: SidebarLinkItemHTMLAttributesSchema(),
});
+
+type InternalSidebarLinkItemShorthandUserConfig = string;
+
const InternalSidebarLinkItemShorthandSchema = z
.string()
.transform((slug) => InternalSidebarLinkItemSchema.parse({ slug }));
export type InternalSidebarLinkItem = z.output;
+export type SidebarItemUserConfig =
+ | SidebarLinkItemUserConfig
+ | ManualSidebarGroupUserConfig
+ | AutoSidebarGroupUserConfig
+ | InternalSidebarLinkItemUserConfig
+ | InternalSidebarLinkItemShorthandUserConfig;
+
export const SidebarItemSchema = z.union([
SidebarLinkItemSchema,
ManualSidebarGroupSchema,
diff --git a/packages/starlight/schemas/site-title.ts b/packages/starlight/src/schemas/site-title.ts
similarity index 90%
rename from packages/starlight/schemas/site-title.ts
rename to packages/starlight/src/schemas/site-title.ts
index e17c0545e2b..4206c21b5bf 100644
--- a/packages/starlight/schemas/site-title.ts
+++ b/packages/starlight/src/schemas/site-title.ts
@@ -1,5 +1,7 @@
import { z } from 'astro/zod';
+export type TitleUserConfig = string | Record;
+
export const TitleConfigSchema = () => z.union([z.string(), z.record(z.string(), z.string())]);
// transform the title for runtime use
diff --git a/packages/starlight/schemas/social.ts b/packages/starlight/src/schemas/social.ts
similarity index 83%
rename from packages/starlight/schemas/social.ts
rename to packages/starlight/src/schemas/social.ts
index beb8aac1a63..13c1c56ebbb 100644
--- a/packages/starlight/schemas/social.ts
+++ b/packages/starlight/src/schemas/social.ts
@@ -1,5 +1,13 @@
import { z } from 'astro/zod';
-import { IconSchema } from './icon';
+import { IconSchema, type IconUserConfig } from './icon';
+
+export type SocialLinksUserConfig =
+ | {
+ icon: IconUserConfig;
+ label: string;
+ href: string;
+ }[]
+ | undefined;
const LinksSchema = z
.object({ icon: IconSchema(), label: z.string().min(1), href: z.string() })
diff --git a/packages/starlight/schemas/tableOfContents.ts b/packages/starlight/src/schemas/tableOfContents.ts
similarity index 72%
rename from packages/starlight/schemas/tableOfContents.ts
rename to packages/starlight/src/schemas/tableOfContents.ts
index 918a010f9b3..a6f3fa1d863 100644
--- a/packages/starlight/schemas/tableOfContents.ts
+++ b/packages/starlight/src/schemas/tableOfContents.ts
@@ -2,6 +2,16 @@ import { z } from 'astro/zod';
const defaults = { minHeadingLevel: 2, maxHeadingLevel: 3 };
+export type TableOfContentsUserConfig =
+ | boolean
+ | {
+ /** The level to start including headings at in the table of contents. Default: 2. */
+ minHeadingLevel?: number | undefined;
+ /** The level to stop including headings at in the table of contents. Default: 3. */
+ maxHeadingLevel?: number | undefined;
+ }
+ | undefined;
+
const TableOfContentsBaseSchema = z
.union([
z.object({
diff --git a/packages/starlight/style/anchor-links.css b/packages/starlight/src/style/anchor-links.css
similarity index 100%
rename from packages/starlight/style/anchor-links.css
rename to packages/starlight/src/style/anchor-links.css
diff --git a/packages/starlight/style/asides.css b/packages/starlight/src/style/asides.css
similarity index 100%
rename from packages/starlight/style/asides.css
rename to packages/starlight/src/style/asides.css
diff --git a/packages/starlight/style/layers.css b/packages/starlight/src/style/layers.css
similarity index 100%
rename from packages/starlight/style/layers.css
rename to packages/starlight/src/style/layers.css
diff --git a/packages/starlight/style/markdown.css b/packages/starlight/src/style/markdown.css
similarity index 100%
rename from packages/starlight/style/markdown.css
rename to packages/starlight/src/style/markdown.css
diff --git a/packages/starlight/style/print.css b/packages/starlight/src/style/print.css
similarity index 100%
rename from packages/starlight/style/print.css
rename to packages/starlight/src/style/print.css
diff --git a/packages/starlight/style/props.css b/packages/starlight/src/style/props.css
similarity index 100%
rename from packages/starlight/style/props.css
rename to packages/starlight/src/style/props.css
diff --git a/packages/starlight/style/reset.css b/packages/starlight/src/style/reset.css
similarity index 100%
rename from packages/starlight/style/reset.css
rename to packages/starlight/src/style/reset.css
diff --git a/packages/starlight/style/util.css b/packages/starlight/src/style/util.css
similarity index 100%
rename from packages/starlight/style/util.css
rename to packages/starlight/src/style/util.css
diff --git a/packages/starlight/translations/README.md b/packages/starlight/src/translations/README.md
similarity index 100%
rename from packages/starlight/translations/README.md
rename to packages/starlight/src/translations/README.md
diff --git a/packages/starlight/translations/ar.json b/packages/starlight/src/translations/ar.json
similarity index 100%
rename from packages/starlight/translations/ar.json
rename to packages/starlight/src/translations/ar.json
diff --git a/packages/starlight/translations/ca.json b/packages/starlight/src/translations/ca.json
similarity index 100%
rename from packages/starlight/translations/ca.json
rename to packages/starlight/src/translations/ca.json
diff --git a/packages/starlight/translations/cs.json b/packages/starlight/src/translations/cs.json
similarity index 100%
rename from packages/starlight/translations/cs.json
rename to packages/starlight/src/translations/cs.json
diff --git a/packages/starlight/translations/da.json b/packages/starlight/src/translations/da.json
similarity index 100%
rename from packages/starlight/translations/da.json
rename to packages/starlight/src/translations/da.json
diff --git a/packages/starlight/translations/de.json b/packages/starlight/src/translations/de.json
similarity index 100%
rename from packages/starlight/translations/de.json
rename to packages/starlight/src/translations/de.json
diff --git a/packages/starlight/translations/el.json b/packages/starlight/src/translations/el.json
similarity index 100%
rename from packages/starlight/translations/el.json
rename to packages/starlight/src/translations/el.json
diff --git a/packages/starlight/translations/en.json b/packages/starlight/src/translations/en.json
similarity index 100%
rename from packages/starlight/translations/en.json
rename to packages/starlight/src/translations/en.json
diff --git a/packages/starlight/translations/es.json b/packages/starlight/src/translations/es.json
similarity index 100%
rename from packages/starlight/translations/es.json
rename to packages/starlight/src/translations/es.json
diff --git a/packages/starlight/translations/fa.json b/packages/starlight/src/translations/fa.json
similarity index 100%
rename from packages/starlight/translations/fa.json
rename to packages/starlight/src/translations/fa.json
diff --git a/packages/starlight/translations/fi.json b/packages/starlight/src/translations/fi.json
similarity index 100%
rename from packages/starlight/translations/fi.json
rename to packages/starlight/src/translations/fi.json
diff --git a/packages/starlight/translations/fr.json b/packages/starlight/src/translations/fr.json
similarity index 100%
rename from packages/starlight/translations/fr.json
rename to packages/starlight/src/translations/fr.json
diff --git a/packages/starlight/translations/gl.json b/packages/starlight/src/translations/gl.json
similarity index 100%
rename from packages/starlight/translations/gl.json
rename to packages/starlight/src/translations/gl.json
diff --git a/packages/starlight/translations/he.json b/packages/starlight/src/translations/he.json
similarity index 100%
rename from packages/starlight/translations/he.json
rename to packages/starlight/src/translations/he.json
diff --git a/packages/starlight/translations/hi.json b/packages/starlight/src/translations/hi.json
similarity index 100%
rename from packages/starlight/translations/hi.json
rename to packages/starlight/src/translations/hi.json
diff --git a/packages/starlight/translations/hu.json b/packages/starlight/src/translations/hu.json
similarity index 100%
rename from packages/starlight/translations/hu.json
rename to packages/starlight/src/translations/hu.json
diff --git a/packages/starlight/translations/id.json b/packages/starlight/src/translations/id.json
similarity index 100%
rename from packages/starlight/translations/id.json
rename to packages/starlight/src/translations/id.json
diff --git a/packages/starlight/translations/index.ts b/packages/starlight/src/translations/index.ts
similarity index 100%
rename from packages/starlight/translations/index.ts
rename to packages/starlight/src/translations/index.ts
diff --git a/packages/starlight/translations/it.json b/packages/starlight/src/translations/it.json
similarity index 100%
rename from packages/starlight/translations/it.json
rename to packages/starlight/src/translations/it.json
diff --git a/packages/starlight/translations/ja.json b/packages/starlight/src/translations/ja.json
similarity index 100%
rename from packages/starlight/translations/ja.json
rename to packages/starlight/src/translations/ja.json
diff --git a/packages/starlight/translations/ko.json b/packages/starlight/src/translations/ko.json
similarity index 100%
rename from packages/starlight/translations/ko.json
rename to packages/starlight/src/translations/ko.json
diff --git a/packages/starlight/translations/lv.json b/packages/starlight/src/translations/lv.json
similarity index 100%
rename from packages/starlight/translations/lv.json
rename to packages/starlight/src/translations/lv.json
diff --git a/packages/starlight/translations/nb.json b/packages/starlight/src/translations/nb.json
similarity index 100%
rename from packages/starlight/translations/nb.json
rename to packages/starlight/src/translations/nb.json
diff --git a/packages/starlight/translations/nl.json b/packages/starlight/src/translations/nl.json
similarity index 100%
rename from packages/starlight/translations/nl.json
rename to packages/starlight/src/translations/nl.json
diff --git a/packages/starlight/translations/pl.json b/packages/starlight/src/translations/pl.json
similarity index 100%
rename from packages/starlight/translations/pl.json
rename to packages/starlight/src/translations/pl.json
diff --git a/packages/starlight/translations/pt.json b/packages/starlight/src/translations/pt.json
similarity index 100%
rename from packages/starlight/translations/pt.json
rename to packages/starlight/src/translations/pt.json
diff --git a/packages/starlight/translations/ro.json b/packages/starlight/src/translations/ro.json
similarity index 100%
rename from packages/starlight/translations/ro.json
rename to packages/starlight/src/translations/ro.json
diff --git a/packages/starlight/translations/ru.json b/packages/starlight/src/translations/ru.json
similarity index 100%
rename from packages/starlight/translations/ru.json
rename to packages/starlight/src/translations/ru.json
diff --git a/packages/starlight/translations/sk.json b/packages/starlight/src/translations/sk.json
similarity index 100%
rename from packages/starlight/translations/sk.json
rename to packages/starlight/src/translations/sk.json
diff --git a/packages/starlight/translations/sv.json b/packages/starlight/src/translations/sv.json
similarity index 100%
rename from packages/starlight/translations/sv.json
rename to packages/starlight/src/translations/sv.json
diff --git a/packages/starlight/translations/th.json b/packages/starlight/src/translations/th.json
similarity index 100%
rename from packages/starlight/translations/th.json
rename to packages/starlight/src/translations/th.json
diff --git a/packages/starlight/translations/tr.json b/packages/starlight/src/translations/tr.json
similarity index 100%
rename from packages/starlight/translations/tr.json
rename to packages/starlight/src/translations/tr.json
diff --git a/packages/starlight/translations/uk.json b/packages/starlight/src/translations/uk.json
similarity index 100%
rename from packages/starlight/translations/uk.json
rename to packages/starlight/src/translations/uk.json
diff --git a/packages/starlight/translations/vi.json b/packages/starlight/src/translations/vi.json
similarity index 100%
rename from packages/starlight/translations/vi.json
rename to packages/starlight/src/translations/vi.json
diff --git a/packages/starlight/translations/zh-CN.json b/packages/starlight/src/translations/zh-CN.json
similarity index 100%
rename from packages/starlight/translations/zh-CN.json
rename to packages/starlight/src/translations/zh-CN.json
diff --git a/packages/starlight/translations/zh-TW.json b/packages/starlight/src/translations/zh-TW.json
similarity index 100%
rename from packages/starlight/translations/zh-TW.json
rename to packages/starlight/src/translations/zh-TW.json
diff --git a/packages/starlight/types.ts b/packages/starlight/src/types.ts
similarity index 100%
rename from packages/starlight/types.ts
rename to packages/starlight/src/types.ts
diff --git a/packages/starlight/user-components/Aside.astro b/packages/starlight/src/user-components/Aside.astro
similarity index 100%
rename from packages/starlight/user-components/Aside.astro
rename to packages/starlight/src/user-components/Aside.astro
diff --git a/packages/starlight/user-components/Badge.astro b/packages/starlight/src/user-components/Badge.astro
similarity index 100%
rename from packages/starlight/user-components/Badge.astro
rename to packages/starlight/src/user-components/Badge.astro
diff --git a/packages/starlight/user-components/Card.astro b/packages/starlight/src/user-components/Card.astro
similarity index 100%
rename from packages/starlight/user-components/Card.astro
rename to packages/starlight/src/user-components/Card.astro
diff --git a/packages/starlight/user-components/CardGrid.astro b/packages/starlight/src/user-components/CardGrid.astro
similarity index 100%
rename from packages/starlight/user-components/CardGrid.astro
rename to packages/starlight/src/user-components/CardGrid.astro
diff --git a/packages/starlight/user-components/FileTree.astro b/packages/starlight/src/user-components/FileTree.astro
similarity index 100%
rename from packages/starlight/user-components/FileTree.astro
rename to packages/starlight/src/user-components/FileTree.astro
diff --git a/packages/starlight/user-components/Icon.astro b/packages/starlight/src/user-components/Icon.astro
similarity index 100%
rename from packages/starlight/user-components/Icon.astro
rename to packages/starlight/src/user-components/Icon.astro
diff --git a/packages/starlight/user-components/LinkButton.astro b/packages/starlight/src/user-components/LinkButton.astro
similarity index 100%
rename from packages/starlight/user-components/LinkButton.astro
rename to packages/starlight/src/user-components/LinkButton.astro
diff --git a/packages/starlight/user-components/LinkCard.astro b/packages/starlight/src/user-components/LinkCard.astro
similarity index 100%
rename from packages/starlight/user-components/LinkCard.astro
rename to packages/starlight/src/user-components/LinkCard.astro
diff --git a/packages/starlight/user-components/Steps.astro b/packages/starlight/src/user-components/Steps.astro
similarity index 100%
rename from packages/starlight/user-components/Steps.astro
rename to packages/starlight/src/user-components/Steps.astro
diff --git a/packages/starlight/user-components/TabItem.astro b/packages/starlight/src/user-components/TabItem.astro
similarity index 100%
rename from packages/starlight/user-components/TabItem.astro
rename to packages/starlight/src/user-components/TabItem.astro
diff --git a/packages/starlight/user-components/Tabs.astro b/packages/starlight/src/user-components/Tabs.astro
similarity index 100%
rename from packages/starlight/user-components/Tabs.astro
rename to packages/starlight/src/user-components/Tabs.astro
diff --git a/packages/starlight/user-components/file-tree-icons.ts b/packages/starlight/src/user-components/file-tree-icons.ts
similarity index 99%
rename from packages/starlight/user-components/file-tree-icons.ts
rename to packages/starlight/src/user-components/file-tree-icons.ts
index 2afc8b6cb7d..1de02992b3b 100644
--- a/packages/starlight/user-components/file-tree-icons.ts
+++ b/packages/starlight/src/user-components/file-tree-icons.ts
@@ -780,3 +780,150 @@ export const FileIcons = {
'seti:ignored':
'',
};
+
+export type FileIcon =
+ | 'seti:folder'
+ | 'seti:bsl'
+ | 'seti:mdo'
+ | 'seti:salesforce'
+ | 'seti:asm'
+ | 'seti:bicep'
+ | 'seti:bazel'
+ | 'seti:c'
+ | 'seti:c-sharp'
+ | 'seti:html'
+ | 'seti:cpp'
+ | 'seti:clojure'
+ | 'seti:coldfusion'
+ | 'seti:config'
+ | 'seti:crystal'
+ | 'seti:crystal_embedded'
+ | 'seti:json'
+ | 'seti:css'
+ | 'seti:csv'
+ | 'seti:xls'
+ | 'seti:cu'
+ | 'seti:cake'
+ | 'seti:cake_php'
+ | 'seti:d'
+ | 'seti:word'
+ | 'seti:elixir'
+ | 'seti:elixir_script'
+ | 'seti:hex'
+ | 'seti:elm'
+ | 'seti:favicon'
+ | 'seti:f-sharp'
+ | 'seti:git'
+ | 'seti:go'
+ | 'seti:godot'
+ | 'seti:gradle'
+ | 'seti:grails'
+ | 'seti:graphql'
+ | 'seti:hacklang'
+ | 'seti:haml'
+ | 'seti:mustache'
+ | 'seti:haskell'
+ | 'seti:haxe'
+ | 'seti:jade'
+ | 'seti:java'
+ | 'seti:javascript'
+ | 'seti:jinja'
+ | 'seti:julia'
+ | 'seti:karma'
+ | 'seti:kotlin'
+ | 'seti:dart'
+ | 'seti:liquid'
+ | 'seti:livescript'
+ | 'seti:lua'
+ | 'seti:markdown'
+ | 'seti:argdown'
+ | 'seti:info'
+ | 'seti:clock'
+ | 'seti:maven'
+ | 'seti:nim'
+ | 'seti:github'
+ | 'seti:notebook'
+ | 'seti:nunjucks'
+ | 'seti:npm'
+ | 'seti:ocaml'
+ | 'seti:odata'
+ | 'seti:perl'
+ | 'seti:php'
+ | 'seti:pipeline'
+ | 'seti:pddl'
+ | 'seti:plan'
+ | 'seti:happenings'
+ | 'seti:powershell'
+ | 'seti:prisma'
+ | 'seti:pug'
+ | 'seti:puppet'
+ | 'seti:purescript'
+ | 'seti:python'
+ | 'seti:react'
+ | 'seti:rescript'
+ | 'seti:R'
+ | 'seti:ruby'
+ | 'seti:rust'
+ | 'seti:sass'
+ | 'seti:spring'
+ | 'seti:slim'
+ | 'seti:smarty'
+ | 'seti:sbt'
+ | 'seti:scala'
+ | 'seti:ethereum'
+ | 'seti:stylus'
+ | 'seti:svelte'
+ | 'seti:swift'
+ | 'seti:db'
+ | 'seti:terraform'
+ | 'seti:tex'
+ | 'seti:default'
+ | 'seti:twig'
+ | 'seti:typescript'
+ | 'seti:tsconfig'
+ | 'seti:vala'
+ | 'seti:vite'
+ | 'seti:vue'
+ | 'seti:wasm'
+ | 'seti:wat'
+ | 'seti:xml'
+ | 'seti:yml'
+ | 'seti:prolog'
+ | 'seti:zig'
+ | 'seti:zip'
+ | 'seti:wgt'
+ | 'seti:illustrator'
+ | 'seti:photoshop'
+ | 'seti:pdf'
+ | 'seti:font'
+ | 'seti:image'
+ | 'seti:svg'
+ | 'seti:sublime'
+ | 'seti:code-search'
+ | 'seti:shell'
+ | 'seti:video'
+ | 'seti:audio'
+ | 'seti:windows'
+ | 'seti:jenkins'
+ | 'seti:babel'
+ | 'seti:bower'
+ | 'seti:docker'
+ | 'seti:code-climate'
+ | 'seti:eslint'
+ | 'seti:firebase'
+ | 'seti:firefox'
+ | 'seti:gitlab'
+ | 'seti:grunt'
+ | 'seti:gulp'
+ | 'seti:ionic'
+ | 'seti:platformio'
+ | 'seti:rollup'
+ | 'seti:stylelint'
+ | 'seti:yarn'
+ | 'seti:webpack'
+ | 'seti:lock'
+ | 'seti:license'
+ | 'seti:makefile'
+ | 'seti:heroku'
+ | 'seti:todo'
+ | 'seti:ignored';
diff --git a/packages/starlight/user-components/rehype-file-tree.ts b/packages/starlight/src/user-components/rehype-file-tree.ts
similarity index 100%
rename from packages/starlight/user-components/rehype-file-tree.ts
rename to packages/starlight/src/user-components/rehype-file-tree.ts
diff --git a/packages/starlight/user-components/rehype-steps.ts b/packages/starlight/src/user-components/rehype-steps.ts
similarity index 100%
rename from packages/starlight/user-components/rehype-steps.ts
rename to packages/starlight/src/user-components/rehype-steps.ts
diff --git a/packages/starlight/user-components/rehype-tabs.ts b/packages/starlight/src/user-components/rehype-tabs.ts
similarity index 100%
rename from packages/starlight/user-components/rehype-tabs.ts
rename to packages/starlight/src/user-components/rehype-tabs.ts
diff --git a/packages/starlight/utils/base.ts b/packages/starlight/src/utils/base.ts
similarity index 100%
rename from packages/starlight/utils/base.ts
rename to packages/starlight/src/utils/base.ts
diff --git a/packages/starlight/utils/canonical.ts b/packages/starlight/src/utils/canonical.ts
similarity index 100%
rename from packages/starlight/utils/canonical.ts
rename to packages/starlight/src/utils/canonical.ts
diff --git a/packages/starlight/utils/collection-fs.ts b/packages/starlight/src/utils/collection-fs.ts
similarity index 100%
rename from packages/starlight/utils/collection-fs.ts
rename to packages/starlight/src/utils/collection-fs.ts
diff --git a/packages/starlight/utils/collection.ts b/packages/starlight/src/utils/collection.ts
similarity index 100%
rename from packages/starlight/utils/collection.ts
rename to packages/starlight/src/utils/collection.ts
diff --git a/packages/starlight/utils/createPathFormatter.ts b/packages/starlight/src/utils/createPathFormatter.ts
similarity index 100%
rename from packages/starlight/utils/createPathFormatter.ts
rename to packages/starlight/src/utils/createPathFormatter.ts
diff --git a/packages/starlight/utils/createTranslationSystem.ts b/packages/starlight/src/utils/createTranslationSystem.ts
similarity index 92%
rename from packages/starlight/utils/createTranslationSystem.ts
rename to packages/starlight/src/utils/createTranslationSystem.ts
index be3c4e3400a..dfffedb9825 100644
--- a/packages/starlight/utils/createTranslationSystem.ts
+++ b/packages/starlight/src/utils/createTranslationSystem.ts
@@ -10,7 +10,8 @@ import type { UserI18nKeys, UserI18nSchema } from './translations';
* All translations handled by Starlight are stored in the same namespace and Starlight always use
* a new instance of i18next configured for this namespace.
*/
-export const I18nextNamespace = 'starlight' as const;
+const i18nextNamespace = 'starlight' as const;
+export type I18nextNamespace = typeof i18nextNamespace;
export async function createTranslationSystem(
config: Pick,
@@ -70,9 +71,9 @@ export async function createTranslationSystem(
return (lang: string | undefined) => {
lang ??= config.defaultLocale?.lang || BuiltInDefaultLocale.lang;
- const t = i18n.getFixedT(lang, I18nextNamespace) as I18nT;
- t.all = () => i18n.getResourceBundle(lang, I18nextNamespace) as ReturnType;
- t.exists = (key, options) => i18n.exists(key, { lng: lang, ns: I18nextNamespace, ...options });
+ const t = i18n.getFixedT(lang, i18nextNamespace) as I18nT;
+ t.all = () => i18n.getResourceBundle(lang, i18nextNamespace) as ReturnType;
+ t.exists = (key, options) => i18n.exists(key, { lng: lang, ns: i18nextNamespace, ...options });
t.dir = (dirLang = lang) => i18n.dir(dirLang);
return t;
@@ -108,7 +109,7 @@ type BuiltInStrings = (typeof builtinTranslations)['en'];
/** Build an i18next resources dictionary by layering preferred translation sources. */
function buildResources(
...dictionaries: (T | BuiltInStrings | undefined)[]
-): { [I18nextNamespace]: BuiltInStrings & T } {
+): { [i18nextNamespace]: BuiltInStrings & T } {
const dictionary: Partial = {};
// Iterate over alternate dictionaries to avoid overwriting preceding values with `undefined`.
for (const dict of dictionaries) {
@@ -117,7 +118,7 @@ function buildResources(
if (value) dictionary[key as keyof typeof dictionary] = value;
}
}
- return { [I18nextNamespace]: dictionary as BuiltInStrings & T };
+ return { [i18nextNamespace]: dictionary as BuiltInStrings & T };
}
// `keyof BuiltInStrings` and `UserI18nKeys` may contain some identical keys, e.g. the built-in UI
diff --git a/packages/starlight/utils/error-map.ts b/packages/starlight/src/utils/error-map.ts
similarity index 100%
rename from packages/starlight/utils/error-map.ts
rename to packages/starlight/src/utils/error-map.ts
diff --git a/packages/starlight/utils/format-path.ts b/packages/starlight/src/utils/format-path.ts
similarity index 100%
rename from packages/starlight/utils/format-path.ts
rename to packages/starlight/src/utils/format-path.ts
diff --git a/packages/starlight/utils/generateToC.ts b/packages/starlight/src/utils/generateToC.ts
similarity index 100%
rename from packages/starlight/utils/generateToC.ts
rename to packages/starlight/src/utils/generateToC.ts
diff --git a/packages/starlight/utils/git.ts b/packages/starlight/src/utils/git.ts
similarity index 100%
rename from packages/starlight/utils/git.ts
rename to packages/starlight/src/utils/git.ts
diff --git a/packages/starlight/utils/gitInlined.ts b/packages/starlight/src/utils/gitInlined.ts
similarity index 100%
rename from packages/starlight/utils/gitInlined.ts
rename to packages/starlight/src/utils/gitInlined.ts
diff --git a/packages/starlight/utils/head.ts b/packages/starlight/src/utils/head.ts
similarity index 99%
rename from packages/starlight/utils/head.ts
rename to packages/starlight/src/utils/head.ts
index 46d2efd9fb1..bcf33380fdd 100644
--- a/packages/starlight/utils/head.ts
+++ b/packages/starlight/src/utils/head.ts
@@ -1,6 +1,6 @@
import config from 'virtual:starlight/user-config';
import project from 'virtual:starlight/project-context';
-import { version } from '../package.json';
+import { version } from '../../package.json';
import { type HeadConfig, HeadConfigSchema, type HeadUserConfig } from '../schemas/head';
import type { PageProps, RouteDataContext } from './routing/data';
import { fileWithBase } from './base';
diff --git a/packages/starlight/utils/i18n.ts b/packages/starlight/src/utils/i18n.ts
similarity index 100%
rename from packages/starlight/utils/i18n.ts
rename to packages/starlight/src/utils/i18n.ts
diff --git a/packages/starlight/utils/localizedUrl.ts b/packages/starlight/src/utils/localizedUrl.ts
similarity index 100%
rename from packages/starlight/utils/localizedUrl.ts
rename to packages/starlight/src/utils/localizedUrl.ts
diff --git a/packages/starlight/utils/navigation.ts b/packages/starlight/src/utils/navigation.ts
similarity index 100%
rename from packages/starlight/utils/navigation.ts
rename to packages/starlight/src/utils/navigation.ts
diff --git a/packages/starlight/utils/path.ts b/packages/starlight/src/utils/path.ts
similarity index 100%
rename from packages/starlight/utils/path.ts
rename to packages/starlight/src/utils/path.ts
diff --git a/packages/starlight/utils/plugins.ts b/packages/starlight/src/utils/plugins.ts
similarity index 64%
rename from packages/starlight/utils/plugins.ts
rename to packages/starlight/src/utils/plugins.ts
index 9ccd19c6de5..9a2275510ac 100644
--- a/packages/starlight/utils/plugins.ts
+++ b/packages/starlight/src/utils/plugins.ts
@@ -33,7 +33,7 @@ export async function runPlugins(
// Validate the user-provided plugins configuration.
const pluginsConfig = parseWithFriendlyErrors(
- starlightPluginsConfigSchema,
+ StarlightPluginsConfigSchema,
pluginsUserConfig,
'Invalid plugins config passed to starlight integration'
);
@@ -186,52 +186,177 @@ const astroIntegrationSchema = z.object({
hooks: z.looseObject({}).default({}),
}) as z.ZodType;
+interface RouteMiddlewareUserConfig {
+ entrypoint: string;
+ order?: 'pre' | 'post' | 'default';
+}
+
const routeMiddlewareConfigSchema = z.object({
entrypoint: z.string(),
order: z.enum(['pre', 'post', 'default']).default('default'),
});
-const baseStarlightPluginSchema = z.object({
+interface BaseStarlightPluginUserConfig {
/** Name of the Starlight plugin. */
+ name: string;
+}
+
+const baseStarlightPluginSchema = z.object({
name: z.string(),
});
type StarlightConfigUpdate = Partial>;
type StarlightI18nTFactory = Awaited>;
+type ConfigSetupHookUserConfig =
+ | ((options: {
+ /**
+ * A read-only copy of the user-supplied Starlight configuration.
+ *
+ * Note that this configuration may have been updated by other plugins configured
+ * before this one.
+ */
+ config: StarlightUserConfig & { plugins?: StarlightPluginUserConfig[] | undefined };
+ /**
+ * A callback function to update the user-supplied Starlight configuration.
+ *
+ * You only need to provide the configuration values that you want to update but no deep
+ * merge is performed.
+ *
+ * @example
+ * {
+ * name: 'My Starlight Plugin',
+ * hooks: {
+ * 'config:setup'({ updateConfig }) {
+ * updateConfig({
+ * description: 'Custom description',
+ * });
+ * }
+ * }
+ * }
+ */
+ updateConfig: (newConfig: Partial>) => void;
+ /**
+ * A callback function to add an Astro integration required by this plugin.
+ *
+ * @see https://docs.astro.build/en/reference/integrations-reference/
+ *
+ * @example
+ * {
+ * name: 'My Starlight Plugin',
+ * hooks: {
+ * 'config:setup'({ addIntegration }) {
+ * addIntegration({
+ * name: 'My Plugin Astro Integration',
+ * hooks: {
+ * 'astro:config:setup': () => {
+ * // …
+ * },
+ * },
+ * });
+ * }
+ * }
+ * }
+ */
+ addIntegration: (integration: AstroIntegration) => void;
+ /**
+ * A callback function to register additional route middleware handlers.
+ *
+ * If the order of execution is important, a plugin can use the `order` option to enforce
+ * running first or last.
+ *
+ * @example
+ * {
+ * name: 'My Starlight Plugin',
+ * hooks: {
+ * setup({ addRouteMiddleware }) {
+ * addRouteMiddleware({ entrypoint: '@me/my-plugin/route-middleware' });
+ * },
+ * },
+ * }
+ */
+ addRouteMiddleware: (config: RouteMiddlewareUserConfig) => void;
+ /**
+ * A read-only copy of the user-supplied Astro configuration.
+ *
+ * Note that this configuration is resolved before any other integrations have run.
+ *
+ * @see https://docs.astro.build/en/reference/integrations-reference/#config-option
+ */
+ astroConfig: StarlightPluginContext['config'];
+ /**
+ * The command used to run Starlight.
+ *
+ * @see https://docs.astro.build/en/reference/integrations-reference/#command-option
+ */
+ command: StarlightPluginContext['command'];
+ /**
+ * `false` when the dev server starts, `true` when a reload is triggered.
+ *
+ * @see https://docs.astro.build/en/reference/integrations-reference/#isrestart-option
+ */
+ isRestart: StarlightPluginContext['isRestart'];
+ /**
+ * An instance of the Astro integration logger with all logged messages prefixed with the
+ * plugin name.
+ *
+ * @see https://docs.astro.build/en/reference/integrations-reference/#astrointegrationlogger
+ */
+ logger: StarlightPluginContext['logger'];
+ /**
+ * A callback function to generate a utility function to access UI strings for a given
+ * language.
+ *
+ * @see https://starlight.astro.build/guides/i18n/#using-ui-translations
+ *
+ * @example
+ * {
+ * name: 'My Starlight Plugin',
+ * hooks: {
+ * 'config:setup'({ useTranslations, logger }) {
+ * const t = useTranslations('en');
+ * logger.info(t('builtWithStarlight.label'));
+ * // ^ Logs 'Built with Starlight' to the console.
+ * }
+ * }
+ * }
+ */
+ useTranslations: Awaited>;
+ /**
+ * A callback function to get the language for a given absolute file path. The returned
+ * language can be used with the `useTranslations` helper to get UI strings for that
+ * language.
+ *
+ * This can be particularly useful in remark or rehype plugins to get the language for
+ * the current file being processed and use it to get the appropriate UI strings for that
+ * language.
+ *
+ * @example
+ * {
+ * name: 'My Starlight Plugin',
+ * hooks: {
+ * 'config:setup'({ absolutePathToLang, useTranslations, logger }) {
+ * const lang = absolutePathToLang('/absolute/path/to/project/src/content/docs/fr/index.mdx');
+ * const t = useTranslations(lang);
+ * logger.info(t('aside.tip'));
+ * // ^ Logs 'Astuce' to the console.
+ * }
+ * }
+ * }
+ */
+ absolutePathToLang: (path: string) => string;
+ }) => void | Promise)
+ | undefined;
+
const configSetupHookSchema = z
.function({
input: [
z.object({
- /**
- * A read-only copy of the user-supplied Starlight configuration.
- *
- * Note that this configuration may have been updated by other plugins configured
- * before this one.
- */
config: z.any() as z.ZodType<
// The configuration passed to plugins should contains the list of plugins.
StarlightUserConfigWithPlugins,
StarlightUserConfigWithPlugins
>,
- /**
- * A callback function to update the user-supplied Starlight configuration.
- *
- * You only need to provide the configuration values that you want to update but no deep
- * merge is performed.
- *
- * @example
- * {
- * name: 'My Starlight Plugin',
- * hooks: {
- * 'config:setup'({ updateConfig }) {
- * updateConfig({
- * description: 'Custom description',
- * });
- * }
- * }
- * }
- */
updateConfig: z.function({
input: [
z.record(z.string(), z.any()) as z.ZodType<
@@ -241,132 +366,31 @@ const configSetupHookSchema = z
],
output: z.void(),
}),
- /**
- * A callback function to add an Astro integration required by this plugin.
- *
- * @see https://docs.astro.build/en/reference/integrations-reference/
- *
- * @example
- * {
- * name: 'My Starlight Plugin',
- * hooks: {
- * 'config:setup'({ addIntegration }) {
- * addIntegration({
- * name: 'My Plugin Astro Integration',
- * hooks: {
- * 'astro:config:setup': () => {
- * // …
- * },
- * },
- * });
- * }
- * }
- * }
- */
addIntegration: z.function({
input: [astroIntegrationSchema],
output: z.void(),
}),
- /**
- * A callback function to register additional route middleware handlers.
- *
- * If the order of execution is important, a plugin can use the `order` option to enforce
- * running first or last.
- *
- * @example
- * {
- * name: 'My Starlight Plugin',
- * hooks: {
- * setup({ addRouteMiddleware }) {
- * addRouteMiddleware({ entrypoint: '@me/my-plugin/route-middleware' });
- * },
- * },
- * }
- */
addRouteMiddleware: z.function({
input: [routeMiddlewareConfigSchema],
output: z.void(),
}),
- /**
- * A read-only copy of the user-supplied Astro configuration.
- *
- * Note that this configuration is resolved before any other integrations have run.
- *
- * @see https://docs.astro.build/en/reference/integrations-reference/#config-option
- */
astroConfig: z.any() as z.ZodType<
StarlightPluginContext['config'],
StarlightPluginContext['config']
>,
- /**
- * The command used to run Starlight.
- *
- * @see https://docs.astro.build/en/reference/integrations-reference/#command-option
- */
command: z.any() as z.ZodType<
StarlightPluginContext['command'],
StarlightPluginContext['command']
>,
- /**
- * `false` when the dev server starts, `true` when a reload is triggered.
- *
- * @see https://docs.astro.build/en/reference/integrations-reference/#isrestart-option
- */
isRestart: z.any() as z.ZodType<
StarlightPluginContext['isRestart'],
StarlightPluginContext['isRestart']
>,
- /**
- * An instance of the Astro integration logger with all logged messages prefixed with the
- * plugin name.
- *
- * @see https://docs.astro.build/en/reference/integrations-reference/#astrointegrationlogger
- */
logger: z.any() as z.ZodType<
StarlightPluginContext['logger'],
StarlightPluginContext['logger']
>,
- /**
- * A callback function to generate a utility function to access UI strings for a given
- * language.
- *
- * @see https://starlight.astro.build/guides/i18n/#using-ui-translations
- *
- * @example
- * {
- * name: 'My Starlight Plugin',
- * hooks: {
- * 'config:setup'({ useTranslations, logger }) {
- * const t = useTranslations('en');
- * logger.info(t('builtWithStarlight.label'));
- * // ^ Logs 'Built with Starlight' to the console.
- * }
- * }
- * }
- */
useTranslations: z.any() as z.ZodType,
- /**
- * A callback function to get the language for a given absolute file path. The returned
- * language can be used with the `useTranslations` helper to get UI strings for that
- * language.
- *
- * This can be particularly useful in remark or rehype plugins to get the language for
- * the current file being processed and use it to get the appropriate UI strings for that
- * language.
- *
- * @example
- * {
- * name: 'My Starlight Plugin',
- * hooks: {
- * 'config:setup'({ absolutePathToLang, useTranslations, logger }) {
- * const lang = absolutePathToLang('/absolute/path/to/project/src/content/docs/fr/index.mdx');
- * const t = useTranslations(lang);
- * logger.info(t('aside.tip'));
- * // ^ Logs 'Astuce' to the console.
- * }
- * }
- * }
- */
absolutePathToLang: z.function({
input: [z.string()],
output: z.string(),
@@ -380,6 +404,49 @@ const configSetupHookSchema = z
})
.optional();
+interface StarlightPluginUserConfig extends BaseStarlightPluginUserConfig {
+ /** The different hooks available to the plugin. */
+ hooks: {
+ 'i18n:setup'?:
+ | ((options: {
+ /**
+ * A callback function to add or update translations strings.
+ *
+ * @see https://starlight.astro.build/guides/i18n/#extend-translation-schema
+ *
+ * @example
+ * {
+ * name: 'My Starlight Plugin',
+ * hooks: {
+ * 'i18n:setup'({ injectTranslations }) {
+ * injectTranslations({
+ * en: {
+ * 'myPlugin.doThing': 'Do the thing',
+ * },
+ * fr: {
+ * 'myPlugin.doThing': 'Faire le truc',
+ * },
+ * });
+ * }
+ * }
+ * }
+ */
+ injectTranslations: (translations: Record>) => void;
+ }) => void | Promise)
+ | undefined;
+ /**
+ * Plugin configuration setup function called with an object containing various values that
+ * can be used by the plugin to interact with Starlight.
+ */
+ 'config:setup'?: ConfigSetupHookUserConfig;
+ /**
+ * @deprecated Use the `config:setup` hook instead as `setup` will be removed in a future
+ * version.
+ */
+ setup?: ConfigSetupHookUserConfig;
+ };
+}
+
/**
* A plugin `config` and `updateConfig` argument are purposely not validated using the Starlight
* user config schema but properly typed for user convenience because we do not want to run any of
@@ -388,39 +455,11 @@ const configSetupHookSchema = z
const starlightPluginSchema = z
.object({
...baseStarlightPluginSchema.shape,
- /** The different hooks available to the plugin. */
hooks: z.object({
- /**
- * Plugin internationalization setup function allowing to inject translations strings for the
- * plugin in various locales. These translations will be available in the `config:setup` hook
- * and plugin UI.
- */
'i18n:setup': z
.function({
input: [
z.object({
- /**
- * A callback function to add or update translations strings.
- *
- * @see https://starlight.astro.build/guides/i18n/#extend-translation-schema
- *
- * @example
- * {
- * name: 'My Starlight Plugin',
- * hooks: {
- * 'i18n:setup'({ injectTranslations }) {
- * injectTranslations({
- * en: {
- * 'myPlugin.doThing': 'Do the thing',
- * },
- * fr: {
- * 'myPlugin.doThing': 'Faire le truc',
- * },
- * });
- * }
- * }
- * }
- */
injectTranslations: z.function({
input: [z.record(z.string(), z.record(z.string(), z.string()))],
output: z.void(),
@@ -433,15 +472,7 @@ const starlightPluginSchema = z
output: z.promise(z.void()),
})
.optional(),
- /**
- * Plugin configuration setup function called with an object containing various values that
- * can be used by the plugin to interact with Starlight.
- */
'config:setup': configSetupHookSchema,
- /**
- * @deprecated Use the `config:setup` hook instead as `setup` will be removed in a future
- * version.
- */
setup: configSetupHookSchema,
}),
})
@@ -464,11 +495,11 @@ const starlightPluginSchema = z
}
});
-const starlightPluginsConfigSchema = z.array(starlightPluginSchema).default([]);
+type StarlightPluginsUserConfig = StarlightPluginUserConfig[] | undefined;
-type StarlightPluginsUserConfig = z.input;
+export const StarlightPluginsConfigSchema = z.array(starlightPluginSchema).default([]);
-export type StarlightPlugin = z.input;
+export type StarlightPlugin = StarlightPluginUserConfig;
export type HookParameters<
Hook extends keyof StarlightPlugin['hooks'],
diff --git a/packages/starlight/utils/routing/data.ts b/packages/starlight/src/utils/routing/data.ts
similarity index 100%
rename from packages/starlight/utils/routing/data.ts
rename to packages/starlight/src/utils/routing/data.ts
diff --git a/packages/starlight/utils/routing/index.ts b/packages/starlight/src/utils/routing/index.ts
similarity index 100%
rename from packages/starlight/utils/routing/index.ts
rename to packages/starlight/src/utils/routing/index.ts
diff --git a/packages/starlight/utils/routing/middleware.ts b/packages/starlight/src/utils/routing/middleware.ts
similarity index 100%
rename from packages/starlight/utils/routing/middleware.ts
rename to packages/starlight/src/utils/routing/middleware.ts
diff --git a/packages/starlight/utils/routing/types.ts b/packages/starlight/src/utils/routing/types.ts
similarity index 100%
rename from packages/starlight/utils/routing/types.ts
rename to packages/starlight/src/utils/routing/types.ts
diff --git a/packages/starlight/utils/slugs.ts b/packages/starlight/src/utils/slugs.ts
similarity index 100%
rename from packages/starlight/utils/slugs.ts
rename to packages/starlight/src/utils/slugs.ts
diff --git a/packages/starlight/utils/starlight-page.ts b/packages/starlight/src/utils/starlight-page.ts
similarity index 100%
rename from packages/starlight/utils/starlight-page.ts
rename to packages/starlight/src/utils/starlight-page.ts
diff --git a/packages/starlight/utils/translations-fs.ts b/packages/starlight/src/utils/translations-fs.ts
similarity index 100%
rename from packages/starlight/utils/translations-fs.ts
rename to packages/starlight/src/utils/translations-fs.ts
diff --git a/packages/starlight/utils/translations.ts b/packages/starlight/src/utils/translations.ts
similarity index 80%
rename from packages/starlight/utils/translations.ts
rename to packages/starlight/src/utils/translations.ts
index d4ffaca9a97..d8b468a98ff 100644
--- a/packages/starlight/utils/translations.ts
+++ b/packages/starlight/src/utils/translations.ts
@@ -8,10 +8,8 @@ import type { RemoveIndexSignature } from './types';
import { getCollectionPathFromRoot } from './collection';
import { stripExtension, stripLeadingSlash } from './path';
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
-// @ts-ignore - This may be a type error in projects without an i18n collection and running
-// `tsc --noEmit` in their project. Note that it is not possible to inline this type in
-// `UserI18nSchema` because this would break types for users having multiple data collections.
+// It is not possible to inline this type in `UserI18nSchema` because this would break types for
+// users having multiple data collections.
type i18nCollection = CollectionEntry<'i18n'>;
const i18nCollectionPathFromRoot = getCollectionPathFromRoot('i18n', project);
@@ -29,8 +27,6 @@ async function loadTranslations() {
const warn = console.warn;
console.warn = () => {};
const userTranslations: Record = Object.fromEntries(
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore — may be a type error in projects without an i18n collection
(await getCollection('i18n')).map(({ id, data, filePath }) => {
const lang = !filePath
? id
diff --git a/packages/starlight/utils/types.ts b/packages/starlight/src/utils/types.ts
similarity index 100%
rename from packages/starlight/utils/types.ts
rename to packages/starlight/src/utils/types.ts
diff --git a/packages/starlight/utils/url.ts b/packages/starlight/src/utils/url.ts
similarity index 100%
rename from packages/starlight/utils/url.ts
rename to packages/starlight/src/utils/url.ts
diff --git a/packages/starlight/utils/user-config.ts b/packages/starlight/src/utils/user-config.ts
similarity index 72%
rename from packages/starlight/utils/user-config.ts
rename to packages/starlight/src/utils/user-config.ts
index c4c9b64b313..1f0f29ca24a 100644
--- a/packages/starlight/utils/user-config.ts
+++ b/packages/starlight/src/utils/user-config.ts
@@ -1,43 +1,57 @@
import { z } from 'astro/zod';
import { parse as bcpParse, stringify as bcpStringify } from 'bcp-47';
-import { ComponentConfigSchema } from '../schemas/components';
-import { ExpressiveCodeSchema } from '../schemas/expressiveCode';
-import { FaviconSchema } from '../schemas/favicon';
-import { HeadConfigSchema } from '../schemas/head';
-import { LogoConfigSchema } from '../schemas/logo';
-import { PagefindConfigDefaults, PagefindConfigSchema } from '../schemas/pagefind';
-import { SidebarItemSchema } from '../schemas/sidebar';
-import { TitleConfigSchema, TitleTransformConfigSchema } from '../schemas/site-title';
-import { SocialLinksSchema } from '../schemas/social';
-import { UserConfigTableOfContentsSchema } from '../schemas/tableOfContents';
+import { ComponentConfigSchema, type ComponentUserConfig } from '../schemas/components';
+import { ExpressiveCodeSchema, type ExpressiveCodeUserConfig } from '../schemas/expressiveCode';
+import { FaviconSchema, type FaviconUserConfig } from '../schemas/favicon';
+import { HeadConfigSchema, type HeadUserConfig } from '../schemas/head';
+import { LogoConfigSchema, type LogoUserConfig } from '../schemas/logo';
+import {
+ PagefindConfigDefaults,
+ PagefindConfigSchema,
+ type PagefindUserConfig,
+} from '../schemas/pagefind';
+import { SidebarItemSchema, type SidebarItemUserConfig } from '../schemas/sidebar';
+import {
+ TitleConfigSchema,
+ TitleTransformConfigSchema,
+ type TitleUserConfig,
+} from '../schemas/site-title';
+import { SocialLinksSchema, type SocialLinksUserConfig } from '../schemas/social';
+import {
+ UserConfigTableOfContentsSchema,
+ type TableOfContentsUserConfig,
+} from '../schemas/tableOfContents';
import { BuiltInDefaultLocale } from './i18n';
-
-const LocaleSchema = z.object({
- /** The label for this language to show in UI, e.g. `"English"`, `"العربية"`, or `"简体中文"`. */
- label: z.string(),
- /** The BCP-47 tag for this language, e.g. `"en"`, `"ar"`, or `"zh-CN"`. */
- lang: z.string().optional(),
- /** The writing direction of this language; `"ltr"` for left-to-right (the default) or `"rtl"` for right-to-left. */
- dir: z.enum(['rtl', 'ltr']).optional().default('ltr'),
-});
-
-const UserConfigSchema = z.object({
- /**
- * Title for your website. Will be used in metadata and as browser tab title.
- *
- * @example
- * title: 'My Docs'
- *
- * @example
- * title: { en: 'My Docs' }
- */
- title: TitleConfigSchema(),
+import { LocaleConfigSchema, type LocaleUserConfig } from '../schemas/locale';
+import type { Prettify } from './types';
+
+// The `StarlightUserConfig` interface is an hand-written type rather than using the
+// `z.input` helper so that any JSDoc comments are properly preserved when emitting
+// declaration files.
+// Having such comments in the schema only works in pure-TypeScript environments, but due to a TS
+// issues, such comments can be either missing or misplaced in the emitted declaration files.
+// Such an approach also help reducing the size of the emitted declaration files due to redundancy
+// with Zod 3.
+//
+// @see https://github.com/microsoft/TypeScript/issues/62309
+// @see https://github.com/colinhacks/zod/issues/4227
+//
+// As such approach uses 2 sources of truth (a schema and an hand-written type), we use type tests
+// to ensure that the hand-written type always matches the inferred input type from the schema.
+// Any properties that use a sub-schema also follow the same approach, with type tests ensuring
+// the same consistency there as well.
+// Any new sub-schema used in the configuration should also have corresponding type tests added.
+//
+// @see {@link file://./../../__tests__/basics/schema.test-d.ts}
+export interface StarlightUserConfig {
+ /** Title for your website. Will be used in metadata and as browser tab title. */
+ title: TitleUserConfig;
/** Description metadata for your website. Can be used in page metadata. */
- description: z.string().optional(),
+ description?: string | undefined;
/** Set a logo image to show in the navigation bar alongside or instead of the site title. */
- logo: LogoConfigSchema(),
+ logo?: LogoUserConfig;
/**
* Optional details about the social media accounts for this site.
@@ -51,75 +65,37 @@ const UserConfigSchema = z.object({
* { icon: 'mastodon', label: 'Mastodon', href: 'https://m.webtoo.ls/@astro' },
* ]
*/
- social: SocialLinksSchema(),
-
- /** The tagline for your website. */
- tagline: z.string().optional(),
+ social?: SocialLinksUserConfig;
/** Configure the defaults for the table of contents on each page. */
- tableOfContents: UserConfigTableOfContentsSchema(),
+ tableOfContents?: TableOfContentsUserConfig;
/** Enable and configure “Edit this page” links. */
- editLink: z
- .object({
- /** Set the base URL for edit links. The final link will be `baseUrl` + the current page path. */
- baseUrl: z.url().optional(),
- })
- .optional()
- .default({}),
+ editLink?:
+ | {
+ /** Set the base URL for edit links. The final link will be `baseUrl` + the current page path. */
+ baseUrl?: string | undefined;
+ }
+ | undefined;
/** Configure locales for internationalization (i18n). */
- locales: z
- .object({
- /** Configure a “root” locale to serve a default language from `/`. */
- root: LocaleSchema.required({ lang: true }).optional(),
- })
- .catchall(LocaleSchema)
- .transform((locales, ctx) => {
- for (const key in locales) {
- const locale = locales[key]!;
- // Fall back to the key in the locales object as the lang.
- let lang = locale.lang || key;
-
- // Parse the lang tag so we can check it is valid according to BCP-47.
- const schema = bcpParse(lang, { forgiving: true });
- schema.region = schema.region?.toUpperCase();
- const normalizedLang = bcpStringify(schema);
-
- // Error if parsing the language tag failed.
- if (!normalizedLang) {
- ctx.issues.push({
- code: 'custom',
- message: `Could not validate language tag "${lang}" at locales.${key}.lang.`,
- input: lang,
- });
- return z.NEVER;
- }
-
- // Let users know we’re modifying their configured `lang`.
- if (normalizedLang !== lang) {
- console.warn(
- `Warning: using "${normalizedLang}" language tag for locales.${key}.lang instead of "${lang}".`
- );
- lang = normalizedLang;
- }
-
- // Set the final value as the normalized lang, based on the key if needed.
- locale.lang = lang;
- }
- return locales;
- })
- .optional(),
+ locales?:
+ | Prettify<
+ {
+ root?: Prettify }>;
+ } & Record
+ >
+ | undefined;
/**
* Specify the default language for this site.
*
* The default locale will be used to provide fallback content where translations are missing.
*/
- defaultLocale: z.string().optional(),
+ defaultLocale?: string | undefined;
/** Configure your site’s sidebar navigation items. */
- sidebar: SidebarItemSchema.array().optional(),
+ sidebar?: SidebarItemUserConfig[] | undefined;
/**
* Add extra tags to your site’s ``.
@@ -141,7 +117,7 @@ const UserConfigSchema = z.object({
* ],
* })
*/
- head: HeadConfigSchema({ source: 'config' }),
+ head?: HeadUserConfig;
/**
* Provide CSS files to customize the look and feel of your Starlight site.
@@ -155,6 +131,115 @@ const UserConfigSchema = z.object({
* customCss: ['/src/custom-styles.css', '@fontsource/roboto'],
* })
*/
+ customCss?: string[] | undefined;
+
+ /** Define if the last update date should be visible in the page footer. */
+ lastUpdated?: boolean | undefined;
+
+ /** Define if the previous and next page links should be visible in the page footer. */
+ pagination?: boolean | undefined;
+
+ /** The default favicon for your site which should be a path to an image in the `public/` directory. */
+ favicon?: FaviconUserConfig;
+
+ /**
+ * Define how code blocks are rendered by passing options to Expressive Code,
+ * or disable the integration by passing `false`.
+ */
+ expressiveCode?: ExpressiveCodeUserConfig;
+
+ /**
+ * Configure Starlight’s default site search provider Pagefind. Set to `false` to disable indexing
+ * your site with Pagefind, which will also hide the default search UI if in use.
+ */
+ pagefind?: boolean | PagefindUserConfig | undefined;
+
+ /** Specify paths to components that should override Starlight’s default components */
+ components?: ComponentUserConfig;
+
+ /** Will be used as title delimiter in the generated `` tag. */
+ titleDelimiter?: string | undefined;
+
+ /** Disable Starlight's default 404 page. */
+ disable404Route?: boolean | undefined;
+
+ /**
+ * Define whether Starlight pages should be prerendered or not.
+ * Defaults to always prerender Starlight pages, even when the project is
+ * set to "server" output mode.
+ */
+ prerender?: boolean | undefined;
+
+ /** Enable displaying a “Built with Starlight” link in your site’s footer. */
+ credits?: boolean | undefined;
+
+ /** Add middleware to process Starlight’s route data for each page. */
+ routeMiddleware?: string | string[] | undefined;
+
+ /** Configure features that impact Starlight’s Markdown processing. */
+ markdown?:
+ | {
+ /** Define whether headings in content should be rendered with clickable anchor links. Default: `true`. */
+ headingLinks?: boolean | undefined;
+ /**
+ * Define additional directories where files should be processed by Starlight’s Markdown pipeline.
+ *
+ * Supports local directories relative to the root of your project, e.g. './src/data/comments/'.
+ * Content of the `docs` content collection is always processed by Starlight’s Markdown pipeline.
+ */
+ processedDirs?: string[] | undefined;
+ }
+ | undefined;
+}
+
+const UserConfigSchema = z.object({
+ title: TitleConfigSchema(),
+ description: z.string().optional(),
+ logo: LogoConfigSchema(),
+ social: SocialLinksSchema(),
+ tableOfContents: UserConfigTableOfContentsSchema(),
+ editLink: z.object({ baseUrl: z.url().optional() }).optional().default({}),
+ locales: z
+ .object({ root: LocaleConfigSchema().required({ lang: true }).optional() })
+ .catchall(LocaleConfigSchema())
+ .transform((locales, ctx) => {
+ for (const key in locales) {
+ const locale = locales[key]!;
+ // Fall back to the key in the locales object as the lang.
+ let lang = locale.lang || key;
+
+ // Parse the lang tag so we can check it is valid according to BCP-47.
+ const schema = bcpParse(lang, { forgiving: true });
+ schema.region = schema.region?.toUpperCase();
+ const normalizedLang = bcpStringify(schema);
+
+ // Error if parsing the language tag failed.
+ if (!normalizedLang) {
+ ctx.issues.push({
+ code: 'custom',
+ message: `Could not validate language tag "${lang}" at locales.${key}.lang.`,
+ input: lang,
+ });
+ return z.NEVER;
+ }
+
+ // Let users know we’re modifying their configured `lang`.
+ if (normalizedLang !== lang) {
+ console.warn(
+ `Warning: using "${normalizedLang}" language tag for locales.${key}.lang instead of "${lang}".`
+ );
+ lang = normalizedLang;
+ }
+
+ // Set the final value as the normalized lang, based on the key if needed.
+ locale.lang = lang;
+ }
+ return locales;
+ })
+ .optional(),
+ defaultLocale: z.string().optional(),
+ sidebar: SidebarItemSchema.array().optional(),
+ head: HeadConfigSchema({ source: 'config' }),
customCss: z
.string()
.array()
@@ -174,53 +259,21 @@ const UserConfigSchema = z.object({
});
}
}),
-
- /** Define if the last update date should be visible in the page footer. */
lastUpdated: z.boolean().default(false),
-
- /** Define if the previous and next page links should be visible in the page footer. */
pagination: z.boolean().default(true),
-
- /** The default favicon for your site which should be a path to an image in the `public/` directory. */
favicon: FaviconSchema(),
-
- /**
- * Define how code blocks are rendered by passing options to Expressive Code,
- * or disable the integration by passing `false`.
- */
expressiveCode: ExpressiveCodeSchema(),
-
- /**
- * Configure Starlight’s default site search provider Pagefind. Set to `false` to disable indexing
- * your site with Pagefind, which will also hide the default search UI if in use.
- */
pagefind: z
.boolean()
// Transform `true` to our default config object.
.transform((val) => val && PagefindConfigDefaults())
.or(PagefindConfigSchema())
.optional(),
-
- /** Specify paths to components that should override Starlight’s default components */
components: ComponentConfigSchema(),
-
- /** Will be used as title delimiter in the generated `` tag. */
titleDelimiter: z.string().default('|'),
-
- /** Disable Starlight's default 404 page. */
disable404Route: z.boolean().default(false),
-
- /**
- * Define whether Starlight pages should be prerendered or not.
- * Defaults to always prerender Starlight pages, even when the project is
- * set to "server" output mode.
- */
prerender: z.boolean().default(true),
-
- /** Enable displaying a “Built with Starlight” link in your site’s footer. */
credits: z.boolean().default(false),
-
- /** Add middleware to process Starlight’s route data for each page. */
routeMiddleware: z
.string()
.transform((string) => [string])
@@ -242,18 +295,9 @@ const UserConfigSchema = z.object({
});
}
}),
-
- /** Configure features that impact Starlight’s Markdown processing. */
markdown: z
.object({
- /** Define whether headings in content should be rendered with clickable anchor links. Default: `true`. */
headingLinks: z.boolean().default(true),
- /**
- * Define additional directories where files should be processed by Starlight’s Markdown pipeline.
- *
- * Supports local directories relative to the root of your project, e.g. './src/data/comments/'.
- * Content of the `docs` content collection is always processed by Starlight’s Markdown pipeline.
- */
processedDirs: z.string().array().default([]),
})
.prefault({}),
@@ -345,4 +389,3 @@ export const StarlightConfigSchema = z
});
export type StarlightConfig = z.infer;
-export type StarlightUserConfig = z.input;
diff --git a/packages/starlight/utils/validateLogoImports.ts b/packages/starlight/src/utils/validateLogoImports.ts
similarity index 100%
rename from packages/starlight/utils/validateLogoImports.ts
rename to packages/starlight/src/utils/validateLogoImports.ts
diff --git a/packages/starlight/tsdown.config.ts b/packages/starlight/tsdown.config.ts
new file mode 100644
index 00000000000..ad2cca33338
--- /dev/null
+++ b/packages/starlight/tsdown.config.ts
@@ -0,0 +1,97 @@
+import fs from 'node:fs/promises';
+import path from 'node:path';
+import { glob } from 'tinyglobby';
+import { defineConfig } from 'tsdown';
+
+const outDir = 'dist';
+
+export default defineConfig({
+ copy: ['src/components.ts', 'src/style'],
+ dts: true,
+ entry: [
+ 'src/**/*.ts',
+ // The user components barrel file should not be transpiled as it's consumed as-is by Astro.
+ // https://github.com/withastro/astro/blob/c4c99aa7a5e8e45ada0efa4fda6e6fb96f334663/packages/astro/package.json#L55
+ '!src/components.ts',
+ ],
+ external: [/^astro:/, /^virtual:starlight\//],
+ outDir,
+ plugins: [rawImportPlugin(), globCopyPlugin(['**/*.astro'], 'src')],
+ publint: { strict: true },
+ unbundle: true,
+});
+
+/**
+ * Plugin supporting importing raw file contents using the `?raw` suffix.
+ *
+ * This is a basic implementation suitable for Starlight’s needs as the existing `unplugin-raw`
+ * plugin did not end up working correctly.
+ * Note that this implementation does not support multiple query parameters.
+ */
+function rawImportPlugin() {
+ const rawImportSuffix = '?raw';
+
+ return {
+ name: 'raw-import-plugin',
+ async load(id: string) {
+ const isRawImport = id.endsWith(rawImportSuffix);
+ if (!isRawImport) return;
+
+ const path = id.replace(rawImportSuffix, '');
+ const content = await fs.readFile(path, 'utf8');
+
+ return `export default ${JSON.stringify(content)}`;
+ },
+ };
+}
+
+/**
+ * Plugin copying files matching given glob patterns to the output directory.
+ *
+ * The tsdown `copy` option does not support glob patterns, which can be useful in the case of
+ * Astro files that we all want to copy over as-is. Specifying each directory containing Astro
+ * files to the `copy` option would be tedious and would also end up copying non-Astro files, e.g.
+ * TypeScript files in the `src/components/` directory that we do not want to copy as-is.
+ */
+function globCopyPlugin(globs: string[], cwd: string) {
+ return {
+ name: 'glob-copy-plugin',
+ async writeBundle() {
+ let total = 0;
+
+ info('Copying files matching globs');
+
+ for (const pattern of globs) {
+ const files = await glob(pattern, { cwd });
+
+ await Promise.all(
+ files.map((file) => {
+ const from = path.resolve(cwd, file);
+ const to = path.resolve(outDir, file);
+ return fs.cp(from, to, { force: true });
+ })
+ );
+
+ total += files.length;
+
+ info(`${dim(`${cwd}/`)}${pattern} ${dim(`- ${files.length} files`)}`);
+ }
+
+ info(`${total} files`);
+ },
+ };
+}
+
+function info(message: string) {
+ console.info(`${blue('ℹ')} ${message}`);
+}
+
+// TODO: refactor logging to use `util.styleText()` when possible (22.13.0).
+function blue(message: string) {
+ return `\x1b[34m${message}\x1b[0m`;
+}
+
+// TODO: refactor logging to use `util.styleText()` when possible (22.13.0).
+function dim(message: string) {
+ return `\x1b[2m${message}\x1b[0m`;
+}
diff --git a/packages/starlight/virtual-internal.d.ts b/packages/starlight/virtual-internal.d.ts
deleted file mode 100644
index 3002b4519e4..00000000000
--- a/packages/starlight/virtual-internal.d.ts
+++ /dev/null
@@ -1,149 +0,0 @@
-declare module 'virtual:starlight/git-info' {
- export function getNewestCommitDate(file: string): Date;
-}
-
-declare module 'virtual:starlight/user-css' {}
-
-declare module 'virtual:starlight/optional-css' {}
-
-declare module 'virtual:starlight/user-images' {
- type ImageMetadata = import('astro').ImageMetadata;
- export const logos: {
- dark?: ImageMetadata;
- light?: ImageMetadata;
- };
-}
-
-declare module 'virtual:starlight/collection-config' {
- export const collections: import('astro:content').ContentConfig['collections'] | undefined;
-}
-
-declare module 'virtual:starlight/route-middleware' {
- export const routeMiddleware: Array;
-}
-
-declare module 'virtual:starlight/pagefind-config' {
- export const pagefindUserConfig: Partial<
- Extract
- >;
-}
-
-declare module 'virtual:starlight/components/Banner' {
- const Banner: typeof import('./components/Banner.astro').default;
- export default Banner;
-}
-declare module 'virtual:starlight/components/ContentPanel' {
- const ContentPanel: typeof import('./components/ContentPanel.astro').default;
- export default ContentPanel;
-}
-declare module 'virtual:starlight/components/PageTitle' {
- const PageTitle: typeof import('./components/PageTitle.astro').default;
- export default PageTitle;
-}
-declare module 'virtual:starlight/components/FallbackContentNotice' {
- const FallbackContentNotice: typeof import('./components/FallbackContentNotice.astro').default;
- export default FallbackContentNotice;
-}
-declare module 'virtual:starlight/components/DraftContentNotice' {
- const DraftContentNotice: typeof import('./components/DraftContentNotice.astro').default;
- export default DraftContentNotice;
-}
-
-declare module 'virtual:starlight/components/Footer' {
- const Footer: typeof import('./components/Footer.astro').default;
- export default Footer;
-}
-declare module 'virtual:starlight/components/LastUpdated' {
- const LastUpdated: typeof import('./components/LastUpdated.astro').default;
- export default LastUpdated;
-}
-declare module 'virtual:starlight/components/Pagination' {
- const Pagination: typeof import('./components/Pagination.astro').default;
- export default Pagination;
-}
-declare module 'virtual:starlight/components/EditLink' {
- const EditLink: typeof import('./components/EditLink.astro').default;
- export default EditLink;
-}
-
-declare module 'virtual:starlight/components/Header' {
- const Header: typeof import('./components/Header.astro').default;
- export default Header;
-}
-declare module 'virtual:starlight/components/LanguageSelect' {
- const LanguageSelect: typeof import('./components/LanguageSelect.astro').default;
- export default LanguageSelect;
-}
-declare module 'virtual:starlight/components/Search' {
- const Search: typeof import('./components/Search.astro').default;
- export default Search;
-}
-declare module 'virtual:starlight/components/SiteTitle' {
- const SiteTitle: typeof import('./components/SiteTitle.astro').default;
- export default SiteTitle;
-}
-declare module 'virtual:starlight/components/SocialIcons' {
- const SocialIcons: typeof import('./components/SocialIcons.astro').default;
- export default SocialIcons;
-}
-declare module 'virtual:starlight/components/ThemeSelect' {
- const ThemeSelect: typeof import('./components/ThemeSelect.astro').default;
- export default ThemeSelect;
-}
-
-declare module 'virtual:starlight/components/Head' {
- const Head: typeof import('./components/Head.astro').default;
- export default Head;
-}
-declare module 'virtual:starlight/components/Hero' {
- const Hero: typeof import('./components/Hero.astro').default;
- export default Hero;
-}
-declare module 'virtual:starlight/components/MarkdownContent' {
- const MarkdownContent: typeof import('./components/MarkdownContent.astro').default;
- export default MarkdownContent;
-}
-
-declare module 'virtual:starlight/components/PageSidebar' {
- const PageSidebar: typeof import('./components/PageSidebar.astro').default;
- export default PageSidebar;
-}
-declare module 'virtual:starlight/components/TableOfContents' {
- const TableOfContents: typeof import('./components/TableOfContents.astro').default;
- export default TableOfContents;
-}
-declare module 'virtual:starlight/components/MobileTableOfContents' {
- const MobileTableOfContents: typeof import('./components/MobileTableOfContents.astro').default;
- export default MobileTableOfContents;
-}
-
-declare module 'virtual:starlight/components/Sidebar' {
- const Sidebar: typeof import('./components/Sidebar.astro').default;
- export default Sidebar;
-}
-declare module 'virtual:starlight/components/SkipLink' {
- const SkipLink: typeof import('./components/SkipLink.astro').default;
- export default SkipLink;
-}
-declare module 'virtual:starlight/components/ThemeProvider' {
- const ThemeProvider: typeof import('./components/ThemeProvider.astro').default;
- export default ThemeProvider;
-}
-
-declare module 'virtual:starlight/components/PageFrame' {
- const PageFrame: typeof import('./components/PageFrame.astro').default;
- export default PageFrame;
-}
-declare module 'virtual:starlight/components/MobileMenuToggle' {
- const MobileMenuToggle: typeof import('./components/MobileMenuToggle.astro').default;
- export default MobileMenuToggle;
-}
-declare module 'virtual:starlight/components/MobileMenuFooter' {
- const MobileMenuFooter: typeof import('./components/MobileMenuFooter.astro').default;
- export default MobileMenuFooter;
-}
-
-declare module 'virtual:starlight/components/TwoColumnContent' {
- const TwoColumnContent: typeof import('./components/TwoColumnContent.astro').default;
- export default TwoColumnContent;
-}
diff --git a/packages/starlight/virtual.d.ts b/packages/starlight/virtual.d.ts
index a4f3882b307..e80ce6b69c8 100644
--- a/packages/starlight/virtual.d.ts
+++ b/packages/starlight/virtual.d.ts
@@ -1,19 +1,13 @@
declare module 'virtual:starlight/user-config' {
- const Config: import('./types').StarlightConfig;
+ const Config: import('./src/types').StarlightConfig;
export default Config;
}
declare module 'virtual:starlight/plugin-translations' {
- const PluginTranslations: import('./utils/plugins').PluginTranslations;
+ const PluginTranslations: import('./src/utils/plugins').PluginTranslations;
export default PluginTranslations;
}
-// TODO: Technically, we could move back this module declaration to `virtual-internal.d.ts` when
-// `utils/translations.ts` no longer need to import project context. Altho, we should not aim for
-// such refactor right now as shipping Starlight in JavaScript rather than TypeScript will
-// entirely eliminate such issue and the need for private and public declaration files for virtual
-// modules.
-// @see https://github.com/withastro/starlight/pull/3572
declare module 'virtual:starlight/project-context' {
const ProjectContext: {
root: string;
@@ -25,3 +19,153 @@ declare module 'virtual:starlight/project-context' {
};
export default ProjectContext;
}
+
+declare module 'virtual:starlight/git-info' {
+ export function getNewestCommitDate(file: string): Date;
+}
+
+declare module 'virtual:starlight/user-css' {}
+
+declare module 'virtual:starlight/optional-css' {}
+
+declare module 'virtual:starlight/user-images' {
+ type ImageMetadata = import('astro').ImageMetadata;
+ export const logos: {
+ dark?: ImageMetadata;
+ light?: ImageMetadata;
+ };
+}
+
+declare module 'virtual:starlight/collection-config' {
+ export const collections: import('astro:content').ContentConfig['collections'] | undefined;
+}
+
+declare module 'virtual:starlight/route-middleware' {
+ export const routeMiddleware: Array;
+}
+
+declare module 'virtual:starlight/pagefind-config' {
+ export const pagefindUserConfig: Partial<
+ Extract
+ >;
+}
+
+declare module 'virtual:starlight/components/Banner' {
+ const Banner: typeof import('./src/components/Banner.astro').default;
+ export default Banner;
+}
+declare module 'virtual:starlight/components/ContentPanel' {
+ const ContentPanel: typeof import('./src/components/ContentPanel.astro').default;
+ export default ContentPanel;
+}
+declare module 'virtual:starlight/components/PageTitle' {
+ const PageTitle: typeof import('./src/components/PageTitle.astro').default;
+ export default PageTitle;
+}
+declare module 'virtual:starlight/components/FallbackContentNotice' {
+ const FallbackContentNotice: typeof import('./src/components/FallbackContentNotice.astro').default;
+ export default FallbackContentNotice;
+}
+declare module 'virtual:starlight/components/DraftContentNotice' {
+ const DraftContentNotice: typeof import('./src/components/DraftContentNotice.astro').default;
+ export default DraftContentNotice;
+}
+
+declare module 'virtual:starlight/components/Footer' {
+ const Footer: typeof import('./src/components/Footer.astro').default;
+ export default Footer;
+}
+declare module 'virtual:starlight/components/LastUpdated' {
+ const LastUpdated: typeof import('./src/components/LastUpdated.astro').default;
+ export default LastUpdated;
+}
+declare module 'virtual:starlight/components/Pagination' {
+ const Pagination: typeof import('./src/components/Pagination.astro').default;
+ export default Pagination;
+}
+declare module 'virtual:starlight/components/EditLink' {
+ const EditLink: typeof import('./src/components/EditLink.astro').default;
+ export default EditLink;
+}
+
+declare module 'virtual:starlight/components/Header' {
+ const Header: typeof import('./src/components/Header.astro').default;
+ export default Header;
+}
+declare module 'virtual:starlight/components/LanguageSelect' {
+ const LanguageSelect: typeof import('./src/components/LanguageSelect.astro').default;
+ export default LanguageSelect;
+}
+declare module 'virtual:starlight/components/Search' {
+ const Search: typeof import('./src/components/Search.astro').default;
+ export default Search;
+}
+declare module 'virtual:starlight/components/SiteTitle' {
+ const SiteTitle: typeof import('./src/components/SiteTitle.astro').default;
+ export default SiteTitle;
+}
+declare module 'virtual:starlight/components/SocialIcons' {
+ const SocialIcons: typeof import('./src/components/SocialIcons.astro').default;
+ export default SocialIcons;
+}
+declare module 'virtual:starlight/components/ThemeSelect' {
+ const ThemeSelect: typeof import('./src/components/ThemeSelect.astro').default;
+ export default ThemeSelect;
+}
+
+declare module 'virtual:starlight/components/Head' {
+ const Head: typeof import('./src/components/Head.astro').default;
+ export default Head;
+}
+declare module 'virtual:starlight/components/Hero' {
+ const Hero: typeof import('./src/components/Hero.astro').default;
+ export default Hero;
+}
+declare module 'virtual:starlight/components/MarkdownContent' {
+ const MarkdownContent: typeof import('./src/components/MarkdownContent.astro').default;
+ export default MarkdownContent;
+}
+
+declare module 'virtual:starlight/components/PageSidebar' {
+ const PageSidebar: typeof import('./src/components/PageSidebar.astro').default;
+ export default PageSidebar;
+}
+declare module 'virtual:starlight/components/TableOfContents' {
+ const TableOfContents: typeof import('./src/components/TableOfContents.astro').default;
+ export default TableOfContents;
+}
+declare module 'virtual:starlight/components/MobileTableOfContents' {
+ const MobileTableOfContents: typeof import('./src/components/MobileTableOfContents.astro').default;
+ export default MobileTableOfContents;
+}
+
+declare module 'virtual:starlight/components/Sidebar' {
+ const Sidebar: typeof import('./src/components/Sidebar.astro').default;
+ export default Sidebar;
+}
+declare module 'virtual:starlight/components/SkipLink' {
+ const SkipLink: typeof import('./src/components/SkipLink.astro').default;
+ export default SkipLink;
+}
+declare module 'virtual:starlight/components/ThemeProvider' {
+ const ThemeProvider: typeof import('./src/components/ThemeProvider.astro').default;
+ export default ThemeProvider;
+}
+
+declare module 'virtual:starlight/components/PageFrame' {
+ const PageFrame: typeof import('./src/components/PageFrame.astro').default;
+ export default PageFrame;
+}
+declare module 'virtual:starlight/components/MobileMenuToggle' {
+ const MobileMenuToggle: typeof import('./src/components/MobileMenuToggle.astro').default;
+ export default MobileMenuToggle;
+}
+declare module 'virtual:starlight/components/MobileMenuFooter' {
+ const MobileMenuFooter: typeof import('./src/components/MobileMenuFooter.astro').default;
+ export default MobileMenuFooter;
+}
+
+declare module 'virtual:starlight/components/TwoColumnContent' {
+ const TwoColumnContent: typeof import('./src/components/TwoColumnContent.astro').default;
+ export default TwoColumnContent;
+}
diff --git a/packages/starlight/vitest.config.ts b/packages/starlight/vitest.config.ts
index e9e29379335..58eeeecbb99 100644
--- a/packages/starlight/vitest.config.ts
+++ b/packages/starlight/vitest.config.ts
@@ -5,22 +5,19 @@ export default defineConfig({
projects: ['__tests__/*/vitest.config.ts'],
coverage: {
reportsDirectory: './__coverage__',
- include: ['**.ts'],
+ include: ['src/**/*.ts'],
exclude: [
'**/__tests__/**',
- '**/__e2e__/**',
- 'playwright.config.*',
- '**/vitest.*',
/**
* TODO: re-exclude these 2 files once the issue preventing us from excluding only these
* files at the project root in Vitest 4 is fixed and update thresholds accordingly.
*
* @see https://github.com/vitest-dev/vitest/issues/9395
*/
- // 'components.ts',
- // 'types.ts',
+ // 'src/components.ts',
+ // 'src/types.ts',
// Types-only export.
- 'props.ts',
+ 'src/props.ts',
// Types declaration files.
'*.d.ts',
/**
@@ -30,7 +27,7 @@ export default defineConfig({
* @see https://github.com/vitest-dev/vitest/issues/9395
*/
// Main integration entrypoint — don’t think we’re able to test this directly currently.
- // 'index.ts',
+ // 'src/index.ts',
],
thresholds: {
lines: 87,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7f675fac8b0..787bd3ad7bf 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -44,6 +44,9 @@ importers:
size-limit:
specifier: ^11.1.6
version: 11.1.6
+ tsdown:
+ specifier: ^0.16.2
+ version: 0.16.8(@emnapi/runtime@1.4.3)(publint@0.3.18)(typescript@5.6.3)
typescript:
specifier: ^5.6.3
version: 5.6.3
@@ -279,6 +282,12 @@ importers:
linkedom:
specifier: ^0.18.4
version: 0.18.4
+ publint:
+ specifier: ^0.3.15
+ version: 0.3.18
+ tinyglobby:
+ specifier: ^0.2.15
+ version: 0.2.15
vitest:
specifier: ^4.1.0
version: 4.1.0(@types/node@22.19.3)(jiti@2.6.1)(lightningcss@1.30.2)(tsx@4.15.2)(yaml@2.7.1)
@@ -480,6 +489,10 @@ packages:
'@astrojs/yaml2ts@0.2.2':
resolution: {integrity: sha512-GOfvSr5Nqy2z5XiwqTouBBpy5FyI6DEe+/g/Mk5am9SjILN1S5fOEvYK0GuWHg98yS/dobP4m8qyqw/URW35fQ==}
+ '@babel/generator@7.29.1':
+ resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==}
+ engines: {node: '>=6.9.0'}
+
'@babel/helper-string-parser@7.27.1':
resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==}
engines: {node: '>=6.9.0'}
@@ -1110,6 +1123,9 @@ packages:
cpu: [x64]
os: [win32]
+ '@jridgewell/gen-mapping@0.3.13':
+ resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
+
'@jridgewell/gen-mapping@0.3.5':
resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==}
engines: {node: '>=6.0.0'}
@@ -1163,6 +1179,12 @@ packages:
'@mdx-js/mdx@3.1.1':
resolution: {integrity: sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==}
+ '@napi-rs/wasm-runtime@1.1.2':
+ resolution: {integrity: sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw==}
+ peerDependencies:
+ '@emnapi/core': ^1.7.1
+ '@emnapi/runtime': ^1.7.1
+
'@nodelib/fs.scandir@2.1.5':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
@@ -1178,6 +1200,12 @@ packages:
'@oslojs/encoding@1.1.0':
resolution: {integrity: sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==}
+ '@oxc-project/types@0.122.0':
+ resolution: {integrity: sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==}
+
+ '@oxc-project/types@0.99.0':
+ resolution: {integrity: sha512-LLDEhXB7g1m5J+woRSgfKsFPS3LhR9xRhTeIoEBm5WrkwMxn6eZ0Ld0c0K5eHB57ChZX6I3uSmmLjZ8pcjlRcw==}
+
'@pagefind/darwin-arm64@1.3.0':
resolution: {integrity: sha512-365BEGl6ChOsauRjyVpBjXybflXAOvoMROw3TucAROHIcdBvXk9/2AmEvGFU0r75+vdQI4LJdJdpH4Y6Yqaj4A==}
cpu: [arm64]
@@ -1211,6 +1239,191 @@ packages:
engines: {node: '>=18'}
hasBin: true
+ '@publint/pack@0.1.4':
+ resolution: {integrity: sha512-HDVTWq3H0uTXiU0eeSQntcVUTPP3GamzeXI41+x7uU9J65JgWQh3qWZHblR1i0npXfFtF+mxBiU2nJH8znxWnQ==}
+ engines: {node: '>=18'}
+
+ '@quansync/fs@1.0.0':
+ resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==}
+
+ '@rolldown/binding-android-arm64@1.0.0-beta.52':
+ resolution: {integrity: sha512-MBGIgysimZPqTDcLXI+i9VveijkP5C3EAncEogXhqfax6YXj1Tr2LY3DVuEOMIjWfMPMhtQSPup4fSTAmgjqIw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [android]
+
+ '@rolldown/binding-android-arm64@1.0.0-rc.12':
+ resolution: {integrity: sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [android]
+
+ '@rolldown/binding-darwin-arm64@1.0.0-beta.52':
+ resolution: {integrity: sha512-MmKeoLnKu1d9j6r19K8B+prJnIZ7u+zQ+zGQ3YHXGnr41rzE3eqQLovlkvoZnRoxDGPA4ps0pGiwXy6YE3lJyg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@rolldown/binding-darwin-arm64@1.0.0-rc.12':
+ resolution: {integrity: sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@rolldown/binding-darwin-x64@1.0.0-beta.52':
+ resolution: {integrity: sha512-qpHedvQBmIjT8zdnjN3nWPR2qjQyJttbXniCEKKdHeAbZG9HyNPBUzQF7AZZGwmS9coQKL+hWg9FhWzh2dZ2IA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [darwin]
+
+ '@rolldown/binding-darwin-x64@1.0.0-rc.12':
+ resolution: {integrity: sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [darwin]
+
+ '@rolldown/binding-freebsd-x64@1.0.0-beta.52':
+ resolution: {integrity: sha512-dDp7WbPapj/NVW0LSiH/CLwMhmLwwKb3R7mh2kWX+QW85X1DGVnIEyKh9PmNJjB/+suG1dJygdtdNPVXK1hylg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [freebsd]
+
+ '@rolldown/binding-freebsd-x64@1.0.0-rc.12':
+ resolution: {integrity: sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [freebsd]
+
+ '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.52':
+ resolution: {integrity: sha512-9e4l6vy5qNSliDPqNfR6CkBOAx6PH7iDV4OJiEJzajajGrVy8gc/IKKJUsoE52G8ud8MX6r3PMl97NfwgOzB7g==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm]
+ os: [linux]
+
+ '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.12':
+ resolution: {integrity: sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm]
+ os: [linux]
+
+ '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.52':
+ resolution: {integrity: sha512-V48oDR84feRU2KRuzpALp594Uqlx27+zFsT6+BgTcXOtu7dWy350J1G28ydoCwKB+oxwsRPx2e7aeQnmd3YJbQ==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [linux]
+
+ '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.12':
+ resolution: {integrity: sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [linux]
+
+ '@rolldown/binding-linux-arm64-musl@1.0.0-beta.52':
+ resolution: {integrity: sha512-ENLmSQCWqSA/+YN45V2FqTIemg7QspaiTjlm327eUAMeOLdqmSOVVyrQexJGNTQ5M8sDYCgVAig2Kk01Ggmqaw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [linux]
+
+ '@rolldown/binding-linux-arm64-musl@1.0.0-rc.12':
+ resolution: {integrity: sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [linux]
+
+ '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.12':
+ resolution: {integrity: sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [ppc64]
+ os: [linux]
+
+ '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.12':
+ resolution: {integrity: sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [s390x]
+ os: [linux]
+
+ '@rolldown/binding-linux-x64-gnu@1.0.0-beta.52':
+ resolution: {integrity: sha512-klahlb2EIFltSUubn/VLjuc3qxp1E7th8ukayPfdkcKvvYcQ5rJztgx8JsJSuAKVzKtNTqUGOhy4On71BuyV8g==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [linux]
+
+ '@rolldown/binding-linux-x64-gnu@1.0.0-rc.12':
+ resolution: {integrity: sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [linux]
+
+ '@rolldown/binding-linux-x64-musl@1.0.0-beta.52':
+ resolution: {integrity: sha512-UuA+JqQIgqtkgGN2c/AQ5wi8M6mJHrahz/wciENPTeI6zEIbbLGoth5XN+sQe2pJDejEVofN9aOAp0kaazwnVg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [linux]
+
+ '@rolldown/binding-linux-x64-musl@1.0.0-rc.12':
+ resolution: {integrity: sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [linux]
+
+ '@rolldown/binding-openharmony-arm64@1.0.0-beta.52':
+ resolution: {integrity: sha512-1BNQW8u4ro8bsN1+tgKENJiqmvc+WfuaUhXzMImOVSMw28pkBKdfZtX2qJPADV3terx+vNJtlsgSGeb3+W6Jiw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [openharmony]
+
+ '@rolldown/binding-openharmony-arm64@1.0.0-rc.12':
+ resolution: {integrity: sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [openharmony]
+
+ '@rolldown/binding-wasm32-wasi@1.0.0-beta.52':
+ resolution: {integrity: sha512-K/p7clhCqJOQpXGykrFaBX2Dp9AUVIDHGc+PtFGBwg7V+mvBTv/tsm3LC3aUmH02H2y3gz4y+nUTQ0MLpofEEg==}
+ engines: {node: '>=14.0.0'}
+ cpu: [wasm32]
+
+ '@rolldown/binding-wasm32-wasi@1.0.0-rc.12':
+ resolution: {integrity: sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg==}
+ engines: {node: '>=14.0.0'}
+ cpu: [wasm32]
+
+ '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.52':
+ resolution: {integrity: sha512-a4EkXBtnYYsKipjS7QOhEBM4bU5IlR9N1hU+JcVEVeuTiaslIyhWVKsvf7K2YkQHyVAJ+7/A9BtrGqORFcTgng==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [win32]
+
+ '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.12':
+ resolution: {integrity: sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [win32]
+
+ '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.52':
+ resolution: {integrity: sha512-5ZXcYyd4GxPA6QfbGrNcQjmjbuLGvfz6728pZMsQvGHI+06LT06M6TPtXvFvLgXtexc+OqvFe1yAIXJU1gob/w==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [ia32]
+ os: [win32]
+
+ '@rolldown/binding-win32-x64-msvc@1.0.0-beta.52':
+ resolution: {integrity: sha512-tzpnRQXJrSzb8Z9sm97UD3cY0toKOImx+xRKsDLX4zHaAlRXWh7jbaKBePJXEN7gNw7Nm03PBNwphdtA8KSUYQ==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [win32]
+
+ '@rolldown/binding-win32-x64-msvc@1.0.0-rc.12':
+ resolution: {integrity: sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [win32]
+
+ '@rolldown/pluginutils@1.0.0-beta.52':
+ resolution: {integrity: sha512-/L0htLJZbaZFL1g9OHOblTxbCYIGefErJjtYOwgl9ZqNx27P3L0SDfjhhHIss32gu5NWgnxuT2a2Hnnv6QGHKA==}
+
+ '@rolldown/pluginutils@1.0.0-rc.12':
+ resolution: {integrity: sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw==}
+
'@rollup/pluginutils@5.3.0':
resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==}
engines: {node: '>=14.0.0'}
@@ -1486,6 +1699,9 @@ packages:
peerDependencies:
vite: ^5.2.0 || ^6 || ^7
+ '@tybys/wasm-util@0.10.1':
+ resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==}
+
'@types/acorn@4.0.6':
resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==}
@@ -1745,6 +1961,10 @@ packages:
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
engines: {node: '>=8'}
+ ansis@4.2.0:
+ resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==}
+ engines: {node: '>=14'}
+
anymatch@3.1.3:
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
engines: {node: '>= 8'}
@@ -1773,6 +1993,10 @@ packages:
resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
engines: {node: '>=12'}
+ ast-kit@2.2.0:
+ resolution: {integrity: sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw==}
+ engines: {node: '>=20.19.0'}
+
ast-v8-to-istanbul@1.0.0:
resolution: {integrity: sha512-1fSfIwuDICFA4LKkCzRPO7F0hzFf0B7+Xqrl27ynQaa+Rh0e1Es0v6kWHPott3lU10AyAr7oKHa65OppjLn3Rg==}
@@ -1825,6 +2049,9 @@ packages:
resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==}
engines: {node: '>=4'}
+ birpc@4.0.0:
+ resolution: {integrity: sha512-LShSxJP0KTmd101b6DRyGBj57LZxSDYWKitQNW/mi8GRMvZb078Uf9+pveax1DrVL89vm7mWe+TovdI/UDOuPw==}
+
boolbase@1.0.0:
resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
@@ -1842,6 +2069,10 @@ packages:
resolution: {integrity: sha512-fey6+4jDK7TFtFg/klGSvNKJctyU7n2aQdnM+CO0ruLPbqqMOM8Tio0Pc+deqUeVKX1tL5DQep1zQ7+37aTAsA==}
engines: {node: '>= 0.8'}
+ cac@6.7.14:
+ resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
+ engines: {node: '>=8'}
+
cacheable-lookup@5.0.4:
resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==}
engines: {node: '>=10.6.0'}
@@ -2082,6 +2313,15 @@ packages:
resolution: {integrity: sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA==}
engines: {node: '>=4'}
+ dts-resolver@2.1.3:
+ resolution: {integrity: sha512-bihc7jPC90VrosXNzK0LTE2cuLP6jr0Ro8jk+kMugHReJVLIpHz/xadeq3MhuwyO4TD4OA3L1Q8pBBFRc08Tsw==}
+ engines: {node: '>=20.19.0'}
+ peerDependencies:
+ oxc-resolver: '>=11.0.0'
+ peerDependenciesMeta:
+ oxc-resolver:
+ optional: true
+
ee-first@1.1.1:
resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
@@ -2091,6 +2331,10 @@ packages:
emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
+ empathic@2.0.0:
+ resolution: {integrity: sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==}
+ engines: {node: '>=14'}
+
encodeurl@2.0.0:
resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==}
engines: {node: '>= 0.8'}
@@ -2349,6 +2593,9 @@ packages:
resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==}
engines: {node: '>=8'}
+ get-tsconfig@4.13.7:
+ resolution: {integrity: sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q==}
+
get-tsconfig@4.7.5:
resolution: {integrity: sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==}
@@ -2453,6 +2700,9 @@ packages:
hastscript@9.0.0:
resolution: {integrity: sha512-jzaLBGavEDKHrc5EfFImKN7nZKKBdSLIdGvCwDZ9TfzbF2ffXiov8CKE445L2Z1Ek2t/m4SKQ2j6Ipv7NyUolw==}
+ hookable@5.5.3:
+ resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==}
+
html-escaper@2.0.2:
resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
@@ -2619,6 +2869,11 @@ packages:
resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==}
hasBin: true
+ jsesc@3.1.0:
+ resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==}
+ engines: {node: '>=6'}
+ hasBin: true
+
json-buffer@3.0.1:
resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
@@ -3265,6 +3520,11 @@ packages:
pseudomap@1.0.2:
resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==}
+ publint@0.3.18:
+ resolution: {integrity: sha512-JRJFeBTrfx4qLwEuGFPk+haJOJN97KnPuK01yj+4k/Wj5BgoOK5uNsivporiqBjk2JDaslg7qJOhGRnpltGeog==}
+ engines: {node: '>=18'}
+ hasBin: true
+
pump@3.0.0:
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
@@ -3272,6 +3532,9 @@ packages:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
+ quansync@1.0.0:
+ resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==}
+
queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
@@ -3415,6 +3678,35 @@ packages:
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
+ rolldown-plugin-dts@0.18.4:
+ resolution: {integrity: sha512-7UpdiICFd/BhdjKtDPeakCFRk6pbkTGFe0Z6u01egt4c8aoO+JoPGF1Smc+JRuCH2s5j5hBdteBi0e10G0xQdQ==}
+ engines: {node: '>=20.19.0'}
+ peerDependencies:
+ '@ts-macro/tsc': ^0.3.6
+ '@typescript/native-preview': '>=7.0.0-dev.20250601.1'
+ rolldown: ^1.0.0-beta.51
+ typescript: ^5.0.0
+ vue-tsc: ~3.1.0
+ peerDependenciesMeta:
+ '@ts-macro/tsc':
+ optional: true
+ '@typescript/native-preview':
+ optional: true
+ typescript:
+ optional: true
+ vue-tsc:
+ optional: true
+
+ rolldown@1.0.0-beta.52:
+ resolution: {integrity: sha512-Hbnpljue+JhMJrlOjQ1ixp9me7sUec7OjFvS+A1Qm8k8Xyxmw3ZhxFu7LlSXW1s9AX3POE9W9o2oqCEeR5uDmg==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ hasBin: true
+
+ rolldown@1.0.0-rc.12:
+ resolution: {integrity: sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ hasBin: true
+
rollup@4.53.3:
resolution: {integrity: sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@@ -3426,6 +3718,10 @@ packages:
s.color@0.0.15:
resolution: {integrity: sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==}
+ sade@1.8.1:
+ resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==}
+ engines: {node: '>=6'}
+
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
@@ -3656,6 +3952,10 @@ packages:
tr46@0.0.3:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
+ tree-kill@1.2.2:
+ resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
+ hasBin: true
+
trim-lines@3.0.1:
resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}
@@ -3678,6 +3978,31 @@ packages:
typescript:
optional: true
+ tsdown@0.16.8:
+ resolution: {integrity: sha512-6ANw9mgU9kk7SvTBKvpDu/DVJeAFECiLUSeL5M7f5Nm5H97E7ybxmXT4PQ23FySYn32y6OzjoAH/lsWCbGzfLA==}
+ engines: {node: '>=20.19.0'}
+ hasBin: true
+ peerDependencies:
+ '@arethetypeswrong/core': ^0.18.1
+ '@vitejs/devtools': ^0.0.0-alpha.18
+ publint: ^0.3.0
+ typescript: ^5.0.0
+ unplugin-lightningcss: ^0.4.0
+ unplugin-unused: ^0.5.0
+ peerDependenciesMeta:
+ '@arethetypeswrong/core':
+ optional: true
+ '@vitejs/devtools':
+ optional: true
+ publint:
+ optional: true
+ typescript:
+ optional: true
+ unplugin-lightningcss:
+ optional: true
+ unplugin-unused:
+ optional: true
+
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
@@ -3720,6 +4045,9 @@ packages:
ultramatter@0.0.4:
resolution: {integrity: sha512-1f/hO3mR+/Hgue4eInOF/Qm/wzDqwhYha4DxM0hre9YIUyso3fE2XtrAU6B4njLqTC8CM49EZaYgsVSa+dXHGw==}
+ unconfig-core@7.5.0:
+ resolution: {integrity: sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==}
+
uncrypto@0.1.3:
resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==}
@@ -3769,6 +4097,16 @@ packages:
resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==}
engines: {node: '>= 4.0.0'}
+ unrun@0.2.34:
+ resolution: {integrity: sha512-LyaghRBR++r7svhDK6tnDz2XaYHWdneBOA0jbS8wnRsHerI9MFljX4fIiTgbbNbEVzZ0C9P1OjWLLe1OqoaaEw==}
+ engines: {node: '>=20.19.0'}
+ hasBin: true
+ peerDependencies:
+ synckit: ^0.11.11
+ peerDependenciesMeta:
+ synckit:
+ optional: true
+
unstorage@1.17.4:
resolution: {integrity: sha512-fHK0yNg38tBiJKp/Vgsq4j0JEsCmgqH58HAn707S7zGkArbZsVr/CwINoi+nh3h98BRCwKvx1K3Xg9u3VV83sw==}
peerDependencies:
@@ -4355,6 +4693,14 @@ snapshots:
dependencies:
yaml: 2.7.1
+ '@babel/generator@7.29.1':
+ dependencies:
+ '@babel/parser': 7.29.0
+ '@babel/types': 7.29.0
+ '@jridgewell/gen-mapping': 0.3.13
+ '@jridgewell/trace-mapping': 0.3.31
+ jsesc: 3.1.0
+
'@babel/helper-string-parser@7.27.1': {}
'@babel/helper-validator-identifier@7.28.5': {}
@@ -4913,6 +5259,11 @@ snapshots:
'@img/sharp-win32-x64@0.34.2':
optional: true
+ '@jridgewell/gen-mapping@0.3.13':
+ dependencies:
+ '@jridgewell/sourcemap-codec': 1.5.5
+ '@jridgewell/trace-mapping': 0.3.31
+
'@jridgewell/gen-mapping@0.3.5':
dependencies:
'@jridgewell/set-array': 1.2.1
@@ -5009,6 +5360,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@napi-rs/wasm-runtime@1.1.2(@emnapi/runtime@1.4.3)':
+ dependencies:
+ '@emnapi/runtime': 1.4.3
+ '@tybys/wasm-util': 0.10.1
+ optional: true
+
'@nodelib/fs.scandir@2.1.5':
dependencies:
'@nodelib/fs.stat': 2.0.5
@@ -5023,6 +5380,10 @@ snapshots:
'@oslojs/encoding@1.1.0': {}
+ '@oxc-project/types@0.122.0': {}
+
+ '@oxc-project/types@0.99.0': {}
+
'@pagefind/darwin-arm64@1.3.0':
optional: true
@@ -5044,6 +5405,113 @@ snapshots:
dependencies:
playwright: 1.57.0
+ '@publint/pack@0.1.4': {}
+
+ '@quansync/fs@1.0.0':
+ dependencies:
+ quansync: 1.0.0
+
+ '@rolldown/binding-android-arm64@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-android-arm64@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-darwin-arm64@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-darwin-arm64@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-darwin-x64@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-darwin-x64@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-freebsd-x64@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-freebsd-x64@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-linux-arm64-musl@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-linux-arm64-musl@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-linux-x64-gnu@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-linux-x64-gnu@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-linux-x64-musl@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-linux-x64-musl@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-openharmony-arm64@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-openharmony-arm64@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-wasm32-wasi@1.0.0-beta.52(@emnapi/runtime@1.4.3)':
+ dependencies:
+ '@napi-rs/wasm-runtime': 1.1.2(@emnapi/runtime@1.4.3)
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+ optional: true
+
+ '@rolldown/binding-wasm32-wasi@1.0.0-rc.12(@emnapi/runtime@1.4.3)':
+ dependencies:
+ '@napi-rs/wasm-runtime': 1.1.2(@emnapi/runtime@1.4.3)
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+ optional: true
+
+ '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-win32-x64-msvc@1.0.0-beta.52':
+ optional: true
+
+ '@rolldown/binding-win32-x64-msvc@1.0.0-rc.12':
+ optional: true
+
+ '@rolldown/pluginutils@1.0.0-beta.52': {}
+
+ '@rolldown/pluginutils@1.0.0-rc.12': {}
+
'@rollup/pluginutils@5.3.0(rollup@4.53.3)':
dependencies:
'@types/estree': 1.0.8
@@ -5269,6 +5737,11 @@ snapshots:
tailwindcss: 4.1.18
vite: 7.3.1(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.30.2)(tsx@4.15.2)(yaml@2.7.1)
+ '@tybys/wasm-util@0.10.1':
+ dependencies:
+ tslib: 2.8.1
+ optional: true
+
'@types/acorn@4.0.6':
dependencies:
'@types/estree': 1.0.8
@@ -5626,6 +6099,8 @@ snapshots:
dependencies:
color-convert: 2.0.1
+ ansis@4.2.0: {}
+
anymatch@3.1.3:
dependencies:
normalize-path: 3.0.0
@@ -5647,6 +6122,11 @@ snapshots:
assertion-error@2.0.1: {}
+ ast-kit@2.2.0:
+ dependencies:
+ '@babel/parser': 7.29.0
+ pathe: 2.0.3
+
ast-v8-to-istanbul@1.0.0:
dependencies:
'@jridgewell/trace-mapping': 0.3.31
@@ -5882,6 +6362,8 @@ snapshots:
dependencies:
is-windows: 1.0.2
+ birpc@4.0.0: {}
+
boolbase@1.0.0: {}
brace-expansion@1.1.12:
@@ -5899,6 +6381,8 @@ snapshots:
bytes-iec@3.1.1: {}
+ cac@6.7.14: {}
+
cacheable-lookup@5.0.4: {}
cacheable-request@7.0.4:
@@ -6104,6 +6588,8 @@ snapshots:
dset@3.1.4: {}
+ dts-resolver@2.1.3: {}
+
ee-first@1.1.1: {}
emmet@2.4.7:
@@ -6113,6 +6599,8 @@ snapshots:
emoji-regex@8.0.0: {}
+ empathic@2.0.0: {}
+
encodeurl@2.0.0: {}
end-of-stream@1.4.4:
@@ -6433,6 +6921,10 @@ snapshots:
dependencies:
pump: 3.0.0
+ get-tsconfig@4.13.7:
+ dependencies:
+ resolve-pkg-maps: 1.0.0
+
get-tsconfig@4.7.5:
dependencies:
resolve-pkg-maps: 1.0.0
@@ -6674,6 +7166,8 @@ snapshots:
property-information: 6.2.0
space-separated-tokens: 2.0.2
+ hookable@5.5.3: {}
+
html-escaper@2.0.2: {}
html-escaper@3.0.3: {}
@@ -6815,6 +7309,8 @@ snapshots:
dependencies:
argparse: 2.0.1
+ jsesc@3.1.0: {}
+
json-buffer@3.0.1: {}
json-schema-traverse@0.4.1: {}
@@ -7693,6 +8189,13 @@ snapshots:
pseudomap@1.0.2: {}
+ publint@0.3.18:
+ dependencies:
+ '@publint/pack': 0.1.4
+ package-manager-detector: 1.6.0
+ picocolors: 1.1.1
+ sade: 1.8.1
+
pump@3.0.0:
dependencies:
end-of-stream: 1.4.4
@@ -7700,6 +8203,8 @@ snapshots:
punycode@2.3.1: {}
+ quansync@1.0.0: {}
+
queue-microtask@1.2.3: {}
quick-lru@5.1.1: {}
@@ -7921,6 +8426,70 @@ snapshots:
reusify@1.0.4: {}
+ rolldown-plugin-dts@0.18.4(rolldown@1.0.0-beta.52(@emnapi/runtime@1.4.3))(typescript@5.6.3):
+ dependencies:
+ '@babel/generator': 7.29.1
+ '@babel/parser': 7.29.0
+ '@babel/types': 7.29.0
+ ast-kit: 2.2.0
+ birpc: 4.0.0
+ dts-resolver: 2.1.3
+ get-tsconfig: 4.13.7
+ magic-string: 0.30.21
+ obug: 2.1.1
+ rolldown: 1.0.0-beta.52(@emnapi/runtime@1.4.3)
+ optionalDependencies:
+ typescript: 5.6.3
+ transitivePeerDependencies:
+ - oxc-resolver
+
+ rolldown@1.0.0-beta.52(@emnapi/runtime@1.4.3):
+ dependencies:
+ '@oxc-project/types': 0.99.0
+ '@rolldown/pluginutils': 1.0.0-beta.52
+ optionalDependencies:
+ '@rolldown/binding-android-arm64': 1.0.0-beta.52
+ '@rolldown/binding-darwin-arm64': 1.0.0-beta.52
+ '@rolldown/binding-darwin-x64': 1.0.0-beta.52
+ '@rolldown/binding-freebsd-x64': 1.0.0-beta.52
+ '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.52
+ '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.52
+ '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.52
+ '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.52
+ '@rolldown/binding-linux-x64-musl': 1.0.0-beta.52
+ '@rolldown/binding-openharmony-arm64': 1.0.0-beta.52
+ '@rolldown/binding-wasm32-wasi': 1.0.0-beta.52(@emnapi/runtime@1.4.3)
+ '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.52
+ '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.52
+ '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.52
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+
+ rolldown@1.0.0-rc.12(@emnapi/runtime@1.4.3):
+ dependencies:
+ '@oxc-project/types': 0.122.0
+ '@rolldown/pluginutils': 1.0.0-rc.12
+ optionalDependencies:
+ '@rolldown/binding-android-arm64': 1.0.0-rc.12
+ '@rolldown/binding-darwin-arm64': 1.0.0-rc.12
+ '@rolldown/binding-darwin-x64': 1.0.0-rc.12
+ '@rolldown/binding-freebsd-x64': 1.0.0-rc.12
+ '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.12
+ '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.12
+ '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.12
+ '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.12
+ '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.12
+ '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.12
+ '@rolldown/binding-linux-x64-musl': 1.0.0-rc.12
+ '@rolldown/binding-openharmony-arm64': 1.0.0-rc.12
+ '@rolldown/binding-wasm32-wasi': 1.0.0-rc.12(@emnapi/runtime@1.4.3)
+ '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.12
+ '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.12
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+
rollup@4.53.3:
dependencies:
'@types/estree': 1.0.8
@@ -7955,6 +8524,10 @@ snapshots:
s.color@0.0.15: {}
+ sade@1.8.1:
+ dependencies:
+ mri: 1.2.0
+
safer-buffer@2.1.2: {}
sass-formatter@0.7.6:
@@ -8226,6 +8799,8 @@ snapshots:
tr46@0.0.3: {}
+ tree-kill@1.2.2: {}
+
trim-lines@3.0.1: {}
trough@2.1.0: {}
@@ -8238,6 +8813,35 @@ snapshots:
optionalDependencies:
typescript: 5.6.3
+ tsdown@0.16.8(@emnapi/runtime@1.4.3)(publint@0.3.18)(typescript@5.6.3):
+ dependencies:
+ ansis: 4.2.0
+ cac: 6.7.14
+ chokidar: 5.0.0
+ diff: 8.0.3
+ empathic: 2.0.0
+ hookable: 5.5.3
+ obug: 2.1.1
+ rolldown: 1.0.0-beta.52(@emnapi/runtime@1.4.3)
+ rolldown-plugin-dts: 0.18.4(rolldown@1.0.0-beta.52(@emnapi/runtime@1.4.3))(typescript@5.6.3)
+ semver: 7.7.4
+ tinyexec: 1.0.2
+ tinyglobby: 0.2.15
+ tree-kill: 1.2.2
+ unconfig-core: 7.5.0
+ unrun: 0.2.34(@emnapi/runtime@1.4.3)
+ optionalDependencies:
+ publint: 0.3.18
+ typescript: 5.6.3
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+ - '@ts-macro/tsc'
+ - '@typescript/native-preview'
+ - oxc-resolver
+ - synckit
+ - vue-tsc
+
tslib@2.8.1:
optional: true
@@ -8279,6 +8883,11 @@ snapshots:
ultramatter@0.0.4: {}
+ unconfig-core@7.5.0:
+ dependencies:
+ '@quansync/fs': 1.0.0
+ quansync: 1.0.0
+
uncrypto@0.1.3: {}
undici-types@6.21.0: {}
@@ -8349,6 +8958,13 @@ snapshots:
universalify@0.1.2: {}
+ unrun@0.2.34(@emnapi/runtime@1.4.3):
+ dependencies:
+ rolldown: 1.0.0-rc.12(@emnapi/runtime@1.4.3)
+ transitivePeerDependencies:
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+
unstorage@1.17.4:
dependencies:
anymatch: 3.1.3