@wolfstar/create-http-framework 2.1.3 → 2.1.4-next-20260827143053
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 +47 -43
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -547,26 +547,28 @@ async function main() {
|
|
|
547
547
|
packageManager = pmResult;
|
|
548
548
|
}
|
|
549
549
|
const targetDir = resolve(projectName);
|
|
550
|
-
if (directoryExists(targetDir) && !isEmpty(targetDir))
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
550
|
+
if (directoryExists(targetDir) && !isEmpty(targetDir)) {
|
|
551
|
+
if (flagOverwrite) emptyDir(targetDir);
|
|
552
|
+
else if (nonInteractive) {
|
|
553
|
+
cancel(`"${projectName}" already exists. Use --overwrite to overwrite it.`);
|
|
554
|
+
process.exit(1);
|
|
555
|
+
} else {
|
|
556
|
+
const choice = await select({
|
|
557
|
+
message: `"${projectName}" already exists. What would you like to do?`,
|
|
558
|
+
options: [{
|
|
559
|
+
value: "overwrite",
|
|
560
|
+
label: "Overwrite the directory"
|
|
561
|
+
}, {
|
|
562
|
+
value: "cancel",
|
|
563
|
+
label: "Cancel"
|
|
564
|
+
}]
|
|
565
|
+
});
|
|
566
|
+
if (isCancel(choice) || choice === "cancel") {
|
|
567
|
+
cancel("Operation cancelled.");
|
|
568
|
+
process.exit(0);
|
|
569
|
+
}
|
|
570
|
+
emptyDir(targetDir);
|
|
568
571
|
}
|
|
569
|
-
emptyDir(targetDir);
|
|
570
572
|
}
|
|
571
573
|
let port;
|
|
572
574
|
if (nonInteractive) {
|
|
@@ -613,31 +615,33 @@ async function main() {
|
|
|
613
615
|
}
|
|
614
616
|
let buildTool = "tsdown";
|
|
615
617
|
if (cliBuild !== void 0 && language === "js") log.warn("--build only applies to TypeScript projects and will be ignored.");
|
|
616
|
-
if (language === "ts")
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
618
|
+
if (language === "ts") {
|
|
619
|
+
if (nonInteractive) buildTool = cliBuild ?? "tsdown";
|
|
620
|
+
else {
|
|
621
|
+
const buildResult = await select({
|
|
622
|
+
message: "Which build tool would you like to use?",
|
|
623
|
+
options: [
|
|
624
|
+
{
|
|
625
|
+
value: "tsdown",
|
|
626
|
+
label: "tsdown (bundler)"
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
value: "tsc6",
|
|
630
|
+
label: "TypeScript 6.0 (tsc)"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
value: "tsc7",
|
|
634
|
+
label: "TypeScript 7.0 rc (tsc)"
|
|
635
|
+
}
|
|
636
|
+
],
|
|
637
|
+
initialValue: "tsdown"
|
|
638
|
+
});
|
|
639
|
+
if (isCancel(buildResult)) {
|
|
640
|
+
cancel("Operation cancelled.");
|
|
641
|
+
process.exit(0);
|
|
642
|
+
}
|
|
643
|
+
buildTool = buildResult;
|
|
639
644
|
}
|
|
640
|
-
buildTool = buildResult;
|
|
641
645
|
}
|
|
642
646
|
let linter;
|
|
643
647
|
if (nonInteractive) linter = cliLint ?? "oxlint";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wolfstar/create-http-framework",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4-next-20260827143053",
|
|
4
4
|
"description": "Create a new WolfStar HTTP Framework bot project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@clack/prompts": "^1.7.0",
|
|
38
|
-
"@vercel/detect-agent": "^1.2.
|
|
38
|
+
"@vercel/detect-agent": "^1.2.5",
|
|
39
39
|
"cross-spawn": "^7.0.6",
|
|
40
40
|
"handlebars": "^4.7.9",
|
|
41
41
|
"mri": "^1.2.0",
|