doo-boilerplate 0.2.0 → 0.2.3
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 +4 -29
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26,10 +26,7 @@ function validateProjectName(name) {
|
|
|
26
26
|
// src/prompts.ts
|
|
27
27
|
async function collectOptions(defaults, isTTY2 = true) {
|
|
28
28
|
if (!isTTY2) {
|
|
29
|
-
|
|
30
|
-
const projectName2 = defaults.projectName ?? "my-portal";
|
|
31
|
-
const packageManager2 = validPMs2.includes(defaults.pm) ? defaults.pm : "pnpm";
|
|
32
|
-
return { projectName: projectName2, packageManager: packageManager2 };
|
|
29
|
+
return { projectName: defaults.projectName ?? "my-portal", packageManager: "pnpm" };
|
|
33
30
|
}
|
|
34
31
|
let projectName;
|
|
35
32
|
if (defaults.projectName) {
|
|
@@ -52,26 +49,7 @@ async function collectOptions(defaults, isTTY2 = true) {
|
|
|
52
49
|
}
|
|
53
50
|
projectName = answer;
|
|
54
51
|
}
|
|
55
|
-
|
|
56
|
-
let packageManager;
|
|
57
|
-
if (validPMs.includes(defaults.pm)) {
|
|
58
|
-
packageManager = defaults.pm;
|
|
59
|
-
} else {
|
|
60
|
-
const answer = await p.select({
|
|
61
|
-
message: "Package manager",
|
|
62
|
-
options: [
|
|
63
|
-
{ value: "pnpm", label: "pnpm", hint: "recommended \xB7 efficient disk usage" },
|
|
64
|
-
{ value: "bun", label: "bun", hint: "fastest \xB7 all-in-one runtime" },
|
|
65
|
-
{ value: "yarn", label: "yarn", hint: "reliable \xB7 stable" }
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
if (p.isCancel(answer)) {
|
|
69
|
-
p.cancel("Operation cancelled.");
|
|
70
|
-
process.exit(0);
|
|
71
|
-
}
|
|
72
|
-
packageManager = answer;
|
|
73
|
-
}
|
|
74
|
-
return { projectName, packageManager };
|
|
52
|
+
return { projectName, packageManager: "pnpm" };
|
|
75
53
|
}
|
|
76
54
|
|
|
77
55
|
// src/scaffold.ts
|
|
@@ -195,7 +173,7 @@ function log(msg) {
|
|
|
195
173
|
console.log(msg);
|
|
196
174
|
}
|
|
197
175
|
async function run() {
|
|
198
|
-
const program = new Command().name("create-pila-app").description("Scaffold a Pila portal frontend project").version("0.1.0").argument("[project-name]", "Name of the project").option("--
|
|
176
|
+
const program = new Command().name("create-pila-app").description("Scaffold a Pila portal frontend project").version("0.1.0").argument("[project-name]", "Name of the project").option("--no-git", "Skip git initialization").parse(process.argv);
|
|
199
177
|
log("");
|
|
200
178
|
if (isTTY) {
|
|
201
179
|
p3.intro(pc2.bgCyan(pc2.black(" create-pila-app ")));
|
|
@@ -204,10 +182,7 @@ async function run() {
|
|
|
204
182
|
}
|
|
205
183
|
const args = program.args;
|
|
206
184
|
const opts = program.opts();
|
|
207
|
-
const options = await collectOptions({
|
|
208
|
-
projectName: args[0],
|
|
209
|
-
pm: opts.pm
|
|
210
|
-
}, isTTY);
|
|
185
|
+
const options = await collectOptions({ projectName: args[0] }, isTTY);
|
|
211
186
|
const destDir = path4.resolve(process.cwd(), options.projectName);
|
|
212
187
|
if (await fse3.pathExists(destDir)) {
|
|
213
188
|
const files = await fse3.readdir(destDir);
|