@vercel/geistdocs 2.16.0-canary.abbda54 → 3.0.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 (74) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/config.d.ts +12 -0
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/internal/lazy-mdx-components.d.ts +0 -2
  5. package/dist/internal/lazy-mdx-components.d.ts.map +1 -1
  6. package/dist/internal/lazy-mdx-components.js +0 -1
  7. package/dist/internal/mermaid-source.d.ts +5 -0
  8. package/dist/internal/mermaid-source.d.ts.map +1 -0
  9. package/dist/internal/mermaid-source.js +5 -0
  10. package/dist/internal/page-action-options.d.ts +9 -4
  11. package/dist/internal/page-action-options.d.ts.map +1 -1
  12. package/dist/internal/page-action-options.js +19 -12
  13. package/dist/internal/page-actions-client.d.ts.map +1 -1
  14. package/dist/internal/page-actions-client.js +19 -112
  15. package/dist/internal/page-actions-gate.d.ts +6 -0
  16. package/dist/internal/page-actions-gate.d.ts.map +1 -1
  17. package/dist/internal/page-actions-gate.js +11 -9
  18. package/dist/internal/page-actions-menu-client.d.ts +8 -0
  19. package/dist/internal/page-actions-menu-client.d.ts.map +1 -0
  20. package/dist/internal/page-actions-menu-client.js +105 -0
  21. package/dist/internal/page-markdown.d.ts +3 -0
  22. package/dist/internal/page-markdown.d.ts.map +1 -0
  23. package/dist/internal/page-markdown.js +45 -0
  24. package/dist/internal/toc-actions-client.d.ts +3 -1
  25. package/dist/internal/toc-actions-client.d.ts.map +1 -1
  26. package/dist/internal/toc-actions-client.js +7 -9
  27. package/dist/mdx.js +3 -2
  28. package/dist/next.d.ts +2 -15
  29. package/dist/next.d.ts.map +1 -1
  30. package/dist/next.js +5 -27
  31. package/dist/pages/docs.d.ts +6 -1
  32. package/dist/pages/docs.d.ts.map +1 -1
  33. package/dist/pages/docs.js +11 -6
  34. package/dist/routes/search.d.ts +1 -8
  35. package/dist/routes/search.d.ts.map +1 -1
  36. package/dist/routes/search.js +82 -120
  37. package/dist/source-config.d.ts +0 -2
  38. package/dist/source-config.d.ts.map +1 -1
  39. package/dist/source-config.js +0 -2
  40. package/docs/agents.md +2 -3
  41. package/docs/llms.txt +31 -250
  42. package/docs/manifest.json +2 -11
  43. package/docs/pages/changelog.md +1 -1
  44. package/docs/pages/components/index.md +0 -1
  45. package/docs/pages/configuration.md +24 -73
  46. package/docs/pages/edit-on-github.md +1 -1
  47. package/docs/pages/index.md +0 -29
  48. package/docs/pages/md.md +1 -1
  49. package/docs/pages/migration.md +1 -1
  50. package/docs/pages/syntax.md +1 -107
  51. package/docs/sitemap.md +1 -2
  52. package/package.json +14 -14
  53. package/source-config.js +0 -2
  54. package/template/AGENTS.md +0 -4
  55. package/template/app/[lang]/docs/[[...slug]]/page.tsx +1 -0
  56. package/template/app/api/search/route.ts +2 -7
  57. package/template/content/docs/changelog.mdx +1 -1
  58. package/template/content/docs/components/index.mdx +0 -1
  59. package/template/content/docs/components/meta.json +0 -1
  60. package/template/content/docs/configuration.mdx +24 -73
  61. package/template/content/docs/edit-on-github.mdx +1 -1
  62. package/template/content/docs/index.mdx +0 -28
  63. package/template/content/docs/md.mdx +1 -1
  64. package/template/content/docs/migration.mdx +1 -1
  65. package/template/content/docs/syntax.cn.mdx +1 -107
  66. package/template/content/docs/syntax.mdx +1 -107
  67. package/template/next.config.ts +1 -1
  68. package/template/package.json +1 -2
  69. package/template/source.config.ts +1 -1
  70. package/docs/pages/components/mermaid.md +0 -29
  71. package/search-index.d.ts +0 -14
  72. package/search-index.js +0 -447
  73. package/template/content/docs/components/mermaid.mdx +0 -25
  74. package/template/lib/geistdocs/search-source.ts +0 -6
@@ -2,7 +2,7 @@
2
2
  title: MDX Components
3
3
  description: Author MDX content with supported components, Markdown syntax, and formatting options
4
4
  type: reference
5
- summary: MDX component and authoring reference covering tabs, text formatting, code blocks, line highlighting, and Mermaid diagrams.
5
+ summary: MDX component and authoring reference covering tabs, text formatting, code blocks, and line highlighting.
6
6
  prerequisites:
7
7
  - /docs/getting-started
8
8
  related:
@@ -716,109 +716,3 @@ const numbers = [1, 2, 3, 4, 5];
716
716
  const sum = numbers.reduce((a, b) => a + b, 0); // [!code focus]
717
717
  console.log(sum);
718
718
  ```
719
-
720
- ## Mermaid Diagrams
721
-
722
- Create diagrams and flowcharts using Mermaid syntax.
723
-
724
- ### Flowcharts
725
-
726
- ````md
727
- ```mermaid
728
- graph TD;
729
- A[Start] --> B{Is it working?};
730
- B -->|Yes| C[Great!];
731
- B -->|No| D[Debug];
732
- D --> B;
733
- ```
734
- ````
735
-
736
- This renders as:
737
-
738
- ```mermaid
739
- graph TD;
740
- A[Start] --> B{Is it working?};
741
- B -->|Yes| C[Great!];
742
- B -->|No| D[Debug];
743
- D --> B;
744
- ```
745
-
746
- ### Sequence Diagrams
747
-
748
- ````md
749
- ```mermaid
750
- sequenceDiagram
751
- participant User
752
- participant API
753
- participant Database
754
- User->>API: Request data
755
- API->>Database: Query
756
- Database-->>API: Results
757
- API-->>User: Response
758
- ```
759
- ````
760
-
761
- This renders as:
762
-
763
- ```mermaid
764
- sequenceDiagram
765
- participant User
766
- participant API
767
- participant Database
768
- User->>API: Request data
769
- API->>Database: Query
770
- Database-->>API: Results
771
- API-->>User: Response
772
- ```
773
-
774
- ### Architecture Diagrams
775
-
776
- ````md
777
- ```mermaid
778
- graph TD;
779
- subgraph Frontend
780
- A[Web App]
781
- B[Mobile App]
782
- end
783
- subgraph Backend
784
- C[API Gateway]
785
- D[Auth Service]
786
- E[Data Service]
787
- end
788
- subgraph Storage
789
- F[(Database)]
790
- G[(Cache)]
791
- end
792
- A --> C
793
- B --> C
794
- C --> D
795
- C --> E
796
- E --> F
797
- E --> G
798
- ```
799
- ````
800
-
801
- This renders as:
802
-
803
- ```mermaid
804
- graph TD;
805
- subgraph Frontend
806
- A[Web App]
807
- B[Mobile App]
808
- end
809
- subgraph Backend
810
- C[API Gateway]
811
- D[Auth Service]
812
- E[Data Service]
813
- end
814
- subgraph Storage
815
- F[(Database)]
816
- G[(Cache)]
817
- end
818
- A --> C
819
- B --> C
820
- C --> D
821
- C --> E
822
- E --> F
823
- E --> G
824
- ```
@@ -3,7 +3,7 @@ import { join } from "node:path";
3
3
  import { createGeistdocs } from "@vercel/geistdocs/next";
4
4
  import type { NextConfig } from "next";
5
5
 
6
- const withGeistdocs = createGeistdocs({ searchIndex: true });
6
+ const withGeistdocs = createGeistdocs();
7
7
 
8
8
  // In this monorepo, compile @vercel/geistdocs from its workspace source so edits
9
9
  // to the package hot-reload in the running dev server (no rebuild/restart).
@@ -17,7 +17,7 @@
17
17
  "@streamdown/code": "^1.0.1",
18
18
  "@vercel/agent-readability": "^0.7.0",
19
19
  "@vercel/analytics": "^1.6.1",
20
- "@vercel/geistdocs": "2.16.0-canary.abbda54",
20
+ "@vercel/geistdocs": "3.0.0",
21
21
  "@vercel/speed-insights": "^1.3.1",
22
22
  "ai": "^6.0.132",
23
23
  "clsx": "^2.1.1",
@@ -29,7 +29,6 @@
29
29
  "fumadocs-ui": "16.2.2",
30
30
  "geist": "1.7.1",
31
31
  "jotai": "^2.15.2",
32
- "mermaid": "^11.12.2",
33
32
  "nanoid": "^5.1.6",
34
33
  "next": "16.3.3",
35
34
  "next-themes": "^0.4.6",
@@ -20,4 +20,4 @@ export const docs = defineDocs({
20
20
  },
21
21
  });
22
22
 
23
- export default defineGeistdocsSourceConfig({ searchIndex: true });
23
+ export default defineGeistdocsSourceConfig();
@@ -1,29 +0,0 @@
1
- ---
2
- title: Mermaid
3
- description: Render Mermaid diagrams from chart source
4
- type: reference
5
- summary: Use Mermaid directly when diagram source is assembled outside an MDX Mermaid fence.
6
- url: /docs/components/mermaid
7
- source: apps/template/content/docs/components/mermaid.mdx
8
- related:
9
- - /docs/components
10
- - /docs/syntax
11
- ---
12
-
13
- # Mermaid
14
-
15
- import { Mermaid } from "@vercel/geistdocs/components/mermaid";
16
-
17
- <div className="not-prose my-6 rounded-lg border border-gray-400 bg-background-100 p-6">
18
- <Mermaid chart={'graph LR; A["Start"] --> B["Finish"]'} />
19
- </div>
20
-
21
- ```tsx
22
- import { Mermaid } from "@vercel/geistdocs/components/mermaid";
23
-
24
- export function Flow() {
25
- return <Mermaid chart={'graph LR; A["Start"] --> B["Finish"]'} />;
26
- }
27
- ```
28
-
29
- Mermaid code fences render this component automatically in authored MDX.
package/search-index.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import type { defineConfig } from "fumadocs-mdx/config";
2
- /** Generates search-only collections in .source/search before bundling. */
3
- export declare const searchIndex: () => NonNullable<
4
- NonNullable<Parameters<typeof defineConfig>[0]>["plugins"]
5
- >[number];
6
-
7
- /** Internal Next integration: await generation and surface extraction failures. */
8
- export declare const prepareSearchIndex: (
9
- options?: import("fumadocs-mdx/next").CreateMDXOptions
10
- ) => Promise<void>;
11
-
12
- export declare const skipSearchIndexGeneration: (
13
- options?: import("fumadocs-mdx/next").CreateMDXOptions
14
- ) => void;
package/search-index.js DELETED
@@ -1,447 +0,0 @@
1
- import {
2
- mkdir,
3
- readdir,
4
- readFile,
5
- rename,
6
- rm,
7
- writeFile,
8
- } from "node:fs/promises";
9
- import path from "node:path";
10
- import { createProcessor } from "@mdx-js/mdx";
11
- import { remarkInclude } from "fumadocs-mdx/config";
12
- import { load } from "js-yaml";
13
- import { glob } from "tinyglobby";
14
- import { visit } from "unist-util-visit";
15
- import { VFile } from "vfile";
16
-
17
- const FRONTMATTER = /^---\r?\n(.+?)\r?\n---\r?\n/s;
18
- const PLUGIN_NAME = "geistdocs-search-index";
19
- const flatten = (node) =>
20
- "children" in node ? node.children.map(flatten).join("") : (node.value ?? "");
21
-
22
- // Search uses the remark output, before HTML/highlighting and JS generation.
23
- // Mirror Fumadocs' heading-derived title before discarding the rendered body.
24
- const finishSearch = () => (tree, file) => {
25
- if (!file.data.frontmatter.title) {
26
- visit(tree, "heading", (node) => {
27
- if (node.depth === 1) {
28
- file.data.frontmatter.title = flatten(node);
29
- return false;
30
- }
31
- });
32
- }
33
- tree.children = [];
34
- };
35
-
36
- const serialize = (files) => {
37
- const dates = [];
38
- const walk = (value, keys = []) => {
39
- if (value instanceof Date) {
40
- dates.push(keys);
41
- return value.toISOString();
42
- }
43
- if (Array.isArray(value)) {
44
- return value.map((item, index) => walk(item, [...keys, index]));
45
- }
46
- if (value && typeof value === "object") {
47
- if (Object.getPrototypeOf(value) !== Object.prototype) {
48
- throw new TypeError(
49
- "Search metadata must contain only JSON values and Dates."
50
- );
51
- }
52
- return Object.fromEntries(
53
- Object.entries(value).map(([key, item]) => [
54
- key,
55
- walk(item, [...keys, key]),
56
- ])
57
- );
58
- }
59
- if (
60
- typeof value === "function" ||
61
- typeof value === "symbol" ||
62
- typeof value === "bigint"
63
- ) {
64
- throw new TypeError(
65
- "Search metadata must contain only JSON values and Dates."
66
- );
67
- }
68
- return value;
69
- };
70
- const json = JSON.stringify(walk(files));
71
- return [
72
- "// Generated by Geistdocs. Search data only; no MDX imports.",
73
- "// @ts-nocheck",
74
- 'import "server-only";',
75
- `const files = JSON.parse(${JSON.stringify(json)});`,
76
- ...(dates.length
77
- ? [
78
- `for (const keys of ${JSON.stringify(dates)}) {`,
79
- " let target = files;",
80
- " for (const key of keys.slice(0, -1)) target = target[key];",
81
- " const key = keys[keys.length - 1];",
82
- " target[key] = new Date(target[key]);",
83
- "}",
84
- ]
85
- : []),
86
- 'export default { toFumadocsSource: (): import("fumadocs-core/source").Source => ({ files }) };',
87
- "",
88
- ].join("\n");
89
- };
90
-
91
- const trackIncludes = (tree, filePath, dependencies) => {
92
- visit(tree, (node) => {
93
- if (node.name !== "include") {
94
- return;
95
- }
96
- const specifier = flatten(node);
97
- if (!specifier) {
98
- return;
99
- }
100
- const hash = specifier.lastIndexOf("#");
101
- const file = hash < 0 ? specifier : specifier.slice(0, hash);
102
- const cwd = Array.isArray(node.attributes)
103
- ? node.attributes.some(
104
- (attribute) =>
105
- attribute.type === "mdxJsxAttribute" &&
106
- attribute.name === "cwd" &&
107
- (typeof attribute.value === "string" || attribute.value === null)
108
- )
109
- : Object.hasOwn(node.attributes ?? {}, "cwd");
110
- dependencies.add(
111
- path.resolve(cwd ? process.cwd() : path.dirname(filePath), file)
112
- );
113
- });
114
- };
115
-
116
- const createProcessors = (options, dependencies) => {
117
- const processors = new Map();
118
- return function getProcessor(format) {
119
- if (!processors.has(format)) {
120
- const processor = createProcessor({
121
- ...options,
122
- format,
123
- remarkPlugins: [
124
- remarkInclude,
125
- ...(options.remarkPlugins ?? []),
126
- finishSearch,
127
- ],
128
- rehypePlugins: [],
129
- recmaPlugins: [],
130
- });
131
- const parse = processor.parse.bind(processor);
132
- processor.parse = (file) => {
133
- const tree = parse(file);
134
- // Fumadocs registers includes after reading them. Track them during
135
- // parsing too so creating a previously missing snippet can recover.
136
- if (typeof file?.path === "string") {
137
- trackIncludes(tree, file.path, dependencies);
138
- }
139
- return tree;
140
- };
141
- processors.set(format, processor);
142
- }
143
- return processors.get(format);
144
- };
145
- };
146
-
147
- const collectPage = async (
148
- context,
149
- collection,
150
- relativePath,
151
- getProcessor,
152
- dependencies,
153
- passthroughs
154
- ) => {
155
- const filePath = path.join(collection.dir, relativePath);
156
- dependencies.add(path.resolve(filePath));
157
- const source = await readFile(filePath, "utf8");
158
- const match = source.match(FRONTMATTER);
159
- const frontmatter = await context.core.transformFrontmatter(
160
- { collection, filePath, source },
161
- match ? (load(match[1]) ?? {}) : {}
162
- );
163
- const content = match ? source.slice(match[0].length) : source;
164
- const compiler = {
165
- addDependency(file) {
166
- dependencies.add(path.resolve(file));
167
- },
168
- };
169
- let file = new VFile({
170
- path: filePath,
171
- value: content,
172
- data: {
173
- frontmatter,
174
- _compiler: compiler,
175
- _getProcessor: getProcessor,
176
- },
177
- });
178
- file = await context.core.transformVFile(
179
- { collection, filePath, source: content },
180
- file
181
- );
182
- const processor = getProcessor(filePath.endsWith(".mdx") ? "mdx" : "md");
183
- await processor.run(processor.parse(file), file);
184
- if (!file.data.structuredData) {
185
- throw new Error(
186
- `${filePath}: searchIndex requires remarkStructure to produce search data.`
187
- );
188
- }
189
- const extra = Object.fromEntries(
190
- (file.data["mdx-export"] ?? [])
191
- .filter((entry) => passthroughs.includes(entry.name))
192
- .map((entry) => [entry.name, entry.value])
193
- );
194
- return {
195
- type: "page",
196
- path: relativePath,
197
- absolutePath: filePath,
198
- data: {
199
- structuredData: file.data.structuredData,
200
- ...extra,
201
- ...file.data.frontmatter,
202
- info: { path: relativePath, fullPath: filePath },
203
- },
204
- };
205
- };
206
-
207
- const collectMeta = async (context, collection, relativePath, dependencies) => {
208
- const filePath = path.join(collection.dir, relativePath);
209
- dependencies.add(path.resolve(filePath));
210
- const source = await readFile(filePath, "utf8");
211
- const data = filePath.endsWith(".json") ? JSON.parse(source) : load(source);
212
- return {
213
- type: "meta",
214
- path: relativePath,
215
- absolutePath: filePath,
216
- data: await context.core.transformMeta(
217
- { collection, filePath, source },
218
- data
219
- ),
220
- };
221
- };
222
-
223
- const COLLECTION_NAME = /^[\w$-]+$/;
224
- const collectCollection = async (
225
- context,
226
- parent,
227
- dependencies,
228
- passthroughs
229
- ) => {
230
- // Collection names become paths, never allow output outside search/.
231
- if (!COLLECTION_NAME.test(parent.name)) {
232
- throw new Error(`Invalid search collection name: ${parent.name}`);
233
- }
234
- const collection = parent.type === "docs" ? parent.docs : parent;
235
- const options = await context.core
236
- .getConfig()
237
- .getMDXOptions(collection, "bundler");
238
- const getProcessor = createProcessors(options, dependencies);
239
- const files = [];
240
- // Keep Fumadocs' glob order: insertion order breaks equal-score ties.
241
- for (const file of await glob(collection.patterns, { cwd: collection.dir })) {
242
- files.push(
243
- await collectPage(
244
- context,
245
- collection,
246
- file,
247
- getProcessor,
248
- dependencies,
249
- passthroughs
250
- )
251
- );
252
- }
253
- if (parent.type === "docs") {
254
- for (const file of await glob(parent.meta.patterns, {
255
- cwd: parent.meta.dir,
256
- })) {
257
- files.push(await collectMeta(context, parent.meta, file, dependencies));
258
- }
259
- }
260
- return { path: `search/${parent.name}.ts`, content: serialize(files) };
261
- };
262
-
263
- const removeObsolete = async (outDir, entries) => {
264
- const current = new Set(entries.map((entry) => path.basename(entry.path)));
265
- const output = path.join(outDir, "search");
266
- const existing = await readdir(output).catch((error) => {
267
- if (error.code === "ENOENT") {
268
- return [];
269
- }
270
- throw error;
271
- });
272
- for (const file of existing) {
273
- if (file.endsWith(".ts") && !current.has(file)) {
274
- await rm(path.join(output, file));
275
- }
276
- }
277
- };
278
-
279
- // The source config is bundled separately by Fumadocs. A process-wide key lets
280
- // the Next wrapper await failures and keeps config reloads in the same queue.
281
- const STATE_KEY = Symbol.for("@vercel/geistdocs/search-index");
282
- const getState = ({ configPath = "source.config.ts", outDir = ".source" }) => {
283
- globalThis[STATE_KEY] ??= new Map();
284
- const states = globalThis[STATE_KEY];
285
- const key = `${path.resolve(configPath)}:${path.resolve(outDir)}`;
286
- if (!states.has(key)) {
287
- states.set(key, { revision: 0, queue: Promise.resolve() });
288
- }
289
- return states.get(key);
290
- };
291
-
292
- /** Internal Next integration: production servers consume existing artifacts. */
293
- export const skipSearchIndexGeneration = (options = {}) => {
294
- getState(options).skip = true;
295
- };
296
-
297
- /** Internal Next integration: public Fumadocs codegen, with emit errors propagated. */
298
- export const prepareSearchIndex = async (options = {}) => {
299
- const state = getState(options);
300
- state.skip = false;
301
- state.captureErrors = true;
302
- state.error = undefined;
303
- try {
304
- const { postInstall } = await import("fumadocs-mdx/next");
305
- await postInstall({
306
- ...options,
307
- configPath: path.resolve(options.configPath ?? "source.config.ts"),
308
- outDir: path.resolve(options.outDir ?? ".source"),
309
- });
310
- if (state.error) {
311
- throw state.error;
312
- }
313
- } finally {
314
- state.captureErrors = false;
315
- }
316
- };
317
-
318
- const writeEntries = async (context, entries) => {
319
- await mkdir(path.join(context.outDir, "search"), { recursive: true });
320
- for (const entry of entries) {
321
- const target = path.join(context.outDir, entry.path);
322
- // Keep watchers from reading a partially written module; avoid HMR churn
323
- // when Next's own initialization regenerates the same data.
324
- if (
325
- (await readFile(target, "utf8").catch(() => undefined)) === entry.content
326
- ) {
327
- continue;
328
- }
329
- const temporary = `${target}.${process.pid}.tmp`;
330
- await writeFile(temporary, entry.content);
331
- await rename(temporary, target);
332
- }
333
- await removeObsolete(context.outDir, entries);
334
- };
335
-
336
- const collectEntries = async (context, dependencies) => {
337
- const serverOptions = {};
338
- for (const plugin of context.core.getPlugins()) {
339
- plugin["index-file"]?.serverOptions?.call(context, serverOptions);
340
- }
341
- const entries = [];
342
- for (const collection of context.core.getConfig().collectionList) {
343
- if (collection.type === "docs" || collection.type === "doc") {
344
- entries.push(
345
- await collectCollection(
346
- context,
347
- collection,
348
- dependencies,
349
- serverOptions.doc?.passthroughs ?? []
350
- )
351
- );
352
- }
353
- }
354
- return entries;
355
- };
356
-
357
- const recordFailure = (state, error) => {
358
- if (state.captureErrors) {
359
- state.error = error;
360
- } else if (process.env.NODE_ENV !== "development") {
361
- process.exitCode = 1;
362
- }
363
- };
364
-
365
- /** Fumadocs plugin: emits .source/search/<collection>.ts before bundling. */
366
- export const searchIndex = () => {
367
- let dependencies = new Set();
368
- let revision;
369
- return {
370
- name: PLUGIN_NAME,
371
- config() {
372
- revision = undefined;
373
- },
374
- emit() {
375
- const state = getState(this);
376
- if (state.skip) {
377
- return Promise.resolve([]);
378
- }
379
- revision ??= ++state.revision;
380
- const generation = revision;
381
- const run = state.queue.then(async () => {
382
- if (generation !== state.revision) {
383
- return [];
384
- }
385
- const nextDependencies = new Set();
386
- try {
387
- const entries = await collectEntries(this, nextDependencies);
388
- if (generation !== state.revision) {
389
- return [];
390
- }
391
- dependencies = nextDependencies;
392
- await writeEntries(this, entries);
393
- // Writes stay inside the queue so old config emissions cannot
394
- // overwrite files after the new config has finished generating.
395
- return [];
396
- } catch (error) {
397
- if (generation !== state.revision) {
398
- return [];
399
- }
400
- dependencies = new Set([...dependencies, ...nextDependencies]);
401
- recordFailure(state, error);
402
- await rm(path.join(this.outDir, "search"), {
403
- recursive: true,
404
- force: true,
405
- });
406
- throw error;
407
- }
408
- });
409
- state.queue = run.then(
410
- () => undefined,
411
- () => undefined
412
- );
413
- return run;
414
- },
415
- configureServer({ watcher }) {
416
- if (!watcher) {
417
- return;
418
- }
419
- watcher.add([...dependencies]);
420
- let timer;
421
- watcher.on("all", (_event, file) => {
422
- if (
423
- !(
424
- dependencies.has(path.resolve(file)) ||
425
- this.core
426
- .getConfig()
427
- .collectionList.some((collection) => collection.hasFile(file))
428
- )
429
- ) {
430
- return;
431
- }
432
- clearTimeout(timer);
433
- timer = setTimeout(async () => {
434
- try {
435
- await this.core.emitAndWrite({
436
- filterPlugin: (plugin) => plugin.name === PLUGIN_NAME,
437
- });
438
- } catch (error) {
439
- console.error("[geistdocs search-index]", error);
440
- } finally {
441
- watcher.add([...dependencies]);
442
- }
443
- }, 50);
444
- });
445
- },
446
- };
447
- };
@@ -1,25 +0,0 @@
1
- ---
2
- title: Mermaid
3
- description: Render Mermaid diagrams from chart source
4
- type: reference
5
- summary: Use Mermaid directly when diagram source is assembled outside an MDX Mermaid fence.
6
- related:
7
- - /docs/components
8
- - /docs/syntax
9
- ---
10
-
11
- import { Mermaid } from "@vercel/geistdocs/components/mermaid";
12
-
13
- <div className="not-prose my-6 rounded-lg border border-gray-400 bg-background-100 p-6">
14
- <Mermaid chart={'graph LR; A["Start"] --> B["Finish"]'} />
15
- </div>
16
-
17
- ```tsx
18
- import { Mermaid } from "@vercel/geistdocs/components/mermaid";
19
-
20
- export function Flow() {
21
- return <Mermaid chart={'graph LR; A["Start"] --> B["Finish"]'} />;
22
- }
23
- ```
24
-
25
- Mermaid code fences render this component automatically in authored MDX.
@@ -1,6 +0,0 @@
1
- import { createSource } from "@vercel/geistdocs/source";
2
- import docs from "@/.source/search/docs";
3
- import { config } from "./config";
4
-
5
- // Search-only metadata and sections. Keep .source/server out of this module.
6
- export const searchSource = createSource({ docs, config });