blume 1.1.1 → 1.1.3
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 +21 -0
- package/dist/cli/index.js +175 -26
- package/dist/cli/index.js.map +16 -16
- package/dist/types/ai/component-markdown.d.ts +10 -0
- package/dist/types/core/config-input.d.ts +50 -5
- package/dist/types/core/i18n-ui.d.ts +24 -24
- package/dist/types/core/schema.d.ts +301 -132
- package/dist/types/core/types.d.ts +21 -0
- package/dist/types/markdown/themes.d.ts +21 -0
- package/dist/types/openapi/references.d.ts +5 -0
- package/docs/advanced/api-reference.mdx +20 -0
- package/docs/configuration/index.mdx +28 -1
- package/docs/content/components.mdx +1 -1
- package/docs/content/syntax.mdx +14 -0
- package/package.json +1 -1
- package/src/ai/component-markdown.ts +28 -0
- package/src/ai/llms.ts +11 -2
- package/src/ai/markdown.ts +12 -6
- package/src/astro/examples.ts +13 -0
- package/src/astro/generate.ts +95 -14
- package/src/astro/templates.ts +48 -7
- package/src/components/content/Component.astro +99 -6
- package/src/components/content/diff.ts +53 -4
- package/src/components/layout/Logo.astro +2 -2
- package/src/components/layout/RootLayout.astro +23 -6
- package/src/components/layout/nav-utils.ts +18 -7
- package/src/components/openapi/ApiTagOperations.astro +17 -8
- package/src/core/config-input.ts +51 -5
- package/src/core/date-format.ts +17 -0
- package/src/core/navigation.ts +11 -7
- package/src/core/project-graph.ts +9 -0
- package/src/core/schema.ts +96 -2
- package/src/core/types.ts +23 -0
- package/src/markdown/index.ts +2 -0
- package/src/markdown/inline-code.ts +1 -1
- package/src/markdown/themes.ts +7 -2
- package/src/openapi/references.ts +6 -0
- package/src/openapi/scalar.ts +4 -0
- package/src/registry/eject.ts +6 -3
- package/src/theme/entry.ts +7 -0
- package/src/theme/twoslash.ts +10 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExampleLookup } from "../core/types.ts";
|
|
1
2
|
/** Evaluated props plus whether any attribute resisted static evaluation. */
|
|
2
3
|
interface EvaluatedProps {
|
|
3
4
|
lossy: boolean;
|
|
@@ -27,6 +28,15 @@ export interface ComponentMarkdownContext extends EvaluatedProps {
|
|
|
27
28
|
* fallback when the props can't be recovered statically).
|
|
28
29
|
*/
|
|
29
30
|
export type ComponentMarkdown = (context: ComponentMarkdownContext) => string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Build the `<Component>` serializer for a project's discovered examples. The
|
|
33
|
+
* live preview can't survive the trip to Markdown, so the agent-facing output
|
|
34
|
+
* carries the example's source — the same code the "Code" tab shows — as a
|
|
35
|
+
* fenced block. An unknown `path` (or a missing `path` prop) declines, leaving
|
|
36
|
+
* the JSX verbatim, mirroring the "no example found" note the component renders
|
|
37
|
+
* on the page.
|
|
38
|
+
*/
|
|
39
|
+
export declare const exampleComponentSerializers: (examples: ExampleLookup) => Record<string, ComponentMarkdown>;
|
|
30
40
|
/**
|
|
31
41
|
* Downlevel supported components in an MDX source to plain Markdown. Sources
|
|
32
42
|
* with no supported components — and sources Satteri can't parse as MDX, e.g.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentMarkdown } from "../ai/component-markdown.ts";
|
|
2
|
+
import type { CodeTheme } from "../markdown/themes.ts";
|
|
2
3
|
import type { FontSlug } from "../theme/fonts.ts";
|
|
3
4
|
import type { OpenApiSource, SearchProvider, SidebarDisplay, SidebarItemConfig } from "./schema.ts";
|
|
4
5
|
import type { ContentSource } from "./sources/types.ts";
|
|
@@ -722,12 +723,12 @@ export interface MarkdownConfig {
|
|
|
722
723
|
* `` `code`{:lang} ``, `<CodeBlock>`, and `<Diff>`.
|
|
723
724
|
*/
|
|
724
725
|
codeBlocks?: {
|
|
725
|
-
/** Shiki theme names per color mode. */
|
|
726
|
+
/** Bundled Shiki theme names or inline custom Shiki themes per color mode. */
|
|
726
727
|
theme?: {
|
|
727
|
-
/** Dark-mode theme. Defaults to `github-dark`. */
|
|
728
|
-
dark?:
|
|
729
|
-
/** Light-mode theme. Defaults to `github-light`. */
|
|
730
|
-
light?:
|
|
728
|
+
/** Dark-mode theme name or custom theme. Defaults to `github-dark`. */
|
|
729
|
+
dark?: CodeTheme;
|
|
730
|
+
/** Light-mode theme name or custom theme. Defaults to `github-light`. */
|
|
731
|
+
light?: CodeTheme;
|
|
731
732
|
};
|
|
732
733
|
};
|
|
733
734
|
/**
|
|
@@ -764,6 +765,13 @@ export interface OpenApiConfig {
|
|
|
764
765
|
renderer?: "blume" | "scalar";
|
|
765
766
|
/** Where the reference mounts. Defaults to `/reference`. */
|
|
766
767
|
route?: string;
|
|
768
|
+
/**
|
|
769
|
+
* Extra Scalar options forwarded verbatim to the embedded `<ScalarComponent>`
|
|
770
|
+
* (Scalar renderer only) — e.g. `localization`, `agent`,
|
|
771
|
+
* `hideTestRequestButton`, `orderSchemaPropertiesBy`. These win over Blume's
|
|
772
|
+
* derived spec/theme config, so it's a full escape hatch to Scalar's API.
|
|
773
|
+
*/
|
|
774
|
+
scalar?: Record<string, unknown>;
|
|
767
775
|
/** One or more specs; each renders on its own route by default. */
|
|
768
776
|
sources?: OpenApiSource[];
|
|
769
777
|
/** Shorthand for a single source: `sources: [{ spec }]`. */
|
|
@@ -781,6 +789,12 @@ export interface AsyncApiConfig {
|
|
|
781
789
|
enabled?: boolean;
|
|
782
790
|
/** Where the reference mounts. Defaults to `/events`. */
|
|
783
791
|
route?: string;
|
|
792
|
+
/**
|
|
793
|
+
* Extra Scalar options forwarded verbatim to the embedded `<ScalarComponent>`.
|
|
794
|
+
* These win over Blume's derived spec/theme config — a full escape hatch to
|
|
795
|
+
* Scalar's API.
|
|
796
|
+
*/
|
|
797
|
+
scalar?: Record<string, unknown>;
|
|
784
798
|
/** One or more specs. */
|
|
785
799
|
sources?: OpenApiSource[];
|
|
786
800
|
/** Shorthand for a single source. */
|
|
@@ -856,6 +870,32 @@ export type LastModifiedConfig = boolean | {
|
|
|
856
870
|
/** Where the date comes from. Defaults to `git`. */
|
|
857
871
|
type?: "git" | "frontmatter";
|
|
858
872
|
};
|
|
873
|
+
/**
|
|
874
|
+
* Date presentation for the "last updated" stamp and the changelog timeline —
|
|
875
|
+
* a curated pass-through to `Intl.DateTimeFormat`, shared by both surfaces.
|
|
876
|
+
* Defaults to `{ dateStyle: "long" }`. Dates render in UTC unless `timeZone` is
|
|
877
|
+
* set. `dateStyle` is a preset and can't be combined with the component fields.
|
|
878
|
+
*/
|
|
879
|
+
export interface DateFormatConfig {
|
|
880
|
+
/** Preset date length; mutually exclusive with the component fields below. */
|
|
881
|
+
dateStyle?: "full" | "long" | "medium" | "short";
|
|
882
|
+
/** Weekday representation. */
|
|
883
|
+
weekday?: "long" | "short" | "narrow";
|
|
884
|
+
/** Era representation (e.g. the Japanese imperial era). */
|
|
885
|
+
era?: "long" | "short" | "narrow";
|
|
886
|
+
/** Year representation. */
|
|
887
|
+
year?: "numeric" | "2-digit";
|
|
888
|
+
/** Month representation. */
|
|
889
|
+
month?: "numeric" | "2-digit" | "long" | "short" | "narrow";
|
|
890
|
+
/** Day representation. */
|
|
891
|
+
day?: "numeric" | "2-digit";
|
|
892
|
+
/** IANA time zone (e.g. `Asia/Tokyo`). Defaults to `UTC`. */
|
|
893
|
+
timeZone?: string;
|
|
894
|
+
/** Calendar system (e.g. `japanese`, `buddhist`). */
|
|
895
|
+
calendar?: string;
|
|
896
|
+
/** Numbering system (e.g. `latn`, `arab`). */
|
|
897
|
+
numberingSystem?: string;
|
|
898
|
+
}
|
|
859
899
|
/**
|
|
860
900
|
* On-page table of contents. `true`/`false` toggles it; the object form narrows
|
|
861
901
|
* the heading range. Defaults to on, H2–H3.
|
|
@@ -892,6 +932,11 @@ export interface BlumeConfig {
|
|
|
892
932
|
basePath?: string;
|
|
893
933
|
/** Where content lives and how it's discovered. */
|
|
894
934
|
content?: ContentConfig;
|
|
935
|
+
/**
|
|
936
|
+
* Date presentation for the "last updated" stamp and the changelog timeline.
|
|
937
|
+
* Pass-through `Intl.DateTimeFormat` options; defaults to `{ dateStyle: "long" }`.
|
|
938
|
+
*/
|
|
939
|
+
dateFormat?: DateFormatConfig;
|
|
895
940
|
/** Where and how the site deploys (site URL, adapter, output mode). */
|
|
896
941
|
deployment?: DeploymentConfig;
|
|
897
942
|
/** Default meta description, used where a page sets none. */
|
|
@@ -77,9 +77,9 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
77
77
|
title: z.ZodDefault<z.ZodString>;
|
|
78
78
|
you: z.ZodDefault<z.ZodString>;
|
|
79
79
|
}, "strip", z.ZodTypeAny, {
|
|
80
|
-
title: string;
|
|
81
80
|
label: string;
|
|
82
81
|
ai: string;
|
|
82
|
+
title: string;
|
|
83
83
|
empty: string;
|
|
84
84
|
error: string;
|
|
85
85
|
placeholder: string;
|
|
@@ -90,9 +90,9 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
90
90
|
tip: string;
|
|
91
91
|
you: string;
|
|
92
92
|
}, {
|
|
93
|
-
title?: string | undefined;
|
|
94
93
|
label?: string | undefined;
|
|
95
94
|
ai?: string | undefined;
|
|
95
|
+
title?: string | undefined;
|
|
96
96
|
empty?: string | undefined;
|
|
97
97
|
error?: string | undefined;
|
|
98
98
|
placeholder?: string | undefined;
|
|
@@ -115,12 +115,12 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
115
115
|
showReleases: z.ZodDefault<z.ZodString>;
|
|
116
116
|
title: z.ZodDefault<z.ZodString>;
|
|
117
117
|
}, "strip", z.ZodTypeAny, {
|
|
118
|
-
title: string;
|
|
119
118
|
description: string;
|
|
119
|
+
title: string;
|
|
120
120
|
showReleases: string;
|
|
121
121
|
}, {
|
|
122
|
-
title?: string | undefined;
|
|
123
122
|
description?: string | undefined;
|
|
123
|
+
title?: string | undefined;
|
|
124
124
|
showReleases?: string | undefined;
|
|
125
125
|
}>>;
|
|
126
126
|
content: z.ZodDefault<z.ZodObject<{
|
|
@@ -198,12 +198,12 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
198
198
|
home: z.ZodDefault<z.ZodString>;
|
|
199
199
|
title: z.ZodDefault<z.ZodString>;
|
|
200
200
|
}, "strip", z.ZodTypeAny, {
|
|
201
|
-
title: string;
|
|
202
201
|
description: string;
|
|
202
|
+
title: string;
|
|
203
203
|
home: string;
|
|
204
204
|
}, {
|
|
205
|
-
title?: string | undefined;
|
|
206
205
|
description?: string | undefined;
|
|
206
|
+
title?: string | undefined;
|
|
207
207
|
home?: string | undefined;
|
|
208
208
|
}>>;
|
|
209
209
|
page: z.ZodDefault<z.ZodObject<{
|
|
@@ -283,9 +283,9 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
283
283
|
}>>;
|
|
284
284
|
}, "strip", z.ZodTypeAny, {
|
|
285
285
|
ask: {
|
|
286
|
-
title: string;
|
|
287
286
|
label: string;
|
|
288
287
|
ai: string;
|
|
288
|
+
title: string;
|
|
289
289
|
empty: string;
|
|
290
290
|
error: string;
|
|
291
291
|
placeholder: string;
|
|
@@ -333,8 +333,8 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
333
333
|
results: string;
|
|
334
334
|
};
|
|
335
335
|
changelog: {
|
|
336
|
-
title: string;
|
|
337
336
|
description: string;
|
|
337
|
+
title: string;
|
|
338
338
|
showReleases: string;
|
|
339
339
|
};
|
|
340
340
|
toc: {
|
|
@@ -377,15 +377,15 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
377
377
|
toggleTheme: string;
|
|
378
378
|
};
|
|
379
379
|
notFound: {
|
|
380
|
-
title: string;
|
|
381
380
|
description: string;
|
|
381
|
+
title: string;
|
|
382
382
|
home: string;
|
|
383
383
|
};
|
|
384
384
|
}, {
|
|
385
385
|
ask?: {
|
|
386
|
-
title?: string | undefined;
|
|
387
386
|
label?: string | undefined;
|
|
388
387
|
ai?: string | undefined;
|
|
388
|
+
title?: string | undefined;
|
|
389
389
|
empty?: string | undefined;
|
|
390
390
|
error?: string | undefined;
|
|
391
391
|
placeholder?: string | undefined;
|
|
@@ -433,8 +433,8 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
433
433
|
results?: string | undefined;
|
|
434
434
|
} | undefined;
|
|
435
435
|
changelog?: {
|
|
436
|
-
title?: string | undefined;
|
|
437
436
|
description?: string | undefined;
|
|
437
|
+
title?: string | undefined;
|
|
438
438
|
showReleases?: string | undefined;
|
|
439
439
|
} | undefined;
|
|
440
440
|
toc?: {
|
|
@@ -477,8 +477,8 @@ declare const uiStringsObject: z.ZodObject<{
|
|
|
477
477
|
toggleTheme?: string | undefined;
|
|
478
478
|
} | undefined;
|
|
479
479
|
notFound?: {
|
|
480
|
-
title?: string | undefined;
|
|
481
480
|
description?: string | undefined;
|
|
481
|
+
title?: string | undefined;
|
|
482
482
|
home?: string | undefined;
|
|
483
483
|
} | undefined;
|
|
484
484
|
}>;
|
|
@@ -552,9 +552,9 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
552
552
|
title: z.ZodDefault<z.ZodString>;
|
|
553
553
|
you: z.ZodDefault<z.ZodString>;
|
|
554
554
|
}, "strip", z.ZodTypeAny, {
|
|
555
|
-
title: string;
|
|
556
555
|
label: string;
|
|
557
556
|
ai: string;
|
|
557
|
+
title: string;
|
|
558
558
|
empty: string;
|
|
559
559
|
error: string;
|
|
560
560
|
placeholder: string;
|
|
@@ -565,9 +565,9 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
565
565
|
tip: string;
|
|
566
566
|
you: string;
|
|
567
567
|
}, {
|
|
568
|
-
title?: string | undefined;
|
|
569
568
|
label?: string | undefined;
|
|
570
569
|
ai?: string | undefined;
|
|
570
|
+
title?: string | undefined;
|
|
571
571
|
empty?: string | undefined;
|
|
572
572
|
error?: string | undefined;
|
|
573
573
|
placeholder?: string | undefined;
|
|
@@ -590,12 +590,12 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
590
590
|
showReleases: z.ZodDefault<z.ZodString>;
|
|
591
591
|
title: z.ZodDefault<z.ZodString>;
|
|
592
592
|
}, "strip", z.ZodTypeAny, {
|
|
593
|
-
title: string;
|
|
594
593
|
description: string;
|
|
594
|
+
title: string;
|
|
595
595
|
showReleases: string;
|
|
596
596
|
}, {
|
|
597
|
-
title?: string | undefined;
|
|
598
597
|
description?: string | undefined;
|
|
598
|
+
title?: string | undefined;
|
|
599
599
|
showReleases?: string | undefined;
|
|
600
600
|
}>>;
|
|
601
601
|
content: z.ZodDefault<z.ZodObject<{
|
|
@@ -673,12 +673,12 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
673
673
|
home: z.ZodDefault<z.ZodString>;
|
|
674
674
|
title: z.ZodDefault<z.ZodString>;
|
|
675
675
|
}, "strip", z.ZodTypeAny, {
|
|
676
|
-
title: string;
|
|
677
676
|
description: string;
|
|
677
|
+
title: string;
|
|
678
678
|
home: string;
|
|
679
679
|
}, {
|
|
680
|
-
title?: string | undefined;
|
|
681
680
|
description?: string | undefined;
|
|
681
|
+
title?: string | undefined;
|
|
682
682
|
home?: string | undefined;
|
|
683
683
|
}>>;
|
|
684
684
|
page: z.ZodDefault<z.ZodObject<{
|
|
@@ -758,9 +758,9 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
758
758
|
}>>;
|
|
759
759
|
}, "strip", z.ZodTypeAny, {
|
|
760
760
|
ask: {
|
|
761
|
-
title: string;
|
|
762
761
|
label: string;
|
|
763
762
|
ai: string;
|
|
763
|
+
title: string;
|
|
764
764
|
empty: string;
|
|
765
765
|
error: string;
|
|
766
766
|
placeholder: string;
|
|
@@ -808,8 +808,8 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
808
808
|
results: string;
|
|
809
809
|
};
|
|
810
810
|
changelog: {
|
|
811
|
-
title: string;
|
|
812
811
|
description: string;
|
|
812
|
+
title: string;
|
|
813
813
|
showReleases: string;
|
|
814
814
|
};
|
|
815
815
|
toc: {
|
|
@@ -852,15 +852,15 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
852
852
|
toggleTheme: string;
|
|
853
853
|
};
|
|
854
854
|
notFound: {
|
|
855
|
-
title: string;
|
|
856
855
|
description: string;
|
|
856
|
+
title: string;
|
|
857
857
|
home: string;
|
|
858
858
|
};
|
|
859
859
|
}, {
|
|
860
860
|
ask?: {
|
|
861
|
-
title?: string | undefined;
|
|
862
861
|
label?: string | undefined;
|
|
863
862
|
ai?: string | undefined;
|
|
863
|
+
title?: string | undefined;
|
|
864
864
|
empty?: string | undefined;
|
|
865
865
|
error?: string | undefined;
|
|
866
866
|
placeholder?: string | undefined;
|
|
@@ -908,8 +908,8 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
908
908
|
results?: string | undefined;
|
|
909
909
|
} | undefined;
|
|
910
910
|
changelog?: {
|
|
911
|
-
title?: string | undefined;
|
|
912
911
|
description?: string | undefined;
|
|
912
|
+
title?: string | undefined;
|
|
913
913
|
showReleases?: string | undefined;
|
|
914
914
|
} | undefined;
|
|
915
915
|
toc?: {
|
|
@@ -952,8 +952,8 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
|
|
|
952
952
|
toggleTheme?: string | undefined;
|
|
953
953
|
} | undefined;
|
|
954
954
|
notFound?: {
|
|
955
|
-
title?: string | undefined;
|
|
956
955
|
description?: string | undefined;
|
|
956
|
+
title?: string | undefined;
|
|
957
957
|
home?: string | undefined;
|
|
958
958
|
} | undefined;
|
|
959
959
|
}>>;
|