blume 1.5.2 → 1.6.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 +85 -0
- package/dist/cli/index.js +3639 -1377
- package/dist/cli/index.js.map +103 -91
- package/dist/types/ai/component-markdown.d.ts +79 -0
- package/dist/types/components/layout/nav-utils.d.ts +60 -0
- package/dist/types/core/base-path.d.ts +9 -0
- package/dist/types/core/config-input.d.ts +206 -4
- package/dist/types/core/config.d.ts +6 -4
- package/dist/types/core/data.d.ts +23 -1
- package/dist/types/core/github.d.ts +35 -0
- package/dist/types/core/i18n-ui.d.ts +8 -0
- package/dist/types/core/navigation.d.ts +69 -0
- package/dist/types/core/schema.d.ts +117 -1
- package/dist/types/core/sources/types.d.ts +31 -6
- package/dist/types/core/types.d.ts +23 -2
- package/dist/types/markdown/features.d.ts +21 -0
- package/dist/types/openapi/references.d.ts +21 -1
- package/dist/types/seo/jsonld.d.ts +105 -0
- package/dist/types/theme/fonts.d.ts +34 -4
- package/docs/_snippets/include-demo.mdx +7 -0
- package/docs/advanced/api-reference.mdx +3 -3
- package/docs/advanced/custom-pages.mdx +1 -1
- package/docs/advanced/graphql.mdx +84 -0
- package/docs/advanced/meta.ts +8 -1
- package/docs/configuration/ai.mdx +21 -3
- package/docs/configuration/index.mdx +24 -0
- package/docs/configuration/search.mdx +13 -1
- package/docs/configuration/seo.mdx +27 -0
- package/docs/configuration/theming.mdx +17 -0
- package/docs/content/components.mdx +7 -0
- package/docs/content/includes.mdx +68 -0
- package/docs/content/meta.ts +1 -0
- package/docs/content/navigation.mdx +25 -0
- package/docs/content/sources.mdx +42 -1
- package/docs/content/syntax.mdx +69 -1
- package/docs/content/versioning.mdx +15 -9
- package/docs/reference/cli.mdx +2 -1
- package/package.json +23 -14
- package/skills/blume-migrate/SKILL.md +16 -7
- package/skills/blume-migrate/references/docusaurus.md +5 -3
- package/skills/blume-migrate/references/fumadocs.md +10 -2
- package/skills/blume-migrate/references/mintlify.md +3 -2
- package/skills/blume-migrate/references/nextra.md +2 -2
- package/skills/blume-migrate/references/starlight.md +1 -1
- package/src/ai/agent-readability.ts +2 -1
- package/src/ai/ask-data.ts +2 -1
- package/src/ai/component-markdown.ts +199 -36
- package/src/ai/llms.ts +93 -6
- package/src/ai/markdown.ts +2 -2
- package/src/ai/mcp/discovery.ts +10 -2
- package/src/ai/mcp/server.ts +74 -2
- package/src/astro/generate.ts +183 -116
- package/src/astro/include-hmr.ts +81 -0
- package/src/astro/include-refresh.ts +0 -0
- package/src/astro/index.ts +3 -5
- package/src/astro/templates.ts +125 -76
- package/src/cli/commands/build.ts +84 -15
- package/src/cli/init/questions.ts +1 -0
- package/src/cli/init/scaffold.ts +27 -4
- package/src/components/colors.ts +142 -0
- package/src/components/content/Badge.astro +5 -12
- package/src/components/content/Callout.astro +19 -36
- package/src/components/content/Card.astro +15 -21
- package/src/components/content/Component.astro +10 -1
- package/src/components/content/GithubInfo.astro +28 -9
- package/src/components/content/Tabs.astro +27 -5
- package/src/components/content/github-info.ts +20 -5
- package/src/components/dropdown-dismiss.ts +122 -0
- package/src/components/layout/Fonts.astro +15 -8
- package/src/components/layout/Header.astro +44 -0
- package/src/components/layout/LanguageSwitcher.astro +9 -1
- package/src/components/layout/NavSelector.astro +12 -3
- package/src/components/layout/NavTree.astro +6 -18
- package/src/components/layout/PageActions.astro +29 -8
- package/src/components/layout/PageLayout.astro +10 -1
- package/src/components/layout/ReferenceLayout.astro +6 -1
- package/src/components/layout/RootLayout.astro +46 -15
- package/src/components/layout/Search.astro +36 -4
- package/src/components/layout/TableOfContents.astro +8 -2
- package/src/components/layout/head-scripts.ts +53 -1
- package/src/components/openapi/ApiOverview.astro +13 -3
- package/src/components/openapi/AsyncApiOperation.astro +7 -14
- package/src/components/openapi/GraphqlChip.astro +33 -0
- package/src/components/openapi/GraphqlFieldsTable.astro +111 -0
- package/src/components/openapi/GraphqlOperation.astro +186 -0
- package/src/components/openapi/GraphqlType.astro +154 -0
- package/src/components/openapi/MethodBadge.astro +3 -14
- package/src/components/openapi/Operation.astro +12 -5
- package/src/components/openapi/OperationPanel.astro +43 -0
- package/src/components/openapi/RequestPanel.astro +5 -10
- package/src/components/openapi/Responses.astro +1 -16
- package/src/components/openapi/graphql-helpers.ts +466 -0
- package/src/components/openapi/playground-client.ts +15 -0
- package/src/components/openapi/sample-panels.ts +45 -0
- package/src/components/openapi/snippets.ts +13 -35
- package/src/core/base-path.ts +11 -0
- package/src/core/config-input.ts +209 -2
- package/src/core/config.ts +6 -4
- package/src/core/content-assets.ts +15 -4
- package/src/core/data.ts +18 -2
- package/src/core/diagnostics.ts +8 -0
- package/src/core/frontmatter.ts +20 -8
- package/src/core/github.ts +71 -0
- package/src/core/graph.ts +22 -8
- package/src/core/heading-markers.ts +96 -0
- package/src/core/i18n-ui.ts +11 -0
- package/src/core/includes.ts +632 -0
- package/src/core/last-modified.ts +36 -11
- package/src/core/links.ts +79 -13
- package/src/core/meta.ts +2 -1
- package/src/core/nav-diagnostics.ts +11 -2
- package/src/core/navigation.ts +27 -6
- package/src/core/project-graph.ts +61 -9
- package/src/core/schema.ts +226 -35
- package/src/core/server-features.ts +5 -9
- package/src/core/sources/github-releases.ts +2 -2
- package/src/core/sources/normalize.ts +502 -115
- package/src/core/sources/notion.ts +43 -8
- package/src/core/sources/obsidian.ts +1038 -0
- package/src/core/sources/read.ts +36 -1
- package/src/core/sources/resolve.ts +34 -1
- package/src/core/sources/types.ts +28 -6
- package/src/core/sources/watch.ts +12 -8
- package/src/core/tsconfig-aliases.ts +48 -35
- package/src/core/types.ts +25 -2
- package/src/core/ui-packs/ar.ts +1 -0
- package/src/core/ui-packs/bg.ts +2 -0
- package/src/core/ui-packs/bn.ts +1 -0
- package/src/core/ui-packs/ca.ts +2 -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 +2 -0
- package/src/core/ui-packs/el.ts +2 -0
- package/src/core/ui-packs/es.ts +2 -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 -0
- 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 +2 -0
- package/src/core/ui-packs/hu.ts +2 -0
- package/src/core/ui-packs/id.ts +2 -0
- package/src/core/ui-packs/it.ts +1 -0
- package/src/core/ui-packs/ja.ts +2 -0
- package/src/core/ui-packs/ko.ts +2 -0
- package/src/core/ui-packs/nl.ts +2 -0
- package/src/core/ui-packs/no.ts +2 -0
- package/src/core/ui-packs/pl.ts +2 -0
- package/src/core/ui-packs/pt-br.ts +2 -0
- package/src/core/ui-packs/pt.ts +2 -0
- package/src/core/ui-packs/ro.ts +2 -0
- package/src/core/ui-packs/ru.ts +2 -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 +2 -0
- package/src/core/ui-packs/th.ts +1 -0
- package/src/core/ui-packs/tr.ts +2 -0
- package/src/core/ui-packs/uk.ts +2 -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/core/version-cut.ts +21 -3
- package/src/core/yaml.ts +26 -0
- package/src/deploy/function-bundle.ts +251 -0
- package/src/eval/schema.ts +3 -1
- package/src/markdown/code-title.ts +22 -16
- package/src/markdown/features.ts +21 -0
- package/src/markdown/fence-meta.ts +50 -0
- package/src/markdown/heading-anchors.ts +198 -37
- package/src/markdown/include.ts +247 -0
- package/src/markdown/index.ts +43 -34
- package/src/markdown/language-icon.ts +2 -2
- package/src/markdown/mdast.ts +7 -3
- package/src/markdown/ts2js.ts +264 -0
- package/src/openapi/asyncapi.ts +4 -1
- package/src/openapi/graphql-build.ts +293 -0
- package/src/openapi/graphql.ts +212 -0
- package/src/openapi/model.ts +38 -5
- package/src/openapi/parse.ts +34 -0
- package/src/openapi/proxy.ts +30 -5
- package/src/openapi/references.ts +89 -13
- package/src/openapi/render-mdx.ts +48 -8
- package/src/openapi/scalar.ts +5 -12
- package/src/openapi/source.ts +91 -23
- package/src/registry/eject.ts +11 -0
- package/src/search/documents.ts +229 -37
- package/src/search/orama-index.ts +9 -5
- package/src/seo/jsonld.ts +293 -51
- package/src/theme/code-block-padding.ts +16 -0
- package/src/theme/entry.ts +65 -11
- package/src/theme/fonts.ts +189 -16
- package/src/translate/prompts.ts +2 -0
- package/src/translate/run.ts +7 -0
- package/src/translate/work-list.ts +0 -0
|
@@ -70,11 +70,21 @@ interface NotionList<T> {
|
|
|
70
70
|
next_cursor: string | null;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* The slice of `@notionhq/client` (v5+) this adapter relies on, so it's
|
|
75
|
+
* mockable. Since API version 2025-09-03 a database's rows live in a data
|
|
76
|
+
* source: `databases.retrieve` names the data sources and
|
|
77
|
+
* `dataSources.query` pages through one of them.
|
|
78
|
+
*/
|
|
74
79
|
export interface NotionClientLike {
|
|
75
80
|
databases: {
|
|
81
|
+
retrieve: (args: { database_id: string }) => Promise<{
|
|
82
|
+
data_sources: { id: string; name: string }[];
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
dataSources: {
|
|
76
86
|
query: (args: {
|
|
77
|
-
|
|
87
|
+
data_source_id: string;
|
|
78
88
|
start_cursor?: string;
|
|
79
89
|
}) => Promise<NotionList<NotionPage>>;
|
|
80
90
|
};
|
|
@@ -319,10 +329,14 @@ export const notionSource = (
|
|
|
319
329
|
}
|
|
320
330
|
let Client: new (config: { auth?: string }) => NotionClientLike;
|
|
321
331
|
try {
|
|
332
|
+
// The module is widened first because the SDK's response unions are
|
|
333
|
+
// broader than the NotionClientLike slice, so a direct assertion is
|
|
334
|
+
// rejected as non-overlapping.
|
|
335
|
+
const sdk: unknown = await import("@notionhq/client");
|
|
322
336
|
// SAFETY: `@notionhq/client` exports a `Client` class constructable with
|
|
323
337
|
// an `auth` token whose instances cover the NotionClientLike slice; the
|
|
324
338
|
// local type keeps the SDK mockable without importing its types.
|
|
325
|
-
({ Client } =
|
|
339
|
+
({ Client } = sdk as {
|
|
326
340
|
Client: new (config: { auth?: string }) => NotionClientLike;
|
|
327
341
|
});
|
|
328
342
|
} catch {
|
|
@@ -511,15 +525,35 @@ export const notionSource = (
|
|
|
511
525
|
};
|
|
512
526
|
};
|
|
513
527
|
|
|
528
|
+
// A database's rows live in its data source (API 2025-09-03). Blume reads
|
|
529
|
+
// the first one, which is the only one a database created in Notion has.
|
|
530
|
+
const resolveDataSource = async (
|
|
531
|
+
client: NotionClientLike
|
|
532
|
+
): Promise<string> => {
|
|
533
|
+
const database = await notionCall(() =>
|
|
534
|
+
client.databases.retrieve({ database_id: options.database })
|
|
535
|
+
);
|
|
536
|
+
const [dataSource] = database.data_sources;
|
|
537
|
+
if (!dataSource) {
|
|
538
|
+
throw new BlumeError({
|
|
539
|
+
code: "BLUME_SOURCE_MISCONFIGURED",
|
|
540
|
+
message: `Source "${options.name}": Notion database "${options.database}" has no data source to read pages from.`,
|
|
541
|
+
severity: "error",
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
return dataSource.id;
|
|
545
|
+
};
|
|
546
|
+
|
|
514
547
|
// Hoisted out of `load` so the retry closure doesn't nest past the linter's
|
|
515
|
-
// 4-level limit (source factory →
|
|
516
|
-
const
|
|
548
|
+
// 4-level limit (source factory → queryDataSource → notionCall callback).
|
|
549
|
+
const queryDataSource = (
|
|
517
550
|
client: NotionClientLike,
|
|
551
|
+
dataSourceId: string,
|
|
518
552
|
cursor?: string
|
|
519
553
|
): Promise<NotionList<NotionPage>> =>
|
|
520
554
|
notionCall(() =>
|
|
521
|
-
client.
|
|
522
|
-
|
|
555
|
+
client.dataSources.query({
|
|
556
|
+
data_source_id: dataSourceId,
|
|
523
557
|
start_cursor: cursor,
|
|
524
558
|
})
|
|
525
559
|
);
|
|
@@ -533,8 +567,9 @@ export const notionSource = (
|
|
|
533
567
|
cache,
|
|
534
568
|
async () => {
|
|
535
569
|
const client = await resolveClient();
|
|
570
|
+
const dataSourceId = await resolveDataSource(client);
|
|
536
571
|
const pages = await collectAll((cursor) =>
|
|
537
|
-
|
|
572
|
+
queryDataSource(client, dataSourceId, cursor)
|
|
538
573
|
);
|
|
539
574
|
const built = await Promise.all(
|
|
540
575
|
pages.map((page) => toEntry(client, page))
|