create-fumadocs-app 16.0.33 → 16.0.34
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 +155 -206
- package/dist/bin.js.map +1 -0
- package/dist/constants-CReWPhck.js +150 -0
- package/dist/constants-CReWPhck.js.map +1 -0
- package/dist/index-CC4EFQ5p.d.ts +67 -0
- package/dist/index-CC4EFQ5p.d.ts.map +1 -0
- package/dist/index.d.ts +2 -63
- package/dist/index.js +4 -7
- package/dist/plugins/biome.base.d.ts +40 -45
- package/dist/plugins/biome.base.d.ts.map +1 -0
- package/dist/plugins/biome.base.js +37 -17
- package/dist/plugins/biome.base.js.map +1 -0
- package/dist/plugins/biome.d.ts +4 -2
- package/dist/plugins/biome.d.ts.map +1 -0
- package/dist/plugins/biome.js +30 -40
- package/dist/plugins/biome.js.map +1 -0
- package/dist/plugins/biome.next.d.ts +41 -49
- package/dist/plugins/biome.next.d.ts.map +1 -0
- package/dist/plugins/biome.next.js +43 -17
- package/dist/plugins/biome.next.js.map +1 -0
- package/dist/plugins/eslint.d.ts +4 -2
- package/dist/plugins/eslint.d.ts.map +1 -0
- package/dist/plugins/eslint.js +30 -33
- package/dist/plugins/eslint.js.map +1 -0
- package/dist/plugins/next-use-src.d.ts +5 -2
- package/dist/plugins/next-use-src.d.ts.map +1 -0
- package/dist/plugins/next-use-src.js +33 -35
- package/dist/plugins/next-use-src.js.map +1 -0
- package/dist/plugins/orama-cloud.d.ts +4 -2
- package/dist/plugins/orama-cloud.d.ts.map +1 -0
- package/dist/plugins/orama-cloud.js +210 -276
- package/dist/plugins/orama-cloud.js.map +1 -0
- package/dist/src-DWqRvlfn.js +89 -0
- package/dist/src-DWqRvlfn.js.map +1 -0
- package/package.json +19 -18
- package/template/+next+fuma-docs-mdx/app/docs/[[...slug]]/page.tsx +2 -9
- package/template/+next+fuma-docs-mdx/app/docs/layout.tsx +1 -1
- package/template/+next+fuma-docs-mdx/app/og/docs/[...slug]/route.tsx +2 -9
- package/template/+next+fuma-docs-mdx/package.json +2 -2
- package/template/+next+fuma-docs-mdx/source.config.ts +1 -6
- package/template/+orama-cloud/@app/components/search.tsx +1 -6
- package/template/react-router/app/docs/page.tsx +1 -6
- package/template/react-router/app/root.tsx +1 -3
- package/template/react-router/package.json +6 -6
- package/template/react-router/tsconfig.json +1 -6
- package/template/react-router-spa/app/components/search.tsx +1 -6
- package/template/react-router-spa/app/docs/page.tsx +2 -7
- package/template/react-router-spa/app/root.tsx +1 -3
- package/template/react-router-spa/package.json +6 -6
- package/template/react-router-spa/tsconfig.json +1 -6
- package/template/tanstack-start/content/docs/index.mdx +1 -4
- package/template/tanstack-start/package.json +4 -4
- package/template/tanstack-start/src/components/not-found.tsx +2 -2
- package/template/tanstack-start/src/routes/__root.tsx +1 -6
- package/template/tanstack-start/src/routes/docs/$.tsx +1 -6
- package/template/tanstack-start/src/routes/index.tsx +1 -3
- package/template/tanstack-start-spa/content/docs/index.mdx +1 -4
- package/template/tanstack-start-spa/package.json +5 -5
- package/template/tanstack-start-spa/src/components/not-found.tsx +2 -2
- package/template/tanstack-start-spa/src/components/search.tsx +1 -6
- package/template/tanstack-start-spa/src/routes/__root.tsx +1 -6
- package/template/tanstack-start-spa/src/routes/docs/$.tsx +2 -7
- package/template/waku/package.json +4 -4
- package/template/waku/src/pages/docs/[...slugs].tsx +2 -9
- package/template/waku/src/pages/docs/_layout.tsx +1 -1
- package/dist/chunk-7QPQHHV2.js +0 -179
- package/dist/chunk-BEZTHMLF.js +0 -51
- package/dist/chunk-EM5SN2F4.js +0 -130
- package/dist/chunk-JCFTHRDR.js +0 -50
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "example-tanstack-start-spa",
|
|
3
3
|
"private": true,
|
|
4
|
-
"sideEffects": false,
|
|
5
4
|
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite dev",
|
|
8
8
|
"build": "vite build",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types:check": "fumadocs-mdx && tsc --noEmit"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@orama/orama": "^3.1.
|
|
13
|
+
"@orama/orama": "^3.1.18",
|
|
14
14
|
"@tanstack/react-router": "1.136.18",
|
|
15
15
|
"@tanstack/react-router-devtools": "1.136.18",
|
|
16
16
|
"@tanstack/react-start": "1.136.18",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"fumadocs-core": "workspace:*",
|
|
19
19
|
"fumadocs-mdx": "workspace:*",
|
|
20
20
|
"fumadocs-ui": "workspace:*",
|
|
21
|
-
"lucide-static": "^0.
|
|
21
|
+
"lucide-static": "^0.562.0",
|
|
22
22
|
"react": "^19.2.3",
|
|
23
23
|
"react-dom": "^19.2.3",
|
|
24
24
|
"tailwind-merge": "^3.4.0",
|
|
25
|
-
"vite": "^7.
|
|
25
|
+
"vite": "^7.3.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@tailwindcss/vite": "^4.1.18",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"serve": "^14.2.5",
|
|
35
35
|
"tailwindcss": "^4.1.18",
|
|
36
36
|
"typescript": "^5.9.3",
|
|
37
|
-
"vite-tsconfig-paths": "^6.0.
|
|
37
|
+
"vite-tsconfig-paths": "^6.0.3"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -13,8 +13,8 @@ export function NotFound() {
|
|
|
13
13
|
<h1 className="text-6xl font-bold text-fd-muted-foreground">404</h1>
|
|
14
14
|
<h2 className="text-2xl font-semibold">Page Not Found</h2>
|
|
15
15
|
<p className="text-fd-muted-foreground max-w-md">
|
|
16
|
-
The page you are looking for might have been removed, had its name
|
|
17
|
-
|
|
16
|
+
The page you are looking for might have been removed, had its name changed, or is
|
|
17
|
+
temporarily unavailable.
|
|
18
18
|
</p>
|
|
19
19
|
<Link
|
|
20
20
|
to="/"
|
|
@@ -31,12 +31,7 @@ export default function DefaultSearchDialog(props: SharedProps) {
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
|
-
<SearchDialog
|
|
35
|
-
search={search}
|
|
36
|
-
onSearchChange={setSearch}
|
|
37
|
-
isLoading={query.isLoading}
|
|
38
|
-
{...props}
|
|
39
|
-
>
|
|
34
|
+
<SearchDialog search={search} onSearchChange={setSearch} isLoading={query.isLoading} {...props}>
|
|
40
35
|
<SearchDialogOverlay />
|
|
41
36
|
<SearchDialogContent>
|
|
42
37
|
<SearchDialogHeader>
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createRootRoute,
|
|
3
|
-
HeadContent,
|
|
4
|
-
Outlet,
|
|
5
|
-
Scripts,
|
|
6
|
-
} from '@tanstack/react-router';
|
|
1
|
+
import { createRootRoute, HeadContent, Outlet, Scripts } from '@tanstack/react-router';
|
|
7
2
|
import * as React from 'react';
|
|
8
3
|
import appCss from '@/styles/app.css?url';
|
|
9
4
|
import { RootProvider } from 'fumadocs-ui/provider/tanstack';
|
|
@@ -3,12 +3,7 @@ import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
|
|
3
3
|
import { createServerFn } from '@tanstack/react-start';
|
|
4
4
|
import { source } from '@/lib/source';
|
|
5
5
|
import browserCollections from 'fumadocs-mdx:collections/browser';
|
|
6
|
-
import {
|
|
7
|
-
DocsBody,
|
|
8
|
-
DocsDescription,
|
|
9
|
-
DocsPage,
|
|
10
|
-
DocsTitle,
|
|
11
|
-
} from 'fumadocs-ui/layouts/docs/page';
|
|
6
|
+
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/layouts/docs/page';
|
|
12
7
|
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
13
8
|
import { baseOptions } from '@/lib/layout.shared';
|
|
14
9
|
import { staticFunctionMiddleware } from '@tanstack/start-static-server-functions';
|
|
@@ -35,7 +30,7 @@ const loader = createServerFn({
|
|
|
35
30
|
|
|
36
31
|
return {
|
|
37
32
|
path: page.path,
|
|
38
|
-
pageTree: await source.serializePageTree(source.
|
|
33
|
+
pageTree: await source.serializePageTree(source.getPageTree()),
|
|
39
34
|
};
|
|
40
35
|
});
|
|
41
36
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "example-waku",
|
|
3
3
|
"private": true,
|
|
4
|
-
"sideEffects": false,
|
|
5
4
|
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "waku dev",
|
|
8
8
|
"build": "waku build",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"react": "^19.2.3",
|
|
17
17
|
"react-dom": "^19.2.3",
|
|
18
18
|
"react-server-dom-webpack": "^19.2.3",
|
|
19
|
-
"waku": "^0.27.
|
|
19
|
+
"waku": "^0.27.5"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@tailwindcss/vite": "^4.1.18",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@types/react-dom": "^19.2.3",
|
|
27
27
|
"tailwindcss": "^4.1.18",
|
|
28
28
|
"typescript": "^5.9.3",
|
|
29
|
-
"vite": "^7.
|
|
30
|
-
"vite-tsconfig-paths": "^6.0.
|
|
29
|
+
"vite": "^7.3.0",
|
|
30
|
+
"vite-tsconfig-paths": "^6.0.3"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { source } from '@/lib/source';
|
|
2
2
|
import { PageProps } from 'waku/router';
|
|
3
3
|
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
4
|
-
import {
|
|
5
|
-
DocsBody,
|
|
6
|
-
DocsDescription,
|
|
7
|
-
DocsPage,
|
|
8
|
-
DocsTitle,
|
|
9
|
-
} from 'fumadocs-ui/layouts/docs/page';
|
|
4
|
+
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/layouts/docs/page';
|
|
10
5
|
|
|
11
6
|
export default function DocPage({ slugs }: PageProps<'/docs/[...slugs]'>) {
|
|
12
7
|
const page = source.getPage(slugs);
|
|
@@ -14,9 +9,7 @@ export default function DocPage({ slugs }: PageProps<'/docs/[...slugs]'>) {
|
|
|
14
9
|
if (!page) {
|
|
15
10
|
return (
|
|
16
11
|
<div className="text-center py-12">
|
|
17
|
-
<h1 className="text-3xl font-bold mb-4 text-gray-900 dark:text-gray-100">
|
|
18
|
-
Page Not Found
|
|
19
|
-
</h1>
|
|
12
|
+
<h1 className="text-3xl font-bold mb-4 text-gray-900 dark:text-gray-100">Page Not Found</h1>
|
|
20
13
|
<p className="text-gray-600 dark:text-gray-400">
|
|
21
14
|
The page you are looking for does not exist.
|
|
22
15
|
</p>
|
|
@@ -5,7 +5,7 @@ import { baseOptions } from '@/lib/layout.shared';
|
|
|
5
5
|
|
|
6
6
|
export default function Layout({ children }: { children: ReactNode }) {
|
|
7
7
|
return (
|
|
8
|
-
<DocsLayout {...baseOptions()} tree={source.
|
|
8
|
+
<DocsLayout {...baseOptions()} tree={source.getPageTree()}>
|
|
9
9
|
{children}
|
|
10
10
|
</DocsLayout>
|
|
11
11
|
);
|
package/dist/chunk-7QPQHHV2.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
// src/utils.ts
|
|
2
|
-
import fs from "fs/promises";
|
|
3
|
-
import path, { join } from "path";
|
|
4
|
-
import { x } from "tinyexec";
|
|
5
|
-
async function writeFile(file, content) {
|
|
6
|
-
await fs.mkdir(path.dirname(file), { recursive: true });
|
|
7
|
-
await fs.writeFile(file, content);
|
|
8
|
-
}
|
|
9
|
-
async function copy(from, to, options = {}) {
|
|
10
|
-
const {
|
|
11
|
-
rename = (s) => s,
|
|
12
|
-
filterDir = () => true,
|
|
13
|
-
filter = () => true
|
|
14
|
-
} = options;
|
|
15
|
-
const stats = await fs.stat(from);
|
|
16
|
-
if (stats.isDirectory() && filterDir(from)) {
|
|
17
|
-
const files = await fs.readdir(from);
|
|
18
|
-
await Promise.all(
|
|
19
|
-
files.map(
|
|
20
|
-
(file) => copy(path.join(from, file), path.join(to, file), options)
|
|
21
|
-
)
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
if (stats.isFile() && filter(from)) {
|
|
25
|
-
to = rename(to);
|
|
26
|
-
await fs.mkdir(path.dirname(to), { recursive: true });
|
|
27
|
-
await fs.copyFile(from, to);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async function isInGitRepository(cwd) {
|
|
31
|
-
const { exitCode } = await x("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
32
|
-
nodeOptions: { cwd }
|
|
33
|
-
});
|
|
34
|
-
return exitCode === 0;
|
|
35
|
-
}
|
|
36
|
-
async function isDefaultBranchSet(cwd) {
|
|
37
|
-
const { exitCode } = await x("git", ["config", "init.defaultBranch"], {
|
|
38
|
-
nodeOptions: { cwd }
|
|
39
|
-
});
|
|
40
|
-
return exitCode === 0;
|
|
41
|
-
}
|
|
42
|
-
async function tryGitInit(cwd) {
|
|
43
|
-
const { exitCode } = await x("git", ["--version"]);
|
|
44
|
-
if (exitCode !== 0) return false;
|
|
45
|
-
if (await isInGitRepository(cwd)) return false;
|
|
46
|
-
try {
|
|
47
|
-
await x("git", ["init"], {
|
|
48
|
-
throwOnError: true,
|
|
49
|
-
nodeOptions: { cwd }
|
|
50
|
-
});
|
|
51
|
-
if (!await isDefaultBranchSet(cwd)) {
|
|
52
|
-
await x("git", ["checkout", "-b", "main"], {
|
|
53
|
-
throwOnError: true,
|
|
54
|
-
nodeOptions: {
|
|
55
|
-
cwd
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
await x("git", ["add", "-A"], {
|
|
60
|
-
throwOnError: true,
|
|
61
|
-
nodeOptions: {
|
|
62
|
-
cwd
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
await x(
|
|
66
|
-
"git",
|
|
67
|
-
["commit", "-m", "Initial commit from Create Fumadocs App"],
|
|
68
|
-
{
|
|
69
|
-
throwOnError: true,
|
|
70
|
-
nodeOptions: {
|
|
71
|
-
cwd
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
return true;
|
|
76
|
-
} catch {
|
|
77
|
-
await fs.rmdir(join(cwd, ".git"), { recursive: true }).catch(() => null);
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function pick(obj, keys) {
|
|
82
|
-
const result = {};
|
|
83
|
-
for (const key of keys) {
|
|
84
|
-
if (key in obj) {
|
|
85
|
-
result[key] = obj[key];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// src/constants.ts
|
|
92
|
-
import { fileURLToPath } from "url";
|
|
93
|
-
|
|
94
|
-
// ../create-app-versions/package.json
|
|
95
|
-
var package_default = {
|
|
96
|
-
name: "create-fumadocs-versions",
|
|
97
|
-
version: "16.0.33",
|
|
98
|
-
private: true,
|
|
99
|
-
description: "Used to track dependency versions in create-fumadocs-app",
|
|
100
|
-
dependencies: {
|
|
101
|
-
"@biomejs/biome": "^2.3.10",
|
|
102
|
-
"@orama/core": "^1.2.15",
|
|
103
|
-
eslint: "^9.39.2",
|
|
104
|
-
"fumadocs-core": "workspace:*",
|
|
105
|
-
"fumadocs-mdx": "workspace:*",
|
|
106
|
-
"fumadocs-ui": "workspace:*"
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// ../core/package.json
|
|
111
|
-
var version = "16.4.1";
|
|
112
|
-
|
|
113
|
-
// ../ui/package.json
|
|
114
|
-
var version2 = "16.4.1";
|
|
115
|
-
|
|
116
|
-
// ../mdx/package.json
|
|
117
|
-
var version3 = "14.2.3";
|
|
118
|
-
|
|
119
|
-
// src/constants.ts
|
|
120
|
-
var sourceDir = fileURLToPath(new URL(`../`, import.meta.url).href);
|
|
121
|
-
var isCI = Boolean(process.env.CI);
|
|
122
|
-
var templates = [
|
|
123
|
-
{
|
|
124
|
-
value: "+next+fuma-docs-mdx",
|
|
125
|
-
label: "Next.js: Fumadocs MDX",
|
|
126
|
-
hint: "recommended",
|
|
127
|
-
appDir: "",
|
|
128
|
-
rootProviderPath: "app/layout.tsx"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
value: "waku",
|
|
132
|
-
label: "Waku: Fumadocs MDX",
|
|
133
|
-
appDir: "src",
|
|
134
|
-
rootProviderPath: "components/provider.tsx"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
value: "react-router",
|
|
138
|
-
label: "React Router: Fumadocs MDX (not RSC)",
|
|
139
|
-
appDir: "app",
|
|
140
|
-
rootProviderPath: "root.tsx"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
value: "react-router-spa",
|
|
144
|
-
label: "React Router SPA: Fumadocs MDX (not RSC)",
|
|
145
|
-
hint: "SPA mode allows you to host the site statically, compatible with a CDN.",
|
|
146
|
-
appDir: "app",
|
|
147
|
-
rootProviderPath: "root.tsx"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
value: "tanstack-start",
|
|
151
|
-
label: "Tanstack Start: Fumadocs MDX (not RSC)",
|
|
152
|
-
appDir: "src",
|
|
153
|
-
rootProviderPath: "routes/__root.tsx"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
value: "tanstack-start-spa",
|
|
157
|
-
label: "Tanstack Start SPA: Fumadocs MDX (not RSC)",
|
|
158
|
-
hint: "SPA mode allows you to host the site statically, compatible with a CDN.",
|
|
159
|
-
appDir: "src",
|
|
160
|
-
rootProviderPath: "routes/__root.tsx"
|
|
161
|
-
}
|
|
162
|
-
];
|
|
163
|
-
var depVersions = {
|
|
164
|
-
...package_default.dependencies,
|
|
165
|
-
"fumadocs-core": version,
|
|
166
|
-
"fumadocs-ui": version2,
|
|
167
|
-
"fumadocs-mdx": version3
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export {
|
|
171
|
-
writeFile,
|
|
172
|
-
copy,
|
|
173
|
-
tryGitInit,
|
|
174
|
-
pick,
|
|
175
|
-
sourceDir,
|
|
176
|
-
isCI,
|
|
177
|
-
templates,
|
|
178
|
-
depVersions
|
|
179
|
-
};
|
package/dist/chunk-BEZTHMLF.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// src/plugins/biome.next.json
|
|
2
|
-
var $schema = "https://biomejs.dev/schemas/2.2.0/schema.json";
|
|
3
|
-
var vcs = {
|
|
4
|
-
enabled: true,
|
|
5
|
-
clientKind: "git",
|
|
6
|
-
useIgnoreFile: true
|
|
7
|
-
};
|
|
8
|
-
var files = {
|
|
9
|
-
ignoreUnknown: true,
|
|
10
|
-
includes: ["**", "!node_modules", "!.next", "!dist", "!build", "!.source"]
|
|
11
|
-
};
|
|
12
|
-
var formatter = {
|
|
13
|
-
enabled: true,
|
|
14
|
-
indentStyle: "space",
|
|
15
|
-
indentWidth: 2
|
|
16
|
-
};
|
|
17
|
-
var linter = {
|
|
18
|
-
enabled: true,
|
|
19
|
-
rules: {
|
|
20
|
-
recommended: true
|
|
21
|
-
},
|
|
22
|
-
domains: {
|
|
23
|
-
next: "recommended",
|
|
24
|
-
react: "recommended"
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var assist = {
|
|
28
|
-
actions: {
|
|
29
|
-
source: {
|
|
30
|
-
organizeImports: "on"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
var biome_next_default = {
|
|
35
|
-
$schema,
|
|
36
|
-
vcs,
|
|
37
|
-
files,
|
|
38
|
-
formatter,
|
|
39
|
-
linter,
|
|
40
|
-
assist
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export {
|
|
44
|
-
$schema,
|
|
45
|
-
vcs,
|
|
46
|
-
files,
|
|
47
|
-
formatter,
|
|
48
|
-
linter,
|
|
49
|
-
assist,
|
|
50
|
-
biome_next_default
|
|
51
|
-
};
|
package/dist/chunk-EM5SN2F4.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
copy,
|
|
3
|
-
depVersions,
|
|
4
|
-
sourceDir,
|
|
5
|
-
templates,
|
|
6
|
-
tryGitInit
|
|
7
|
-
} from "./chunk-7QPQHHV2.js";
|
|
8
|
-
|
|
9
|
-
// src/index.ts
|
|
10
|
-
import path from "path";
|
|
11
|
-
import fs from "fs/promises";
|
|
12
|
-
|
|
13
|
-
// src/auto-install.ts
|
|
14
|
-
import { x } from "tinyexec";
|
|
15
|
-
var managers = ["npm", "yarn", "bun", "pnpm"];
|
|
16
|
-
function getPackageManager() {
|
|
17
|
-
const userAgent = process.env.npm_config_user_agent ?? "";
|
|
18
|
-
if (userAgent.startsWith("yarn")) {
|
|
19
|
-
return "yarn";
|
|
20
|
-
}
|
|
21
|
-
if (userAgent.startsWith("pnpm")) {
|
|
22
|
-
return "pnpm";
|
|
23
|
-
}
|
|
24
|
-
if (userAgent.startsWith("bun")) {
|
|
25
|
-
return "bun";
|
|
26
|
-
}
|
|
27
|
-
return "npm";
|
|
28
|
-
}
|
|
29
|
-
async function autoInstall(manager, dest) {
|
|
30
|
-
await x(manager, ["install"], {
|
|
31
|
-
throwOnError: true,
|
|
32
|
-
nodeOptions: {
|
|
33
|
-
env: {
|
|
34
|
-
...process.env,
|
|
35
|
-
NODE_ENV: "development",
|
|
36
|
-
DISABLE_OPENCOLLECTIVE: "1"
|
|
37
|
-
},
|
|
38
|
-
cwd: dest
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// src/index.ts
|
|
44
|
-
async function create(createOptions) {
|
|
45
|
-
const {
|
|
46
|
-
outputDir,
|
|
47
|
-
plugins = [],
|
|
48
|
-
packageManager = "npm",
|
|
49
|
-
initializeGit = false,
|
|
50
|
-
installDeps = false,
|
|
51
|
-
log = console.log
|
|
52
|
-
} = createOptions;
|
|
53
|
-
let template = templates.find(
|
|
54
|
-
(item) => item.value === createOptions.template
|
|
55
|
-
);
|
|
56
|
-
for (const plugin of plugins) {
|
|
57
|
-
template = await plugin.template?.call({ dest: outputDir }, template) ?? template;
|
|
58
|
-
}
|
|
59
|
-
const appDir = path.join(outputDir, template.appDir);
|
|
60
|
-
const projectName = path.basename(outputDir);
|
|
61
|
-
const pluginContext = {
|
|
62
|
-
template,
|
|
63
|
-
dest: outputDir,
|
|
64
|
-
log,
|
|
65
|
-
appDir
|
|
66
|
-
};
|
|
67
|
-
await copy(path.join(sourceDir, "template", template.value), outputDir, {
|
|
68
|
-
rename(file) {
|
|
69
|
-
file = file.replace("example.gitignore", ".gitignore");
|
|
70
|
-
return template.rename?.(file) ?? file;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const packageJsonPath = path.join(outputDir, "package.json");
|
|
74
|
-
let packageJson = await initPackageJson(projectName, packageJsonPath);
|
|
75
|
-
for (const plugin of plugins) {
|
|
76
|
-
packageJson = await plugin.packageJson?.call(pluginContext, packageJson) ?? packageJson;
|
|
77
|
-
}
|
|
78
|
-
await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
79
|
-
const readmePath = path.join(outputDir, "README.md");
|
|
80
|
-
let readme = `# ${projectName}
|
|
81
|
-
|
|
82
|
-
${await fs.readFile(readmePath)}`;
|
|
83
|
-
for (const plugin of plugins) {
|
|
84
|
-
readme = await plugin.readme?.call(pluginContext, readme) ?? readme;
|
|
85
|
-
}
|
|
86
|
-
await fs.writeFile(readmePath, readme);
|
|
87
|
-
for (const plugin of plugins) {
|
|
88
|
-
await plugin.afterWrite?.call(pluginContext);
|
|
89
|
-
}
|
|
90
|
-
if (installDeps) {
|
|
91
|
-
try {
|
|
92
|
-
await autoInstall(packageManager, outputDir);
|
|
93
|
-
log("Installed dependencies");
|
|
94
|
-
} catch (err) {
|
|
95
|
-
log(`Failed to install dependencies: ${err}`);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (initializeGit && await tryGitInit(outputDir)) {
|
|
99
|
-
log("Initialized Git repository");
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
async function initPackageJson(projectName, packageJsonPath) {
|
|
103
|
-
function replaceWorkspaceDeps(deps = {}) {
|
|
104
|
-
for (const k in deps) {
|
|
105
|
-
if (deps[k].startsWith("workspace:") && k in depVersions) {
|
|
106
|
-
deps[k] = depVersions[k];
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return deps;
|
|
110
|
-
}
|
|
111
|
-
const packageJson = JSON.parse(
|
|
112
|
-
(await fs.readFile(packageJsonPath)).toString()
|
|
113
|
-
);
|
|
114
|
-
return {
|
|
115
|
-
...packageJson,
|
|
116
|
-
name: projectName,
|
|
117
|
-
scripts: {
|
|
118
|
-
...packageJson.scripts,
|
|
119
|
-
postinstall: "fumadocs-mdx"
|
|
120
|
-
},
|
|
121
|
-
dependencies: replaceWorkspaceDeps(packageJson.dependencies),
|
|
122
|
-
devDependencies: replaceWorkspaceDeps(packageJson.devDependencies)
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export {
|
|
127
|
-
managers,
|
|
128
|
-
getPackageManager,
|
|
129
|
-
create
|
|
130
|
-
};
|
package/dist/chunk-JCFTHRDR.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// src/plugins/biome.base.json
|
|
2
|
-
var $schema = "https://biomejs.dev/schemas/2.2.0/schema.json";
|
|
3
|
-
var vcs = {
|
|
4
|
-
enabled: true,
|
|
5
|
-
clientKind: "git",
|
|
6
|
-
useIgnoreFile: true
|
|
7
|
-
};
|
|
8
|
-
var files = {
|
|
9
|
-
ignoreUnknown: true,
|
|
10
|
-
includes: ["**", "!node_modules", "!.source"]
|
|
11
|
-
};
|
|
12
|
-
var formatter = {
|
|
13
|
-
enabled: true,
|
|
14
|
-
indentStyle: "space",
|
|
15
|
-
indentWidth: 2
|
|
16
|
-
};
|
|
17
|
-
var linter = {
|
|
18
|
-
enabled: true,
|
|
19
|
-
rules: {
|
|
20
|
-
recommended: true
|
|
21
|
-
},
|
|
22
|
-
domains: {
|
|
23
|
-
react: "recommended"
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var assist = {
|
|
27
|
-
actions: {
|
|
28
|
-
source: {
|
|
29
|
-
organizeImports: "on"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var biome_base_default = {
|
|
34
|
-
$schema,
|
|
35
|
-
vcs,
|
|
36
|
-
files,
|
|
37
|
-
formatter,
|
|
38
|
-
linter,
|
|
39
|
-
assist
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export {
|
|
43
|
-
$schema,
|
|
44
|
-
vcs,
|
|
45
|
-
files,
|
|
46
|
-
formatter,
|
|
47
|
-
linter,
|
|
48
|
-
assist,
|
|
49
|
-
biome_base_default
|
|
50
|
-
};
|