create-fumadocs-app 16.1.4 → 16.1.6
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.
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +2 -2
- package/dist/{constants-sL_RKDRb.js → constants-UZ9hhOMa.js} +41 -30
- package/dist/{constants-sL_RKDRb.js.map → constants-UZ9hhOMa.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins/biome.js +1 -1
- package/dist/plugins/next-use-takumi.js +1 -1
- package/dist/plugins/orama-cloud.js +1 -1
- package/dist/plugins/orama-cloud.js.map +1 -1
- package/dist/plugins/oxlint.js +1 -1
- package/dist/{src-B7odPk6D.js → src-Dfp3MdVo.js} +2 -2
- package/dist/{src-B7odPk6D.js.map → src-Dfp3MdVo.js.map} +1 -1
- package/package.json +2 -2
- package/template/+next+fuma-docs-mdx/package.json +8 -8
- package/template/+next+fuma-docs-mdx+static/package.json +8 -8
- package/template/astro/package.json +8 -8
- package/template/react-router/package.json +12 -12
- package/template/react-router-spa/package.json +10 -10
- package/template/tanstack-start/package.json +8 -8
- package/template/tanstack-start-spa/package.json +10 -10
- package/template/waku/package.json +9 -9
package/dist/bin.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as templates, n as isCI } from "./constants-
|
|
3
|
-
import { n as getPackageManager, r as managers, t as create } from "./src-
|
|
2
|
+
import { i as templates, n as isCI } from "./constants-UZ9hhOMa.js";
|
|
3
|
+
import { n as getPackageManager, r as managers, t as create } from "./src-Dfp3MdVo.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { cancel, confirm, group, intro, isCancel, outro, select, spinner, text } from "@clack/prompts";
|
|
@@ -13,14 +13,14 @@ var __exportAll = (all, no_symbols) => {
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region ../create-app-versions/package.json
|
|
15
15
|
var dependencies$3 = {
|
|
16
|
-
"@biomejs/biome": "^2.5.
|
|
16
|
+
"@biomejs/biome": "^2.5.5",
|
|
17
17
|
"@orama/core": "^1.2.19",
|
|
18
18
|
"fumadocs-core": "workspace:*",
|
|
19
19
|
"fumadocs-mdx": "workspace:*",
|
|
20
20
|
"fumadocs-ui": "workspace:*",
|
|
21
|
-
"oxlint": "^1.
|
|
22
|
-
"react": "^19.2.
|
|
23
|
-
"takumi-js": "^2.
|
|
21
|
+
"oxlint": "^1.74.0",
|
|
22
|
+
"react": "^19.2.8",
|
|
23
|
+
"takumi-js": "^2.4.0"
|
|
24
24
|
};
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region ../core/package.json
|
|
@@ -47,7 +47,7 @@ var package_exports$2 = /* @__PURE__ */ __exportAll({
|
|
|
47
47
|
version: () => version$2
|
|
48
48
|
});
|
|
49
49
|
var name$2 = "fumadocs-core";
|
|
50
|
-
var version$2 = "16.
|
|
50
|
+
var version$2 = "16.12.0";
|
|
51
51
|
var description$2 = "The React.js library for building a documentation website";
|
|
52
52
|
var keywords$2 = ["Docs", "Fumadocs"];
|
|
53
53
|
var homepage$2 = "https://fumadocs.dev";
|
|
@@ -152,6 +152,7 @@ var dependencies$2 = {
|
|
|
152
152
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
153
153
|
"mdast-util-mdx": "^3.0.0",
|
|
154
154
|
"mdast-util-to-markdown": "^2.1.2",
|
|
155
|
+
"npm-to-yarn": "3.1.0",
|
|
155
156
|
"remark": "^15.0.1",
|
|
156
157
|
"remark-gfm": "^4.0.1",
|
|
157
158
|
"remark-rehype": "^11.1.2",
|
|
@@ -164,13 +165,13 @@ var dependencies$2 = {
|
|
|
164
165
|
"yaml": "^2.9.0"
|
|
165
166
|
};
|
|
166
167
|
var devDependencies$2 = {
|
|
167
|
-
"@formatjs/intl-localematcher": "^0.8.
|
|
168
|
+
"@formatjs/intl-localematcher": "^0.8.13",
|
|
168
169
|
"@mdx-js/mdx": "^3.1.1",
|
|
169
170
|
"@mixedbread/sdk": "0.77.0",
|
|
170
171
|
"@orama/core": "^1.2.19",
|
|
171
172
|
"@oramacloud/client": "^2.1.4",
|
|
172
173
|
"@shikijs/transformers": "^4.3.1",
|
|
173
|
-
"@tanstack/react-router": "1.170.
|
|
174
|
+
"@tanstack/react-router": "1.170.18",
|
|
174
175
|
"@types/estree-jsx": "^1.0.5",
|
|
175
176
|
"@types/hast": "^3.0.5",
|
|
176
177
|
"@types/mdast": "^4.0.4",
|
|
@@ -178,22 +179,21 @@ var devDependencies$2 = {
|
|
|
178
179
|
"@types/node": "26.1.1",
|
|
179
180
|
"@types/react": "^19.2.17",
|
|
180
181
|
"@types/react-dom": "^19.2.3",
|
|
181
|
-
"algoliasearch": "5.
|
|
182
|
+
"algoliasearch": "5.56.0",
|
|
182
183
|
"flexsearch": "^0.8.212",
|
|
183
184
|
"image-size": "^2.0.2",
|
|
184
|
-
"lucide-react": "^1.
|
|
185
|
+
"lucide-react": "^1.25.0",
|
|
185
186
|
"negotiator": "^1.0.0",
|
|
186
|
-
"next": "16.2.
|
|
187
|
-
"npm-to-yarn": "^3.0.1",
|
|
187
|
+
"next": "16.2.11",
|
|
188
188
|
"path-to-regexp": "^8.4.2",
|
|
189
|
-
"react-router": "^8.
|
|
189
|
+
"react-router": "^8.3.0",
|
|
190
190
|
"remark-directive": "^4.0.0",
|
|
191
191
|
"remark-mdx": "^3.1.1",
|
|
192
192
|
"remove-markdown": "^0.6.4",
|
|
193
193
|
"tsconfig": "workspace:*",
|
|
194
|
-
"tsdown": "0.22.
|
|
194
|
+
"tsdown": "0.22.13",
|
|
195
195
|
"typescript": "^6.0.3",
|
|
196
|
-
"waku": "1.0.0-beta.
|
|
196
|
+
"waku": "1.0.0-beta.7",
|
|
197
197
|
"zod": "4.4.3"
|
|
198
198
|
};
|
|
199
199
|
var peerDependencies$2 = {
|
|
@@ -238,11 +238,10 @@ var peerDependenciesMeta$2 = {
|
|
|
238
238
|
};
|
|
239
239
|
var inlinedDependencies$1 = {
|
|
240
240
|
"@formatjs/fast-memoize": "3.1.7",
|
|
241
|
-
"@formatjs/intl-localematcher": "0.8.
|
|
241
|
+
"@formatjs/intl-localematcher": "0.8.13",
|
|
242
242
|
"@shikijs/transformers": "4.3.1",
|
|
243
243
|
"image-size": "2.0.2",
|
|
244
244
|
"negotiator": "1.0.0",
|
|
245
|
-
"npm-to-yarn": "3.0.1",
|
|
246
245
|
"path-to-regexp": "8.4.2",
|
|
247
246
|
"remove-markdown": "0.6.4"
|
|
248
247
|
};
|
|
@@ -292,7 +291,7 @@ var package_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
292
291
|
version: () => version$1
|
|
293
292
|
});
|
|
294
293
|
var name$1 = "fumadocs-mdx";
|
|
295
|
-
var version$1 = "15.
|
|
294
|
+
var version$1 = "15.2.0";
|
|
296
295
|
var description$1 = "The built-in source for Fumadocs";
|
|
297
296
|
var keywords$1 = ["Docs", "fumadocs"];
|
|
298
297
|
var homepage$1 = "https://fumadocs.dev";
|
|
@@ -308,6 +307,7 @@ var exports$1 = {
|
|
|
308
307
|
"./bin": "./dist/bin.js",
|
|
309
308
|
"./bun": "./dist/bun/index.js",
|
|
310
309
|
"./config": "./dist/config/index.js",
|
|
310
|
+
"./macro": "./dist/macro/index.js",
|
|
311
311
|
"./next": "./dist/next/index.js",
|
|
312
312
|
"./node": "./dist/node/index.js",
|
|
313
313
|
"./node/_loader": "./dist/node/_loader.js",
|
|
@@ -318,9 +318,11 @@ var exports$1 = {
|
|
|
318
318
|
"./rolldown": "./dist/rolldown/index.js",
|
|
319
319
|
"./runtime/browser": "./dist/runtime/browser.js",
|
|
320
320
|
"./runtime/dynamic": "./dist/runtime/dynamic.js",
|
|
321
|
+
"./runtime/macro": "./dist/runtime/macro.js",
|
|
321
322
|
"./runtime/server": "./dist/runtime/server.js",
|
|
322
323
|
"./runtime/types": "./dist/runtime/types.js",
|
|
323
324
|
"./vite": "./dist/vite/index.js",
|
|
325
|
+
"./webpack/macro": "./dist/webpack/macro.js",
|
|
324
326
|
"./webpack/mdx": "./dist/webpack/mdx.js",
|
|
325
327
|
"./webpack/meta": "./dist/webpack/meta.js",
|
|
326
328
|
"./package.json": "./package.json"
|
|
@@ -340,6 +342,7 @@ var dependencies$1 = {
|
|
|
340
342
|
"esbuild": "^0.28.1",
|
|
341
343
|
"estree-util-value-to-estree": "^3.5.0",
|
|
342
344
|
"github-slugger": "^2.0.0",
|
|
345
|
+
"magic-string": "^1.0.0",
|
|
343
346
|
"mdast-util-mdx": "^3.0.0",
|
|
344
347
|
"picocolors": "^1.1.1",
|
|
345
348
|
"picomatch": "^4.0.5",
|
|
@@ -350,6 +353,7 @@ var dependencies$1 = {
|
|
|
350
353
|
"unist-util-visit": "^5.1.0",
|
|
351
354
|
"vfile": "^6.0.3",
|
|
352
355
|
"yaml": "^2.9.0",
|
|
356
|
+
"yuku-analyzer": "^0.7.3",
|
|
353
357
|
"zod": "^4.4.3"
|
|
354
358
|
};
|
|
355
359
|
var devDependencies$1 = {
|
|
@@ -363,16 +367,16 @@ var devDependencies$1 = {
|
|
|
363
367
|
"@types/react": "^19.2.17",
|
|
364
368
|
"fumadocs-core": "workspace:*",
|
|
365
369
|
"mdast-util-directive": "^3.1.0",
|
|
366
|
-
"next": "^16.2.
|
|
367
|
-
"react": "^19.2.
|
|
370
|
+
"next": "^16.2.11",
|
|
371
|
+
"react": "^19.2.8",
|
|
368
372
|
"remark": "^15.0.1",
|
|
369
373
|
"remark-directive": "^4.0.0",
|
|
370
374
|
"remark-mdx": "^3.1.1",
|
|
371
|
-
"rolldown": "^1.
|
|
375
|
+
"rolldown": "^1.2.0",
|
|
372
376
|
"satteri": "^0.9.5",
|
|
373
377
|
"tsconfig": "workspace:*",
|
|
374
|
-
"tsdown": "0.22.
|
|
375
|
-
"vite": "^8.1.
|
|
378
|
+
"tsdown": "0.22.13",
|
|
379
|
+
"vite": "^8.1.5",
|
|
376
380
|
"webpack": "^5.108.4"
|
|
377
381
|
};
|
|
378
382
|
var peerDependencies$1 = {
|
|
@@ -445,7 +449,7 @@ var package_exports = /* @__PURE__ */ __exportAll({
|
|
|
445
449
|
version: () => version
|
|
446
450
|
});
|
|
447
451
|
var name = "@fumadocs/base-ui";
|
|
448
|
-
var version = "16.
|
|
452
|
+
var version = "16.12.0";
|
|
449
453
|
var description = "The Base UI version of Fumadocs UI";
|
|
450
454
|
var keywords = ["Docs", "Fumadocs"];
|
|
451
455
|
var homepage = "https://fumadocs.dev";
|
|
@@ -511,6 +515,13 @@ var exports = {
|
|
|
511
515
|
"./layouts/flux/slots/container": "./dist/layouts/flux/slots/container.js",
|
|
512
516
|
"./layouts/flux/slots/sidebar": "./dist/layouts/flux/slots/sidebar.js",
|
|
513
517
|
"./layouts/flux/slots/tab-dropdown": "./dist/layouts/flux/slots/tab-dropdown.js",
|
|
518
|
+
"./layouts/glass": "./dist/layouts/glass/index.js",
|
|
519
|
+
"./layouts/glass/page": "./dist/layouts/glass/page/index.js",
|
|
520
|
+
"./layouts/glass/page/slots/breadcrumb": "./dist/layouts/glass/page/slots/breadcrumb.js",
|
|
521
|
+
"./layouts/glass/page/slots/footer": "./dist/layouts/glass/page/slots/footer.js",
|
|
522
|
+
"./layouts/glass/page/slots/toc": "./dist/layouts/glass/page/slots/toc.js",
|
|
523
|
+
"./layouts/glass/slots/header": "./dist/layouts/glass/slots/header.js",
|
|
524
|
+
"./layouts/glass/slots/sidebar": "./dist/layouts/glass/slots/sidebar.js",
|
|
514
525
|
"./layouts/home": "./dist/layouts/home/index.js",
|
|
515
526
|
"./layouts/home/navbar": "./dist/layouts/home/navbar.js",
|
|
516
527
|
"./layouts/home/not-found": "./dist/layouts/home/not-found.js",
|
|
@@ -567,7 +578,7 @@ var dependencies = {
|
|
|
567
578
|
"@fumadocs/tailwind": "workspace:*",
|
|
568
579
|
"class-variance-authority": "^0.7.1",
|
|
569
580
|
"cnfast": "^0.0.8",
|
|
570
|
-
"lucide-react": "^1.
|
|
581
|
+
"lucide-react": "^1.25.0",
|
|
571
582
|
"motion": "^12.42.2",
|
|
572
583
|
"next-themes": "^0.4.6",
|
|
573
584
|
"react-remove-scroll": "^2.7.2",
|
|
@@ -578,9 +589,9 @@ var dependencies = {
|
|
|
578
589
|
};
|
|
579
590
|
var devDependencies = {
|
|
580
591
|
"@fumadocs/cli": "workspace:*",
|
|
581
|
-
"@tailwindcss/cli": "^4.3.
|
|
582
|
-
"@tailwindcss/oxide": "^4.3.
|
|
583
|
-
"@tsdown/css": "^0.22.
|
|
592
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
593
|
+
"@tailwindcss/oxide": "^4.3.3",
|
|
594
|
+
"@tsdown/css": "^0.22.13",
|
|
584
595
|
"@types/hast": "^3.0.5",
|
|
585
596
|
"@types/mdx": "^2.0.14",
|
|
586
597
|
"@types/node": "^26.1.1",
|
|
@@ -589,9 +600,9 @@ var devDependencies = {
|
|
|
589
600
|
"fuma-cli": "^0.1.1",
|
|
590
601
|
"fumadocs-core": "workspace:*",
|
|
591
602
|
"react-medium-image-zoom": "^5.4.8",
|
|
592
|
-
"tailwindcss": "^4.3.
|
|
603
|
+
"tailwindcss": "^4.3.3",
|
|
593
604
|
"tsconfig": "workspace:*",
|
|
594
|
-
"tsdown": "0.22.
|
|
605
|
+
"tsdown": "0.22.13",
|
|
595
606
|
"unified": "^11.0.5"
|
|
596
607
|
};
|
|
597
608
|
var peerDependencies = {
|
|
@@ -699,4 +710,4 @@ depVersions["fumadocs-ui"] = `npm:${name}@${version}`;
|
|
|
699
710
|
//#endregion
|
|
700
711
|
export { templates as i, isCI as n, sourceDir as r, depVersions as t };
|
|
701
712
|
|
|
702
|
-
//# sourceMappingURL=constants-
|
|
713
|
+
//# sourceMappingURL=constants-UZ9hhOMa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants-
|
|
1
|
+
{"version":3,"file":"constants-UZ9hhOMa.js","names":["corePkg","mdxPkg","basePkg","versionPkg.dependencies","basePkg.name","basePkg.version"],"sources":["../../create-app-versions/package.json","../../core/package.json","../../mdx/package.json","../../base-ui/package.json","../src/constants.ts"],"sourcesContent":["","","","","import { fileURLToPath } from 'node:url';\nimport versionPkg from '../../create-app-versions/package.json';\nimport * as corePkg from '../../core/package.json';\nimport * as mdxPkg from '../../mdx/package.json';\nimport * as basePkg from '../../base-ui/package.json';\n\nexport const sourceDir = fileURLToPath(new URL(`../`, import.meta.url).href);\n\nexport const isCI = Boolean(process.env.CI);\n\nexport interface TemplateInfo {\n value:\n | '+next+fuma-docs-mdx'\n | 'astro'\n | 'waku'\n | 'react-router'\n | 'react-router-spa'\n | 'tanstack-start'\n | 'tanstack-start-spa'\n | '+next+fuma-docs-mdx+static';\n label: string;\n appDir: string;\n /**\n * path to root provider, relative to `appDir``\n */\n rootProviderPath: string;\n hint?: string;\n /**\n * rename files when copying from template\n */\n rename?: (name: string) => string;\n}\n\nexport const templates: TemplateInfo[] = [\n {\n value: '+next+fuma-docs-mdx',\n label: 'Next.js: Fumadocs MDX',\n hint: 'recommended',\n appDir: '',\n rootProviderPath: 'app/layout.tsx',\n },\n {\n value: 'astro',\n label: 'Astro: React Islands',\n hint: 'uses Astro Content Collections and Fumadocs UI as a React island',\n appDir: 'src',\n rootProviderPath: 'components/docs.tsx',\n },\n {\n value: '+next+fuma-docs-mdx+static',\n label: 'Next.js Static: Fumadocs MDX',\n appDir: '',\n rootProviderPath: 'components/provider.tsx',\n },\n {\n value: 'waku',\n label: 'Waku: Fumadocs MDX',\n appDir: 'src',\n rootProviderPath: 'components/provider.tsx',\n },\n {\n value: 'react-router',\n label: 'React Router: Fumadocs MDX (not RSC)',\n appDir: 'app',\n rootProviderPath: 'root.tsx',\n },\n {\n value: 'react-router-spa',\n label: 'React Router SPA: Fumadocs MDX (not RSC)',\n hint: 'SPA mode allows you to host the site statically, compatible with a CDN.',\n appDir: 'app',\n rootProviderPath: 'root.tsx',\n },\n {\n value: 'tanstack-start',\n label: 'Tanstack Start: Fumadocs MDX (not RSC)',\n appDir: 'src',\n rootProviderPath: 'routes/__root.tsx',\n },\n {\n value: 'tanstack-start-spa',\n label: 'Tanstack Start SPA: Fumadocs MDX (not RSC)',\n hint: 'SPA mode allows you to host the site statically, compatible with a CDN.',\n appDir: 'src',\n rootProviderPath: 'routes/__root.tsx',\n },\n];\n\nconst workspaces = [corePkg, mdxPkg, basePkg];\n\nexport const depVersions = versionPkg.dependencies;\n\nfor (const workspace of workspaces) {\n depVersions[workspace.name as keyof typeof depVersions] = workspace.version;\n}\n\ndepVersions['fumadocs-ui'] = `npm:${basePkg.name}@${basePkg.version}`;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIMA,MAAa,YAAY,cAAc,IAAI,IAAI,OAAO,OAAO,KAAK,GAAG,CAAC,CAAC,IAAI;AAE3E,MAAa,OAAO,QAAQ,QAAQ,IAAI,EAAE;AAyB1C,MAAa,YAA4B;CACvC;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,QAAQ;EACR,kBAAkB;CACpB;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,kBAAkB;CACpB;AACF;AAEA,MAAM,aAAa;CAACA;CAASC;CAAQC;AAAO;AAE5C,MAAa,cAAcC;AAE3B,KAAK,MAAM,aAAa,YACtB,YAAY,UAAU,QAAoC,UAAU;AAGtE,YAAY,iBAAiB,OAAOC,KAAa,GAAGC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as create } from "./src-
|
|
1
|
+
import { t as create } from "./src-Dfp3MdVo.js";
|
|
2
2
|
export { create };
|
package/dist/plugins/biome.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as depVersions } from "../constants-
|
|
1
|
+
import { t as depVersions } from "../constants-UZ9hhOMa.js";
|
|
2
2
|
import { i as writeFile, n as pick } from "../utils-BZh9vMXJ.js";
|
|
3
3
|
import biome_base_default from "./biome.base.js";
|
|
4
4
|
import biome_next_default from "./biome.next.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as sourceDir, t as depVersions } from "../constants-
|
|
1
|
+
import { r as sourceDir, t as depVersions } from "../constants-UZ9hhOMa.js";
|
|
2
2
|
import { i as writeFile$1, n as pick, t as copy } from "../utils-BZh9vMXJ.js";
|
|
3
3
|
import { n as getCodeValue, t as createSourceFile } from "../shared-Bilr6W8M.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orama-cloud.js","names":["SyntaxKind","writeFile"],"sources":["../../src/transform/react-router.ts","../../src/transform/tanstack-start.ts","../../src/transform/index.ts","../../src/plugins/orama-cloud.ts"],"sourcesContent":["import { ArrayLiteralExpression, MethodDeclaration, SourceFile, ts } from 'ts-morph';\nimport { getCodeValue } from '@/transform/shared';\nimport SyntaxKind = ts.SyntaxKind;\n\n/**\n * filter items in a specific array initializer in the prerender function\n */\nexport function filterReactRouterPrerenderArray(\n sourceFile: SourceFile,\n array: 'paths' | 'excluded',\n filter: (item: string) => boolean,\n) {\n const methodBody = getPrerenderMethod(sourceFile)?.getBody();\n if (!methodBody) return;\n\n const initializer = methodBody\n .getDescendantsOfKind(SyntaxKind.VariableDeclaration)\n .find((item) => item.getName() === array)\n ?.getInitializerIfKind(SyntaxKind.ArrayLiteralExpression);\n\n if (!initializer) return;\n for (const element of initializer.getElements()) {\n if (!filter(getCodeValue(element.getText()))) {\n initializer.removeElement(element);\n }\n }\n}\n\n/**\n * Add a new route to route config\n */\nexport function addReactRouterRoute(\n sourceFile: SourceFile,\n routes: { path: string; entry: string }[],\n) {\n modifyReactRouterRoutes(sourceFile, (arr) => {\n for (const { path, entry } of routes) {\n arr.addElement(`route('${path}', '${entry}')`);\n }\n });\n}\n\n/**\n * Remove routes from route config (root level only)\n */\nexport function filterReactRouterRoute(\n sourceFile: SourceFile,\n filter: (item: { path: string; entry: string }) => boolean,\n) {\n modifyReactRouterRoutes(sourceFile, (arr) => {\n for (const element of arr.getElements()) {\n if (\n !element.isKind(SyntaxKind.CallExpression) ||\n element.getFirstChildByKind(SyntaxKind.Identifier)?.getText() !== 'route'\n )\n continue;\n const args = element.getArguments();\n\n if (\n filter({\n path: getCodeValue(args[0].getText()),\n entry: getCodeValue(args[1].getText()),\n })\n )\n continue;\n\n arr.removeElement(element);\n }\n });\n}\n\nexport function modifyReactRouterRoutes(\n sourceFile: SourceFile,\n mod: (array: ArrayLiteralExpression) => void,\n) {\n const initializer = sourceFile\n .getDefaultExportSymbol()\n ?.getValueDeclaration()\n ?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression);\n if (initializer) mod(initializer);\n}\n\n/**\n * Find the prerender method from the config\n */\nfunction getPrerenderMethod(sourceFile: SourceFile): MethodDeclaration | null {\n return (\n sourceFile\n .getDefaultExportSymbol()\n ?.getValueDeclaration()\n ?.getFirstDescendantByKind(SyntaxKind.ObjectLiteralExpression)\n ?.getProperty('prerender')\n ?.asKind(SyntaxKind.MethodDeclaration) ?? null\n );\n}\n","import { CallExpression, SourceFile, SyntaxKind } from 'ts-morph';\nimport { getCodeValue } from '@/transform/shared';\n\n/**\n * Add path to the `pages` array in tanstack start vite config.\n *\n * If the `pages` property doesn't exist, create one.\n */\nexport function addTanstackPrerender(sourceFile: SourceFile, paths: string[]) {\n const optionsArg = getTanstackStartCall(sourceFile)\n ?.getArguments()[0]\n ?.asKind(SyntaxKind.ObjectLiteralExpression);\n if (!optionsArg) {\n return;\n }\n\n const pagesProperty = optionsArg.getProperty('pages')?.asKind(SyntaxKind.PropertyAssignment);\n\n function toItem(path: string) {\n return `{ path: '${path}' }`;\n }\n\n if (pagesProperty) {\n const initializer = pagesProperty.getInitializerIfKindOrThrow(\n SyntaxKind.ArrayLiteralExpression,\n );\n\n const existingPaths = new Set<string>();\n for (const element of initializer.getElements()) {\n const value = element\n .asKind(SyntaxKind.ObjectLiteralExpression)\n ?.getProperty('path')\n ?.asKind(SyntaxKind.PropertyAssignment)\n ?.getInitializer()\n ?.getText();\n\n if (value) {\n existingPaths.add(getCodeValue(value));\n }\n }\n\n for (const path of paths) {\n if (existingPaths.has(path)) continue;\n initializer.addElement(toItem(path));\n }\n } else {\n optionsArg.addProperty(`pages: [\\n${paths.map((path) => ` ${toItem(path)}`).join(',\\n')}\\n]`);\n }\n}\n\n/**\n * Find the tanstackStart call expression\n */\nfunction getTanstackStartCall(sourceFile: SourceFile): CallExpression | undefined {\n const pluginsProperty = sourceFile\n .getDefaultExportSymbol()\n ?.getValueDeclaration()\n ?.getFirstDescendantByKind(SyntaxKind.ObjectLiteralExpression)\n ?.getProperty('plugins')\n ?.getFirstChildByKind(SyntaxKind.ArrayLiteralExpression);\n\n if (!pluginsProperty) return;\n\n for (const element of pluginsProperty.getElements()) {\n const expression = element.asKind(SyntaxKind.CallExpression);\n if (expression?.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'tanstackStart') {\n return expression;\n }\n }\n}\n","import { TemplatePluginContext } from '@/index';\nimport { createSourceFile } from '@/transform/shared';\nimport path from 'node:path';\nimport {\n addReactRouterRoute,\n filterReactRouterPrerenderArray,\n filterReactRouterRoute,\n} from '@/transform/react-router';\nimport fs from 'node:fs/promises';\nimport { addTanstackPrerender } from '@/transform/tanstack-start';\nimport { StructureKind, SyntaxKind } from 'ts-morph';\n\ninterface RootLayoutMod {\n addSearchDialog: (specifier: string) => void;\n}\n\nexport async function rootProvider(\n { appDir, template }: TemplatePluginContext,\n fn: (mod: RootLayoutMod) => void,\n) {\n const file = await createSourceFile(path.join(appDir, template.rootProviderPath));\n fn({\n addSearchDialog(specifier) {\n const elements = file.getDescendantsOfKind(SyntaxKind.JsxElement);\n\n for (const element of elements) {\n const provider = element.getFirstChildByKind(SyntaxKind.JsxOpeningElement);\n if (provider?.getTagNameNode().getText() !== 'RootProvider') continue;\n\n // Skip if search prop already exists\n if (\n provider\n .getAttributes()\n .some(\n (attr) =>\n attr.isKind(SyntaxKind.JsxAttribute) && attr.getNameNode().getText() === 'search',\n )\n )\n continue;\n\n provider.addAttribute({\n kind: StructureKind.JsxAttribute,\n name: 'search',\n initializer: '{{ SearchDialog }}',\n });\n file.addImportDeclaration({\n moduleSpecifier: specifier,\n defaultImport: 'SearchDialog',\n });\n break;\n }\n },\n });\n await file.save();\n}\n\ninterface ReactRouterRoutesMod {\n /**\n * @param path API route's path\n * @param entry route's file path\n * @param code create the file if specified\n */\n addRoute: (path: string, entry: string, code?: string) => void;\n\n /**\n * @param path API route's path\n */\n removeRoute: (path: string) => void;\n}\n\nexport async function reactRouterRoutes(\n { dest, appDir }: TemplatePluginContext,\n fn: (mod: ReactRouterRoutesMod) => void,\n) {\n const configFile = await createSourceFile(path.join(dest, 'react-router.config.ts'));\n const routesFile = await createSourceFile(path.join(appDir, 'routes.ts'));\n const tasks: Promise<unknown>[] = [];\n\n function normalizePath(v: string) {\n return v.split('/').filter(Boolean).join('/');\n }\n\n fn({\n addRoute: (p, entry, code) => {\n addReactRouterRoute(routesFile, [{ path: p, entry }]);\n\n if (code) {\n tasks.push(fs.writeFile(path.join(appDir, entry), code));\n }\n },\n removeRoute: (p) => {\n const normalizedPath = normalizePath(p);\n\n filterReactRouterRoute(routesFile, (item) => {\n if (normalizePath(item.path) !== normalizedPath) return true;\n\n tasks.push(fs.unlink(path.join(appDir, item.entry)).catch(() => null));\n return false;\n });\n\n filterReactRouterPrerenderArray(\n configFile,\n 'excluded',\n (item) => normalizePath(item) !== normalizedPath,\n );\n\n filterReactRouterPrerenderArray(\n configFile,\n 'paths',\n (item) => normalizePath(item) !== normalizedPath,\n );\n },\n });\n\n await Promise.all([...tasks, routesFile.save(), configFile.save()]);\n}\n\nexport interface TanstackStartRoutesMod {\n addRoute: (options: {\n /**\n * file path relative to `routes`\n */\n path: string;\n\n /**\n * Generated route path of `path`\n */\n route: string;\n\n /**\n * if specified, create the file\n */\n code?: string;\n\n /**\n * if true, add to prerender list\n */\n prerender?: boolean;\n }) => void;\n\n removeRoute: (options: {\n /**\n * file path relative to routes directory\n */\n path: string;\n\n route: string;\n }) => void;\n}\n\nexport async function tanstackStartRoutes(\n { appDir, dest }: TemplatePluginContext,\n fn: (mod: TanstackStartRoutesMod) => void,\n) {\n const configFile = await createSourceFile(path.join(dest, 'vite.config.ts'));\n const tasks: Promise<unknown>[] = [];\n\n fn({\n addRoute(options) {\n if (options.code) {\n tasks.push(fs.writeFile(path.join(appDir, 'routes', options.path), options.code));\n }\n\n if (options.prerender) {\n addTanstackPrerender(configFile, [options.route]);\n }\n },\n removeRoute(options) {\n tasks.push(fs.unlink(path.join(appDir, 'routes', options.path)).catch(() => null));\n },\n });\n\n await Promise.all([...tasks, configFile.save()]);\n}\n","import { TemplatePlugin } from '@/index';\nimport { copy, pick, writeFile } from '@/utils';\nimport path from 'node:path';\nimport { depVersions, sourceDir } from '@/constants';\nimport fs from 'node:fs/promises';\nimport { reactRouterRoutes, rootProvider, tanstackStartRoutes } from '@/transform';\n\nexport function oramaCloud(): TemplatePlugin {\n return {\n packageJson(packageJson) {\n return {\n ...packageJson,\n scripts: {\n ...packageJson.scripts,\n build: `${packageJson.scripts!.build} && bun scripts/sync-content.ts`,\n },\n dependencies: {\n ...packageJson.dependencies,\n ...pick(depVersions, ['@orama/core']),\n },\n };\n },\n readme(content) {\n return `${content}\\n\\n## Orama Cloud\n \nThis project uses Orama Cloud for 3rd party search solution.\n\nSee https://fumadocs.dev/docs/headless/search/orama-cloud for integrating Orama Cloud to Fumadocs.`;\n },\n async afterWrite() {\n const { dest, appDir, template } = this;\n await copy(path.join(sourceDir, 'template/+orama-cloud/@root'), dest);\n await copy(path.join(sourceDir, 'template/+orama-cloud/@app'), appDir);\n\n await rootProvider(this, (mod) => mod.addSearchDialog('@/components/search'));\n\n if (template.value === 'tanstack-start') {\n await tanstackStartRoutes(this, (mod) => {\n mod.addRoute({\n path: 'static[.]json.ts',\n route: '/static.json',\n code: route.tanstack,\n prerender: true,\n });\n mod.removeRoute({\n path: 'api/search.ts',\n route: '/api/search',\n });\n });\n } else if (template.value.startsWith('react-router')) {\n await reactRouterRoutes(this, (mod) => {\n mod.addRoute('static.json', 'routes/static.ts', route['react-router']);\n mod.removeRoute('api/search');\n });\n } else if (template.value.startsWith('+next')) {\n await Promise.all([\n fs.unlink(path.join(appDir, 'app/api/search/route.ts')).catch(() => null),\n writeFile(path.join(appDir, 'app/static.json/route.ts'), route.next),\n ]);\n } else if (template.value === 'astro') {\n await Promise.all([\n fs.unlink(path.join(appDir, 'pages/api/search.ts')).catch(() => null),\n writeFile(path.join(appDir, 'pages/static.json.ts'), route.astro),\n writeFile(path.join(appDir, 'lib/export-static-indexes.ts'), astroExportSearchIndexes),\n ]);\n } else {\n await Promise.all([\n fs.unlink(path.join(appDir, 'pages/_api/api/search.ts')).catch(() => null),\n writeFile(path.join(appDir, 'pages/_api/static.json.ts'), route.waku),\n ]);\n }\n\n const filePath = {\n '+next+fuma-docs-mdx': '.next/server/app/static.json.body',\n '+next+fuma-docs-mdx+static': '.next/server/app/static.json.body',\n 'tanstack-start': '.output/public/static.json',\n 'tanstack-start-spa': 'dist/client/static.json',\n 'react-router': 'build/client/static.json',\n 'react-router-spa': 'build/client/static.json',\n astro: 'dist/static.json',\n waku: 'dist/public/static.json',\n }[template.value];\n\n await writeFile(\n path.join(dest, 'scripts/sync-content.ts'),\n `import { type OramaDocument, sync } from 'fumadocs-core/search/orama-cloud';\nimport * as fs from 'node:fs/promises';\nimport { OramaCloud } from '@orama/core';\n\n// the path of pre-rendered \\`static.json\\`\nconst filePath = '${filePath}';\n\nasync function main() {\n const orama = new OramaCloud({\n projectId: process.env.NEXT_PUBLIC_ORAMA_PROJECT_ID,\n apiKey: process.env.ORAMA_PRIVATE_API_KEY,\n });\n\n const content = await fs.readFile(filePath);\n const records = JSON.parse(content.toString()) as OramaDocument[];\n\n await sync(orama, {\n index: process.env.NEXT_PUBLIC_ORAMA_DATASOURCE_ID,\n documents: records,\n });\n\n console.log(\\`search updated: \\${records.length} records\\`);\n}\n\nvoid main();`,\n );\n },\n };\n}\n\nconst route = {\n next: `import { exportSearchIndexes } from '@/lib/export-search-indexes';\n\nexport const revalidate = false;\n\nexport async function GET() {\n return Response.json(await exportSearchIndexes());\n}`,\n 'react-router': `import { exportSearchIndexes } from '@/lib/export-search-indexes';\n\nexport async function loader() {\n return Response.json(await exportSearchIndexes());\n}`,\n tanstack: `import { createFileRoute } from '@tanstack/react-router';\nimport { exportSearchIndexes } from '@/lib/export-search-indexes';\n\nexport const Route = createFileRoute('/static.json')({\n server: {\n handlers: {\n GET: async () => Response.json(await exportSearchIndexes()),\n },\n },\n});`,\n waku: `import { exportSearchIndexes } from '@/lib/export-search-indexes';\n\nexport async function GET() {\n return Response.json(await exportSearchIndexes());\n}\n\nexport const getConfig = () => ({\n render: 'static',\n});`,\n astro: `import type { APIRoute } from 'astro';\nimport { exportSearchIndexes } from '@/lib/export-static-indexes';\n\nexport const GET: APIRoute = async () => {\n return Response.json(await exportSearchIndexes());\n};`,\n};\n\nconst astroExportSearchIndexes = `import { getStructuredData, source } from '@/lib/source';\nimport type { OramaDocument } from 'fumadocs-core/search/orama-cloud';\n\nexport async function exportSearchIndexes() {\n return source.getPages().map((page) => {\n return {\n id: page.url,\n structured: getStructuredData(page.data._raw),\n url: page.url,\n title: page.data.title,\n description: page.data.description,\n } satisfies OramaDocument;\n });\n}\n`;\n"],"mappings":";;;;;;;IAEOA,eAAa,GAAG;;;;AAKvB,SAAgB,gCACd,YACA,OACA,QACA;CACA,MAAM,aAAa,mBAAmB,UAAU,CAAC,EAAE,QAAQ;CAC3D,IAAI,CAAC,YAAY;CAEjB,MAAM,cAAc,WACjB,qBAAqBA,aAAW,mBAAmB,CAAC,CACpD,MAAM,SAAS,KAAK,QAAQ,MAAM,KAAK,CAAC,EACvC,qBAAqBA,aAAW,sBAAsB;CAE1D,IAAI,CAAC,aAAa;CAClB,KAAK,MAAM,WAAW,YAAY,YAAY,GAC5C,IAAI,CAAC,OAAO,aAAa,QAAQ,QAAQ,CAAC,CAAC,GACzC,YAAY,cAAc,OAAO;AAGvC;;;;AAKA,SA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ASN,OAAO;;;;;;AAMT;AAEA,MAAM,2BAA2B"}
|
|
1
|
+
{"version":3,"file":"orama-cloud.js","names":["SyntaxKind","writeFile"],"sources":["../../src/transform/react-router.ts","../../src/transform/tanstack-start.ts","../../src/transform/index.ts","../../src/plugins/orama-cloud.ts"],"sourcesContent":["import { ArrayLiteralExpression, MethodDeclaration, SourceFile, ts } from 'ts-morph';\nimport { getCodeValue } from '@/transform/shared';\nimport SyntaxKind = ts.SyntaxKind;\n\n/**\n * filter items in a specific array initializer in the prerender function\n */\nexport function filterReactRouterPrerenderArray(\n sourceFile: SourceFile,\n array: 'paths' | 'excluded',\n filter: (item: string) => boolean,\n) {\n const methodBody = getPrerenderMethod(sourceFile)?.getBody();\n if (!methodBody) return;\n\n const initializer = methodBody\n .getDescendantsOfKind(SyntaxKind.VariableDeclaration)\n .find((item) => item.getName() === array)\n ?.getInitializerIfKind(SyntaxKind.ArrayLiteralExpression);\n\n if (!initializer) return;\n for (const element of initializer.getElements()) {\n if (!filter(getCodeValue(element.getText()))) {\n initializer.removeElement(element);\n }\n }\n}\n\n/**\n * Add a new route to route config\n */\nexport function addReactRouterRoute(\n sourceFile: SourceFile,\n routes: { path: string; entry: string }[],\n) {\n modifyReactRouterRoutes(sourceFile, (arr) => {\n for (const { path, entry } of routes) {\n arr.addElement(`route('${path}', '${entry}')`);\n }\n });\n}\n\n/**\n * Remove routes from route config (root level only)\n */\nexport function filterReactRouterRoute(\n sourceFile: SourceFile,\n filter: (item: { path: string; entry: string }) => boolean,\n) {\n modifyReactRouterRoutes(sourceFile, (arr) => {\n for (const element of arr.getElements()) {\n if (\n !element.isKind(SyntaxKind.CallExpression) ||\n element.getFirstChildByKind(SyntaxKind.Identifier)?.getText() !== 'route'\n )\n continue;\n const args = element.getArguments();\n\n if (\n filter({\n path: getCodeValue(args[0].getText()),\n entry: getCodeValue(args[1].getText()),\n })\n )\n continue;\n\n arr.removeElement(element);\n }\n });\n}\n\nexport function modifyReactRouterRoutes(\n sourceFile: SourceFile,\n mod: (array: ArrayLiteralExpression) => void,\n) {\n const initializer = sourceFile\n .getDefaultExportSymbol()\n ?.getValueDeclaration()\n ?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression);\n if (initializer) mod(initializer);\n}\n\n/**\n * Find the prerender method from the config\n */\nfunction getPrerenderMethod(sourceFile: SourceFile): MethodDeclaration | null {\n return (\n sourceFile\n .getDefaultExportSymbol()\n ?.getValueDeclaration()\n ?.getFirstDescendantByKind(SyntaxKind.ObjectLiteralExpression)\n ?.getProperty('prerender')\n ?.asKind(SyntaxKind.MethodDeclaration) ?? null\n );\n}\n","import { CallExpression, SourceFile, SyntaxKind } from 'ts-morph';\nimport { getCodeValue } from '@/transform/shared';\n\n/**\n * Add path to the `pages` array in tanstack start vite config.\n *\n * If the `pages` property doesn't exist, create one.\n */\nexport function addTanstackPrerender(sourceFile: SourceFile, paths: string[]) {\n const optionsArg = getTanstackStartCall(sourceFile)\n ?.getArguments()[0]\n ?.asKind(SyntaxKind.ObjectLiteralExpression);\n if (!optionsArg) {\n return;\n }\n\n const pagesProperty = optionsArg.getProperty('pages')?.asKind(SyntaxKind.PropertyAssignment);\n\n function toItem(path: string) {\n return `{ path: '${path}' }`;\n }\n\n if (pagesProperty) {\n const initializer = pagesProperty.getInitializerIfKindOrThrow(\n SyntaxKind.ArrayLiteralExpression,\n );\n\n const existingPaths = new Set<string>();\n for (const element of initializer.getElements()) {\n const value = element\n .asKind(SyntaxKind.ObjectLiteralExpression)\n ?.getProperty('path')\n ?.asKind(SyntaxKind.PropertyAssignment)\n ?.getInitializer()\n ?.getText();\n\n if (value) {\n existingPaths.add(getCodeValue(value));\n }\n }\n\n for (const path of paths) {\n if (existingPaths.has(path)) continue;\n initializer.addElement(toItem(path));\n }\n } else {\n optionsArg.addProperty(`pages: [\\n${paths.map((path) => ` ${toItem(path)}`).join(',\\n')}\\n]`);\n }\n}\n\n/**\n * Find the tanstackStart call expression\n */\nfunction getTanstackStartCall(sourceFile: SourceFile): CallExpression | undefined {\n const pluginsProperty = sourceFile\n .getDefaultExportSymbol()\n ?.getValueDeclaration()\n ?.getFirstDescendantByKind(SyntaxKind.ObjectLiteralExpression)\n ?.getProperty('plugins')\n ?.getFirstChildByKind(SyntaxKind.ArrayLiteralExpression);\n\n if (!pluginsProperty) return;\n\n for (const element of pluginsProperty.getElements()) {\n const expression = element.asKind(SyntaxKind.CallExpression);\n if (expression?.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'tanstackStart') {\n return expression;\n }\n }\n}\n","import { TemplatePluginContext } from '@/index';\nimport { createSourceFile } from '@/transform/shared';\nimport path from 'node:path';\nimport {\n addReactRouterRoute,\n filterReactRouterPrerenderArray,\n filterReactRouterRoute,\n} from '@/transform/react-router';\nimport fs from 'node:fs/promises';\nimport { addTanstackPrerender } from '@/transform/tanstack-start';\nimport { StructureKind, SyntaxKind } from 'ts-morph';\n\ninterface RootLayoutMod {\n addSearchDialog: (specifier: string) => void;\n}\n\nexport async function rootProvider(\n { appDir, template }: TemplatePluginContext,\n fn: (mod: RootLayoutMod) => void,\n) {\n const file = await createSourceFile(path.join(appDir, template.rootProviderPath));\n fn({\n addSearchDialog(specifier) {\n const elements = file.getDescendantsOfKind(SyntaxKind.JsxElement);\n\n for (const element of elements) {\n const provider = element.getFirstChildByKind(SyntaxKind.JsxOpeningElement);\n if (provider?.getTagNameNode().getText() !== 'RootProvider') continue;\n\n // Skip if search prop already exists\n if (\n provider\n .getAttributes()\n .some(\n (attr) =>\n attr.isKind(SyntaxKind.JsxAttribute) && attr.getNameNode().getText() === 'search',\n )\n )\n continue;\n\n provider.addAttribute({\n kind: StructureKind.JsxAttribute,\n name: 'search',\n initializer: '{{ SearchDialog }}',\n });\n file.addImportDeclaration({\n moduleSpecifier: specifier,\n defaultImport: 'SearchDialog',\n });\n break;\n }\n },\n });\n await file.save();\n}\n\ninterface ReactRouterRoutesMod {\n /**\n * @param path API route's path\n * @param entry route's file path\n * @param code create the file if specified\n */\n addRoute: (path: string, entry: string, code?: string) => void;\n\n /**\n * @param path API route's path\n */\n removeRoute: (path: string) => void;\n}\n\nexport async function reactRouterRoutes(\n { dest, appDir }: TemplatePluginContext,\n fn: (mod: ReactRouterRoutesMod) => void,\n) {\n const configFile = await createSourceFile(path.join(dest, 'react-router.config.ts'));\n const routesFile = await createSourceFile(path.join(appDir, 'routes.ts'));\n const tasks: Promise<unknown>[] = [];\n\n function normalizePath(v: string) {\n return v.split('/').filter(Boolean).join('/');\n }\n\n fn({\n addRoute: (p, entry, code) => {\n addReactRouterRoute(routesFile, [{ path: p, entry }]);\n\n if (code) {\n tasks.push(fs.writeFile(path.join(appDir, entry), code));\n }\n },\n removeRoute: (p) => {\n const normalizedPath = normalizePath(p);\n\n filterReactRouterRoute(routesFile, (item) => {\n if (normalizePath(item.path) !== normalizedPath) return true;\n\n tasks.push(fs.unlink(path.join(appDir, item.entry)).catch(() => null));\n return false;\n });\n\n filterReactRouterPrerenderArray(\n configFile,\n 'excluded',\n (item) => normalizePath(item) !== normalizedPath,\n );\n\n filterReactRouterPrerenderArray(\n configFile,\n 'paths',\n (item) => normalizePath(item) !== normalizedPath,\n );\n },\n });\n\n await Promise.all([...tasks, routesFile.save(), configFile.save()]);\n}\n\nexport interface TanstackStartRoutesMod {\n addRoute: (options: {\n /**\n * file path relative to `routes`\n */\n path: string;\n\n /**\n * Generated route path of `path`\n */\n route: string;\n\n /**\n * if specified, create the file\n */\n code?: string;\n\n /**\n * if true, add to prerender list\n */\n prerender?: boolean;\n }) => void;\n\n removeRoute: (options: {\n /**\n * file path relative to routes directory\n */\n path: string;\n\n route: string;\n }) => void;\n}\n\nexport async function tanstackStartRoutes(\n { appDir, dest }: TemplatePluginContext,\n fn: (mod: TanstackStartRoutesMod) => void,\n) {\n const configFile = await createSourceFile(path.join(dest, 'vite.config.ts'));\n const tasks: Promise<unknown>[] = [];\n\n fn({\n addRoute(options) {\n if (options.code) {\n tasks.push(fs.writeFile(path.join(appDir, 'routes', options.path), options.code));\n }\n\n if (options.prerender) {\n addTanstackPrerender(configFile, [options.route]);\n }\n },\n removeRoute(options) {\n tasks.push(fs.unlink(path.join(appDir, 'routes', options.path)).catch(() => null));\n },\n });\n\n await Promise.all([...tasks, configFile.save()]);\n}\n","import { TemplatePlugin } from '@/index';\nimport { copy, pick, writeFile } from '@/utils';\nimport path from 'node:path';\nimport { depVersions, sourceDir } from '@/constants';\nimport fs from 'node:fs/promises';\nimport { reactRouterRoutes, rootProvider, tanstackStartRoutes } from '@/transform';\n\nexport function oramaCloud(): TemplatePlugin {\n return {\n packageJson(packageJson) {\n return {\n ...packageJson,\n scripts: {\n ...packageJson.scripts,\n build: `${packageJson.scripts!.build} && bun scripts/sync-content.ts`,\n },\n dependencies: {\n ...packageJson.dependencies,\n ...pick(depVersions, ['@orama/core']),\n },\n };\n },\n readme(content) {\n return `${content}\\n\\n## Orama Cloud\n \nThis project uses Orama Cloud for 3rd party search solution.\n\nSee https://fumadocs.dev/docs/headless/search/orama-cloud for integrating Orama Cloud to Fumadocs.`;\n },\n async afterWrite() {\n const { dest, appDir, template } = this;\n await copy(path.join(sourceDir, 'template/+orama-cloud/@root'), dest);\n await copy(path.join(sourceDir, 'template/+orama-cloud/@app'), appDir);\n\n await rootProvider(this, (mod) => mod.addSearchDialog('@/components/search'));\n\n if (template.value === 'tanstack-start') {\n await tanstackStartRoutes(this, (mod) => {\n mod.addRoute({\n path: 'static[.]json.ts',\n route: '/static.json',\n code: route.tanstack,\n prerender: true,\n });\n mod.removeRoute({\n path: 'api/search.ts',\n route: '/api/search',\n });\n });\n } else if (template.value.startsWith('react-router')) {\n await reactRouterRoutes(this, (mod) => {\n mod.addRoute('static.json', 'routes/static.ts', route['react-router']);\n mod.removeRoute('api/search');\n });\n } else if (template.value.startsWith('+next')) {\n await Promise.all([\n fs.unlink(path.join(appDir, 'app/api/search/route.ts')).catch(() => null),\n writeFile(path.join(appDir, 'app/static.json/route.ts'), route.next),\n ]);\n } else if (template.value === 'astro') {\n await Promise.all([\n fs.unlink(path.join(appDir, 'pages/api/search.ts')).catch(() => null),\n writeFile(path.join(appDir, 'pages/static.json.ts'), route.astro),\n writeFile(path.join(appDir, 'lib/export-static-indexes.ts'), astroExportSearchIndexes),\n ]);\n } else {\n await Promise.all([\n fs.unlink(path.join(appDir, 'pages/_api/api/search.ts')).catch(() => null),\n writeFile(path.join(appDir, 'pages/_api/static.json.ts'), route.waku),\n ]);\n }\n\n const filePath = {\n '+next+fuma-docs-mdx': '.next/server/app/static.json.body',\n '+next+fuma-docs-mdx+static': '.next/server/app/static.json.body',\n 'tanstack-start': '.output/public/static.json',\n 'tanstack-start-spa': 'dist/client/static.json',\n 'react-router': 'build/client/static.json',\n 'react-router-spa': 'build/client/static.json',\n astro: 'dist/static.json',\n waku: 'dist/public/static.json',\n }[template.value];\n\n await writeFile(\n path.join(dest, 'scripts/sync-content.ts'),\n `import { type OramaDocument, sync } from 'fumadocs-core/search/orama-cloud';\nimport * as fs from 'node:fs/promises';\nimport { OramaCloud } from '@orama/core';\n\n// the path of pre-rendered \\`static.json\\`\nconst filePath = '${filePath}';\n\nasync function main() {\n const orama = new OramaCloud({\n projectId: process.env.NEXT_PUBLIC_ORAMA_PROJECT_ID,\n apiKey: process.env.ORAMA_PRIVATE_API_KEY,\n });\n\n const content = await fs.readFile(filePath);\n const records = JSON.parse(content.toString()) as OramaDocument[];\n\n await sync(orama, {\n index: process.env.NEXT_PUBLIC_ORAMA_DATASOURCE_ID,\n documents: records,\n });\n\n console.log(\\`search updated: \\${records.length} records\\`);\n}\n\nvoid main();`,\n );\n },\n };\n}\n\nconst route = {\n next: `import { exportSearchIndexes } from '@/lib/export-search-indexes';\n\nexport const revalidate = false;\n\nexport async function GET() {\n return Response.json(await exportSearchIndexes());\n}`,\n 'react-router': `import { exportSearchIndexes } from '@/lib/export-search-indexes';\n\nexport async function loader() {\n return Response.json(await exportSearchIndexes());\n}`,\n tanstack: `import { createFileRoute } from '@tanstack/react-router';\nimport { exportSearchIndexes } from '@/lib/export-search-indexes';\n\nexport const Route = createFileRoute('/static.json')({\n server: {\n handlers: {\n GET: async () => Response.json(await exportSearchIndexes()),\n },\n },\n});`,\n waku: `import { exportSearchIndexes } from '@/lib/export-search-indexes';\n\nexport async function GET() {\n return Response.json(await exportSearchIndexes());\n}\n\nexport const getConfig = () => ({\n render: 'static',\n});`,\n astro: `import type { APIRoute } from 'astro';\nimport { exportSearchIndexes } from '@/lib/export-static-indexes';\n\nexport const GET: APIRoute = async () => {\n return Response.json(await exportSearchIndexes());\n};`,\n};\n\nconst astroExportSearchIndexes = `import { getStructuredData, source } from '@/lib/source';\nimport type { OramaDocument } from 'fumadocs-core/search/orama-cloud';\n\nexport async function exportSearchIndexes() {\n return source.getPages().map((page) => {\n return {\n id: page.url,\n structured: getStructuredData(page.data._raw),\n url: page.url,\n title: page.data.title,\n description: page.data.description,\n } satisfies OramaDocument;\n });\n}\n`;\n"],"mappings":";;;;;;;AAEOA,IAAAA,eAAa,GAAG;;;;AAKvB,SAAgB,gCACd,YACA,OACA,QACA;CACA,MAAM,aAAa,mBAAmB,UAAU,CAAC,EAAE,QAAQ;CAC3D,IAAI,CAAC,YAAY;CAEjB,MAAM,cAAc,WACjB,qBAAqBA,aAAW,mBAAmB,CAAC,CACpD,MAAM,SAAS,KAAK,QAAQ,MAAM,KAAK,CAAC,EACvC,qBAAqBA,aAAW,sBAAsB;CAE1D,IAAI,CAAC,aAAa;CAClB,KAAK,MAAM,WAAW,YAAY,YAAY,GAC5C,IAAI,CAAC,OAAO,aAAa,QAAQ,QAAQ,CAAC,CAAC,GACzC,YAAY,cAAc,OAAO;AAGvC;;;;AAKA,SAAgB,oBACd,YACA,QACA;CACA,wBAAwB,aAAa,QAAQ;EAC3C,KAAK,MAAM,EAAE,MAAM,WAAW,QAC5B,IAAI,WAAW,UAAU,KAAK,MAAM,MAAM,GAAG;CAEjD,CAAC;AACH;;;;AAKA,SAAgB,uBACd,YACA,QACA;CACA,wBAAwB,aAAa,QAAQ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IAAI,YAAY,YAAY;GAC9B,CAAC;QACI,IAAI,SAAS,MAAM,WAAW,OAAO,GAC1C,MAAM,QAAQ,IAAI,CAChB,GAAG,OAAO,KAAK,KAAK,QAAQ,yBAAyB,CAAC,CAAC,CAAC,YAAY,IAAI,GACxEC,YAAU,KAAK,KAAK,QAAQ,0BAA0B,GAAG,MAAM,IAAI,CACrE,CAAC;QACI,IAAI,SAAS,UAAU,SAC5B,MAAM,QAAQ,IAAI;IAChB,GAAG,OAAO,KAAK,KAAK,QAAQ,qBAAqB,CAAC,CAAC,CAAC,YAAY,IAAI;IACpEA,YAAU,KAAK,KAAK,QAAQ,sBAAsB,GAAG,MAAM,KAAK;IAChEA,YAAU,KAAK,KAAK,QAAQ,8BAA8B,GAAG,wBAAwB;GACvF,CAAC;QAED,MAAM,QAAQ,IAAI,CAChB,GAAG,OAAO,KAAK,KAAK,QAAQ,0BAA0B,CAAC,CAAC,CAAC,YAAY,IAAI,GACzEA,YAAU,KAAK,KAAK,QAAQ,2BAA2B,GAAG,MAAM,IAAI,CACtE,CAAC;GAGH,MAAM,WAAW;IACf,uBAAuB;IACvB,8BAA8B;IAC9B,kBAAkB;IAClB,sBAAsB;IACtB,gBAAgB;IAChB,oBAAoB;IACpB,OAAO;IACP,MAAM;GACR,EAAE,SAAS;GAEX,MAAMA,YACJ,KAAK,KAAK,MAAM,yBAAyB,GACzC;;;;;oBAKY,SAAS;;;;;;;;;;;;;;;;;;;aAoBvB;EACF;CACF;AACF;AAEA,MAAM,QAAQ;CACZ,MAAM;;;;;;;CAON,gBAAgB;;;;;CAKhB,UAAU;;;;;;;;;;CAUV,MAAM;;;;;;;;;CASN,OAAO;;;;;;AAMT;AAEA,MAAM,2BAA2B"}
|
package/dist/plugins/oxlint.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as templates, r as sourceDir, t as depVersions } from "./constants-
|
|
1
|
+
import { i as templates, r as sourceDir, t as depVersions } from "./constants-UZ9hhOMa.js";
|
|
2
2
|
import { r as tryGitInit, t as copy } from "./utils-BZh9vMXJ.js";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
@@ -86,4 +86,4 @@ async function initPackageJson(projectName, packageJsonPath) {
|
|
|
86
86
|
//#endregion
|
|
87
87
|
export { getPackageManager as n, managers as r, create as t };
|
|
88
88
|
|
|
89
|
-
//# sourceMappingURL=src-
|
|
89
|
+
//# sourceMappingURL=src-Dfp3MdVo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src-
|
|
1
|
+
{"version":3,"file":"src-Dfp3MdVo.js","names":[],"sources":["../src/auto-install.ts","../src/index.ts"],"sourcesContent":["import { x } from 'tinyexec';\n\nexport type PackageManager = (typeof managers)[number];\n\nexport const managers = ['npm', 'yarn', 'bun', 'pnpm'] as const;\n\nexport function getPackageManager(): PackageManager {\n const userAgent = process.env.npm_config_user_agent ?? '';\n\n if (userAgent.startsWith('yarn')) {\n return 'yarn';\n }\n\n if (userAgent.startsWith('pnpm')) {\n return 'pnpm';\n }\n\n if (userAgent.startsWith('bun')) {\n return 'bun';\n }\n\n return 'npm';\n}\n\nexport async function autoInstall(manager: PackageManager, dest: string) {\n await x(manager, ['install'], {\n throwOnError: true,\n nodeOptions: {\n env: {\n ...process.env,\n NODE_ENV: 'development',\n DISABLE_OPENCOLLECTIVE: '1',\n },\n cwd: dest,\n },\n });\n}\n","import path from 'node:path';\nimport fs from 'node:fs/promises';\nimport { copy, tryGitInit } from '@/utils';\nimport type { PackageManager } from './auto-install';\nimport { autoInstall } from './auto-install';\nimport { depVersions, sourceDir, type TemplateInfo, templates } from './constants';\n\nexport type Template = TemplateInfo['value'];\nexport interface Options {\n outputDir: string;\n template: Template;\n\n /**\n * the package manager to use\n *\n * @defaultValue 'npm'\n */\n packageManager?: PackageManager;\n\n installDeps?: boolean;\n initializeGit?: boolean;\n log?: (message: string) => void;\n plugins?: TemplatePlugin[];\n}\n\nexport interface TemplatePluginContext {\n template: TemplateInfo;\n log: (message: string) => void;\n /**\n * output directory\n */\n dest: string;\n\n /**\n * output directory for app code (e.g. under `/src`)\n */\n appDir: string;\n}\n\nexport type PackageJsonType = {\n name?: string;\n version?: string;\n private?: boolean;\n scripts?: Record<string, string>;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n} & Record<string, unknown>;\n\ntype Awaitable<T> = T | Promise<T>;\n\nexport interface TemplatePlugin {\n template?: (\n this: Pick<TemplatePluginContext, 'dest'>,\n info: TemplateInfo,\n ) => Awaitable<void | TemplateInfo>;\n packageJson?: (\n this: TemplatePluginContext,\n packageJson: PackageJsonType,\n ) => Awaitable<void | PackageJsonType>;\n afterWrite?: (this: TemplatePluginContext) => Awaitable<void>;\n readme?: (this: TemplatePluginContext, content: string) => Awaitable<void | string>;\n}\n\nexport async function create(createOptions: Options): Promise<void> {\n const {\n outputDir,\n plugins = [],\n packageManager = 'npm',\n initializeGit = false,\n installDeps = false,\n log = console.log,\n } = createOptions;\n\n let template = templates.find((item) => item.value === createOptions.template)!;\n for (const plugin of plugins) {\n template = (await plugin.template?.call({ dest: outputDir }, template)) ?? template;\n }\n\n const appDir = path.join(outputDir, template.appDir);\n const projectName = path.basename(outputDir);\n const pluginContext: TemplatePluginContext = {\n template,\n dest: outputDir,\n log,\n appDir,\n };\n\n await copy(path.join(sourceDir, 'template', template.value), outputDir, {\n rename(file) {\n file = file.replace('example.gitignore', '.gitignore');\n\n return template.rename?.(file) ?? file;\n },\n });\n\n const packageJsonPath = path.join(outputDir, 'package.json');\n let packageJson = await initPackageJson(projectName, packageJsonPath);\n for (const plugin of plugins) {\n packageJson = (await plugin.packageJson?.call(pluginContext, packageJson)) ?? packageJson;\n }\n await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));\n\n const readmePath = path.join(outputDir, 'README.md');\n let readme = `# ${projectName}\\n\\n${await fs.readFile(readmePath)}`;\n for (const plugin of plugins) {\n readme = (await plugin.readme?.call(pluginContext, readme)) ?? readme;\n }\n await fs.writeFile(readmePath, readme);\n\n for (const plugin of plugins) {\n await plugin.afterWrite?.call(pluginContext);\n }\n\n if (installDeps) {\n try {\n await autoInstall(packageManager, outputDir);\n log('Installed dependencies');\n } catch (err) {\n log(`Failed to install dependencies: ${err}`);\n }\n }\n\n if (initializeGit && (await tryGitInit(outputDir))) {\n log('Initialized Git repository');\n }\n}\n\nasync function initPackageJson(\n projectName: string,\n packageJsonPath: string,\n): Promise<PackageJsonType> {\n function replaceWorkspaceDeps(deps: Record<string, string> = {}) {\n for (const k in deps) {\n if (deps[k].startsWith('workspace:') && k in depVersions) {\n deps[k] = depVersions[k as keyof typeof depVersions];\n }\n }\n\n return deps;\n }\n\n const packageJson: PackageJsonType = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));\n const dependencies = replaceWorkspaceDeps(packageJson.dependencies);\n const devDependencies = replaceWorkspaceDeps(packageJson.devDependencies);\n const scripts = { ...packageJson.scripts };\n\n if (dependencies['fumadocs-mdx'] || devDependencies['fumadocs-mdx']) {\n scripts.postinstall = 'fumadocs-mdx';\n }\n\n return {\n ...packageJson,\n name: projectName,\n scripts,\n dependencies,\n devDependencies,\n };\n}\n"],"mappings":";;;;;;AAIA,MAAa,WAAW;CAAC;CAAO;CAAQ;CAAO;AAAM;AAErD,SAAgB,oBAAoC;CAClD,MAAM,YAAY,QAAQ,IAAI,yBAAyB;CAEvD,IAAI,UAAU,WAAW,MAAM,GAC7B,OAAO;CAGT,IAAI,UAAU,WAAW,MAAM,GAC7B,OAAO;CAGT,IAAI,UAAU,WAAW,KAAK,GAC5B,OAAO;CAGT,OAAO;AACT;AAEA,eAAsB,YAAY,SAAyB,MAAc;CACvE,MAAM,EAAE,SAAS,CAAC,SAAS,GAAG;EAC5B,cAAc;EACd,aAAa;GACX,KAAK;IACH,GAAG,QAAQ;IACX,UAAU;IACV,wBAAwB;GAC1B;GACA,KAAK;EACP;CACF,CAAC;AACH;;;AC2BA,eAAsB,OAAO,eAAuC;C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iBAAkB,MAAM,WAAW,SAAS,GAC9C,IAAI,4BAA4B;AAEpC;AAEA,eAAe,gBACb,aACA,iBAC0B;CAC1B,SAAS,qBAAqB,OAA+B,CAAC,GAAG;EAC/D,KAAK,MAAM,KAAK,MACd,IAAI,KAAK,EAAE,CAAC,WAAW,YAAY,KAAK,KAAK,aAC3C,KAAK,KAAK,YAAY;EAI1B,OAAO;CACT;CAEA,MAAM,cAA+B,KAAK,MAAM,MAAM,GAAG,SAAS,iBAAiB,OAAO,CAAC;CAC3F,MAAM,eAAe,qBAAqB,YAAY,YAAY;CAClE,MAAM,kBAAkB,qBAAqB,YAAY,eAAe;CACxE,MAAM,UAAU,EAAE,GAAG,YAAY,QAAQ;CAEzC,IAAI,aAAa,mBAAmB,gBAAgB,iBAClD,QAAQ,cAAc;CAGxB,OAAO;EACL,GAAG;EACH,MAAM;EACN;EACA;EACA;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fumadocs-app",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.6",
|
|
4
4
|
"description": "Create a new documentation site with Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/cross-spawn": "^6.0.6",
|
|
49
49
|
"@types/node": "26.1.1",
|
|
50
50
|
"tinyglobby": "^0.2.17",
|
|
51
|
-
"tsdown": "0.22.
|
|
51
|
+
"tsdown": "0.22.13",
|
|
52
52
|
"typescript": "^6.0.3",
|
|
53
53
|
"tsconfig": "0.0.0"
|
|
54
54
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "example-next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "next build",
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
"fumadocs-core": "workspace:*",
|
|
14
14
|
"fumadocs-mdx": "workspace:*",
|
|
15
15
|
"fumadocs-ui": "workspace:@fumadocs/base-ui@*",
|
|
16
|
-
"lucide-react": "^1.
|
|
17
|
-
"next": "16.2.
|
|
18
|
-
"react": "^19.2.
|
|
19
|
-
"react-dom": "^19.2.
|
|
16
|
+
"lucide-react": "^1.25.0",
|
|
17
|
+
"next": "16.2.11",
|
|
18
|
+
"react": "^19.2.8",
|
|
19
|
+
"react-dom": "^19.2.8"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@tailwindcss/postcss": "^4.3.
|
|
22
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
23
23
|
"@types/mdx": "^2.0.14",
|
|
24
24
|
"@types/node": "^26.1.1",
|
|
25
25
|
"@types/react": "^19.2.17",
|
|
26
26
|
"@types/react-dom": "^19.2.3",
|
|
27
|
-
"postcss": "^8.5.
|
|
28
|
-
"tailwindcss": "^4.3.
|
|
27
|
+
"postcss": "^8.5.21",
|
|
28
|
+
"tailwindcss": "^4.3.3",
|
|
29
29
|
"typescript": "^6.0.3"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "example-next-static",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "next build",
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
"fumadocs-core": "workspace:*",
|
|
15
15
|
"fumadocs-mdx": "workspace:*",
|
|
16
16
|
"fumadocs-ui": "workspace:@fumadocs/base-ui@*",
|
|
17
|
-
"lucide-react": "^1.
|
|
18
|
-
"next": "16.2.
|
|
19
|
-
"react": "^19.2.
|
|
20
|
-
"react-dom": "^19.2.
|
|
17
|
+
"lucide-react": "^1.25.0",
|
|
18
|
+
"next": "16.2.11",
|
|
19
|
+
"react": "^19.2.8",
|
|
20
|
+
"react-dom": "^19.2.8"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@tailwindcss/postcss": "^4.3.
|
|
23
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
24
24
|
"@types/mdx": "^2.0.14",
|
|
25
25
|
"@types/node": "^26.1.1",
|
|
26
26
|
"@types/react": "^19.2.17",
|
|
27
27
|
"@types/react-dom": "^19.2.3",
|
|
28
|
-
"postcss": "^8.5.
|
|
28
|
+
"postcss": "^8.5.21",
|
|
29
29
|
"serve": "^14.2.6",
|
|
30
|
-
"tailwindcss": "^4.3.
|
|
30
|
+
"tailwindcss": "^4.3.3",
|
|
31
31
|
"typescript": "^6.0.3"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "example-astro",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@astrojs/markdown-remark": "^7.2.1",
|
|
15
|
-
"@astrojs/mdx": "^7.0.
|
|
15
|
+
"@astrojs/mdx": "^7.0.3",
|
|
16
16
|
"@astrojs/react": "^6.0.1",
|
|
17
17
|
"@orama/orama": "^3.1.18",
|
|
18
|
-
"astro": "^7.
|
|
18
|
+
"astro": "^7.1.3",
|
|
19
19
|
"fumadocs-core": "workspace:*",
|
|
20
20
|
"fumadocs-ui": "workspace:@fumadocs/base-ui@*",
|
|
21
|
-
"react": "^19.2.
|
|
22
|
-
"react-dom": "^19.2.
|
|
21
|
+
"react": "^19.2.8",
|
|
22
|
+
"react-dom": "^19.2.8",
|
|
23
23
|
"sharp": "^0.35.3",
|
|
24
|
-
"takumi-js": "^2.
|
|
24
|
+
"takumi-js": "^2.4.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@tailwindcss/vite": "^4.3.
|
|
27
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
28
28
|
"@types/react": "^19.2.17",
|
|
29
29
|
"@types/react-dom": "^19.2.3",
|
|
30
|
-
"tailwindcss": "^4.3.
|
|
30
|
+
"tailwindcss": "^4.3.3"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -9,29 +9,29 @@
|
|
|
9
9
|
"types:check": "react-router typegen && fumadocs-mdx && tsc --noEmit"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@react-router/node": "^8.
|
|
13
|
-
"@react-router/serve": "^8.
|
|
12
|
+
"@react-router/node": "^8.3.0",
|
|
13
|
+
"@react-router/serve": "^8.3.0",
|
|
14
14
|
"cnfast": "^0.0.8",
|
|
15
15
|
"fumadocs-core": "workspace:*",
|
|
16
16
|
"fumadocs-mdx": "workspace:*",
|
|
17
17
|
"fumadocs-ui": "workspace:@fumadocs/base-ui@*",
|
|
18
|
-
"isbot": "^5.2.
|
|
19
|
-
"lucide-react": "^1.
|
|
20
|
-
"react": "^19.2.
|
|
21
|
-
"react-dom": "^19.2.
|
|
22
|
-
"react-router": "^8.
|
|
23
|
-
"takumi-js": "^2.
|
|
18
|
+
"isbot": "^5.2.1",
|
|
19
|
+
"lucide-react": "^1.25.0",
|
|
20
|
+
"react": "^19.2.8",
|
|
21
|
+
"react-dom": "^19.2.8",
|
|
22
|
+
"react-router": "^8.3.0",
|
|
23
|
+
"takumi-js": "^2.4.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@react-router/dev": "^8.
|
|
27
|
-
"@tailwindcss/vite": "^4.3.
|
|
26
|
+
"@react-router/dev": "^8.3.0",
|
|
27
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
28
28
|
"@types/mdx": "^2.0.14",
|
|
29
29
|
"@types/node": "^26.1.1",
|
|
30
30
|
"@types/react": "^19.2.17",
|
|
31
31
|
"@types/react-dom": "^19.2.3",
|
|
32
32
|
"react-router-devtools": "^6.2.1",
|
|
33
|
-
"tailwindcss": "^4.3.
|
|
33
|
+
"tailwindcss": "^4.3.3",
|
|
34
34
|
"typescript": "^6.0.3",
|
|
35
|
-
"vite": "^8.1.
|
|
35
|
+
"vite": "^8.1.5"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -10,28 +10,28 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@orama/orama": "^3.1.18",
|
|
13
|
-
"@react-router/node": "^8.
|
|
13
|
+
"@react-router/node": "^8.3.0",
|
|
14
14
|
"cnfast": "^0.0.8",
|
|
15
15
|
"fumadocs-core": "workspace:*",
|
|
16
16
|
"fumadocs-mdx": "workspace:*",
|
|
17
17
|
"fumadocs-ui": "workspace:@fumadocs/base-ui@*",
|
|
18
|
-
"isbot": "^5.2.
|
|
19
|
-
"lucide-react": "^1.
|
|
20
|
-
"react": "^19.2.
|
|
21
|
-
"react-dom": "^19.2.
|
|
22
|
-
"react-router": "^8.
|
|
18
|
+
"isbot": "^5.2.1",
|
|
19
|
+
"lucide-react": "^1.25.0",
|
|
20
|
+
"react": "^19.2.8",
|
|
21
|
+
"react-dom": "^19.2.8",
|
|
22
|
+
"react-router": "^8.3.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@react-router/dev": "^8.
|
|
26
|
-
"@tailwindcss/vite": "^4.3.
|
|
25
|
+
"@react-router/dev": "^8.3.0",
|
|
26
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
27
27
|
"@types/mdx": "^2.0.14",
|
|
28
28
|
"@types/node": "^26.1.1",
|
|
29
29
|
"@types/react": "^19.2.17",
|
|
30
30
|
"@types/react-dom": "^19.2.3",
|
|
31
31
|
"react-router-devtools": "^6.2.1",
|
|
32
32
|
"serve": "^14.2.6",
|
|
33
|
-
"tailwindcss": "^4.3.
|
|
33
|
+
"tailwindcss": "^4.3.3",
|
|
34
34
|
"typescript": "^6.0.3",
|
|
35
|
-
"vite": "^8.1.
|
|
35
|
+
"vite": "^8.1.5"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -11,27 +11,27 @@
|
|
|
11
11
|
"types:check": "fumadocs-mdx && tsc --noEmit"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@tanstack/react-router": "1.170.
|
|
14
|
+
"@tanstack/react-router": "1.170.18",
|
|
15
15
|
"@tanstack/react-router-devtools": "1.167.0",
|
|
16
|
-
"@tanstack/react-start": "1.168.
|
|
16
|
+
"@tanstack/react-start": "1.168.32",
|
|
17
17
|
"cnfast": "^0.0.8",
|
|
18
18
|
"fumadocs-core": "workspace:*",
|
|
19
19
|
"fumadocs-mdx": "workspace:*",
|
|
20
20
|
"fumadocs-ui": "workspace:@fumadocs/base-ui@*",
|
|
21
|
-
"lucide-react": "^1.
|
|
22
|
-
"react": "^19.2.
|
|
23
|
-
"react-dom": "^19.2.
|
|
21
|
+
"lucide-react": "^1.25.0",
|
|
22
|
+
"react": "^19.2.8",
|
|
23
|
+
"react-dom": "^19.2.8"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tailwindcss/vite": "^4.3.
|
|
26
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
27
27
|
"@types/mdx": "^2.0.14",
|
|
28
28
|
"@types/node": "^26.1.1",
|
|
29
29
|
"@types/react": "^19.2.17",
|
|
30
30
|
"@types/react-dom": "^19.2.3",
|
|
31
31
|
"@vitejs/plugin-react": "^6.0.3",
|
|
32
32
|
"nitro": "3.0.260610-beta",
|
|
33
|
-
"tailwindcss": "^4.3.
|
|
33
|
+
"tailwindcss": "^4.3.3",
|
|
34
34
|
"typescript": "^6.0.3",
|
|
35
|
-
"vite": "^8.1.
|
|
35
|
+
"vite": "^8.1.5"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -12,20 +12,20 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@orama/orama": "^3.1.18",
|
|
15
|
-
"@tanstack/react-router": "1.170.
|
|
15
|
+
"@tanstack/react-router": "1.170.18",
|
|
16
16
|
"@tanstack/react-router-devtools": "1.167.0",
|
|
17
|
-
"@tanstack/react-start": "1.168.
|
|
18
|
-
"@tanstack/start-static-server-functions": "1.167.
|
|
17
|
+
"@tanstack/react-start": "1.168.32",
|
|
18
|
+
"@tanstack/start-static-server-functions": "1.167.19",
|
|
19
19
|
"cnfast": "^0.0.8",
|
|
20
20
|
"fumadocs-core": "workspace:*",
|
|
21
21
|
"fumadocs-mdx": "workspace:*",
|
|
22
22
|
"fumadocs-ui": "workspace:@fumadocs/base-ui@*",
|
|
23
|
-
"lucide-react": "^1.
|
|
24
|
-
"react": "^19.2.
|
|
25
|
-
"react-dom": "^19.2.
|
|
23
|
+
"lucide-react": "^1.25.0",
|
|
24
|
+
"react": "^19.2.8",
|
|
25
|
+
"react-dom": "^19.2.8"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tailwindcss/vite": "^4.3.
|
|
28
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
29
29
|
"@types/mdx": "^2.0.14",
|
|
30
30
|
"@types/node": "^26.1.1",
|
|
31
31
|
"@types/react": "^19.2.17",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@vitejs/plugin-react": "^6.0.3",
|
|
34
34
|
"nitro": "3.0.260610-beta",
|
|
35
35
|
"serve": "^14.2.6",
|
|
36
|
-
"srvx": "^0.
|
|
37
|
-
"tailwindcss": "^4.3.
|
|
36
|
+
"srvx": "^0.12.1",
|
|
37
|
+
"tailwindcss": "^4.3.3",
|
|
38
38
|
"typescript": "^6.0.3",
|
|
39
|
-
"vite": "^8.1.
|
|
39
|
+
"vite": "^8.1.5"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
"fumadocs-core": "workspace:*",
|
|
15
15
|
"fumadocs-mdx": "workspace:*",
|
|
16
16
|
"fumadocs-ui": "workspace:@fumadocs/base-ui@*",
|
|
17
|
-
"lucide-react": "^1.
|
|
18
|
-
"react": "^19.2.
|
|
19
|
-
"react-dom": "^19.2.
|
|
20
|
-
"react-server-dom-webpack": "^19.2.
|
|
21
|
-
"takumi-js": "^2.
|
|
22
|
-
"waku": "1.0.0-beta.
|
|
17
|
+
"lucide-react": "^1.25.0",
|
|
18
|
+
"react": "^19.2.8",
|
|
19
|
+
"react-dom": "^19.2.8",
|
|
20
|
+
"react-server-dom-webpack": "^19.2.8",
|
|
21
|
+
"takumi-js": "^2.4.0",
|
|
22
|
+
"waku": "1.0.0-beta.7"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tailwindcss/vite": "^4.3.
|
|
25
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
26
26
|
"@types/mdx": "^2.0.14",
|
|
27
27
|
"@types/node": "^26.1.1",
|
|
28
28
|
"@types/react": "^19.2.17",
|
|
29
29
|
"@types/react-dom": "^19.2.3",
|
|
30
|
-
"tailwindcss": "^4.3.
|
|
30
|
+
"tailwindcss": "^4.3.3",
|
|
31
31
|
"typescript": "^6.0.3",
|
|
32
|
-
"vite": "^8.1.
|
|
32
|
+
"vite": "^8.1.5"
|
|
33
33
|
}
|
|
34
34
|
}
|