blume 1.0.3 → 1.1.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.
Files changed (126) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/cli/index.js +13784 -10579
  3. package/dist/cli/index.js.map +93 -61
  4. package/dist/types/core/config-input.d.ts +87 -8
  5. package/dist/types/core/data.d.ts +21 -0
  6. package/dist/types/core/deployment-env.d.ts +6 -0
  7. package/dist/types/core/diagnostics.d.ts +23 -0
  8. package/dist/types/core/i18n-ui.d.ts +140 -140
  9. package/dist/types/core/schema.d.ts +549 -370
  10. package/dist/types/core/sources/types.d.ts +3 -1
  11. package/dist/types/core/standard-schema.d.ts +41 -0
  12. package/dist/types/core/types.d.ts +23 -0
  13. package/dist/types/og/card.d.ts +63 -0
  14. package/dist/types/og/dimensions.d.ts +12 -0
  15. package/dist/types/openapi/references.d.ts +12 -7
  16. package/docs/01-quickstart.mdx +1 -1
  17. package/docs/02-deployment.mdx +9 -1
  18. package/docs/advanced/api-reference.mdx +22 -3
  19. package/docs/advanced/changelog.mdx +1 -1
  20. package/docs/advanced/skills.mdx +1 -1
  21. package/docs/configuration/ai.mdx +1 -1
  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 +40 -2
  27. package/docs/configuration/theming.mdx +1 -1
  28. package/docs/content/components.mdx +15 -2
  29. package/docs/content/index.mdx +1 -1
  30. package/docs/content/meta.mdx +1 -1
  31. package/docs/content/navigation.mdx +11 -1
  32. package/docs/content/sources.mdx +1 -1
  33. package/docs/content/syntax.mdx +116 -4
  34. package/docs/reference/cli.mdx +79 -1
  35. package/docs/reference/frontmatter.mdx +29 -1
  36. package/package.json +3 -3
  37. package/skills/blume-migrate/SKILL.md +170 -0
  38. package/skills/blume-migrate/assets/oxfmt@0.55.0.patch +20 -0
  39. package/skills/blume-migrate/references/docusaurus.md +95 -0
  40. package/skills/blume-migrate/references/fumadocs.md +95 -0
  41. package/skills/blume-migrate/references/mintlify.md +156 -0
  42. package/skills/blume-migrate/references/monorepo.md +224 -0
  43. package/skills/blume-migrate/references/nextra.md +76 -0
  44. package/skills/blume-migrate/references/starlight.md +116 -0
  45. package/skills/blume-migrate/scripts/mintlify-codemod.mjs +478 -0
  46. package/src/ai/llms.ts +15 -0
  47. package/src/astro/adapter-root.ts +70 -0
  48. package/src/astro/component-slots.ts +3 -2
  49. package/src/astro/generate.ts +132 -42
  50. package/src/astro/index.ts +1 -0
  51. package/src/astro/pages.ts +18 -3
  52. package/src/astro/templates.ts +158 -56
  53. package/src/audit/agent.ts +114 -0
  54. package/src/audit/catalog.ts +826 -0
  55. package/src/audit/checks/assets.ts +177 -0
  56. package/src/audit/checks/content.ts +231 -0
  57. package/src/audit/checks/duplicates.ts +131 -0
  58. package/src/audit/checks/i18n.ts +246 -0
  59. package/src/audit/checks/indexability.ts +213 -0
  60. package/src/audit/checks/links.ts +223 -0
  61. package/src/audit/checks/llms.ts +135 -0
  62. package/src/audit/checks/network.ts +272 -0
  63. package/src/audit/checks/og-image.ts +113 -0
  64. package/src/audit/checks/redirects.ts +87 -0
  65. package/src/audit/checks/robots.ts +114 -0
  66. package/src/audit/checks/sitemap.ts +229 -0
  67. package/src/audit/checks/social.ts +238 -0
  68. package/src/audit/crawl.ts +259 -0
  69. package/src/audit/graph.ts +74 -0
  70. package/src/audit/html.ts +54 -0
  71. package/src/audit/image-size.ts +63 -0
  72. package/src/audit/locate.ts +33 -0
  73. package/src/audit/redirects.ts +74 -0
  74. package/src/audit/report.ts +278 -0
  75. package/src/audit/run.ts +198 -0
  76. package/src/audit/snapshot.ts +189 -0
  77. package/src/audit/types.ts +214 -0
  78. package/src/audit/url.ts +103 -0
  79. package/src/cli/commands/audit.ts +205 -0
  80. package/src/cli/commands/build.ts +51 -12
  81. package/src/cli/index.ts +2 -0
  82. package/src/components/content/Callout.astro +8 -2
  83. package/src/components/content/Prompt.astro +25 -13
  84. package/src/components/content/Tabs.astro +98 -15
  85. package/src/components/layout/Breadcrumbs.astro +1 -1
  86. package/src/components/layout/Header.astro +5 -8
  87. package/src/components/layout/Logo.astro +13 -1
  88. package/src/components/layout/PageFeedback.astro +2 -2
  89. package/src/components/layout/PageLayout.astro +9 -9
  90. package/src/components/layout/Pagination.astro +7 -7
  91. package/src/components/layout/RootLayout.astro +9 -11
  92. package/src/components/layout/Search.astro +36 -7
  93. package/src/components/layout/TableOfContents.astro +1 -1
  94. package/src/components/layout/nav-utils.ts +9 -7
  95. package/src/components/openapi/Authorization.astro +80 -0
  96. package/src/components/openapi/Operation.astro +19 -1
  97. package/src/components/openapi/ParametersTable.astro +1 -1
  98. package/src/components/openapi/security.ts +201 -0
  99. package/src/components/openapi/snippets.ts +42 -13
  100. package/src/core/config-input.ts +94 -8
  101. package/src/core/data.ts +18 -2
  102. package/src/core/deployment-env.ts +9 -0
  103. package/src/core/diagnostics.ts +59 -12
  104. package/src/core/links.ts +2 -91
  105. package/src/core/nav-diagnostics.ts +48 -4
  106. package/src/core/navigation.ts +55 -13
  107. package/src/core/probe.ts +136 -0
  108. package/src/core/project-graph.ts +8 -0
  109. package/src/core/schema.ts +100 -1
  110. package/src/core/sources/normalize.ts +198 -25
  111. package/src/core/sources/types.ts +3 -1
  112. package/src/core/sources/watch.ts +5 -0
  113. package/src/core/standard-schema.ts +54 -0
  114. package/src/core/types.ts +23 -0
  115. package/src/deploy/adapter-output.ts +27 -15
  116. package/src/deploy/headers.ts +66 -0
  117. package/src/deploy/redirects.ts +49 -9
  118. package/src/markdown/index.ts +2 -0
  119. package/src/markdown/language-icon.ts +2 -1
  120. package/src/markdown/table-wrap.ts +43 -0
  121. package/src/og/card.ts +128 -36
  122. package/src/og/index.ts +1 -1
  123. package/src/og/logo.ts +21 -0
  124. package/src/openapi/references.ts +19 -16
  125. package/src/search/popular.ts +33 -0
  126. package/src/theme/entry.ts +56 -6
@@ -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`). */
@@ -602,6 +617,44 @@ export interface RssConfig {
602
617
  /** Content types that each get a feed at `/<type>/rss.xml`. Defaults to blog + changelog. */
603
618
  types?: string[];
604
619
  }
620
+ /** Colors used by generated Open Graph cards. Any CSS color — hex, `oklch(…)`, `rgb(…)`, named. */
621
+ export interface OgPaletteConfig {
622
+ /** Fallback mark color. Defaults to the light theme accent. */
623
+ accent?: string;
624
+ /** Card background. */
625
+ background?: string;
626
+ /** Footer divider. */
627
+ border?: string;
628
+ /** Headline and `currentColor` logo color. */
629
+ foreground?: string;
630
+ /** Description and footer text. */
631
+ muted?: string;
632
+ }
633
+ /** Per-page Open Graph image generation. */
634
+ export interface OgConfig {
635
+ /**
636
+ * Generate an OG image per page. Defaults to on once a deployment `site`
637
+ * URL is known and off otherwise (`og:image` must be absolute). An explicit
638
+ * value always wins.
639
+ */
640
+ enabled?: boolean;
641
+ /**
642
+ * Google Font families for the generated card, extending Takumi's Latin-only
643
+ * default so non-Latin titles (CJK, and so on) render instead of tofu.
644
+ * Fetched from Google Fonts at build. A bare string loads the family's
645
+ * default weights; the object form pins weights (`700`, `[400, 700]`, or a
646
+ * `"100..900"` variable range) and styles.
647
+ */
648
+ fonts?: (string | {
649
+ name: string;
650
+ style?: "normal" | "italic" | ("normal" | "italic")[];
651
+ weight?: number | number[] | string;
652
+ })[];
653
+ /** Local SVG used in the generated card instead of the site logo. */
654
+ logo?: string;
655
+ /** Optional generated-card colors. */
656
+ palette?: OgPaletteConfig;
657
+ }
605
658
  /** Discoverability: OG images, feeds, sitemap, robots, and structured data. */
606
659
  export interface SeoConfig {
607
660
  /**
@@ -612,14 +665,7 @@ export interface SeoConfig {
612
665
  /** robots.txt `Content-Signal` usage declaration. Defaults to `true`. */
613
666
  contentSignals?: ContentSignalsConfig;
614
667
  /** Per-page Open Graph image generation. */
615
- og?: {
616
- /**
617
- * Generate an OG image per page. Defaults to on once a deployment `site`
618
- * URL is known and off otherwise (`og:image` must be absolute). An explicit
619
- * value always wins.
620
- */
621
- enabled?: boolean;
622
- };
668
+ og?: OgConfig;
623
669
  /** Generate robots.txt (with a Sitemap reference when available). Defaults to `true`. */
624
670
  robots?: boolean;
625
671
  /** RSS/Atom feeds. */
@@ -761,6 +807,37 @@ export type ExportConfig = boolean | {
761
807
  /** Offer PDF export (via print). Defaults to `false`. */
762
808
  pdf?: boolean;
763
809
  };
810
+ /**
811
+ * Opt-in custom frontmatter keys. Page frontmatter is strictly validated —
812
+ * an unknown key fails the build so typos are caught — and `extend` carves
813
+ * out project-specific keys from that rule, each validated by a schema you
814
+ * supply.
815
+ */
816
+ export interface FrontmatterConfig {
817
+ /**
818
+ * Extra frontmatter keys pages may carry, mapped to their validation
819
+ * schemas — any library implementing Standard Schema works (Zod — the
820
+ * version your project installs, 3.24+ or 4 — Valibot, ArkType):
821
+ *
822
+ * ```ts
823
+ * import { z } from "zod";
824
+ *
825
+ * frontmatter: {
826
+ * extend: {
827
+ * owner: z.string(),
828
+ * reviewedAt: z.coerce.date().optional(),
829
+ * },
830
+ * },
831
+ * ```
832
+ *
833
+ * Every declared key is validated on every page — absent ones included —
834
+ * so a required schema enforces the key site-wide; mark it `.optional()`
835
+ * to validate only when present. Validated values are preserved on each
836
+ * page record's `custom` field. Built-in frontmatter fields cannot be
837
+ * redeclared.
838
+ */
839
+ extend?: Record<string, StandardSchema>;
840
+ }
764
841
  /**
765
842
  * "Last updated" timestamps. `false` (default) disables them; `true` derives
766
843
  * each date from git history; the object form selects the source. A page's
@@ -824,6 +901,8 @@ export interface BlumeConfig {
824
901
  export?: ExportConfig;
825
902
  /** Show the per-page "Was this helpful?" widget. Defaults to `true`. */
826
903
  feedback?: boolean;
904
+ /** Opt-in custom frontmatter keys, validated by schemas you supply. */
905
+ frontmatter?: FrontmatterConfig;
827
906
  /** Source repository (Edit-this-page links and the header repo link). */
828
907
  github?: GithubConfig;
829
908
  /** 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";
@@ -13,6 +14,16 @@ export interface BlumeLogo {
13
14
  svg?: string;
14
15
  light?: string;
15
16
  dark?: string;
17
+ dimensions?: {
18
+ dark?: {
19
+ height: number;
20
+ width: number;
21
+ };
22
+ light?: {
23
+ height: number;
24
+ width: number;
25
+ };
26
+ };
16
27
  alt: string;
17
28
  href: string;
18
29
  /** Wordmark text beside the mark; `undefined` falls back to the site title. */
@@ -108,11 +119,21 @@ export interface BlumeDataConfig {
108
119
  /** Open Graph image generation. */
109
120
  og: {
110
121
  enabled: boolean;
122
+ /** Extra Google Font family specs for the card renderer, fetched at build. */
123
+ fonts?: OgFont[];
124
+ logo?: string;
125
+ palette?: ResolvedConfig["seo"]["og"]["palette"];
111
126
  };
112
127
  /** Repository URL for header/edit links, or `null`. */
113
128
  repoUrl: string | null;
114
129
  search: {
115
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
+ }[];
116
137
  provider: SearchProvider;
117
138
  };
118
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;