blume 0.2.0 → 0.3.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 (71) hide show
  1. package/dist/cli/index.js +1921 -560
  2. package/dist/cli/index.js.map +36 -24
  3. package/dist/types/core/data.d.ts +16 -0
  4. package/dist/types/core/define-components.d.ts +9 -2
  5. package/dist/types/core/diagnostics.d.ts +5 -0
  6. package/dist/types/core/schema.d.ts +26 -502
  7. package/dist/types/core/types.d.ts +2 -2
  8. package/docs/02-deployment.mdx +21 -2
  9. package/docs/advanced/custom-pages.mdx +63 -1
  10. package/docs/configuration/ai.mdx +20 -3
  11. package/docs/configuration/customization.mdx +103 -5
  12. package/docs/configuration/index.mdx +13 -0
  13. package/docs/configuration/seo.mdx +5 -0
  14. package/docs/content/islands.mdx +73 -0
  15. package/docs/content/navigation.mdx +25 -0
  16. package/docs/index.mdx +3 -12
  17. package/docs/reference/cli.mdx +42 -0
  18. package/package.json +3 -1
  19. package/src/ai/ask-context.ts +131 -0
  20. package/src/ai/ask-data.ts +25 -0
  21. package/src/astro/component-slots.ts +165 -0
  22. package/src/astro/generate.ts +132 -13
  23. package/src/astro/integration.ts +59 -0
  24. package/src/astro/pages.ts +5 -12
  25. package/src/astro/templates.ts +92 -44
  26. package/src/blume-modules.d.ts +25 -0
  27. package/src/cli/commands/build.ts +186 -1
  28. package/src/cli/commands/check.ts +62 -0
  29. package/src/cli/commands/dev.ts +21 -1
  30. package/src/cli/commands/doctor.ts +23 -6
  31. package/src/cli/commands/init.ts +163 -15
  32. package/src/cli/commands/validate.ts +16 -2
  33. package/src/cli/index.ts +15 -0
  34. package/src/cli/internal-error.ts +63 -0
  35. package/src/cli/log.ts +30 -1
  36. package/src/cli/prepare.ts +17 -3
  37. package/src/cli/required-secrets.ts +44 -0
  38. package/src/components/BlumePage.astro +107 -0
  39. package/src/components/index.ts +3 -3
  40. package/src/components/islands/ask-ai.tsx +15 -1
  41. package/src/components/islands/hooks.ts +188 -0
  42. package/src/components/layout/Empty.astro +6 -0
  43. package/src/components/layout/Header.astro +24 -39
  44. package/src/components/layout/Logo.astro +50 -0
  45. package/src/components/layout/NavSelector.astro +75 -0
  46. package/src/components/layout/PageLayout.astro +38 -2
  47. package/src/components/layout/RootLayout.astro +70 -4
  48. package/src/components/layout/hydration-hint.ts +30 -0
  49. package/src/components/layout/overrides.ts +6 -4
  50. package/src/components/props.ts +68 -0
  51. package/src/core/builtin-tags.ts +39 -0
  52. package/src/core/component-diagnostics.ts +44 -0
  53. package/src/core/component-overrides.ts +478 -0
  54. package/src/core/config.ts +8 -0
  55. package/src/core/data.ts +14 -0
  56. package/src/core/define-components.ts +9 -2
  57. package/src/core/diagnostics.ts +90 -1
  58. package/src/core/graph.ts +7 -0
  59. package/src/core/nav-diagnostics.ts +205 -0
  60. package/src/core/project-graph.ts +40 -1
  61. package/src/core/schema.ts +28 -96
  62. package/src/core/sources/normalize.ts +51 -0
  63. package/src/core/types.ts +2 -2
  64. package/src/deploy/redirects.ts +43 -0
  65. package/src/migrate/mintlify/config.ts +1 -176
  66. package/src/migrate/starlight/config.ts +0 -4
  67. package/src/og/card.ts +163 -38
  68. package/src/registry/eject.ts +39 -9
  69. package/src/registry/registry.ts +166 -0
  70. package/src/runtime/index.ts +61 -0
  71. package/src/vite-env.d.ts +14 -0
@@ -110,6 +110,22 @@ export interface BlumeDataConfig {
110
110
  structuredData: boolean;
111
111
  theme: ResolvedConfig["theme"];
112
112
  title: string;
113
+ /** Table-of-contents settings: whether to show it and the heading range. */
114
+ toc: ResolvedConfig["toc"];
115
+ }
116
+ /**
117
+ * The compact snapshot the layout serializes into the page for React island
118
+ * hooks (`blume/hooks`). Islands hydrate independently, so this is read from a
119
+ * `<script type="application/json" id="blume-client-data">` tag rather than
120
+ * React context.
121
+ */
122
+ export interface BlumeClientData {
123
+ config: BlumeDataConfig;
124
+ navigation: Navigation;
125
+ page: {
126
+ route: string;
127
+ title: string;
128
+ };
113
129
  }
114
130
  /** The `blume:data` module a Blume site's custom pages import. */
115
131
  export interface BlumeData {
@@ -15,10 +15,17 @@ export interface IslandDescriptor {
15
15
  export type ComponentOverride = ComponentReference | IslandDescriptor;
16
16
  /** User-authored component overrides, grouped by surface. */
17
17
  export interface ComponentOverrides {
18
+ /**
19
+ * Interactive framework components made available in every `.mdx` page. Like
20
+ * `mdx`, but hydrated: entries default to `client: "visible"`. Shorthand for
21
+ * an `mdx` descriptor with a client mode, and the config-file equivalent of
22
+ * dropping a component in the `islands/` folder.
23
+ */
24
+ islands?: Record<string, ComponentOverride>;
25
+ /** Layout slot overrides (`Header`, `Sidebar`, `Footer`, ...). */
26
+ layout?: Record<string, ComponentOverride>;
18
27
  /** MDX component map overrides (`Callout`, `Card`, ...). */
19
28
  mdx?: Record<string, ComponentOverride>;
20
- /** Layout slot overrides (`Header`, `Sidebar`, `Search`, ...). */
21
- layout?: Record<string, ComponentOverride>;
22
29
  }
23
30
  /**
24
31
  * Identity helper for authoring `components.ts`. Provides type inference and a
@@ -6,10 +6,15 @@ export declare class BlumeError extends Error {
6
6
  constructor(diagnostic: Diagnostic);
7
7
  }
8
8
  export declare const createDiagnostic: (diagnostic: Diagnostic) => Diagnostic;
9
+ /** The docs URL that explains a diagnostic code, if one is mapped. */
10
+ export declare const resolveDocsUrl: (code: string) => string | undefined;
11
+ /** Fill in `docsUrl` from the code map where a diagnostic doesn't set its own. */
12
+ export declare const enrichDiagnostic: (diagnostic: Diagnostic) => Diagnostic;
9
13
  /** Convert a ZodError into Blume diagnostics, anchored to a file. */
10
14
  export declare const diagnosticsFromZod: (error: ZodError, options: {
11
15
  code: string;
12
16
  file?: string;
17
+ source?: string;
13
18
  }) => Diagnostic[];
14
19
  /** Format a single diagnostic for terminal output. */
15
20
  export declare const formatDiagnostic: (diagnostic: Diagnostic, root?: string) => string;