blume 1.0.4 → 1.1.1

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 (117) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/cli/index.js +13404 -10228
  3. package/dist/cli/index.js.map +94 -63
  4. package/dist/types/ai/component-markdown.d.ts +12 -1
  5. package/dist/types/core/config-input.d.ts +73 -4
  6. package/dist/types/core/data.d.ts +9 -0
  7. package/dist/types/core/deployment-env.d.ts +6 -0
  8. package/dist/types/core/diagnostics.d.ts +23 -0
  9. package/dist/types/core/i18n-ui.d.ts +8 -8
  10. package/dist/types/core/schema.d.ts +144 -22
  11. package/dist/types/core/sources/types.d.ts +3 -1
  12. package/dist/types/core/standard-schema.d.ts +41 -0
  13. package/dist/types/core/types.d.ts +20 -0
  14. package/dist/types/og/card.d.ts +63 -0
  15. package/dist/types/og/dimensions.d.ts +12 -0
  16. package/docs/01-quickstart.mdx +1 -1
  17. package/docs/02-deployment.mdx +9 -1
  18. package/docs/advanced/api-reference.mdx +11 -0
  19. package/docs/advanced/changelog.mdx +2 -2
  20. package/docs/advanced/skills.mdx +1 -1
  21. package/docs/configuration/ai.mdx +3 -3
  22. package/docs/configuration/customization.mdx +1 -1
  23. package/docs/configuration/export.mdx +1 -1
  24. package/docs/configuration/index.mdx +21 -1
  25. package/docs/configuration/search.mdx +28 -1
  26. package/docs/configuration/seo.mdx +37 -2
  27. package/docs/configuration/theming.mdx +1 -1
  28. package/docs/content/components.mdx +14 -0
  29. package/docs/content/index.mdx +1 -1
  30. package/docs/content/meta.mdx +1 -1
  31. package/docs/content/navigation.mdx +5 -1
  32. package/docs/content/sources.mdx +1 -1
  33. package/docs/reference/cli.mdx +80 -2
  34. package/docs/reference/frontmatter.mdx +31 -1
  35. package/package.json +4 -3
  36. package/skills/blume-migrate/SKILL.md +1 -1
  37. package/skills/blume-migrate/references/mintlify.md +3 -2
  38. package/skills/blume-migrate/scripts/mintlify-codemod.mjs +16 -4
  39. package/src/ai/component-markdown.ts +39 -11
  40. package/src/ai/llms.ts +19 -2
  41. package/src/ai/markdown.ts +5 -1
  42. package/src/astro/adapter-root.ts +70 -0
  43. package/src/astro/generate.ts +124 -50
  44. package/src/astro/index.ts +1 -0
  45. package/src/astro/pages.ts +39 -8
  46. package/src/astro/templates.ts +93 -28
  47. package/src/audit/agent.ts +114 -0
  48. package/src/audit/catalog.ts +826 -0
  49. package/src/audit/checks/assets.ts +177 -0
  50. package/src/audit/checks/content.ts +231 -0
  51. package/src/audit/checks/duplicates.ts +131 -0
  52. package/src/audit/checks/i18n.ts +246 -0
  53. package/src/audit/checks/indexability.ts +213 -0
  54. package/src/audit/checks/links.ts +223 -0
  55. package/src/audit/checks/llms.ts +138 -0
  56. package/src/audit/checks/network.ts +272 -0
  57. package/src/audit/checks/og-image.ts +113 -0
  58. package/src/audit/checks/redirects.ts +87 -0
  59. package/src/audit/checks/robots.ts +114 -0
  60. package/src/audit/checks/sitemap.ts +229 -0
  61. package/src/audit/checks/social.ts +238 -0
  62. package/src/audit/crawl.ts +259 -0
  63. package/src/audit/graph.ts +74 -0
  64. package/src/audit/html.ts +54 -0
  65. package/src/audit/image-size.ts +63 -0
  66. package/src/audit/locate.ts +33 -0
  67. package/src/audit/redirects.ts +74 -0
  68. package/src/audit/report.ts +278 -0
  69. package/src/audit/run.ts +198 -0
  70. package/src/audit/snapshot.ts +189 -0
  71. package/src/audit/types.ts +214 -0
  72. package/src/audit/url.ts +103 -0
  73. package/src/cli/commands/audit.ts +205 -0
  74. package/src/cli/commands/build.ts +64 -13
  75. package/src/cli/index.ts +2 -0
  76. package/src/cli/prepare.ts +10 -2
  77. package/src/components/content/Tabs.astro +98 -15
  78. package/src/components/layout/Breadcrumbs.astro +1 -1
  79. package/src/components/layout/Header.astro +1 -0
  80. package/src/components/layout/PageFeedback.astro +1 -1
  81. package/src/components/layout/PageLayout.astro +5 -1
  82. package/src/components/layout/Pagination.astro +1 -1
  83. package/src/components/layout/RootLayout.astro +5 -3
  84. package/src/components/layout/Search.astro +35 -6
  85. package/src/components/layout/TableOfContents.astro +1 -1
  86. package/src/components/openapi/Authorization.astro +80 -0
  87. package/src/components/openapi/Operation.astro +19 -1
  88. package/src/components/openapi/ParametersTable.astro +1 -1
  89. package/src/components/openapi/security.ts +201 -0
  90. package/src/components/openapi/snippets.ts +42 -13
  91. package/src/core/config-input.ts +78 -4
  92. package/src/core/data.ts +9 -1
  93. package/src/core/deployment-env.ts +9 -0
  94. package/src/core/diagnostics.ts +61 -12
  95. package/src/core/graph.ts +23 -4
  96. package/src/core/links.ts +2 -91
  97. package/src/core/nav-diagnostics.ts +48 -4
  98. package/src/core/navigation.ts +169 -14
  99. package/src/core/probe.ts +136 -0
  100. package/src/core/project-graph.ts +54 -20
  101. package/src/core/schema.ts +93 -3
  102. package/src/core/sources/github-releases.ts +65 -2
  103. package/src/core/sources/normalize.ts +198 -25
  104. package/src/core/sources/types.ts +3 -1
  105. package/src/core/standard-schema.ts +54 -0
  106. package/src/core/types.ts +20 -0
  107. package/src/deploy/adapter-output.ts +27 -15
  108. package/src/deploy/headers.ts +66 -0
  109. package/src/deploy/redirects.ts +49 -9
  110. package/src/markdown/index.ts +1 -0
  111. package/src/markdown/twoslash.ts +60 -0
  112. package/src/og/card.ts +98 -33
  113. package/src/og/index.ts +1 -1
  114. package/src/registry/eject.ts +3 -1
  115. package/src/search/popular.ts +33 -0
  116. package/src/theme/entry.ts +6 -1
  117. /package/docs/{03-faq.mdx → 07-faq.mdx} +0 -0
@@ -14,6 +14,12 @@ export interface ComponentMarkdownContext extends EvaluatedProps {
14
14
  childComponents: (name: string) => ComponentMarkdownChild[];
15
15
  /** The element's body, downleveled and dedented (empty if self-closing). */
16
16
  children: string;
17
+ /**
18
+ * The page's parsed front-matter (empty when the caller has none). Lets a
19
+ * serializer read page metadata directly, even when a prop expression is
20
+ * not statically evaluable.
21
+ */
22
+ frontmatter: Record<string, unknown>;
17
23
  }
18
24
  /**
19
25
  * A component's Markdown serializer. Return the replacement Markdown, or
@@ -29,6 +35,11 @@ export type ComponentMarkdown = (context: ComponentMarkdownContext) => string |
29
35
  * `components` adds user serializers from `ai.markdownComponents`, layered
30
36
  * over the built-ins: a same-name entry replaces the built-in serializer, and
31
37
  * one that always returns `null` effectively opts that component out.
38
+ *
39
+ * `frontmatter` is the page's parsed front-matter data. It is put in scope
40
+ * when evaluating attribute expressions — so `prop={frontmatter.status}`
41
+ * resolves the way it does when Astro renders the page — and handed to
42
+ * serializers on their context.
32
43
  */
33
- export declare const downlevelComponents: (source: string, components?: Record<string, ComponentMarkdown>) => string;
44
+ export declare const downlevelComponents: (source: string, components?: Record<string, ComponentMarkdown>, frontmatter?: Record<string, unknown>) => string;
34
45
  export {};
@@ -2,6 +2,7 @@ import type { ComponentMarkdown } from "../ai/component-markdown.ts";
2
2
  import type { FontSlug } from "../theme/fonts.ts";
3
3
  import type { OpenApiSource, SearchProvider, SidebarDisplay, SidebarItemConfig } from "./schema.ts";
4
4
  import type { ContentSource } from "./sources/types.ts";
5
+ import type { StandardSchema } from "./standard-schema.ts";
5
6
  /**
6
7
  * The public, hand-documented authoring type for `blume.config.ts`.
7
8
  *
@@ -382,6 +383,15 @@ export interface TypesenseSearch {
382
383
  export interface MixedbreadSearch {
383
384
  storeId: string;
384
385
  }
386
+ /** A curated link for the search dialog empty state. */
387
+ export interface SearchPopularLink {
388
+ /** Internal route or external URL. */
389
+ href: string;
390
+ /** Built-in icon name shown beside the label; defaults to the file glyph. */
391
+ icon?: string;
392
+ /** Link label shown in the dialog. */
393
+ label: string;
394
+ }
385
395
  /**
386
396
  * Search backend. The default `orama` builds a local index at build time (and
387
397
  * runs in dev); hosted providers need their credential block below. `none`
@@ -399,6 +409,11 @@ export interface SearchConfig {
399
409
  mixedbread?: MixedbreadSearch;
400
410
  /** Orama Cloud credentials (required when `provider` is `orama-cloud`). */
401
411
  oramaCloud?: OramaCloudSearch;
412
+ /**
413
+ * Curated links for the Cmd+K empty state. When omitted or empty, the first
414
+ * sidebar pages are shown instead.
415
+ */
416
+ popular?: SearchPopularLink[];
402
417
  /** Which backend powers search. Defaults to `orama`. */
403
418
  provider?: SearchProvider;
404
419
  /** Typesense credentials (required when `provider` is `typesense`). */
@@ -472,9 +487,11 @@ export interface AiConfig {
472
487
  /**
473
488
  * Markdown serializers for custom components in agent-facing output (the
474
489
  * `.md` mirror, `llms-full.txt`, MCP `get_page`), keyed by JSX name. Each
475
- * receives the component's statically-evaluated `props` and downleveled
476
- * `children` and returns replacement Markdown — or `null` to leave the JSX
477
- * verbatim. A same-name entry replaces a built-in serializer.
490
+ * receives the component's statically-evaluated `props` (with the page's
491
+ * `frontmatter` in scope, so `prop={frontmatter.status}` resolves), its
492
+ * downleveled `children`, and the page's `frontmatter` data, and returns
493
+ * replacement Markdown — or `null` to leave the JSX verbatim. A same-name
494
+ * entry replaces a built-in serializer.
478
495
  *
479
496
  * These live in `blume.config.ts` (which is executed at build time), not in
480
497
  * `components.tsx` (which is only statically analyzed, never run).
@@ -602,7 +619,7 @@ export interface RssConfig {
602
619
  /** Content types that each get a feed at `/<type>/rss.xml`. Defaults to blog + changelog. */
603
620
  types?: string[];
604
621
  }
605
- /** Colors used by generated Open Graph cards. Values must be hex colors. */
622
+ /** Colors used by generated Open Graph cards. Any CSS color — hex, `oklch(…)`, `rgb(…)`, named. */
606
623
  export interface OgPaletteConfig {
607
624
  /** Fallback mark color. Defaults to the light theme accent. */
608
625
  accent?: string;
@@ -623,10 +640,29 @@ export interface OgConfig {
623
640
  * value always wins.
624
641
  */
625
642
  enabled?: boolean;
643
+ /**
644
+ * Google Font families for the generated card, extending Takumi's Latin-only
645
+ * default so non-Latin titles (CJK, and so on) render instead of tofu.
646
+ * Fetched from Google Fonts at build. A bare string loads the family's
647
+ * default weights; the object form pins weights (`700`, `[400, 700]`, or a
648
+ * `"100..900"` variable range) and styles.
649
+ */
650
+ fonts?: (string | {
651
+ name: string;
652
+ style?: "normal" | "italic" | ("normal" | "italic")[];
653
+ weight?: number | number[] | string;
654
+ })[];
626
655
  /** Local SVG used in the generated card instead of the site logo. */
627
656
  logo?: string;
628
657
  /** Optional generated-card colors. */
629
658
  palette?: OgPaletteConfig;
659
+ /**
660
+ * Card headlines for custom `.astro` pages, keyed by route (`"/"`, `"/cli"`).
661
+ * A custom page has no frontmatter to read, so its card is otherwise titled
662
+ * by humanizing its last URL segment (`/cli` → "Cli"); an entry here wins.
663
+ * Content pages always take their card headline from the page title.
664
+ */
665
+ titles?: Record<string, string>;
630
666
  }
631
667
  /** Discoverability: OG images, feeds, sitemap, robots, and structured data. */
632
668
  export interface SeoConfig {
@@ -780,6 +816,37 @@ export type ExportConfig = boolean | {
780
816
  /** Offer PDF export (via print). Defaults to `false`. */
781
817
  pdf?: boolean;
782
818
  };
819
+ /**
820
+ * Opt-in custom frontmatter keys. Page frontmatter is strictly validated —
821
+ * an unknown key fails the build so typos are caught — and `extend` carves
822
+ * out project-specific keys from that rule, each validated by a schema you
823
+ * supply.
824
+ */
825
+ export interface FrontmatterConfig {
826
+ /**
827
+ * Extra frontmatter keys pages may carry, mapped to their validation
828
+ * schemas — any library implementing Standard Schema works (Zod — the
829
+ * version your project installs, 3.24+ or 4 — Valibot, ArkType):
830
+ *
831
+ * ```ts
832
+ * import { z } from "zod";
833
+ *
834
+ * frontmatter: {
835
+ * extend: {
836
+ * owner: z.string(),
837
+ * reviewedAt: z.coerce.date().optional(),
838
+ * },
839
+ * },
840
+ * ```
841
+ *
842
+ * Every declared key is validated on every page — absent ones included —
843
+ * so a required schema enforces the key site-wide; mark it `.optional()`
844
+ * to validate only when present. Validated values are preserved on each
845
+ * page record's `custom` field. Built-in frontmatter fields cannot be
846
+ * redeclared.
847
+ */
848
+ extend?: Record<string, StandardSchema>;
849
+ }
783
850
  /**
784
851
  * "Last updated" timestamps. `false` (default) disables them; `true` derives
785
852
  * each date from git history; the object form selects the source. A page's
@@ -843,6 +910,8 @@ export interface BlumeConfig {
843
910
  export?: ExportConfig;
844
911
  /** Show the per-page "Was this helpful?" widget. Defaults to `true`. */
845
912
  feedback?: boolean;
913
+ /** Opt-in custom frontmatter keys, validated by schemas you supply. */
914
+ frontmatter?: FrontmatterConfig;
846
915
  /** Source repository (Edit-this-page links and the header repo link). */
847
916
  github?: GithubConfig;
848
917
  /** Internationalization (opt-in multi-locale). */
@@ -1,3 +1,4 @@
1
+ import type { OgFont } from "../og/card.ts";
1
2
  import type { UIStrings } from "./i18n-ui.ts";
2
3
  import type { ResolvedConfig, SearchProvider } from "./schema.ts";
3
4
  import type { Navigation, RouteAlternate } from "./types.ts";
@@ -118,6 +119,8 @@ export interface BlumeDataConfig {
118
119
  /** Open Graph image generation. */
119
120
  og: {
120
121
  enabled: boolean;
122
+ /** Extra Google Font family specs for the card renderer, fetched at build. */
123
+ fonts?: OgFont[];
121
124
  logo?: string;
122
125
  palette?: ResolvedConfig["seo"]["og"]["palette"];
123
126
  };
@@ -125,6 +128,12 @@ export interface BlumeDataConfig {
125
128
  repoUrl: string | null;
126
129
  search: {
127
130
  enabled: boolean;
131
+ /** Resolved empty-state links; empty when unset (Search falls back to sidebar). */
132
+ popular: {
133
+ icon?: string;
134
+ label: string;
135
+ route: string;
136
+ }[];
128
137
  provider: SearchProvider;
129
138
  };
130
139
  /** Deployment site URL, or `null` when none is configured/detected. */
@@ -1,4 +1,10 @@
1
1
  import type { ResolvedConfig } from "./schema.ts";
2
+ /**
3
+ * Adapters whose `deployment.site` arrives from platform env vars at deploy
4
+ * time. Consumers (e.g. the audit) use this to tell "site is missing" apart
5
+ * from "site is missing *here*, but the platform will set it".
6
+ */
7
+ export declare const SITE_INFERRING_ADAPTERS: ReadonlySet<string>;
2
8
  /**
3
9
  * Fill in `deployment.adapter` and `deployment.site` from platform env vars
4
10
  * (Vercel, Netlify, Cloudflare Pages) when the user hasn't set them. Explicit
@@ -10,6 +10,29 @@ export declare const createDiagnostic: (diagnostic: Diagnostic) => Diagnostic;
10
10
  export declare const resolveDocsUrl: (code: string) => string | undefined;
11
11
  /** Fill in `docsUrl` from the code map where a diagnostic doesn't set its own. */
12
12
  export declare const enrichDiagnostic: (diagnostic: Diagnostic) => Diagnostic;
13
+ /**
14
+ * Locate a front matter key in a content file, e.g. `["seo", "description"]` in
15
+ * `docs/api.mdx`. Scoped to the front matter block so a `title:` written in the
16
+ * page body can't be mistaken for the front matter key of the same name; returns
17
+ * undefined when the file has no front matter or the key isn't set (a missing
18
+ * key has no line to point at — callers anchor to the file instead).
19
+ */
20
+ export declare const locateFrontmatterKey: (source: string, path: readonly (string | number)[]) => {
21
+ column: number;
22
+ line: number;
23
+ } | undefined;
24
+ /**
25
+ * Convert generic validation issues (message + path, the shape shared by Zod
26
+ * and Standard Schema issues) into Blume diagnostics, anchored to a file.
27
+ */
28
+ export declare const diagnosticsFromIssues: (issues: readonly {
29
+ message: string;
30
+ path: readonly (string | number)[];
31
+ }[], options: {
32
+ code: string;
33
+ file?: string;
34
+ source?: string;
35
+ }) => Diagnostic[];
13
36
  /** Convert a ZodError into Blume diagnostics, anchored to a file. */
14
37
  export declare const diagnosticsFromZod: (error: ZodError, options: {
15
38
  code: string;
@@ -243,6 +243,7 @@ declare const uiStringsObject: z.ZodObject<{
243
243
  results: z.ZodDefault<z.ZodString>;
244
244
  }, "strip", z.ZodTypeAny, {
245
245
  label: string;
246
+ popular: string;
246
247
  error: string;
247
248
  placeholder: string;
248
249
  all: string;
@@ -254,11 +255,11 @@ declare const uiStringsObject: z.ZodObject<{
254
255
  askAiHint: string;
255
256
  navigate: string;
256
257
  open: string;
257
- popular: string;
258
258
  preview: string;
259
259
  results: string;
260
260
  }, {
261
261
  label?: string | undefined;
262
+ popular?: string | undefined;
262
263
  error?: string | undefined;
263
264
  placeholder?: string | undefined;
264
265
  all?: string | undefined;
@@ -270,7 +271,6 @@ declare const uiStringsObject: z.ZodObject<{
270
271
  askAiHint?: string | undefined;
271
272
  navigate?: string | undefined;
272
273
  open?: string | undefined;
273
- popular?: string | undefined;
274
274
  preview?: string | undefined;
275
275
  results?: string | undefined;
276
276
  }>>;
@@ -317,6 +317,7 @@ declare const uiStringsObject: z.ZodObject<{
317
317
  };
318
318
  search: {
319
319
  label: string;
320
+ popular: string;
320
321
  error: string;
321
322
  placeholder: string;
322
323
  all: string;
@@ -328,7 +329,6 @@ declare const uiStringsObject: z.ZodObject<{
328
329
  askAiHint: string;
329
330
  navigate: string;
330
331
  open: string;
331
- popular: string;
332
332
  preview: string;
333
333
  results: string;
334
334
  };
@@ -417,6 +417,7 @@ declare const uiStringsObject: z.ZodObject<{
417
417
  } | undefined;
418
418
  search?: {
419
419
  label?: string | undefined;
420
+ popular?: string | undefined;
420
421
  error?: string | undefined;
421
422
  placeholder?: string | undefined;
422
423
  all?: string | undefined;
@@ -428,7 +429,6 @@ declare const uiStringsObject: z.ZodObject<{
428
429
  askAiHint?: string | undefined;
429
430
  navigate?: string | undefined;
430
431
  open?: string | undefined;
431
- popular?: string | undefined;
432
432
  preview?: string | undefined;
433
433
  results?: string | undefined;
434
434
  } | undefined;
@@ -718,6 +718,7 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
718
718
  results: z.ZodDefault<z.ZodString>;
719
719
  }, "strip", z.ZodTypeAny, {
720
720
  label: string;
721
+ popular: string;
721
722
  error: string;
722
723
  placeholder: string;
723
724
  all: string;
@@ -729,11 +730,11 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
729
730
  askAiHint: string;
730
731
  navigate: string;
731
732
  open: string;
732
- popular: string;
733
733
  preview: string;
734
734
  results: string;
735
735
  }, {
736
736
  label?: string | undefined;
737
+ popular?: string | undefined;
737
738
  error?: string | undefined;
738
739
  placeholder?: string | undefined;
739
740
  all?: string | undefined;
@@ -745,7 +746,6 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
745
746
  askAiHint?: string | undefined;
746
747
  navigate?: string | undefined;
747
748
  open?: string | undefined;
748
- popular?: string | undefined;
749
749
  preview?: string | undefined;
750
750
  results?: string | undefined;
751
751
  }>>;
@@ -792,6 +792,7 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
792
792
  };
793
793
  search: {
794
794
  label: string;
795
+ popular: string;
795
796
  error: string;
796
797
  placeholder: string;
797
798
  all: string;
@@ -803,7 +804,6 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
803
804
  askAiHint: string;
804
805
  navigate: string;
805
806
  open: string;
806
- popular: string;
807
807
  preview: string;
808
808
  results: string;
809
809
  };
@@ -892,6 +892,7 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
892
892
  } | undefined;
893
893
  search?: {
894
894
  label?: string | undefined;
895
+ popular?: string | undefined;
895
896
  error?: string | undefined;
896
897
  placeholder?: string | undefined;
897
898
  all?: string | undefined;
@@ -903,7 +904,6 @@ export declare const uiStringsSchema: z.ZodDefault<z.ZodObject<{
903
904
  askAiHint?: string | undefined;
904
905
  navigate?: string | undefined;
905
906
  open?: string | undefined;
906
- popular?: string | undefined;
907
907
  preview?: string | undefined;
908
908
  results?: string | undefined;
909
909
  } | undefined;