create-boltdocs 0.2.3 → 0.2.5
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/index.cjs +20 -22
- package/dist/index.mjs +20 -21
- package/dist/templates/base/docs/pages-external/index.tsx +1 -1
- package/dist/templates/base/index.css +3 -2
- package/dist/templates/i18n/docs/pages-external/home.tsx +41 -12
- package/dist/templates/i18n/docs/pages-external/index.tsx +1 -1
- package/dist/templates/i18n/index.css +3 -2
- package/dist/templates/i18n/src/components/footer.tsx +1 -1
- package/package.json +3 -3
- package/dist/templates/i18n/src/pages/home.tsx +0 -49
package/dist/index.cjs
CHANGED
|
@@ -29,10 +29,8 @@ let node_url = require("node:url");
|
|
|
29
29
|
let node_child_process = require("node:child_process");
|
|
30
30
|
let prompts = require("prompts");
|
|
31
31
|
prompts = __toESM(prompts);
|
|
32
|
-
let
|
|
33
|
-
picocolors = __toESM(picocolors);
|
|
32
|
+
let _bdocs_dui = require("@bdocs/dui");
|
|
34
33
|
//#region src/index.ts
|
|
35
|
-
const { green, yellow, bold, cyan, magenta, blue, red, dim } = picocolors.default;
|
|
36
34
|
function getPackageManager() {
|
|
37
35
|
const userAgent = process.env.npm_config_user_agent;
|
|
38
36
|
if (userAgent?.includes("pnpm")) return "pnpm";
|
|
@@ -55,13 +53,13 @@ function copy(src, dest, replacements) {
|
|
|
55
53
|
}
|
|
56
54
|
async function run() {
|
|
57
55
|
const pkgManager = getPackageManager();
|
|
58
|
-
console.log(blue(bold(`
|
|
56
|
+
console.log(_bdocs_dui.colors.blue(_bdocs_dui.colors.bold(`
|
|
59
57
|
____ ___ _ _____ ____ ___ ____ ____
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
console.log(dim(`\n v0.0.4 - The modern documentation framework\n`));
|
|
58
|
+
| __ ) / _ \\| | |_ _| _ \\ / _ \\ / ___/ ___|
|
|
59
|
+
| _ \\| | | | | | | | | | | | | | | \\___ \\
|
|
60
|
+
| |_) | |_| | |___ | | | |_| | |_| | |___ ___) |
|
|
61
|
+
|____/ \\___/|_____| |_| |____/ \\___/ \\____|____/`)));
|
|
62
|
+
console.log(_bdocs_dui.colors.dim(`\n v0.0.4 - The modern documentation framework\n`));
|
|
65
63
|
const response = await (0, prompts.default)([
|
|
66
64
|
{
|
|
67
65
|
type: "text",
|
|
@@ -87,24 +85,24 @@ async function run() {
|
|
|
87
85
|
{
|
|
88
86
|
type: "confirm",
|
|
89
87
|
name: "install",
|
|
90
|
-
message: `Install dependencies with ${bold(pkgManager)}?`,
|
|
88
|
+
message: `Install dependencies with ${_bdocs_dui.colors.bold(pkgManager)}?`,
|
|
91
89
|
initial: true
|
|
92
90
|
}
|
|
93
91
|
]);
|
|
94
92
|
if (!response.projectName || !response.template) {
|
|
95
|
-
|
|
93
|
+
(0, _bdocs_dui.warn)("Operation canceled.");
|
|
96
94
|
return;
|
|
97
95
|
}
|
|
98
96
|
const projectDir = node_path.default.join(process.cwd(), response.projectName);
|
|
99
97
|
if (node_fs.default.existsSync(projectDir)) {
|
|
100
|
-
|
|
98
|
+
(0, _bdocs_dui.error)(`Directory "${response.projectName}" already exists.`);
|
|
101
99
|
process.exit(1);
|
|
102
100
|
}
|
|
103
|
-
|
|
101
|
+
(0, _bdocs_dui.info)("Building your documentation site...");
|
|
104
102
|
const __dirname = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
105
103
|
const templateDir = node_path.default.resolve(__dirname, "templates", response.template);
|
|
106
104
|
if (!node_fs.default.existsSync(templateDir)) {
|
|
107
|
-
|
|
105
|
+
(0, _bdocs_dui.error)(`Template "${response.template}" not found at ${templateDir}`);
|
|
108
106
|
process.exit(1);
|
|
109
107
|
}
|
|
110
108
|
try {
|
|
@@ -112,28 +110,28 @@ async function run() {
|
|
|
112
110
|
name: response.projectName,
|
|
113
111
|
title: response.projectName
|
|
114
112
|
});
|
|
115
|
-
|
|
116
|
-
} catch (
|
|
117
|
-
|
|
113
|
+
(0, _bdocs_dui.success)(`Created project structure and applied "${response.template}" preset`);
|
|
114
|
+
} catch (e) {
|
|
115
|
+
(0, _bdocs_dui.error)(`Error copying template: ${e instanceof Error ? e.message : String(e)}`);
|
|
118
116
|
process.exit(1);
|
|
119
117
|
}
|
|
120
118
|
if (response.install) {
|
|
121
|
-
|
|
119
|
+
(0, _bdocs_dui.info)(`Installing dependencies with ${pkgManager}...`);
|
|
122
120
|
try {
|
|
123
121
|
(0, node_child_process.execSync)(`${pkgManager} install`, {
|
|
124
122
|
cwd: projectDir,
|
|
125
123
|
stdio: "inherit"
|
|
126
124
|
});
|
|
127
|
-
|
|
125
|
+
(0, _bdocs_dui.success)("Dependencies installed successfully");
|
|
128
126
|
} catch (e) {
|
|
129
|
-
|
|
127
|
+
(0, _bdocs_dui.warn)(`Could not install dependencies automatically. Please run "${pkgManager} install".`);
|
|
130
128
|
}
|
|
131
129
|
}
|
|
132
|
-
|
|
130
|
+
(0, _bdocs_dui.success)("✨ All set! Your documentation is ready. ✨");
|
|
133
131
|
console.log(`To start developing:`);
|
|
134
132
|
console.log(` cd ${response.projectName}`);
|
|
135
133
|
if (!response.install) console.log(` ${pkgManager} install`);
|
|
136
134
|
console.log(` ${pkgManager} run dev\n`);
|
|
137
135
|
}
|
|
138
|
-
run().catch(
|
|
136
|
+
run().catch((e) => (0, _bdocs_dui.error)("Unhandled error", e));
|
|
139
137
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -4,9 +4,8 @@ import path from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { execSync } from "node:child_process";
|
|
6
6
|
import prompts from "prompts";
|
|
7
|
-
import
|
|
7
|
+
import { colors, error, info, success, warn } from "@bdocs/dui";
|
|
8
8
|
//#region src/index.ts
|
|
9
|
-
const { green, yellow, bold, cyan, magenta, blue, red, dim } = picocolors;
|
|
10
9
|
function getPackageManager() {
|
|
11
10
|
const userAgent = process.env.npm_config_user_agent;
|
|
12
11
|
if (userAgent?.includes("pnpm")) return "pnpm";
|
|
@@ -29,13 +28,13 @@ function copy(src, dest, replacements) {
|
|
|
29
28
|
}
|
|
30
29
|
async function run() {
|
|
31
30
|
const pkgManager = getPackageManager();
|
|
32
|
-
console.log(blue(bold(`
|
|
31
|
+
console.log(colors.blue(colors.bold(`
|
|
33
32
|
____ ___ _ _____ ____ ___ ____ ____
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
console.log(dim(`\n v0.0.4 - The modern documentation framework\n`));
|
|
33
|
+
| __ ) / _ \\| | |_ _| _ \\ / _ \\ / ___/ ___|
|
|
34
|
+
| _ \\| | | | | | | | | | | | | | | \\___ \\
|
|
35
|
+
| |_) | |_| | |___ | | | |_| | |_| | |___ ___) |
|
|
36
|
+
|____/ \\___/|_____| |_| |____/ \\___/ \\____|____/`)));
|
|
37
|
+
console.log(colors.dim(`\n v0.0.4 - The modern documentation framework\n`));
|
|
39
38
|
const response = await prompts([
|
|
40
39
|
{
|
|
41
40
|
type: "text",
|
|
@@ -61,24 +60,24 @@ async function run() {
|
|
|
61
60
|
{
|
|
62
61
|
type: "confirm",
|
|
63
62
|
name: "install",
|
|
64
|
-
message: `Install dependencies with ${bold(pkgManager)}?`,
|
|
63
|
+
message: `Install dependencies with ${colors.bold(pkgManager)}?`,
|
|
65
64
|
initial: true
|
|
66
65
|
}
|
|
67
66
|
]);
|
|
68
67
|
if (!response.projectName || !response.template) {
|
|
69
|
-
|
|
68
|
+
warn("Operation canceled.");
|
|
70
69
|
return;
|
|
71
70
|
}
|
|
72
71
|
const projectDir = path.join(process.cwd(), response.projectName);
|
|
73
72
|
if (fs.existsSync(projectDir)) {
|
|
74
|
-
|
|
73
|
+
error(`Directory "${response.projectName}" already exists.`);
|
|
75
74
|
process.exit(1);
|
|
76
75
|
}
|
|
77
|
-
|
|
76
|
+
info("Building your documentation site...");
|
|
78
77
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
79
78
|
const templateDir = path.resolve(__dirname, "templates", response.template);
|
|
80
79
|
if (!fs.existsSync(templateDir)) {
|
|
81
|
-
|
|
80
|
+
error(`Template "${response.template}" not found at ${templateDir}`);
|
|
82
81
|
process.exit(1);
|
|
83
82
|
}
|
|
84
83
|
try {
|
|
@@ -86,29 +85,29 @@ async function run() {
|
|
|
86
85
|
name: response.projectName,
|
|
87
86
|
title: response.projectName
|
|
88
87
|
});
|
|
89
|
-
|
|
90
|
-
} catch (
|
|
91
|
-
|
|
88
|
+
success(`Created project structure and applied "${response.template}" preset`);
|
|
89
|
+
} catch (e) {
|
|
90
|
+
error(`Error copying template: ${e instanceof Error ? e.message : String(e)}`);
|
|
92
91
|
process.exit(1);
|
|
93
92
|
}
|
|
94
93
|
if (response.install) {
|
|
95
|
-
|
|
94
|
+
info(`Installing dependencies with ${pkgManager}...`);
|
|
96
95
|
try {
|
|
97
96
|
execSync(`${pkgManager} install`, {
|
|
98
97
|
cwd: projectDir,
|
|
99
98
|
stdio: "inherit"
|
|
100
99
|
});
|
|
101
|
-
|
|
100
|
+
success("Dependencies installed successfully");
|
|
102
101
|
} catch (e) {
|
|
103
|
-
|
|
102
|
+
warn(`Could not install dependencies automatically. Please run "${pkgManager} install".`);
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
|
-
|
|
105
|
+
success("✨ All set! Your documentation is ready. ✨");
|
|
107
106
|
console.log(`To start developing:`);
|
|
108
107
|
console.log(` cd ${response.projectName}`);
|
|
109
108
|
if (!response.install) console.log(` ${pkgManager} install`);
|
|
110
109
|
console.log(` ${pkgManager} run dev\n`);
|
|
111
110
|
}
|
|
112
|
-
run().catch(
|
|
111
|
+
run().catch((e) => error("Unhandled error", e));
|
|
113
112
|
//#endregion
|
|
114
113
|
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
|
|
2
2
|
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap");
|
|
3
|
-
|
|
4
3
|
@import "tailwindcss";
|
|
5
4
|
|
|
5
|
+
/* Tailwind must be declared first so the theme can override its styles */
|
|
6
|
+
@import "boltdocs/theme/reset.css";
|
|
6
7
|
@import "boltdocs/theme/neutral.css";
|
|
7
8
|
|
|
8
9
|
/*
|
|
9
10
|
@source directive tells Tailwind to scan Boltdocs client components
|
|
10
11
|
inside node_modules for class usage and generate the necessary CSS.
|
|
11
12
|
*/
|
|
12
|
-
@source "./node_modules/boltdocs/src/client";
|
|
13
|
+
@source "./node_modules/boltdocs/src/client";
|
|
@@ -1,30 +1,55 @@
|
|
|
1
|
-
import { Card, Cards } from 'boltdocs/client'
|
|
1
|
+
import { Card, Cards, useI18n } from 'boltdocs/client'
|
|
2
2
|
import { Route, FileText, Settings, Sparkles } from 'lucide-react'
|
|
3
3
|
|
|
4
4
|
const features = [
|
|
5
5
|
{
|
|
6
|
-
title:
|
|
7
|
-
|
|
6
|
+
title: {
|
|
7
|
+
en: 'File-route',
|
|
8
|
+
es: 'Rutas de archivos',
|
|
9
|
+
},
|
|
10
|
+
description: {
|
|
11
|
+
en: 'Generate routes from file structure.',
|
|
12
|
+
es: 'Genera rutas a partir de la estructura de archivos.',
|
|
13
|
+
},
|
|
8
14
|
Icon: Route,
|
|
9
15
|
},
|
|
10
16
|
{
|
|
11
|
-
title:
|
|
12
|
-
|
|
17
|
+
title: {
|
|
18
|
+
en: 'Markdown',
|
|
19
|
+
es: 'Markdown',
|
|
20
|
+
},
|
|
21
|
+
description: {
|
|
22
|
+
en: 'Support Markdown for writing documentation.',
|
|
23
|
+
es: 'Soporte de Markdown para escribir documentación.',
|
|
24
|
+
},
|
|
13
25
|
Icon: FileText,
|
|
14
26
|
},
|
|
15
27
|
{
|
|
16
|
-
title:
|
|
17
|
-
|
|
28
|
+
title: {
|
|
29
|
+
en: 'Customizable',
|
|
30
|
+
es: 'Personalizable',
|
|
31
|
+
},
|
|
32
|
+
description: {
|
|
33
|
+
en: 'Customizable to your needs.',
|
|
34
|
+
es: 'Personalizable a tus necesidades.',
|
|
35
|
+
},
|
|
18
36
|
Icon: Settings,
|
|
19
37
|
},
|
|
20
38
|
{
|
|
21
|
-
title:
|
|
22
|
-
|
|
39
|
+
title: {
|
|
40
|
+
en: 'Secure by design',
|
|
41
|
+
es: 'Seguro por diseño',
|
|
42
|
+
},
|
|
43
|
+
description: {
|
|
44
|
+
en: 'Boltdocs is secure by design.',
|
|
45
|
+
es: 'Boltdocs es seguro por diseño.',
|
|
46
|
+
},
|
|
23
47
|
Icon: Sparkles,
|
|
24
48
|
},
|
|
25
49
|
]
|
|
26
50
|
|
|
27
51
|
export function HomePage() {
|
|
52
|
+
const { currentLocale } = useI18n()
|
|
28
53
|
return (
|
|
29
54
|
<div className="w-full h-[calc(100vh-120px)] flex items-center gap-10">
|
|
30
55
|
<div className="flex flex-col justify-center py-10">
|
|
@@ -36,11 +61,15 @@ export function HomePage() {
|
|
|
36
61
|
<Cards cols={4}>
|
|
37
62
|
{features.map((feature) => (
|
|
38
63
|
<Card
|
|
39
|
-
key={feature.title}
|
|
40
|
-
title={feature.title}
|
|
64
|
+
key={feature.title.en}
|
|
65
|
+
title={feature.title[currentLocale as keyof typeof feature.title]}
|
|
41
66
|
icon={<feature.Icon />}
|
|
42
67
|
>
|
|
43
|
-
{
|
|
68
|
+
{
|
|
69
|
+
feature.description[
|
|
70
|
+
currentLocale as keyof typeof feature.description
|
|
71
|
+
]
|
|
72
|
+
}
|
|
44
73
|
</Card>
|
|
45
74
|
))}
|
|
46
75
|
</Cards>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
|
|
2
2
|
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap");
|
|
3
|
-
|
|
4
3
|
@import "tailwindcss";
|
|
5
4
|
|
|
5
|
+
/* Tailwind must be declared first so the theme can override its styles */
|
|
6
|
+
@import "boltdocs/theme/reset.css";
|
|
6
7
|
@import "boltdocs/theme/neutral.css";
|
|
7
8
|
|
|
8
9
|
/*
|
|
9
10
|
@source directive tells Tailwind to scan Boltdocs client components
|
|
10
11
|
inside node_modules for class usage and generate the necessary CSS.
|
|
11
12
|
*/
|
|
12
|
-
@source "./node_modules/boltdocs/src/client";
|
|
13
|
+
@source "./node_modules/boltdocs/src/client";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-boltdocs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Create a new boltdocs project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Jesus Alcala",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"prompts": "^2.4.2",
|
|
20
|
+
"@bdocs/dui": "0.1.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^22.0.0",
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Card, Cards } from 'boltdocs/client'
|
|
2
|
-
import { Route, FileText, Settings, Sparkles } from 'lucide-react'
|
|
3
|
-
|
|
4
|
-
const features = [
|
|
5
|
-
{
|
|
6
|
-
title: 'File-route',
|
|
7
|
-
description: 'Generate routes from file structure.',
|
|
8
|
-
Icon: Route,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
title: 'Markdown',
|
|
12
|
-
description: 'Support Markdown for writing documentation.',
|
|
13
|
-
Icon: FileText,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
title: 'Customizable',
|
|
17
|
-
description: 'Customizable to your needs.',
|
|
18
|
-
Icon: Settings,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
title: 'Secure by design',
|
|
22
|
-
description: 'Boltdocs is secure by design.',
|
|
23
|
-
Icon: Sparkles,
|
|
24
|
-
},
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
export function HomePage() {
|
|
28
|
-
return (
|
|
29
|
-
<div className="w-full h-[calc(100vh-120px)] flex items-center gap-10">
|
|
30
|
-
<div className="flex flex-col justify-center py-10">
|
|
31
|
-
<h1 className="text-5xl font-extrabold">
|
|
32
|
-
Power by <p className="text-purple-500 inline">Boltdocs</p>
|
|
33
|
-
</h1>
|
|
34
|
-
<p className="text-xl mt-4 text-muted">Docs generators for react.</p>
|
|
35
|
-
</div>
|
|
36
|
-
<Cards cols={4}>
|
|
37
|
-
{features.map((feature) => (
|
|
38
|
-
<Card
|
|
39
|
-
key={feature.title}
|
|
40
|
-
title={feature.title}
|
|
41
|
-
icon={<feature.Icon />}
|
|
42
|
-
>
|
|
43
|
-
{feature.description}
|
|
44
|
-
</Card>
|
|
45
|
-
))}
|
|
46
|
-
</Cards>
|
|
47
|
-
</div>
|
|
48
|
-
)
|
|
49
|
-
}
|