blume 0.1.0 → 0.1.2
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/dist/cli/index.js +1213 -473
- package/dist/cli/index.js.map +33 -29
- package/dist/types/core/bridge.d.ts +24 -0
- package/dist/types/core/config.d.ts +35 -0
- package/dist/types/core/data.d.ts +129 -0
- package/dist/types/core/define-components.d.ts +27 -0
- package/dist/types/core/define-meta.d.ts +16 -0
- package/dist/types/core/deployment-env.d.ts +9 -0
- package/dist/types/core/diagnostics.d.ts +17 -0
- package/dist/types/core/i18n-ui.d.ts +500 -0
- package/dist/types/core/load-module.d.ts +7 -0
- package/dist/types/core/package-root.d.ts +17 -0
- package/dist/types/core/project.d.ts +9 -0
- package/dist/types/core/schema.d.ts +3461 -0
- package/dist/types/core/sources/types.d.ts +107 -0
- package/dist/types/core/types.d.ts +245 -0
- package/dist/types/core/ui-packs/ar.d.ts +3 -0
- package/dist/types/core/ui-packs/bg.d.ts +3 -0
- package/dist/types/core/ui-packs/bn.d.ts +3 -0
- package/dist/types/core/ui-packs/ca.d.ts +3 -0
- package/dist/types/core/ui-packs/cs.d.ts +3 -0
- package/dist/types/core/ui-packs/da.d.ts +3 -0
- package/dist/types/core/ui-packs/de.d.ts +3 -0
- package/dist/types/core/ui-packs/el.d.ts +3 -0
- package/dist/types/core/ui-packs/es.d.ts +3 -0
- package/dist/types/core/ui-packs/fa.d.ts +3 -0
- package/dist/types/core/ui-packs/fi.d.ts +3 -0
- package/dist/types/core/ui-packs/fr.d.ts +3 -0
- package/dist/types/core/ui-packs/he.d.ts +3 -0
- package/dist/types/core/ui-packs/hi.d.ts +3 -0
- package/dist/types/core/ui-packs/hr.d.ts +3 -0
- package/dist/types/core/ui-packs/hu.d.ts +3 -0
- package/dist/types/core/ui-packs/id.d.ts +3 -0
- package/dist/types/core/ui-packs/index.d.ts +13 -0
- package/dist/types/core/ui-packs/it.d.ts +3 -0
- package/dist/types/core/ui-packs/ja.d.ts +3 -0
- package/dist/types/core/ui-packs/ko.d.ts +3 -0
- package/dist/types/core/ui-packs/nl.d.ts +3 -0
- package/dist/types/core/ui-packs/no.d.ts +3 -0
- package/dist/types/core/ui-packs/pl.d.ts +3 -0
- package/dist/types/core/ui-packs/pt-br.d.ts +3 -0
- package/dist/types/core/ui-packs/pt.d.ts +3 -0
- package/dist/types/core/ui-packs/ro.d.ts +3 -0
- package/dist/types/core/ui-packs/ru.d.ts +3 -0
- package/dist/types/core/ui-packs/sk.d.ts +3 -0
- package/dist/types/core/ui-packs/sr.d.ts +3 -0
- package/dist/types/core/ui-packs/sv.d.ts +3 -0
- package/dist/types/core/ui-packs/th.d.ts +3 -0
- package/dist/types/core/ui-packs/tr.d.ts +3 -0
- package/dist/types/core/ui-packs/uk.d.ts +3 -0
- package/dist/types/core/ui-packs/vi.d.ts +3 -0
- package/dist/types/core/ui-packs/zh-tw.d.ts +3 -0
- package/dist/types/core/ui-packs/zh.d.ts +3 -0
- package/dist/types/core/version.d.ts +8 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/migrate/mintlify/config.d.ts +2 -0
- package/dist/types/migrate/mintlify/i18n.d.ts +7 -0
- package/dist/types/theme/fonts.d.ts +163 -0
- package/docs/advanced/custom-pages.mdx +91 -10
- package/docs/configuration/index.mdx +19 -0
- package/docs/content/components.mdx +103 -1
- package/package.json +13 -3
- package/src/ai/llms.ts +1 -2
- package/src/astro/examples.ts +106 -0
- package/src/astro/generate.ts +300 -75
- package/src/astro/index.ts +1 -1
- package/src/astro/islands.ts +1 -1
- package/src/astro/pages.ts +59 -0
- package/src/astro/templates.ts +180 -22
- package/src/cli/commands/validate.ts +1 -0
- package/src/components/content/CodeBlock.astro +28 -0
- package/src/components/content/Component.astro +65 -0
- package/src/components/content/Diff.astro +44 -0
- package/src/components/content/Tab.astro +8 -2
- package/src/components/content/diff.ts +95 -0
- package/src/components/layout/Favicon.astro +11 -4
- package/src/components/layout/PageLayout.astro +173 -0
- package/src/components/layout/ReferenceLayout.astro +6 -1
- package/src/components/layout/RootLayout.astro +9 -5
- package/src/components/layout/head-scripts.ts +19 -0
- package/src/core/data.ts +128 -0
- package/src/core/frontmatter.ts +43 -0
- package/src/core/links.ts +26 -10
- package/src/core/schema.ts +8 -0
- package/src/core/sources/filesystem.ts +1 -1
- package/src/core/sources/mdx-remote.ts +1 -2
- package/src/core/sources/mintlify.ts +1 -1
- package/src/core/sources/normalize.ts +19 -3
- package/src/core/sources/notion.ts +1 -1
- package/src/core/sources/sanity.ts +1 -1
- package/src/core/tsconfig-aliases.ts +201 -0
- package/src/index.ts +12 -0
- package/src/markdown/index.ts +69 -0
- package/src/migrate/fumadocs/config.ts +53 -4
- package/src/migrate/fumadocs/content.ts +1 -1
- package/src/migrate/fumadocs/groups.ts +230 -0
- package/src/migrate/fumadocs/index.ts +104 -19
- package/src/migrate/fumadocs/meta.ts +140 -10
- package/src/migrate/mintlify/snippets.ts +2 -1
- package/src/migrate/mintlify/transform.ts +1 -2
- package/src/migrate/nextra/index.ts +1 -1
- package/src/migrate/shared.ts +98 -1
- package/src/migrate/starlight/index.ts +1 -1
- package/src/registry/eject.ts +57 -10
- package/src/search/documents.ts +1 -2
- package/src/theme/entry.ts +29 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { ResolvedI18nConfig } from "../schema.ts";
|
|
2
|
+
import type { Diagnostic } from "../types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* A single content item, normalized by a source adapter. Adapters lower their
|
|
5
|
+
* native shape (files, Portable Text, Notion blocks, remote HTML) to Markdown/MDX
|
|
6
|
+
* *text* so Blume's markdown processors and component set apply uniformly.
|
|
7
|
+
*/
|
|
8
|
+
export interface SourceEntry {
|
|
9
|
+
/** Source-local stable id, e.g. `api/auth.mdx` or a CMS document id. */
|
|
10
|
+
ref: string;
|
|
11
|
+
/** Logical route input; defaults to `ref` if omitted. May include slashes. */
|
|
12
|
+
slug?: string;
|
|
13
|
+
/** Frontmatter-equivalent metadata, validated against the Blume meta schema. */
|
|
14
|
+
data: Record<string, unknown>;
|
|
15
|
+
/** The renderable body as Markdown/MDX source text (frontmatter stripped). */
|
|
16
|
+
body: {
|
|
17
|
+
format: "md" | "mdx";
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Full source text including frontmatter, written verbatim to the staging
|
|
22
|
+
* dir so Astro re-parses the same frontmatter. Staged (non-filesystem) sources
|
|
23
|
+
* set this; filesystem entries (read from disk) omit it.
|
|
24
|
+
*/
|
|
25
|
+
raw?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Absolute filesystem path when the entry originates from disk. Populated by
|
|
28
|
+
* the filesystem adapter only; powers git last-modified and edit URLs and the
|
|
29
|
+
* `sourcePath` back-compat window. Omitted by remote/CMS adapters.
|
|
30
|
+
*/
|
|
31
|
+
sourcePath?: string;
|
|
32
|
+
/** Optional provenance for "edit this page". */
|
|
33
|
+
editUrl?: string;
|
|
34
|
+
/** Optional last-modified ISO date supplied by the adapter (non-filesystem). */
|
|
35
|
+
lastModified?: string;
|
|
36
|
+
/** Content hash for cache invalidation / HMR; adapter-computed when cheap. */
|
|
37
|
+
hash?: string;
|
|
38
|
+
}
|
|
39
|
+
/** The result of a single `ContentSource.load()` call. */
|
|
40
|
+
export interface SourceLoadResult {
|
|
41
|
+
entries: SourceEntry[];
|
|
42
|
+
/** Source-level diagnostics (e.g. an offline cache fallback warning). */
|
|
43
|
+
diagnostics: Diagnostic[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Per-source runtime context, handed to an adapter factory at construction so
|
|
47
|
+
* `load`/`read`/`watch` can close over it without re-threading on every call.
|
|
48
|
+
*/
|
|
49
|
+
export interface SourceContext {
|
|
50
|
+
projectRoot: string;
|
|
51
|
+
/** Per-source cache dir under `.blume/cache/<source>/`. */
|
|
52
|
+
cacheDir: string;
|
|
53
|
+
mode: "dev" | "build";
|
|
54
|
+
/** Dir for downloaded assets (served from the site's public dir). */
|
|
55
|
+
assetsDir?: string;
|
|
56
|
+
/** Public URL prefix the downloaded assets are served under. */
|
|
57
|
+
assetsBaseUrl?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Re-fetch remote content instead of serving the cached snapshot. True for
|
|
60
|
+
* builds and `blume sync`; false in dev (cache-first for fast, offline-tolerant
|
|
61
|
+
* restarts — refresh with `blume sync` or an opt-in `pollInterval`).
|
|
62
|
+
*/
|
|
63
|
+
refresh?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Preview unpublished content: drafts are kept and CMS adapters fetch draft
|
|
66
|
+
* documents (Sanity's `previewDrafts` perspective). Off for production builds.
|
|
67
|
+
*/
|
|
68
|
+
preview?: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A pluggable content source. Adapters enumerate normalized entries and
|
|
72
|
+
* (optionally) re-read a single entry, validate themselves, and watch for
|
|
73
|
+
* changes. Identity is the opaque `SourceEntry.ref`, never a filesystem path.
|
|
74
|
+
*/
|
|
75
|
+
export interface ContentSource {
|
|
76
|
+
/** Unique, stable name; used for id namespacing and diagnostics. */
|
|
77
|
+
readonly name: string;
|
|
78
|
+
/**
|
|
79
|
+
* Whether entries render through the staging collection. Filesystem sources
|
|
80
|
+
* render through Astro's existing `docs` glob collection (`false`); every
|
|
81
|
+
* other source materializes MDX into `.blume/content` (`true`).
|
|
82
|
+
*/
|
|
83
|
+
readonly staged: boolean;
|
|
84
|
+
/** Optional route prefix; the source's routes namespace under `/<prefix>/`. */
|
|
85
|
+
readonly prefix?: string;
|
|
86
|
+
/** Pull every entry. Called once per scan. */
|
|
87
|
+
load: () => Promise<SourceLoadResult>;
|
|
88
|
+
/** Validate the source is usable; throws a BlumeError when not. */
|
|
89
|
+
validate?: () => void;
|
|
90
|
+
/** Read a single entry's body lazily (search / AI / raw export). */
|
|
91
|
+
read?: (ref: string) => Promise<string>;
|
|
92
|
+
/**
|
|
93
|
+
* Notify on change in dev. Returns a disposer. Filesystem uses `fs.watch`;
|
|
94
|
+
* remote/static sources omit it (content is frozen for the session).
|
|
95
|
+
*/
|
|
96
|
+
watch?: (onChange: () => void) => () => void;
|
|
97
|
+
}
|
|
98
|
+
/** Context passed to `normalizeEntry`, describing the owning source. */
|
|
99
|
+
export interface NormalizeContext {
|
|
100
|
+
source: {
|
|
101
|
+
name: string;
|
|
102
|
+
prefix?: string;
|
|
103
|
+
staged: boolean;
|
|
104
|
+
};
|
|
105
|
+
defaultType: string;
|
|
106
|
+
i18n?: ResolvedI18nConfig;
|
|
107
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import type { DirectoryMode, PageMeta, ResolvedConfig, SidebarDisplay } from "./schema.ts";
|
|
2
|
+
/** Severity levels for Blume diagnostics. */
|
|
3
|
+
export type DiagnosticSeverity = "error" | "warning" | "info";
|
|
4
|
+
/**
|
|
5
|
+
* A single actionable diagnostic. Diagnostics are printable in the CLI, the
|
|
6
|
+
* Astro/Vite overlay, and as JSON for editor integrations.
|
|
7
|
+
*/
|
|
8
|
+
export interface Diagnostic {
|
|
9
|
+
code: string;
|
|
10
|
+
severity: DiagnosticSeverity;
|
|
11
|
+
message: string;
|
|
12
|
+
file?: string;
|
|
13
|
+
line?: number;
|
|
14
|
+
column?: number;
|
|
15
|
+
schemaPath?: string;
|
|
16
|
+
suggestion?: string;
|
|
17
|
+
docsUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
/** A heading extracted from page content, used for the TOC and search. */
|
|
20
|
+
export interface Heading {
|
|
21
|
+
depth: number;
|
|
22
|
+
text: string;
|
|
23
|
+
slug: string;
|
|
24
|
+
}
|
|
25
|
+
/** A link target discovered in page content, anchored to its source line. */
|
|
26
|
+
export interface PageLink {
|
|
27
|
+
/** Raw link target as written, e.g. `./foo`, `/api#auth`, `https://x.dev`. */
|
|
28
|
+
target: string;
|
|
29
|
+
/** 1-based line number in the source file. */
|
|
30
|
+
line: number;
|
|
31
|
+
/** 1-based column of the target within the line. */
|
|
32
|
+
column: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolved project paths. Computed once per CLI invocation and threaded
|
|
36
|
+
* through the core pipeline.
|
|
37
|
+
*/
|
|
38
|
+
export interface ProjectContext {
|
|
39
|
+
/** Absolute path to the user project root. */
|
|
40
|
+
root: string;
|
|
41
|
+
/** Absolute path to the content root (e.g. `<root>/docs`). */
|
|
42
|
+
contentRoot: string;
|
|
43
|
+
/** Absolute path to the custom pages dir, if it exists. */
|
|
44
|
+
pagesRoot: string | null;
|
|
45
|
+
/** Absolute path to the generated runtime (`<root>/.blume`). */
|
|
46
|
+
outDir: string;
|
|
47
|
+
/** Absolute path to the user `theme.css`, if present. */
|
|
48
|
+
themeFile: string | null;
|
|
49
|
+
/** Absolute path to the user `components.ts`/`.tsx`, if present. */
|
|
50
|
+
componentsFile: string | null;
|
|
51
|
+
/** Absolute path to the resolved config file, if any was found. */
|
|
52
|
+
configFile: string | null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A normalized content page. This is the unit the route manifest, nav graph,
|
|
56
|
+
* and search index are derived from.
|
|
57
|
+
*/
|
|
58
|
+
export interface PageRecord {
|
|
59
|
+
/** Stable, globally-unique id: `"<source>:<ref>"`, e.g. `filesystem:api/auth.mdx`. */
|
|
60
|
+
id: string;
|
|
61
|
+
/** Provenance: the owning source's name and its source-local ref. */
|
|
62
|
+
source: {
|
|
63
|
+
name: string;
|
|
64
|
+
ref: string;
|
|
65
|
+
};
|
|
66
|
+
/** Absolute source path. Populated by the filesystem adapter only (back-compat). */
|
|
67
|
+
sourcePath?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Renderable body captured at scan time. Set for staged (non-filesystem)
|
|
70
|
+
* sources so they can be materialized to `.blume/content` and so soft
|
|
71
|
+
* consumers need no re-read; omitted for filesystem entries (read from disk).
|
|
72
|
+
*/
|
|
73
|
+
body?: {
|
|
74
|
+
format: "md" | "mdx";
|
|
75
|
+
text: string;
|
|
76
|
+
};
|
|
77
|
+
/** Adapter-supplied "edit this page" URL (non-filesystem sources). */
|
|
78
|
+
editUrl?: string;
|
|
79
|
+
/** Astro collection this entry renders through; defaults to `"docs"`. */
|
|
80
|
+
collection?: string;
|
|
81
|
+
/** Astro collection-relative entry id for `getEntry`; defaults to the ref. */
|
|
82
|
+
entryId?: string;
|
|
83
|
+
/** URL route, e.g. `/api/auth`. Always starts with `/`. Locale-prefixed under i18n. */
|
|
84
|
+
route: string;
|
|
85
|
+
/** Resolved locale code; the default locale when not under i18n. */
|
|
86
|
+
locale: string;
|
|
87
|
+
/**
|
|
88
|
+
* Locale-agnostic logical route shared by every translation (e.g.
|
|
89
|
+
* `/guides/x`). Pages with the same key are translations of each other.
|
|
90
|
+
*/
|
|
91
|
+
translationKey: string;
|
|
92
|
+
/**
|
|
93
|
+
* Content-relative path with the leading locale directory stripped, used for
|
|
94
|
+
* sidebar grouping so the locale dir is not surfaced as a nav group. Equals
|
|
95
|
+
* `id` for single-locale projects.
|
|
96
|
+
*/
|
|
97
|
+
navPath: string;
|
|
98
|
+
/** Path segments without numeric prefixes, e.g. `["api", "auth"]`. */
|
|
99
|
+
segments: string[];
|
|
100
|
+
/** Group-folder labels this page lives under, e.g. `["guides"]`. */
|
|
101
|
+
groups: string[];
|
|
102
|
+
title: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
contentType: string;
|
|
105
|
+
meta: PageMeta;
|
|
106
|
+
headings: Heading[];
|
|
107
|
+
/** Whether the file is `.md`/`.mdx`. */
|
|
108
|
+
format: "md" | "mdx";
|
|
109
|
+
/** Internal/asset links discovered in the page (for validation). */
|
|
110
|
+
links: PageLink[];
|
|
111
|
+
/** Resolved "last updated" ISO date, when the feature is enabled. */
|
|
112
|
+
lastModified?: string;
|
|
113
|
+
}
|
|
114
|
+
/** A node in the generated navigation tree. */
|
|
115
|
+
export type NavNode = {
|
|
116
|
+
kind: "page";
|
|
117
|
+
label: string;
|
|
118
|
+
route: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
icon?: string;
|
|
121
|
+
badge?: string;
|
|
122
|
+
deprecated?: boolean;
|
|
123
|
+
pageId: string;
|
|
124
|
+
} | {
|
|
125
|
+
kind: "group";
|
|
126
|
+
label: string;
|
|
127
|
+
badge?: string;
|
|
128
|
+
directory?: DirectoryMode;
|
|
129
|
+
display?: SidebarDisplay;
|
|
130
|
+
icon?: string;
|
|
131
|
+
route?: string;
|
|
132
|
+
collapsed?: boolean;
|
|
133
|
+
children: NavNode[];
|
|
134
|
+
};
|
|
135
|
+
/** Top-level tab/section. */
|
|
136
|
+
export interface NavTab {
|
|
137
|
+
label: string;
|
|
138
|
+
path: string;
|
|
139
|
+
icon?: string;
|
|
140
|
+
items?: NavSelectorItem[];
|
|
141
|
+
}
|
|
142
|
+
/** A selectable navigation option inside a tab menu or top selector. */
|
|
143
|
+
export interface NavSelectorItem {
|
|
144
|
+
label: string;
|
|
145
|
+
path: string;
|
|
146
|
+
description?: string;
|
|
147
|
+
icon?: string;
|
|
148
|
+
tag?: string;
|
|
149
|
+
}
|
|
150
|
+
/** Top-level Mintlify-style partition selectors. */
|
|
151
|
+
export interface NavSelector {
|
|
152
|
+
label: string;
|
|
153
|
+
kind: "dropdown" | "language" | "product" | "version";
|
|
154
|
+
items: NavSelectorItem[];
|
|
155
|
+
}
|
|
156
|
+
/** Sidebar tree used when the current route belongs to a nav partition. */
|
|
157
|
+
export interface NavSidebarVariant {
|
|
158
|
+
path: string;
|
|
159
|
+
sidebar: NavNode[];
|
|
160
|
+
}
|
|
161
|
+
/** Chrome overrides used when the current route belongs to a nav partition. */
|
|
162
|
+
export interface NavChromeVariant {
|
|
163
|
+
path: string;
|
|
164
|
+
banner?: ResolvedConfig["banner"];
|
|
165
|
+
footer?: ResolvedConfig["footer"];
|
|
166
|
+
navbar?: ResolvedConfig["navbar"];
|
|
167
|
+
}
|
|
168
|
+
/** The complete navigation model derived from the content graph. */
|
|
169
|
+
export interface Navigation {
|
|
170
|
+
tabs: NavTab[];
|
|
171
|
+
selectors: NavSelector[];
|
|
172
|
+
chromeVariants: NavChromeVariant[];
|
|
173
|
+
sidebar: NavNode[];
|
|
174
|
+
sidebarVariants: NavSidebarVariant[];
|
|
175
|
+
/** Repo URL for the header link, or null when hidden (`navigation.repo`). */
|
|
176
|
+
repoUrl?: string | null;
|
|
177
|
+
}
|
|
178
|
+
/** The full content graph: the source of truth for generated modules. */
|
|
179
|
+
export interface ContentGraph {
|
|
180
|
+
pages: PageRecord[];
|
|
181
|
+
/** Default-locale navigation (the whole site when not under i18n). */
|
|
182
|
+
navigation: Navigation;
|
|
183
|
+
/** Navigation per locale; one entry per configured locale under i18n. */
|
|
184
|
+
navigationByLocale: Record<string, Navigation>;
|
|
185
|
+
/** Map of route -> pageId for fast lookup and duplicate detection. */
|
|
186
|
+
routes: Map<string, string>;
|
|
187
|
+
diagnostics: Diagnostic[];
|
|
188
|
+
}
|
|
189
|
+
/** A locale a logical page exists in, for the switcher and `hreflang`. */
|
|
190
|
+
export interface RouteAlternate {
|
|
191
|
+
locale: string;
|
|
192
|
+
path: string;
|
|
193
|
+
}
|
|
194
|
+
/** A resolved language-switcher entry for the current page. */
|
|
195
|
+
export interface LocaleSwitchOption {
|
|
196
|
+
code: string;
|
|
197
|
+
label: string;
|
|
198
|
+
dir: "ltr" | "rtl";
|
|
199
|
+
/** Target URL: the real translation, or the localized fallback URL. */
|
|
200
|
+
href: string;
|
|
201
|
+
current: boolean;
|
|
202
|
+
/** True when this locale has no real translation (renders fallback content). */
|
|
203
|
+
untranslated: boolean;
|
|
204
|
+
}
|
|
205
|
+
/** A route entry written to `blume.manifest.json`. */
|
|
206
|
+
export interface RouteManifestEntry {
|
|
207
|
+
id: string;
|
|
208
|
+
/** Provenance: the owning source's name and its source-local ref. */
|
|
209
|
+
source: {
|
|
210
|
+
name: string;
|
|
211
|
+
ref: string;
|
|
212
|
+
};
|
|
213
|
+
/** Astro collection this entry renders through (`"docs"` | `"staged"`). */
|
|
214
|
+
collection: string;
|
|
215
|
+
/** Astro collection-relative entry id, passed to `getEntry`. */
|
|
216
|
+
entryId: string;
|
|
217
|
+
path: string;
|
|
218
|
+
/** Absolute source path; populated for filesystem entries only (back-compat). */
|
|
219
|
+
sourcePath?: string;
|
|
220
|
+
/** Adapter-supplied "edit this page" URL (non-filesystem sources). */
|
|
221
|
+
editUrl?: string;
|
|
222
|
+
title: string;
|
|
223
|
+
contentType: string;
|
|
224
|
+
hidden: boolean;
|
|
225
|
+
draft: boolean;
|
|
226
|
+
/** Whether the page should be included in the search index. */
|
|
227
|
+
indexable: boolean;
|
|
228
|
+
/** Resolved locale code; the default locale when not under i18n. */
|
|
229
|
+
locale: string;
|
|
230
|
+
/** Locales this logical page is genuinely translated into (excludes fallbacks). */
|
|
231
|
+
alternates: RouteAlternate[];
|
|
232
|
+
/** True when this route renders fallback content for a missing translation. */
|
|
233
|
+
fallback?: boolean;
|
|
234
|
+
/** Resolved "last updated" ISO date, when the feature is enabled. */
|
|
235
|
+
lastModified?: string;
|
|
236
|
+
}
|
|
237
|
+
/** The generated runtime contract between core and the Astro project. */
|
|
238
|
+
export interface BlumeManifest {
|
|
239
|
+
version: number;
|
|
240
|
+
blumeVersion: string;
|
|
241
|
+
projectRoot: string;
|
|
242
|
+
contentRoot: string;
|
|
243
|
+
output: ResolvedConfig["deployment"]["output"];
|
|
244
|
+
routes: RouteManifestEntry[];
|
|
245
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UIStringsOverride } from "../i18n-ui.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Built-in translation packs, one module per locale (`./<code>.ts`). English is
|
|
4
|
+
* the schema baseline, so it has no pack; every other locale ships a starter
|
|
5
|
+
* pack so adopters get translated chrome out of the box. Brand names (Cursor,
|
|
6
|
+
* VS Code, MCP, Claude Code, Markdown, GitHub) are kept verbatim. Packs are
|
|
7
|
+
* community-maintained — open a PR to add a locale or sharpen a translation.
|
|
8
|
+
*
|
|
9
|
+
* Keyed by locale code; regional variants use the BCP 47 form (`pt-BR`,
|
|
10
|
+
* `zh-TW`). A locale's pack is merged onto English by {@link resolveUIStrings},
|
|
11
|
+
* so a pack only needs the keys it translates.
|
|
12
|
+
*/
|
|
13
|
+
export declare const UI_PACKS: Record<string, UIStringsOverride>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The installed Blume package version, read lazily from its `package.json`.
|
|
3
|
+
*
|
|
4
|
+
* Computed on demand (not at module load) so importing the `blume` barrel has no
|
|
5
|
+
* filesystem side effect, and anchored at the package root so it resolves the
|
|
6
|
+
* same whether running from source or the bundled CLI.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getBlumeVersion: () => string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { defineConfig } from "./core/config.ts";
|
|
2
|
+
export type { BlumeBanner, BlumeData, BlumeDataConfig, BlumeDataI18n, BlumeDataLocale, BlumeFavicon, BlumeFeed, BlumeLogo, BlumeRoute, } from "./core/data.ts";
|
|
3
|
+
export { defineComponents } from "./core/define-components.ts";
|
|
4
|
+
export type { ComponentOverride, ComponentOverrides, IslandDescriptor, } from "./core/define-components.ts";
|
|
5
|
+
export { defineMeta } from "./core/define-meta.ts";
|
|
6
|
+
export type { FolderMetaDefinition, FolderMetaFactory, } from "./core/define-meta.ts";
|
|
7
|
+
export type { UIStrings } from "./core/i18n-ui.ts";
|
|
8
|
+
export type { BlumeConfig, FolderMeta, HydrationMode, ResolvedConfig, } from "./core/schema.ts";
|
|
9
|
+
export type { Diagnostic, Heading, NavNode, Navigation, NavTab, PageRecord, } from "./core/types.ts";
|
|
10
|
+
export { getBlumeVersion } from "./core/version.ts";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlumeConfig } from "../../core/schema.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Map a Mintlify `navigation.languages[]` array to a Blume `i18n` config. The
|
|
4
|
+
* entry marked `default: true` becomes `defaultLocale`; translated content
|
|
5
|
+
* already lives in ISO-code directories, which match Blume's `dir` parser.
|
|
6
|
+
*/
|
|
7
|
+
export declare const mintlifyI18n: (spec: Record<string, unknown>) => BlumeConfig["i18n"] | null;
|