create-ardo 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -170,7 +170,7 @@ async function promptProjectName() {
|
|
|
170
170
|
name: "projectName",
|
|
171
171
|
message: reset("Project name:"),
|
|
172
172
|
initial: defaultTargetDir,
|
|
173
|
-
validate
|
|
173
|
+
validate(value) {
|
|
174
174
|
const name = value.trim();
|
|
175
175
|
if (!name) return "Project name is required";
|
|
176
176
|
if (/^[.-]/.test(name)) return "Project name cannot start with a dot or hyphen";
|
|
@@ -223,7 +223,7 @@ function getNewProjectPrompts(targetDir, root, argTemplate) {
|
|
|
223
223
|
]
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
|
-
type
|
|
226
|
+
type(_, { overwrite }) {
|
|
227
227
|
if (overwrite === "no") throw new Error(`${red("✖")} Operation cancelled`);
|
|
228
228
|
return null;
|
|
229
229
|
},
|
|
@@ -271,7 +271,7 @@ function getNewProjectPrompts(targetDir, root, argTemplate) {
|
|
|
271
271
|
];
|
|
272
272
|
}
|
|
273
273
|
async function runNewProjectFlow(targetDir, root, argTemplate) {
|
|
274
|
-
const response = await prompts(getNewProjectPrompts(targetDir, root, argTemplate), { onCancel });
|
|
274
|
+
const response = readNewProjectPromptResponse(await prompts(getNewProjectPrompts(targetDir, root, argTemplate), { onCancel }));
|
|
275
275
|
const template = response.template ?? argTemplate ?? "minimal";
|
|
276
276
|
if (response.overwrite === "yes") emptyDir(root);
|
|
277
277
|
else if (!fs.existsSync(root)) fs.mkdirSync(root, { recursive: true });
|
|
@@ -288,6 +288,25 @@ async function runNewProjectFlow(targetDir, root, argTemplate) {
|
|
|
288
288
|
console.log(` ${blue("pnpm install")}`);
|
|
289
289
|
console.log(` ${blue("pnpm dev")}\n`);
|
|
290
290
|
}
|
|
291
|
+
function readNewProjectPromptResponse(data) {
|
|
292
|
+
if (!isRecord(data)) return {
|
|
293
|
+
docType: "general",
|
|
294
|
+
siteTitle: "My Documentation"
|
|
295
|
+
};
|
|
296
|
+
return {
|
|
297
|
+
docType: data.docType === "library" ? "library" : "general",
|
|
298
|
+
githubPages: typeof data.githubPages === "boolean" ? data.githubPages : void 0,
|
|
299
|
+
overwrite: readOverwrite(data.overwrite),
|
|
300
|
+
siteTitle: typeof data.siteTitle === "string" ? data.siteTitle : "My Documentation",
|
|
301
|
+
template: typeof data.template === "string" ? data.template : void 0
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
function readOverwrite(value) {
|
|
305
|
+
return value === "ignore" || value === "no" || value === "yes" ? value : void 0;
|
|
306
|
+
}
|
|
307
|
+
function isRecord(value) {
|
|
308
|
+
return value != null && typeof value === "object";
|
|
309
|
+
}
|
|
291
310
|
async function main() {
|
|
292
311
|
console.log(`\n ${cyan("◆")} ${green("create-ardo")}\n`);
|
|
293
312
|
const argTargetDir = process.argv.length > 2 ? process.argv[2] : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ardo",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Scaffolding tool for Ardo documentation projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,14 +29,15 @@
|
|
|
29
29
|
"url": "https://github.com/sebastian-software/ardo/issues"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"kolorist": "^1.8.0",
|
|
33
|
+
"prompts": "^2.4.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^25.
|
|
36
|
+
"@types/node": "^25.6.1",
|
|
37
37
|
"@types/prompts": "^2.4.9",
|
|
38
|
-
"tsdown": "^0.
|
|
39
|
-
"typescript": "^6.0.
|
|
38
|
+
"tsdown": "^0.22.0",
|
|
39
|
+
"typescript": "^6.0.3",
|
|
40
|
+
"vitest": "^4.1.5"
|
|
40
41
|
},
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": ">=18.0.0"
|
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"ardo": "^{{ARDO_VERSION}}",
|
|
13
13
|
"isbot": "^5.1.36",
|
|
14
|
-
"lucide-react": "^
|
|
14
|
+
"lucide-react": "^1.14.0",
|
|
15
15
|
"react": "^19.2.4",
|
|
16
16
|
"react-dom": "^19.2.4",
|
|
17
17
|
"react-router": "^7.13.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@react-router/dev": "^7.
|
|
21
|
-
"@tailwindcss/vite": "^4.2.
|
|
20
|
+
"@react-router/dev": "^7.15.0",
|
|
21
|
+
"@tailwindcss/vite": "^4.2.4",
|
|
22
22
|
"@types/react": "^19.2.14",
|
|
23
23
|
"@types/react-dom": "^19.2.3",
|
|
24
|
-
"tailwindcss": "^4.2.
|
|
25
|
-
"typescript": "^6.0.
|
|
26
|
-
"vite": "^8.0.
|
|
24
|
+
"tailwindcss": "^4.2.4",
|
|
25
|
+
"typescript": "^6.0.3",
|
|
26
|
+
"vite": "^8.0.11"
|
|
27
27
|
}
|
|
28
28
|
}
|