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.
- package/CHANGELOG.md +618 -0
- package/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/cli/index.js +2609 -1041
- package/dist/cli/index.js.map +110 -103
- package/dist/types/ai/component-markdown.d.ts +34 -0
- package/dist/types/components/content/youtube.d.ts +18 -0
- package/dist/types/core/base-path.d.ts +47 -0
- package/dist/types/core/config-input.d.ts +110 -12
- package/dist/types/core/config.d.ts +6 -4
- package/dist/types/core/data.d.ts +4 -0
- package/dist/types/core/i18n-ui.d.ts +477 -135
- package/dist/types/core/schema.d.ts +309 -195
- package/dist/types/core/sources/types.d.ts +2 -0
- package/dist/types/core/types.d.ts +6 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/openapi/references.d.ts +60 -0
- package/docs/01-quickstart.mdx +5 -2
- package/docs/02-deployment.mdx +24 -9
- package/docs/03-faq.mdx +46 -16
- package/docs/advanced/custom-pages.mdx +1 -1
- package/docs/advanced/skills.mdx +1 -1
- package/docs/configuration/ai.mdx +49 -10
- package/docs/configuration/customization.mdx +11 -0
- package/docs/configuration/index.mdx +33 -3
- package/docs/configuration/seo.mdx +2 -2
- package/docs/content/components.mdx +30 -3
- package/docs/content/i18n.mdx +1 -1
- package/docs/content/islands.mdx +8 -0
- package/docs/content/navigation.mdx +3 -3
- package/docs/content/sources.mdx +1 -1
- package/docs/content/syntax.mdx +17 -2
- package/docs/index.mdx +2 -2
- package/docs/reference/cli.mdx +8 -6
- package/package.json +15 -4
- package/skills/blume/SKILL.md +5 -3
- package/skills/blume-update-docs/SKILL.md +3 -2
- package/src/ai/agent-readability.ts +11 -5
- package/src/ai/ask-context.ts +7 -2
- package/src/ai/ask-data.ts +3 -0
- package/src/ai/ask.ts +12 -7
- package/src/ai/component-markdown.ts +461 -0
- package/src/ai/llms.ts +143 -23
- package/src/ai/markdown.ts +35 -6
- package/src/ai/mcp/data.ts +33 -8
- package/src/ai/mcp/discovery.ts +10 -3
- package/src/ai/mcp/server.ts +24 -7
- package/src/ai/visibility.ts +74 -0
- package/src/astro/component-slots.ts +16 -4
- package/src/astro/examples.ts +12 -7
- package/src/astro/generate.ts +393 -189
- package/src/astro/index.ts +5 -1
- package/src/astro/integration.ts +9 -5
- package/src/astro/islands.ts +11 -5
- package/src/astro/markdown-negotiation.ts +2 -2
- package/src/astro/pages.ts +89 -22
- package/src/astro/templates.ts +259 -25
- package/src/blume-modules.d.ts +8 -0
- package/src/cli/commands/build.ts +131 -38
- package/src/cli/commands/check.ts +1 -1
- package/src/cli/commands/dev.ts +71 -17
- package/src/cli/commands/doctor.ts +2 -2
- package/src/cli/commands/eject.ts +47 -19
- package/src/cli/commands/init.ts +120 -180
- package/src/cli/commands/preview.ts +4 -1
- package/src/cli/commands/validate.ts +44 -2
- package/src/cli/dev-lock.ts +34 -19
- package/src/cli/eject-scripts.ts +72 -0
- package/src/cli/env.ts +15 -5
- package/src/cli/init/questions.ts +158 -0
- package/src/cli/init/scaffold.ts +380 -0
- package/src/cli/required-secrets.ts +2 -1
- package/src/components/content/AccordionItem.astro +23 -4
- package/src/components/content/Badge.astro +3 -1
- package/src/components/content/Card.astro +4 -2
- package/src/components/content/CodeBlock.astro +3 -0
- package/src/components/content/Component.astro +30 -16
- package/src/components/content/Diff.astro +3 -1
- package/src/components/content/Step.astro +10 -1
- package/src/components/content/Tabs.astro +15 -3
- package/src/components/content/Tile.astro +2 -1
- package/src/components/content/Tooltip.astro +3 -1
- package/src/components/content/Update.astro +9 -2
- package/src/components/content/auto-type-table.ts +25 -9
- package/src/components/content/base-href.ts +33 -0
- package/src/components/content/changelog-element.ts +9 -2
- package/src/components/content/diff.ts +12 -6
- package/src/components/content/mermaid-element.ts +10 -2
- package/src/components/index.ts +23 -1
- package/src/components/islands/AskAI.astro +5 -2
- package/src/components/islands/ask-ai.tsx +68 -12
- package/src/components/islands/base-path.ts +28 -0
- package/src/components/islands/hooks.ts +44 -9
- package/src/components/layout/Banner.astro +12 -3
- package/src/components/layout/Breadcrumbs.astro +2 -1
- package/src/components/layout/Favicon.astro +3 -2
- package/src/components/layout/Header.astro +15 -5
- package/src/components/layout/LanguageSwitcher.astro +2 -1
- package/src/components/layout/Logo.astro +13 -4
- package/src/components/layout/NavSelector.astro +2 -1
- package/src/components/layout/NavTree.astro +22 -7
- package/src/components/layout/PageActions.astro +25 -10
- package/src/components/layout/PageFeedback.astro +4 -1
- package/src/components/layout/PageLayout.astro +51 -9
- package/src/components/layout/Pagination.astro +3 -2
- package/src/components/layout/ReferenceLayout.astro +8 -1
- package/src/components/layout/RootLayout.astro +74 -13
- package/src/components/layout/Search.astro +107 -27
- package/src/components/layout/nav-utils.ts +18 -10
- package/src/components/layout/search/algolia.ts +11 -2
- package/src/components/layout/search/endpoint.ts +11 -5
- package/src/components/layout/search/orama-cloud.ts +8 -2
- package/src/components/layout/search/pagefind.ts +3 -0
- package/src/components/layout/search/types.ts +5 -1
- package/src/components/layout/search/typesense.ts +4 -1
- package/src/components/layout/toc-element.ts +8 -2
- package/src/components/openapi/ApiTagOperations.astro +2 -1
- package/src/components/openapi/Operation.astro +47 -40
- package/src/components/openapi/RequestPanel.astro +8 -2
- package/src/components/openapi/helpers.ts +71 -3
- package/src/components/openapi/panel.ts +1 -1
- package/src/components/openapi/snippets.ts +25 -11
- package/src/core/base-path.ts +94 -0
- package/src/core/builtin-tags.ts +2 -0
- package/src/core/component-overrides.ts +103 -74
- package/src/core/config-input.ts +118 -17
- package/src/core/config.ts +8 -5
- package/src/core/content.ts +2 -0
- package/src/core/data.ts +4 -0
- package/src/core/diagnostics.ts +54 -34
- package/src/core/gitignore.ts +4 -1
- package/src/core/graph.ts +166 -88
- package/src/core/i18n-ui.ts +63 -3
- package/src/core/last-modified.ts +15 -6
- package/src/core/links.ts +69 -25
- package/src/core/manifest.ts +62 -45
- package/src/core/nav-diagnostics.ts +1 -1
- package/src/core/navigation.ts +144 -58
- package/src/core/package-json.ts +17 -2
- package/src/core/project-graph.ts +25 -15
- package/src/core/schema.ts +605 -620
- package/src/core/sources/assets.ts +6 -1
- package/src/core/sources/filesystem.ts +4 -0
- package/src/core/sources/github-releases.ts +2 -1
- package/src/core/sources/mdx-remote.ts +76 -63
- package/src/core/sources/normalize.ts +236 -91
- package/src/core/sources/notion.ts +27 -18
- package/src/core/sources/types.ts +2 -0
- package/src/core/tsconfig-aliases.ts +59 -30
- package/src/core/types.ts +6 -1
- package/src/core/ui-packs/ar.ts +1 -0
- package/src/core/ui-packs/bg.ts +1 -0
- package/src/core/ui-packs/bn.ts +1 -0
- package/src/core/ui-packs/ca.ts +1 -0
- package/src/core/ui-packs/cs.ts +1 -0
- package/src/core/ui-packs/da.ts +1 -0
- package/src/core/ui-packs/de.ts +1 -0
- package/src/core/ui-packs/el.ts +1 -0
- package/src/core/ui-packs/es.ts +1 -0
- package/src/core/ui-packs/fa.ts +1 -0
- package/src/core/ui-packs/fi.ts +1 -0
- package/src/core/ui-packs/fr.ts +2 -1
- package/src/core/ui-packs/he.ts +1 -0
- package/src/core/ui-packs/hi.ts +1 -0
- package/src/core/ui-packs/hr.ts +1 -0
- package/src/core/ui-packs/hu.ts +1 -0
- package/src/core/ui-packs/id.ts +1 -0
- package/src/core/ui-packs/it.ts +1 -0
- package/src/core/ui-packs/ja.ts +1 -0
- package/src/core/ui-packs/ko.ts +1 -0
- package/src/core/ui-packs/nl.ts +1 -0
- package/src/core/ui-packs/no.ts +1 -0
- package/src/core/ui-packs/pl.ts +1 -0
- package/src/core/ui-packs/pt-br.ts +1 -0
- package/src/core/ui-packs/pt.ts +1 -0
- package/src/core/ui-packs/ro.ts +1 -0
- package/src/core/ui-packs/ru.ts +1 -0
- package/src/core/ui-packs/sk.ts +1 -0
- package/src/core/ui-packs/sr.ts +1 -0
- package/src/core/ui-packs/sv.ts +1 -0
- package/src/core/ui-packs/th.ts +1 -0
- package/src/core/ui-packs/tr.ts +1 -0
- package/src/core/ui-packs/uk.ts +1 -0
- package/src/core/ui-packs/vi.ts +1 -0
- package/src/core/ui-packs/zh-tw.ts +1 -0
- package/src/core/ui-packs/zh.ts +1 -0
- package/src/deploy/adapter-output.ts +18 -8
- package/src/deploy/redirects.ts +25 -2
- package/src/deploy/robots.ts +6 -1
- package/src/deploy/rss.ts +10 -3
- package/src/deploy/sitemap.ts +59 -13
- package/src/index.ts +5 -0
- package/src/markdown/base-links.ts +60 -0
- package/src/markdown/code-title.ts +11 -14
- package/src/markdown/index.ts +46 -9
- package/src/markdown/inline-code.ts +14 -4
- package/src/markdown/package-commands.ts +10 -4
- package/src/markdown/themes.ts +24 -0
- package/src/openapi/model.ts +15 -5
- package/src/openapi/parse.ts +21 -0
- package/src/openapi/references.ts +75 -21
- package/src/openapi/render-mdx.ts +11 -6
- package/src/openapi/scalar.ts +32 -16
- package/src/openapi/source.ts +59 -10
- package/src/registry/eject.ts +247 -19
- package/src/registry/registry.ts +0 -3
- package/src/search/build.ts +3 -0
- package/src/search/documents.ts +36 -4
- package/src/search/sync/typesense.ts +6 -4
- package/src/seo/jsonld.ts +28 -17
- 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:
|
|
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?:
|
|
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?:
|
|
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
|
-
/**
|
|
431
|
-
|
|
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 }) => ``,
|
|
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?:
|
|
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?:
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
707
|
-
*
|
|
708
|
-
* target a registry that colocates
|
|
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)
|
|
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` —
|
|
87
|
-
*
|
|
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;
|