blume 0.6.7 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/CHANGELOG.md +618 -0
  2. package/LICENSE +21 -0
  3. package/README.md +107 -0
  4. package/dist/cli/index.js +2609 -1041
  5. package/dist/cli/index.js.map +110 -103
  6. package/dist/types/ai/component-markdown.d.ts +34 -0
  7. package/dist/types/components/content/youtube.d.ts +18 -0
  8. package/dist/types/core/base-path.d.ts +47 -0
  9. package/dist/types/core/config-input.d.ts +110 -12
  10. package/dist/types/core/config.d.ts +6 -4
  11. package/dist/types/core/data.d.ts +4 -0
  12. package/dist/types/core/i18n-ui.d.ts +477 -135
  13. package/dist/types/core/schema.d.ts +309 -195
  14. package/dist/types/core/sources/types.d.ts +2 -0
  15. package/dist/types/core/types.d.ts +6 -1
  16. package/dist/types/index.d.ts +1 -0
  17. package/dist/types/openapi/references.d.ts +60 -0
  18. package/docs/01-quickstart.mdx +5 -2
  19. package/docs/02-deployment.mdx +24 -9
  20. package/docs/03-faq.mdx +46 -16
  21. package/docs/advanced/custom-pages.mdx +1 -1
  22. package/docs/advanced/skills.mdx +1 -1
  23. package/docs/configuration/ai.mdx +49 -10
  24. package/docs/configuration/customization.mdx +11 -0
  25. package/docs/configuration/index.mdx +33 -3
  26. package/docs/configuration/seo.mdx +2 -2
  27. package/docs/content/components.mdx +30 -3
  28. package/docs/content/i18n.mdx +1 -1
  29. package/docs/content/islands.mdx +8 -0
  30. package/docs/content/navigation.mdx +3 -3
  31. package/docs/content/sources.mdx +1 -1
  32. package/docs/content/syntax.mdx +17 -2
  33. package/docs/index.mdx +2 -2
  34. package/docs/reference/cli.mdx +8 -6
  35. package/package.json +15 -4
  36. package/skills/blume/SKILL.md +5 -3
  37. package/skills/blume-update-docs/SKILL.md +3 -2
  38. package/src/ai/agent-readability.ts +11 -5
  39. package/src/ai/ask-context.ts +7 -2
  40. package/src/ai/ask-data.ts +3 -0
  41. package/src/ai/ask.ts +12 -7
  42. package/src/ai/component-markdown.ts +461 -0
  43. package/src/ai/llms.ts +143 -23
  44. package/src/ai/markdown.ts +35 -6
  45. package/src/ai/mcp/data.ts +33 -8
  46. package/src/ai/mcp/discovery.ts +10 -3
  47. package/src/ai/mcp/server.ts +24 -7
  48. package/src/ai/visibility.ts +74 -0
  49. package/src/astro/component-slots.ts +16 -4
  50. package/src/astro/examples.ts +12 -7
  51. package/src/astro/generate.ts +393 -189
  52. package/src/astro/index.ts +5 -1
  53. package/src/astro/integration.ts +9 -5
  54. package/src/astro/islands.ts +11 -5
  55. package/src/astro/markdown-negotiation.ts +2 -2
  56. package/src/astro/pages.ts +89 -22
  57. package/src/astro/templates.ts +259 -25
  58. package/src/blume-modules.d.ts +8 -0
  59. package/src/cli/commands/build.ts +131 -38
  60. package/src/cli/commands/check.ts +1 -1
  61. package/src/cli/commands/dev.ts +71 -17
  62. package/src/cli/commands/doctor.ts +2 -2
  63. package/src/cli/commands/eject.ts +47 -19
  64. package/src/cli/commands/init.ts +120 -180
  65. package/src/cli/commands/preview.ts +4 -1
  66. package/src/cli/commands/validate.ts +44 -2
  67. package/src/cli/dev-lock.ts +34 -19
  68. package/src/cli/eject-scripts.ts +72 -0
  69. package/src/cli/env.ts +15 -5
  70. package/src/cli/init/questions.ts +158 -0
  71. package/src/cli/init/scaffold.ts +380 -0
  72. package/src/cli/required-secrets.ts +2 -1
  73. package/src/components/content/AccordionItem.astro +23 -4
  74. package/src/components/content/Badge.astro +3 -1
  75. package/src/components/content/Card.astro +4 -2
  76. package/src/components/content/CodeBlock.astro +3 -0
  77. package/src/components/content/Component.astro +30 -16
  78. package/src/components/content/Diff.astro +3 -1
  79. package/src/components/content/Step.astro +10 -1
  80. package/src/components/content/Tabs.astro +15 -3
  81. package/src/components/content/Tile.astro +2 -1
  82. package/src/components/content/Tooltip.astro +3 -1
  83. package/src/components/content/Update.astro +9 -2
  84. package/src/components/content/auto-type-table.ts +25 -9
  85. package/src/components/content/base-href.ts +33 -0
  86. package/src/components/content/changelog-element.ts +9 -2
  87. package/src/components/content/diff.ts +12 -6
  88. package/src/components/content/mermaid-element.ts +10 -2
  89. package/src/components/index.ts +23 -1
  90. package/src/components/islands/AskAI.astro +5 -2
  91. package/src/components/islands/ask-ai.tsx +68 -12
  92. package/src/components/islands/base-path.ts +28 -0
  93. package/src/components/islands/hooks.ts +44 -9
  94. package/src/components/layout/Banner.astro +12 -3
  95. package/src/components/layout/Breadcrumbs.astro +2 -1
  96. package/src/components/layout/Favicon.astro +3 -2
  97. package/src/components/layout/Header.astro +15 -5
  98. package/src/components/layout/LanguageSwitcher.astro +2 -1
  99. package/src/components/layout/Logo.astro +13 -4
  100. package/src/components/layout/NavSelector.astro +2 -1
  101. package/src/components/layout/NavTree.astro +22 -7
  102. package/src/components/layout/PageActions.astro +25 -10
  103. package/src/components/layout/PageFeedback.astro +4 -1
  104. package/src/components/layout/PageLayout.astro +51 -9
  105. package/src/components/layout/Pagination.astro +3 -2
  106. package/src/components/layout/ReferenceLayout.astro +8 -1
  107. package/src/components/layout/RootLayout.astro +74 -13
  108. package/src/components/layout/Search.astro +107 -27
  109. package/src/components/layout/nav-utils.ts +18 -10
  110. package/src/components/layout/search/algolia.ts +11 -2
  111. package/src/components/layout/search/endpoint.ts +11 -5
  112. package/src/components/layout/search/orama-cloud.ts +8 -2
  113. package/src/components/layout/search/pagefind.ts +3 -0
  114. package/src/components/layout/search/types.ts +5 -1
  115. package/src/components/layout/search/typesense.ts +4 -1
  116. package/src/components/layout/toc-element.ts +8 -2
  117. package/src/components/openapi/ApiTagOperations.astro +2 -1
  118. package/src/components/openapi/Operation.astro +47 -40
  119. package/src/components/openapi/RequestPanel.astro +8 -2
  120. package/src/components/openapi/helpers.ts +71 -3
  121. package/src/components/openapi/panel.ts +1 -1
  122. package/src/components/openapi/snippets.ts +25 -11
  123. package/src/core/base-path.ts +94 -0
  124. package/src/core/builtin-tags.ts +2 -0
  125. package/src/core/component-overrides.ts +103 -74
  126. package/src/core/config-input.ts +118 -17
  127. package/src/core/config.ts +8 -5
  128. package/src/core/content.ts +2 -0
  129. package/src/core/data.ts +4 -0
  130. package/src/core/diagnostics.ts +54 -34
  131. package/src/core/gitignore.ts +4 -1
  132. package/src/core/graph.ts +166 -88
  133. package/src/core/i18n-ui.ts +63 -3
  134. package/src/core/last-modified.ts +15 -6
  135. package/src/core/links.ts +69 -25
  136. package/src/core/manifest.ts +62 -45
  137. package/src/core/nav-diagnostics.ts +1 -1
  138. package/src/core/navigation.ts +144 -58
  139. package/src/core/package-json.ts +17 -2
  140. package/src/core/project-graph.ts +25 -15
  141. package/src/core/schema.ts +605 -620
  142. package/src/core/sources/assets.ts +6 -1
  143. package/src/core/sources/filesystem.ts +4 -0
  144. package/src/core/sources/github-releases.ts +2 -1
  145. package/src/core/sources/mdx-remote.ts +76 -63
  146. package/src/core/sources/normalize.ts +236 -91
  147. package/src/core/sources/notion.ts +27 -18
  148. package/src/core/sources/types.ts +2 -0
  149. package/src/core/tsconfig-aliases.ts +59 -30
  150. package/src/core/types.ts +6 -1
  151. package/src/core/ui-packs/ar.ts +1 -0
  152. package/src/core/ui-packs/bg.ts +1 -0
  153. package/src/core/ui-packs/bn.ts +1 -0
  154. package/src/core/ui-packs/ca.ts +1 -0
  155. package/src/core/ui-packs/cs.ts +1 -0
  156. package/src/core/ui-packs/da.ts +1 -0
  157. package/src/core/ui-packs/de.ts +1 -0
  158. package/src/core/ui-packs/el.ts +1 -0
  159. package/src/core/ui-packs/es.ts +1 -0
  160. package/src/core/ui-packs/fa.ts +1 -0
  161. package/src/core/ui-packs/fi.ts +1 -0
  162. package/src/core/ui-packs/fr.ts +2 -1
  163. package/src/core/ui-packs/he.ts +1 -0
  164. package/src/core/ui-packs/hi.ts +1 -0
  165. package/src/core/ui-packs/hr.ts +1 -0
  166. package/src/core/ui-packs/hu.ts +1 -0
  167. package/src/core/ui-packs/id.ts +1 -0
  168. package/src/core/ui-packs/it.ts +1 -0
  169. package/src/core/ui-packs/ja.ts +1 -0
  170. package/src/core/ui-packs/ko.ts +1 -0
  171. package/src/core/ui-packs/nl.ts +1 -0
  172. package/src/core/ui-packs/no.ts +1 -0
  173. package/src/core/ui-packs/pl.ts +1 -0
  174. package/src/core/ui-packs/pt-br.ts +1 -0
  175. package/src/core/ui-packs/pt.ts +1 -0
  176. package/src/core/ui-packs/ro.ts +1 -0
  177. package/src/core/ui-packs/ru.ts +1 -0
  178. package/src/core/ui-packs/sk.ts +1 -0
  179. package/src/core/ui-packs/sr.ts +1 -0
  180. package/src/core/ui-packs/sv.ts +1 -0
  181. package/src/core/ui-packs/th.ts +1 -0
  182. package/src/core/ui-packs/tr.ts +1 -0
  183. package/src/core/ui-packs/uk.ts +1 -0
  184. package/src/core/ui-packs/vi.ts +1 -0
  185. package/src/core/ui-packs/zh-tw.ts +1 -0
  186. package/src/core/ui-packs/zh.ts +1 -0
  187. package/src/deploy/adapter-output.ts +18 -8
  188. package/src/deploy/redirects.ts +25 -2
  189. package/src/deploy/robots.ts +6 -1
  190. package/src/deploy/rss.ts +10 -3
  191. package/src/deploy/sitemap.ts +59 -13
  192. package/src/index.ts +5 -0
  193. package/src/markdown/base-links.ts +60 -0
  194. package/src/markdown/code-title.ts +11 -14
  195. package/src/markdown/index.ts +46 -9
  196. package/src/markdown/inline-code.ts +14 -4
  197. package/src/markdown/package-commands.ts +10 -4
  198. package/src/markdown/themes.ts +24 -0
  199. package/src/openapi/model.ts +15 -5
  200. package/src/openapi/parse.ts +21 -0
  201. package/src/openapi/references.ts +75 -21
  202. package/src/openapi/render-mdx.ts +11 -6
  203. package/src/openapi/scalar.ts +32 -16
  204. package/src/openapi/source.ts +59 -10
  205. package/src/registry/eject.ts +247 -19
  206. package/src/registry/registry.ts +0 -3
  207. package/src/search/build.ts +3 -0
  208. package/src/search/documents.ts +36 -4
  209. package/src/search/sync/typesense.ts +6 -4
  210. package/src/seo/jsonld.ts +28 -17
  211. package/src/theme/entry.ts +85 -20
@@ -0,0 +1,34 @@
1
+ /** Evaluated props plus whether any attribute resisted static evaluation. */
2
+ interface EvaluatedProps {
3
+ lossy: boolean;
4
+ props: Record<string, unknown>;
5
+ }
6
+ /** A child component extracted by name (e.g. each `<Step>` under `<Steps>`). */
7
+ export interface ComponentMarkdownChild extends EvaluatedProps {
8
+ /** The child's body, downleveled and dedented. */
9
+ children: string;
10
+ }
11
+ /** What a serializer receives for one component usage. */
12
+ export interface ComponentMarkdownContext extends EvaluatedProps {
13
+ /** Direct child components of `name`, each with evaluated props and body. */
14
+ childComponents: (name: string) => ComponentMarkdownChild[];
15
+ /** The element's body, downleveled and dedented (empty if self-closing). */
16
+ children: string;
17
+ }
18
+ /**
19
+ * A component's Markdown serializer. Return the replacement Markdown, or
20
+ * `null` to leave the component's JSX in the output verbatim (the safe
21
+ * fallback when the props can't be recovered statically).
22
+ */
23
+ export type ComponentMarkdown = (context: ComponentMarkdownContext) => string | null;
24
+ /**
25
+ * Downlevel supported components in an MDX source to plain Markdown. Sources
26
+ * with no supported components — and sources Satteri can't parse as MDX, e.g.
27
+ * plain `.md` with literal `<`/`{` — are returned byte-identical.
28
+ *
29
+ * `components` adds user serializers from `ai.markdownComponents`, layered
30
+ * over the built-ins: a same-name entry replaces the built-in serializer, and
31
+ * one that always returns `null` effectively opts that component out.
32
+ */
33
+ export declare const downlevelComponents: (source: string, components?: Record<string, ComponentMarkdown>) => string;
34
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Helpers for the `<YouTube>` content component. Kept in a sibling `.ts` (like
3
+ * `diff.ts`/`github-info.ts`) so the id parsing and embed-URL building are pure,
4
+ * unit-testable functions — the `.astro` file stays a thin presentational shell.
5
+ */
6
+ /**
7
+ * Resolve a YouTube video id from either a bare id or a full URL. Returns `null`
8
+ * when nothing that looks like an id can be found, so the component can render
9
+ * nothing rather than a broken embed.
10
+ */
11
+ export declare const parseYouTubeId: (input: string) => string | null;
12
+ /**
13
+ * Build a privacy-enhanced (`youtube-nocookie.com`) embed URL, optionally
14
+ * starting at `start` seconds.
15
+ */
16
+ export declare const youtubeEmbedUrl: (id: string, options?: {
17
+ start?: number;
18
+ }) => string;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The site-wide `basePath` — a mount point that prepends a segment to every
3
+ * generated route (`/docs/getting-started`) while staying invisible to the
4
+ * navigation tree (see `core/navigation.ts`, which builds groups from a page's
5
+ * base-less `navPath` and takes URLs from its based `route`). This is distinct
6
+ * from a per-source `prefix` (a namespace that *does* create a sidebar group)
7
+ * and from `deployment.base` (Astro's host-subdirectory base); the two compose,
8
+ * stacking as `{deployment.base}/{basePath}/page`.
9
+ *
10
+ * These helpers run server-side (config, route construction, the link checker,
11
+ * redirects, the markdown link plugin). The client-side counterpart lives in
12
+ * `components/islands/base-path.ts` and serves `deployment.base` via `BASE_URL`.
13
+ */
14
+ /**
15
+ * Canonicalize a configured base path to either `""` (none) or `/seg[/seg…]`
16
+ * (leading slash, no trailing slash, collapsed inner slashes). A blank value or
17
+ * bare `/` normalizes to `""`, so an unset/`"/"` base is a clean no-op.
18
+ */
19
+ export declare const normalizeBasePath: (input?: string) => string;
20
+ /**
21
+ * Whether a link target is a root-relative internal path (`/x`) — the only
22
+ * shape a base path applies to. Protocol-relative (`//host`), absolute URLs,
23
+ * other schemes (`mailto:`), fragments (`#x`), and relative paths are excluded.
24
+ */
25
+ export declare const isInternalPath: (target: string) => boolean;
26
+ /**
27
+ * Idempotently prepend `basePath` to a root-relative route. A route already
28
+ * equal to or nested under the base is returned unchanged, so authors who write
29
+ * the base by hand (`/docs/x`) aren't double-prefixed to `/docs/docs/x`.
30
+ */
31
+ export declare const withBasePath: (basePath: string, route: string) => string;
32
+ /**
33
+ * {@link withBasePath} for the composed `deployment.base` + `basePath` stack
34
+ * (`/base` + `/docs` serves pages at `/base/docs/x`). The hand-written-base
35
+ * promise applies per layer: authors write `basePath` by hand (see
36
+ * `markdown/base-links.ts`), so a `/docs/x` link gains only the deployment base
37
+ * (`/base/docs/x`) rather than being double-prefixed to `/base/docs/docs/x`,
38
+ * and a route already under the full composite is returned unchanged.
39
+ */
40
+ export declare const withComposedBasePath: (deployBase: string, basePath: string, route: string) => string;
41
+ /**
42
+ * Remove `basePath` from the front of a route (`/docs/guide` -> `/guide`,
43
+ * `/docs` -> `/`). A route not under the base is returned unchanged. Inverse of
44
+ * {@link withBasePath}; used to resolve public assets, which live at the site
45
+ * root regardless of the base.
46
+ */
47
+ export declare const stripBasePath: (basePath: string, route: string) => string;
@@ -1,3 +1,4 @@
1
+ import type { ComponentMarkdown } from "../ai/component-markdown.ts";
1
2
  import type { FontSlug } from "../theme/fonts.ts";
2
3
  import type { OpenApiSource, SearchProvider, SidebarDisplay, SidebarItemConfig } from "./schema.ts";
3
4
  import type { ContentSource } from "./sources/types.ts";
@@ -264,11 +265,15 @@ export interface NavSelectorItem {
264
265
  * A header dropdown for switching context — versions, languages, products, or a
265
266
  * generic dropdown. `kind` drives the icon and a11y labeling.
266
267
  */
268
+ /** Context-partition selector kinds (a versioned/localized/multi-product site). */
269
+ type NavSelectorContextKind = "product" | "version";
270
+ /** What a header selector switches between. */
271
+ type NavSelectorKind = "dropdown" | "language" | NavSelectorContextKind;
267
272
  export interface NavSelector {
268
273
  /** The options shown in the dropdown. */
269
274
  items?: NavSelectorItem[];
270
275
  /** What the selector switches between. */
271
- kind: "dropdown" | "language" | "product" | "version";
276
+ kind: NavSelectorKind;
272
277
  /** Selector label / current value. */
273
278
  label: string;
274
279
  }
@@ -323,6 +328,10 @@ export interface FontsConfig {
323
328
  mono?: LiteralUnion<FontSlug>;
324
329
  }
325
330
  /** Colors, fonts, radius, and color-mode behavior. */
331
+ /** Corner radius scale (`none`/`sm` tighter, `md`/`lg` rounder). */
332
+ type RadiusScaleTight = "none" | "sm";
333
+ type RadiusScaleRound = "md" | "lg";
334
+ type RadiusScale = RadiusScaleTight | RadiusScaleRound;
326
335
  export interface ThemeConfig {
327
336
  /**
328
337
  * Accent color. A palette name (`blue`, `violet`, `green`, …) or any CSS
@@ -346,7 +355,7 @@ export interface ThemeConfig {
346
355
  /** Initial color mode. Defaults to `system`. */
347
356
  mode?: "system" | "light" | "dark";
348
357
  /** Corner radius scale. Defaults to `md`. */
349
- radius?: "none" | "sm" | "md" | "lg";
358
+ radius?: RadiusScale;
350
359
  }
351
360
  /** Public credentials for the Algolia backend (the sync key stays an env var). */
352
361
  export interface AlgoliaSearch {
@@ -403,6 +412,9 @@ export interface AskSuggestion {
403
412
  label: string;
404
413
  }
405
414
  /** The Ask AI chat assistant. */
415
+ /** Backends that can route an Ask AI request. */
416
+ type AskProviderGateway = "gateway" | "openrouter" | "llmgateway";
417
+ type AskProvider = AskProviderGateway | "inkeep" | "openai-compatible";
406
418
  export interface AskConfig {
407
419
  /**
408
420
  * Name of the env var holding the provider API key. Each provider has a
@@ -419,16 +431,49 @@ export interface AskConfig {
419
431
  /** Model id to use. Defaults to `openai/gpt-5.5`. */
420
432
  model?: string;
421
433
  /** Which backend routes the request. Defaults to `gateway`. */
422
- provider?: "gateway" | "openrouter" | "llmgateway" | "inkeep" | "openai-compatible";
434
+ provider?: AskProvider;
423
435
  /** Starter prompts shown before the first question. */
424
436
  suggestions?: AskSuggestion[];
425
437
  }
438
+ /** What the `llms.txt`/`llms-full.txt` files include. */
439
+ export interface LlmsTxtConfig {
440
+ /** Emit `llms.txt` and `llms-full.txt`. Defaults to `true`. */
441
+ enabled?: boolean;
442
+ /**
443
+ * Include the generated API reference pages (OpenAPI/AsyncAPI). Defaults to
444
+ * `true`; set `false` to keep a placeholder or example spec's pages out of
445
+ * the LLM-facing files.
446
+ */
447
+ openapi?: boolean;
448
+ }
426
449
  /** AI-facing features: the Ask AI assistant and an `llms.txt` manifest. */
427
450
  export interface AiConfig {
428
451
  /** The Ask AI chat assistant. */
429
452
  ask?: AskConfig;
430
- /** Emit `llms.txt` (an index of the docs for LLMs). Defaults to `true`. */
431
- llmsTxt?: boolean;
453
+ /**
454
+ * Emit `llms.txt` (an index of the docs for LLMs). Defaults to `true`.
455
+ * The object form adds knobs for what the files include.
456
+ */
457
+ llmsTxt?: boolean | LlmsTxtConfig;
458
+ /**
459
+ * Markdown serializers for custom components in agent-facing output (the
460
+ * `.md` mirror, `llms-full.txt`, MCP `get_page`), keyed by JSX name. Each
461
+ * receives the component's statically-evaluated `props` and downleveled
462
+ * `children` and returns replacement Markdown — or `null` to leave the JSX
463
+ * verbatim. A same-name entry replaces a built-in serializer.
464
+ *
465
+ * These live in `blume.config.ts` (which is executed at build time), not in
466
+ * `components.tsx` (which is only statically analyzed, never run).
467
+ *
468
+ * ```ts
469
+ * ai: {
470
+ * markdownComponents: {
471
+ * Chart: ({ props }) => `![${props.title}](/charts/${props.slug}.png)`,
472
+ * },
473
+ * }
474
+ * ```
475
+ */
476
+ markdownComponents?: Record<string, ComponentMarkdown>;
432
477
  }
433
478
  /** An arbitrary analytics `<script>`; set exactly one of `src` or `content`. */
434
479
  export interface AnalyticsScript {
@@ -501,9 +546,12 @@ export interface I18nConfig {
501
546
  * Where and how the site deploys. `site` (and `adapter`) are auto-detected from
502
547
  * the platform env on Vercel, Netlify, and Cloudflare.
503
548
  */
549
+ /** Astro server-output adapters, by hosting platform. */
550
+ type CloudDeploymentAdapter = "netlify" | "cloudflare";
551
+ type DeploymentAdapter = "vercel" | "node" | CloudDeploymentAdapter;
504
552
  export interface DeploymentConfig {
505
553
  /** Astro adapter for server output. `null` (default) keeps a static build. */
506
- adapter?: "vercel" | "node" | "netlify" | "cloudflare" | null;
554
+ adapter?: DeploymentAdapter | null;
507
555
  /** Base path when the site is served from a subdirectory. */
508
556
  base?: string;
509
557
  /** Build output mode. Defaults to `static`. */
@@ -514,12 +562,16 @@ export interface DeploymentConfig {
514
562
  */
515
563
  site?: string;
516
564
  }
565
+ /** HTTP redirect status codes: permanent (301/308) and temporary (302/307). */
566
+ type RedirectStatusPermanent = 301 | 308;
567
+ type RedirectStatusTemporary = 302 | 307;
568
+ type RedirectStatus = RedirectStatusPermanent | RedirectStatusTemporary;
517
569
  /** A URL redirect rule. */
518
570
  export interface RedirectConfig {
519
571
  /** Path to redirect from. */
520
572
  from: string;
521
573
  /** HTTP status. Defaults to `301`. */
522
- status?: 301 | 302 | 307 | 308;
574
+ status?: RedirectStatus;
523
575
  /** Path or URL to redirect to. */
524
576
  to: string;
525
577
  }
@@ -594,7 +646,10 @@ export interface CodeConfig {
594
646
  export interface MarkdownConfig {
595
647
  /** Code-block rendering: language icons, line wrap. */
596
648
  code?: CodeConfig;
597
- /** Syntax-highlighting themes for fenced code blocks. */
649
+ /**
650
+ * Syntax-highlighting themes for every code surface — fenced blocks, inline
651
+ * `` `code`{:lang} ``, `<CodeBlock>`, and `<Diff>`.
652
+ */
598
653
  codeBlocks?: {
599
654
  /** Shiki theme names per color mode. */
600
655
  theme?: {
@@ -612,6 +667,15 @@ export interface MarkdownConfig {
612
667
  /** Make content images click-to-zoom (lightbox). Defaults to `true`. */
613
668
  imageZoom?: boolean;
614
669
  }
670
+ /** React island behavior. */
671
+ export interface ReactConfig {
672
+ /**
673
+ * Auto-memoize React components/hooks with the React Compiler
674
+ * (`babel-plugin-react-compiler`). On by default whenever React is enabled;
675
+ * set to `false` to skip the compiler's babel pass. Defaults to `true`.
676
+ */
677
+ compiler?: boolean;
678
+ }
615
679
  /**
616
680
  * OpenAPI reference. By default (`renderer: "blume"`) Blume renders its own UI:
617
681
  * one real page per operation, grouped by tag in the sidebar and included in
@@ -653,6 +717,24 @@ export interface AsyncApiConfig {
653
717
  /** Scalar theme name. */
654
718
  theme?: string;
655
719
  }
720
+ /** `<Component />` example previews (the object form of `examples`). */
721
+ export interface ExamplesConfig {
722
+ /**
723
+ * A stylesheet, relative to the project root, injected into every preview
724
+ * frame after Blume's default tokens. Previews render inside an isolated
725
+ * iframe the docs styles never reach, so design tokens for the previewed
726
+ * components — shadcn variables, `@theme` mappings, custom fonts — live
727
+ * here. Tailwind is already provided in the frame; the file should hold
728
+ * tokens and styles, not another `@import "tailwindcss"`.
729
+ */
730
+ css?: string;
731
+ /**
732
+ * Where example files live, relative to the project root. Defaults to
733
+ * `examples`; may be a glob to target a registry that colocates component
734
+ * sources with their examples (e.g. `registry/<pkg>/**\/examples/*`).
735
+ */
736
+ source?: string;
737
+ }
656
738
  /**
657
739
  * Reader-facing "Export" page actions. A boolean toggles both formats; the
658
740
  * object form enables each individually. Defaults to `false`.
@@ -696,6 +778,16 @@ export interface BlumeConfig {
696
778
  asyncapi?: AsyncApiConfig;
697
779
  /** Site-wide announcement banner shown above the header. */
698
780
  banner?: BannerConfig;
781
+ /**
782
+ * Site-wide mount point prepended to every generated route (e.g. `/docs`) —
783
+ * pages, links, redirects, sitemap, OG images, `llms.txt`, and the search
784
+ * index — while staying invisible to the sidebar/nav tree (no wrapper group).
785
+ * Distinct from a per-source `prefix` (which namespaces one source *and*
786
+ * creates a group) and from `deployment.base` (Astro's host-subdirectory
787
+ * base, for serving the whole site — root included — from a subpath). The two
788
+ * compose: with both set, a page lands at `{deployment.base}/{basePath}/page`.
789
+ */
790
+ basePath?: string;
699
791
  /** Where content lives and how it's discovered. */
700
792
  content?: ContentConfig;
701
793
  /** Where and how the site deploys (site URL, adapter, output mode). */
@@ -703,11 +795,15 @@ export interface BlumeConfig {
703
795
  /** Default meta description, used where a page sets none. */
704
796
  description?: string;
705
797
  /**
706
- * Where `<Component path>` resolves live previews and their source from,
707
- * relative to the project root. Defaults to `examples`. May be a glob to
708
- * target a registry that colocates component sources with their examples.
798
+ * `<Component path>` example previews. A string is shorthand for
799
+ * `{ source }`: where examples live, relative to the project root (defaults
800
+ * to `examples`; may be a glob to target a registry that colocates
801
+ * component sources with their examples). The object form adds `css` — a
802
+ * stylesheet injected into every preview frame (previews render in an
803
+ * iframe the docs theme never reaches), for the previewed components'
804
+ * design tokens, e.g. shadcn variables.
709
805
  */
710
- examples?: string;
806
+ examples?: string | ExamplesConfig;
711
807
  /** Reader-facing PDF/EPUB export actions. Defaults to `false`. */
712
808
  export?: ExportConfig;
713
809
  /** Show the per-page "Was this helpful?" widget. Defaults to `true`. */
@@ -728,6 +824,8 @@ export interface BlumeConfig {
728
824
  navigation?: NavigationConfig;
729
825
  /** Native OpenAPI reference. */
730
826
  openapi?: OpenApiConfig;
827
+ /** React island behavior (compiler auto-memoization). */
828
+ react?: ReactConfig;
731
829
  /** URL redirect rules. */
732
830
  redirects?: RedirectConfig[];
733
831
  /** Search backend and credentials. */
@@ -65,8 +65,9 @@ import type { Diagnostic } from "./types.ts";
65
65
  * - `search` — search backend `provider` (`orama` by default; `pagefind`,
66
66
  * `algolia`, `typesense`, `orama-cloud`, `mixedbread`, or `none`) plus its
67
67
  * credential block.
68
- * - `ai` — `ask` (the Ask AI chat endpoint and its provider/model) and `llmsTxt`
69
- * (emit `llms.txt`).
68
+ * - `ai` — `ask` (the Ask AI chat endpoint and its provider/model), `llmsTxt`
69
+ * (emit `llms.txt`), and `markdownComponents` (Markdown serializers for
70
+ * custom components in agent-facing output).
70
71
  * - `mcp` — expose the docs as an MCP server for connecting agents.
71
72
  *
72
73
  * **SEO, feeds & analytics**
@@ -83,8 +84,9 @@ import type { Diagnostic } from "./types.ts";
83
84
  * - `i18n` — opt-in multi-locale: `locales`, `defaultLocale`, `parser`
84
85
  * (`dir` vs filename `dot` suffix), and per-locale UI overrides.
85
86
  *
86
- * - `examples` — where `<Component path>` previews resolve their source from
87
- * (defaults to `examples/`; supports a glob for colocated registries).
87
+ * - `examples` — `<Component path>` previews: `source` (default `examples/`;
88
+ * supports a glob for colocated registries) and `css`, a stylesheet injected
89
+ * into the isolated preview frames (e.g. shadcn variables).
88
90
  *
89
91
  * @example Zero-config — just render the Markdown under `docs/`.
90
92
  * ```ts
@@ -87,6 +87,10 @@ export interface BlumeDataConfig {
87
87
  suggestions: NonNullable<ResolvedConfig["ai"]["ask"]>["suggestions"];
88
88
  } | null;
89
89
  banner: BlumeBanner | null;
90
+ /** Site-wide route mount point, normalized to `""` or `/seg` (see config). */
91
+ basePath: string;
92
+ /** `markdown.codeBlocks.theme`: light/dark Shiki themes for code surfaces. */
93
+ codeThemes: ResolvedConfig["markdown"]["codeBlocks"]["theme"];
90
94
  /** `markdown.code.wrap`: wrap long code lines instead of scrolling. */
91
95
  codeWrap: boolean;
92
96
  description: string | undefined;