boltdocs 2.0.0 → 2.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 (67) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/bin/boltdocs.js +12 -0
  3. package/dist/cache-Q4T6VAUL.mjs +1 -0
  4. package/dist/chunk-52MVMZWS.mjs +1 -0
  5. package/dist/chunk-BVWWKXJH.mjs +1 -0
  6. package/dist/chunk-DVY3RDXD.mjs +1 -0
  7. package/dist/chunk-FUVYCYWC.mjs +1 -0
  8. package/dist/{chunk-BA5NH5HU.mjs → chunk-GBLMDJ2B.mjs} +1 -1
  9. package/dist/{chunk-H63UMKYF.mjs → chunk-ISPX45DF.mjs} +1 -1
  10. package/dist/chunk-PNXZMUCO.mjs +1 -0
  11. package/dist/chunk-V2ZHKQSP.mjs +74 -0
  12. package/dist/client/components/mdx/index.d.mts +2 -3
  13. package/dist/client/components/mdx/index.d.ts +2 -3
  14. package/dist/client/components/mdx/index.js +1 -1
  15. package/dist/client/components/mdx/index.mjs +1 -1
  16. package/dist/client/hooks/index.d.mts +2 -3
  17. package/dist/client/hooks/index.d.ts +2 -3
  18. package/dist/client/hooks/index.js +1 -1
  19. package/dist/client/hooks/index.mjs +1 -1
  20. package/dist/client/index.d.mts +3 -5
  21. package/dist/client/index.d.ts +3 -5
  22. package/dist/client/index.js +1 -1
  23. package/dist/client/index.mjs +1 -1
  24. package/dist/client/ssr.d.mts +53 -6
  25. package/dist/client/ssr.d.ts +53 -6
  26. package/dist/client/ssr.mjs +1 -1
  27. package/dist/node/cli-entry.d.mts +1 -0
  28. package/dist/node/cli-entry.d.ts +1 -0
  29. package/dist/node/cli-entry.js +75 -0
  30. package/dist/node/cli-entry.mjs +2 -0
  31. package/dist/node/index.d.mts +213 -4
  32. package/dist/node/index.d.ts +213 -4
  33. package/dist/node/index.js +40 -23
  34. package/dist/node/index.mjs +1 -57
  35. package/dist/search-dialog-TWGYKF2D.mjs +1 -0
  36. package/dist/types-Cp21DHI6.d.mts +355 -0
  37. package/dist/types-Cp21DHI6.d.ts +355 -0
  38. package/dist/{use-routes-BefRXY3v.d.ts → use-routes-8Iei6jTp.d.mts} +1 -2
  39. package/dist/{use-routes-5bAtAAYX.d.mts → use-routes-xLhumjbV.d.ts} +1 -2
  40. package/package.json +7 -1
  41. package/src/client/components/ui-base/breadcrumbs.tsx +2 -1
  42. package/src/client/components/ui-base/navbar.tsx +3 -3
  43. package/src/client/components/ui-base/sidebar.tsx +2 -1
  44. package/src/client/hooks/use-navbar.ts +1 -1
  45. package/src/node/cli-entry.ts +24 -0
  46. package/src/node/cli.ts +59 -0
  47. package/src/node/config.ts +63 -11
  48. package/src/node/index.ts +39 -3
  49. package/src/node/plugin/entry.ts +7 -0
  50. package/src/node/plugin/html.ts +49 -9
  51. package/src/node/plugin/index.ts +42 -3
  52. package/src/node/ssg/index.ts +6 -1
  53. package/src/node/ssg/robots.ts +50 -0
  54. package/tsup.config.ts +36 -10
  55. package/dist/cache-7G6D532T.mjs +0 -1
  56. package/dist/chunk-A4HQPEPU.mjs +0 -1
  57. package/dist/chunk-BQCD3DWG.mjs +0 -1
  58. package/dist/chunk-IWHRQHS7.mjs +0 -1
  59. package/dist/chunk-JZXLCA2E.mjs +0 -1
  60. package/dist/chunk-MFU7Q6WF.mjs +0 -1
  61. package/dist/chunk-QYPNX5UN.mjs +0 -1
  62. package/dist/chunk-XEAPSFMB.mjs +0 -1
  63. package/dist/config-CX4l-ZNp.d.mts +0 -166
  64. package/dist/config-CX4l-ZNp.d.ts +0 -166
  65. package/dist/search-dialog-EB3N4TYM.mjs +0 -1
  66. package/dist/types-BuZWFT7r.d.ts +0 -159
  67. package/dist/types-CvT-SGbK.d.mts +0 -159
@@ -1,159 +0,0 @@
1
- import React__default from 'react';
2
- import { B as BoltdocsConfig } from './config-CX4l-ZNp.js';
3
-
4
- /**
5
- * Metadata provided by the server for a specific route.
6
- * Maps closely to the `RouteMeta` type in the Node environment.
7
- */
8
- interface ComponentRoute {
9
- /** The final URL path */
10
- path: string;
11
- /** The absolute filesystem path of the source file */
12
- componentPath: string;
13
- /** The page title */
14
- title: string;
15
- /** Explicit order in the sidebar */
16
- sidebarPosition?: number;
17
- /** The relative path from the docs directory */
18
- filePath: string;
19
- /** The group directory name */
20
- group?: string;
21
- /** The display title of the group */
22
- groupTitle?: string;
23
- /** Explicit order of the group in the sidebar */
24
- groupPosition?: number;
25
- /** Extracted markdown headings for search indexing */
26
- headings?: {
27
- level: number;
28
- text: string;
29
- id: string;
30
- }[];
31
- /** The page summary or description */
32
- description?: string;
33
- /** The locale this route belongs to, if i18n is configured */
34
- locale?: string;
35
- /** The version this route belongs to, if versioning is configured */
36
- version?: string;
37
- /** Optional icon to display (Lucide icon name or raw SVG) */
38
- icon?: string;
39
- /** The tab this route belongs to, if tabs are configured */
40
- tab?: string;
41
- /** Optional badge to display next to the sidebar item */
42
- badge?: string | {
43
- text: 'updated' | 'new' | 'deprecated';
44
- expires?: string;
45
- };
46
- /** Optional icon for the route's group */
47
- groupIcon?: string;
48
- /** The extracted plain-text content of the page for search indexing */
49
- _content?: string;
50
- /** The raw markdown content of the page */
51
- _rawContent?: string;
52
- }
53
- /**
54
- * Site configuration provided by the server.
55
- */
56
- type SiteConfig = BoltdocsConfig;
57
- /**
58
- * Configuration options for initializing the Boltdocs client app.
59
- */
60
- interface CreateBoltdocsAppOptions {
61
- /** CSS selector for the DOM element where the app should mount (e.g. '#root') */
62
- target: string;
63
- /** Initial routes generated by the Vite plugin (`virtual:boltdocs-routes`) */
64
- routes: ComponentRoute[];
65
- /** The name of the documentation directory (e.g. 'docs') */
66
- docsDirName: string;
67
- /** Site configuration (`virtual:boltdocs-config`) */
68
- config: SiteConfig;
69
- /** Dynamic import mapping from `import.meta.glob` for the documentation pages */
70
- modules: Record<string, () => Promise<{
71
- default: React__default.ComponentType<any>;
72
- }>>;
73
- /** The `import.meta.hot` instance necessary for fast refresh/HMR updates */
74
- hot?: {
75
- accept: (cb?: (mod: any) => void) => void;
76
- dispose: (cb: (data: any) => void) => void;
77
- on: (event: string, cb: (data: any) => void) => void;
78
- data: any;
79
- };
80
- /** Optional custom React component to render when visiting the root path ('/') */
81
- homePage?: React__default.ComponentType;
82
- /** Custom external pages mapped by their route path */
83
- externalPages?: Record<string, React__default.ComponentType>;
84
- /** Optional custom MDX components provided by plugins */
85
- components?: Record<string, React__default.ComponentType>;
86
- }
87
- /**
88
- * Types for CodeSandbox integration.
89
- */
90
- interface SandboxFile {
91
- content: string | object;
92
- isBinary?: boolean;
93
- }
94
- type SandboxFiles = Record<string, SandboxFile>;
95
- interface SandboxOptions {
96
- files?: SandboxFiles;
97
- dependencies?: Record<string, string>;
98
- devDependencies?: Record<string, string>;
99
- title?: string;
100
- description?: string;
101
- template?: string;
102
- /** The file path to open by default in the editor (e.g. `"src/App.tsx"`). */
103
- entry?: string;
104
- /** Options for the embedded iframe view, used by `embedSandbox()`. */
105
- embed?: SandboxEmbedOptions;
106
- /** Custom scripts for the package.json (e.g. `{ "start": "vite" }`). */
107
- scripts?: Record<string, string>;
108
- /** Optional default theme configuration for the sandbox project. */
109
- themeConfig?: Record<string, unknown>;
110
- }
111
- interface SandboxEmbedOptions {
112
- /** Which panel to display: `"editor"`, `"preview"`, or `"split"`. */
113
- view?: 'editor' | 'preview' | 'split';
114
- /** Color theme: `"dark"` or `"light"`. */
115
- theme?: 'dark' | 'light';
116
- /** Whether to hide the navigation bar in the embed. */
117
- hideNavigation?: boolean;
118
- }
119
- /**
120
- * Tab configuration for the documentation site.
121
- */
122
- interface BoltdocsTab {
123
- id: string;
124
- text: string;
125
- icon?: string;
126
- }
127
- /**
128
- * Props for the OnThisPage (TOC) component.
129
- */
130
- interface OnThisPageProps {
131
- headings?: {
132
- level: number;
133
- text: string;
134
- id: string;
135
- }[];
136
- editLink?: string;
137
- communityHelp?: string;
138
- filePath?: string;
139
- }
140
- /**
141
- * Props for user-defined layout components (layout.tsx).
142
- */
143
- interface LayoutProps {
144
- children: React__default.ReactNode;
145
- }
146
- /**
147
- * Unified type for navbar links.
148
- */
149
- interface NavbarLink {
150
- label: string;
151
- href: string;
152
- active: boolean;
153
- /** Optional icon or string for external link indication */
154
- to?: string;
155
- /** Nested items for NavigationMenu */
156
- items?: NavbarLink[];
157
- }
158
-
159
- export type { BoltdocsTab as B, ComponentRoute as C, LayoutProps as L, NavbarLink as N, OnThisPageProps as O, SandboxOptions as S, CreateBoltdocsAppOptions as a, SandboxEmbedOptions as b, SandboxFile as c, SandboxFiles as d };
@@ -1,159 +0,0 @@
1
- import React__default from 'react';
2
- import { B as BoltdocsConfig } from './config-CX4l-ZNp.mjs';
3
-
4
- /**
5
- * Metadata provided by the server for a specific route.
6
- * Maps closely to the `RouteMeta` type in the Node environment.
7
- */
8
- interface ComponentRoute {
9
- /** The final URL path */
10
- path: string;
11
- /** The absolute filesystem path of the source file */
12
- componentPath: string;
13
- /** The page title */
14
- title: string;
15
- /** Explicit order in the sidebar */
16
- sidebarPosition?: number;
17
- /** The relative path from the docs directory */
18
- filePath: string;
19
- /** The group directory name */
20
- group?: string;
21
- /** The display title of the group */
22
- groupTitle?: string;
23
- /** Explicit order of the group in the sidebar */
24
- groupPosition?: number;
25
- /** Extracted markdown headings for search indexing */
26
- headings?: {
27
- level: number;
28
- text: string;
29
- id: string;
30
- }[];
31
- /** The page summary or description */
32
- description?: string;
33
- /** The locale this route belongs to, if i18n is configured */
34
- locale?: string;
35
- /** The version this route belongs to, if versioning is configured */
36
- version?: string;
37
- /** Optional icon to display (Lucide icon name or raw SVG) */
38
- icon?: string;
39
- /** The tab this route belongs to, if tabs are configured */
40
- tab?: string;
41
- /** Optional badge to display next to the sidebar item */
42
- badge?: string | {
43
- text: 'updated' | 'new' | 'deprecated';
44
- expires?: string;
45
- };
46
- /** Optional icon for the route's group */
47
- groupIcon?: string;
48
- /** The extracted plain-text content of the page for search indexing */
49
- _content?: string;
50
- /** The raw markdown content of the page */
51
- _rawContent?: string;
52
- }
53
- /**
54
- * Site configuration provided by the server.
55
- */
56
- type SiteConfig = BoltdocsConfig;
57
- /**
58
- * Configuration options for initializing the Boltdocs client app.
59
- */
60
- interface CreateBoltdocsAppOptions {
61
- /** CSS selector for the DOM element where the app should mount (e.g. '#root') */
62
- target: string;
63
- /** Initial routes generated by the Vite plugin (`virtual:boltdocs-routes`) */
64
- routes: ComponentRoute[];
65
- /** The name of the documentation directory (e.g. 'docs') */
66
- docsDirName: string;
67
- /** Site configuration (`virtual:boltdocs-config`) */
68
- config: SiteConfig;
69
- /** Dynamic import mapping from `import.meta.glob` for the documentation pages */
70
- modules: Record<string, () => Promise<{
71
- default: React__default.ComponentType<any>;
72
- }>>;
73
- /** The `import.meta.hot` instance necessary for fast refresh/HMR updates */
74
- hot?: {
75
- accept: (cb?: (mod: any) => void) => void;
76
- dispose: (cb: (data: any) => void) => void;
77
- on: (event: string, cb: (data: any) => void) => void;
78
- data: any;
79
- };
80
- /** Optional custom React component to render when visiting the root path ('/') */
81
- homePage?: React__default.ComponentType;
82
- /** Custom external pages mapped by their route path */
83
- externalPages?: Record<string, React__default.ComponentType>;
84
- /** Optional custom MDX components provided by plugins */
85
- components?: Record<string, React__default.ComponentType>;
86
- }
87
- /**
88
- * Types for CodeSandbox integration.
89
- */
90
- interface SandboxFile {
91
- content: string | object;
92
- isBinary?: boolean;
93
- }
94
- type SandboxFiles = Record<string, SandboxFile>;
95
- interface SandboxOptions {
96
- files?: SandboxFiles;
97
- dependencies?: Record<string, string>;
98
- devDependencies?: Record<string, string>;
99
- title?: string;
100
- description?: string;
101
- template?: string;
102
- /** The file path to open by default in the editor (e.g. `"src/App.tsx"`). */
103
- entry?: string;
104
- /** Options for the embedded iframe view, used by `embedSandbox()`. */
105
- embed?: SandboxEmbedOptions;
106
- /** Custom scripts for the package.json (e.g. `{ "start": "vite" }`). */
107
- scripts?: Record<string, string>;
108
- /** Optional default theme configuration for the sandbox project. */
109
- themeConfig?: Record<string, unknown>;
110
- }
111
- interface SandboxEmbedOptions {
112
- /** Which panel to display: `"editor"`, `"preview"`, or `"split"`. */
113
- view?: 'editor' | 'preview' | 'split';
114
- /** Color theme: `"dark"` or `"light"`. */
115
- theme?: 'dark' | 'light';
116
- /** Whether to hide the navigation bar in the embed. */
117
- hideNavigation?: boolean;
118
- }
119
- /**
120
- * Tab configuration for the documentation site.
121
- */
122
- interface BoltdocsTab {
123
- id: string;
124
- text: string;
125
- icon?: string;
126
- }
127
- /**
128
- * Props for the OnThisPage (TOC) component.
129
- */
130
- interface OnThisPageProps {
131
- headings?: {
132
- level: number;
133
- text: string;
134
- id: string;
135
- }[];
136
- editLink?: string;
137
- communityHelp?: string;
138
- filePath?: string;
139
- }
140
- /**
141
- * Props for user-defined layout components (layout.tsx).
142
- */
143
- interface LayoutProps {
144
- children: React__default.ReactNode;
145
- }
146
- /**
147
- * Unified type for navbar links.
148
- */
149
- interface NavbarLink {
150
- label: string;
151
- href: string;
152
- active: boolean;
153
- /** Optional icon or string for external link indication */
154
- to?: string;
155
- /** Nested items for NavigationMenu */
156
- items?: NavbarLink[];
157
- }
158
-
159
- export type { BoltdocsTab as B, ComponentRoute as C, LayoutProps as L, NavbarLink as N, OnThisPageProps as O, SandboxOptions as S, CreateBoltdocsAppOptions as a, SandboxEmbedOptions as b, SandboxFile as c, SandboxFiles as d };