create-banana 2.0.0 → 2.0.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 +13 -370
- package/package.json +1 -1
- package/readme.md +25 -21
package/dist/index.js
CHANGED
|
@@ -1,371 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
choices: [
|
|
16
|
-
{ name: "Yes", value: true },
|
|
17
|
-
{ name: "No", value: false }
|
|
18
|
-
]
|
|
19
|
-
});
|
|
20
|
-
if (!isOverwrite) {
|
|
21
|
-
console.log("canceled!");
|
|
22
|
-
process.exit(0);
|
|
23
|
-
} else {
|
|
24
|
-
await fs.remove(projectDir);
|
|
25
|
-
await fs.mkdir(projectDir);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
} catch (err) {
|
|
29
|
-
console.error(err);
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var pathExists_default = confirmPathExists;
|
|
34
|
-
|
|
35
|
-
// src/app/core/generator.ts
|
|
36
|
-
import fs2 from "fs-extra";
|
|
37
|
-
import path from "path";
|
|
38
|
-
import ejs from "ejs";
|
|
39
|
-
var Generator = class {
|
|
40
|
-
targetDir;
|
|
41
|
-
pkg;
|
|
42
|
-
fileMiddlewares;
|
|
43
|
-
constructor(targetDir) {
|
|
44
|
-
this.targetDir = targetDir;
|
|
45
|
-
this.pkg = {};
|
|
46
|
-
this.fileMiddlewares = [];
|
|
47
|
-
}
|
|
48
|
-
// package.json functions
|
|
49
|
-
writePkg(pkg) {
|
|
50
|
-
this.pkg = { ...this.pkg, ...pkg };
|
|
51
|
-
}
|
|
52
|
-
extendDepsPkg(deps) {
|
|
53
|
-
this.pkg.dependencies = { ...this.pkg.dependencies, ...deps.dependencies };
|
|
54
|
-
}
|
|
55
|
-
extendDevDepsPkg(devDeps) {
|
|
56
|
-
this.pkg.devDependencies = {
|
|
57
|
-
...this.pkg.devDependencies,
|
|
58
|
-
...devDeps.devDependencies
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
extendScriptsPkg(scripts) {
|
|
62
|
-
this.pkg.scripts = { ...this.pkg.scripts, ...scripts.scripts };
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @param {string} source - source file path
|
|
66
|
-
* @param {string} target - target file path
|
|
67
|
-
*/
|
|
68
|
-
copy(source, target) {
|
|
69
|
-
this.fileMiddlewares.push(() => {
|
|
70
|
-
fs2.copySync(source, path.join(this.targetDir, target));
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* render a template file with ejs
|
|
75
|
-
* @param {string} source - source file path
|
|
76
|
-
* @param {string} target - target file path
|
|
77
|
-
* @param {object} feats - ejs render options
|
|
78
|
-
*/
|
|
79
|
-
render(source, target, feats) {
|
|
80
|
-
this.fileMiddlewares.push(() => {
|
|
81
|
-
fs2.writeFileSync(
|
|
82
|
-
path.join(this.targetDir, target),
|
|
83
|
-
ejs.render(fs2.readFileSync(source, "utf-8"), feats)
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
// finally generate all files
|
|
88
|
-
async generate() {
|
|
89
|
-
this.fileMiddlewares.forEach((fileFunction) => fileFunction());
|
|
90
|
-
fs2.writeFileSync(
|
|
91
|
-
path.join(this.targetDir, "package.json"),
|
|
92
|
-
JSON.stringify(this.pkg, null, 2)
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// src/app/CLI/input.ts
|
|
98
|
-
import chalk2 from "chalk";
|
|
99
|
-
import { input, checkbox, select as select2 } from "@inquirer/prompts";
|
|
100
|
-
var inputProjectName = async () => {
|
|
101
|
-
return await input({
|
|
102
|
-
message: `Enter your ${chalk2.yellow("project name")}:`,
|
|
103
|
-
required: true
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
var featsSelect = async () => {
|
|
107
|
-
const feats = await checkbox({
|
|
108
|
-
message: `Please select the ${chalk2.yellow("features")} to include:`,
|
|
109
|
-
choices: [
|
|
110
|
-
{ name: "Eslint", value: "eslint" },
|
|
111
|
-
{ name: "Prettier", value: "prettier" },
|
|
112
|
-
{ name: "Pinia", value: "pinia" },
|
|
113
|
-
{ name: "Vue-Router", value: "vue-router" }
|
|
114
|
-
]
|
|
115
|
-
});
|
|
116
|
-
const useEslint = feats.includes("eslint");
|
|
117
|
-
const usePrettier = feats.includes("prettier");
|
|
118
|
-
const usePinia = feats.includes("pinia");
|
|
119
|
-
const useVueRouter = feats.includes("vue-router");
|
|
120
|
-
let usePiniaPluginPersistedstate = false;
|
|
121
|
-
if (usePinia) {
|
|
122
|
-
usePiniaPluginPersistedstate = await select2({
|
|
123
|
-
message: `Do you want to use ${chalk2.yellow.bold("pinia-plugin-persistedstate")} for Pinia state persistence?`,
|
|
124
|
-
choices: [
|
|
125
|
-
{ name: "Yes", value: true },
|
|
126
|
-
{ name: "No", value: false }
|
|
127
|
-
]
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
useEslint,
|
|
132
|
-
usePrettier,
|
|
133
|
-
usePinia,
|
|
134
|
-
useVueRouter,
|
|
135
|
-
usePiniaPluginPersistedstate
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
// src/utils/figletPrint.ts
|
|
140
|
-
import figlet from "figlet";
|
|
141
|
-
var printString = async (str) => {
|
|
142
|
-
try {
|
|
143
|
-
return await figlet.text(str, {
|
|
144
|
-
font: "Big Money-se",
|
|
145
|
-
horizontalLayout: "default",
|
|
146
|
-
verticalLayout: "default",
|
|
147
|
-
width: 80,
|
|
148
|
-
whitespaceBreak: true
|
|
149
|
-
});
|
|
150
|
-
} catch (err) {
|
|
151
|
-
console.log("Something went wrong...");
|
|
152
|
-
console.dir(err);
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
var figletPrint_default = printString;
|
|
156
|
-
|
|
157
|
-
// src/utils/rainbow.ts
|
|
158
|
-
import chalk3 from "chalk";
|
|
159
|
-
function hslToRgb(h, s, l) {
|
|
160
|
-
s /= 100;
|
|
161
|
-
l /= 100;
|
|
162
|
-
const k = (n) => (n + h / 30) % 12;
|
|
163
|
-
const a = s * Math.min(l, 1 - l);
|
|
164
|
-
const f = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
|
|
165
|
-
return [
|
|
166
|
-
Math.round(255 * f(0)),
|
|
167
|
-
Math.round(255 * f(8)),
|
|
168
|
-
Math.round(255 * f(4))
|
|
169
|
-
];
|
|
170
|
-
}
|
|
171
|
-
function rainbowGradient(text) {
|
|
172
|
-
return text.split("").map((char, i) => {
|
|
173
|
-
const hue = i / text.length * 360;
|
|
174
|
-
const [r, g, b] = hslToRgb(hue, 100, 50);
|
|
175
|
-
return chalk3.rgb(r, g, b)(char);
|
|
176
|
-
}).join("");
|
|
177
|
-
}
|
|
178
|
-
var rainbow_default = rainbowGradient;
|
|
179
|
-
|
|
180
|
-
// src/app/CLI/output.ts
|
|
181
|
-
import chalk4 from "chalk";
|
|
182
|
-
import boxen from "boxen";
|
|
183
|
-
var log = console.log;
|
|
184
|
-
var greenColor = [22, 198, 12];
|
|
185
|
-
var outPkgCommand = (projectName, { useEslint, usePrettier }) => {
|
|
186
|
-
const eslintStr = chalk4.rgb(...greenColor)(
|
|
187
|
-
`
|
|
188
|
-
cd ${projectName} && pnpm i && pnpm lint && pnpm dev
|
|
189
|
-
`
|
|
190
|
-
);
|
|
191
|
-
const prettierStr = chalk4.rgb(...greenColor)(
|
|
192
|
-
`
|
|
193
|
-
cd ${projectName} && pnpm i && pnpm format && pnpm dev
|
|
194
|
-
`
|
|
195
|
-
);
|
|
196
|
-
const noFormatStr = chalk4.rgb(...greenColor)(
|
|
197
|
-
`
|
|
198
|
-
cd ${projectName} && pnpm i && pnpm dev
|
|
199
|
-
`
|
|
200
|
-
);
|
|
201
|
-
const outStr = useEslint ? eslintStr : usePrettier ? prettierStr : noFormatStr;
|
|
202
|
-
log(
|
|
203
|
-
chalk4.cyan(
|
|
204
|
-
boxen(outStr, {
|
|
205
|
-
title: "commands",
|
|
206
|
-
titleAlignment: "center"
|
|
207
|
-
})
|
|
208
|
-
),
|
|
209
|
-
"\n"
|
|
210
|
-
);
|
|
211
|
-
};
|
|
212
|
-
var outGitCommand = () => {
|
|
213
|
-
log(
|
|
214
|
-
chalk4.cyan(
|
|
215
|
-
boxen(
|
|
216
|
-
chalk4.rgb(...greenColor)(
|
|
217
|
-
'\n git init && git add . && git commit -m "Initial commit" \n'
|
|
218
|
-
),
|
|
219
|
-
{
|
|
220
|
-
title: "commands",
|
|
221
|
-
titleAlignment: "center"
|
|
222
|
-
}
|
|
223
|
-
)
|
|
224
|
-
)
|
|
225
|
-
);
|
|
226
|
-
};
|
|
227
|
-
var PrintBANANA = async () => {
|
|
228
|
-
log(rainbow_default(await figletPrint_default("BANANA")));
|
|
229
|
-
};
|
|
230
|
-
var rainbowPrint = async (str) => {
|
|
231
|
-
log(rainbow_default(str));
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
// src/app/features/base.ts
|
|
235
|
-
import fs3 from "fs-extra";
|
|
236
|
-
|
|
237
|
-
// src/utils/URL.ts
|
|
238
|
-
import { fileURLToPath } from "url";
|
|
239
|
-
var templatePath = fileURLToPath(
|
|
240
|
-
new URL("../template", import.meta.url)
|
|
241
|
-
);
|
|
242
|
-
|
|
243
|
-
// src/app/features/base.ts
|
|
244
|
-
import path2 from "path";
|
|
245
|
-
var base_default = (files, feats) => {
|
|
246
|
-
const basePath = path2.join(templatePath, "base");
|
|
247
|
-
files.writePkg(
|
|
248
|
-
fs3.readJSONSync(path2.join(basePath, "static", "package.json"))
|
|
249
|
-
);
|
|
250
|
-
files.copy(path2.join(basePath, "static"), "");
|
|
251
|
-
files.render(
|
|
252
|
-
path2.join(basePath, "ejs", "App.vue.ejs"),
|
|
253
|
-
path2.join("src", "App.vue"),
|
|
254
|
-
{
|
|
255
|
-
...feats
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
files.render(
|
|
259
|
-
path2.join(basePath, "ejs", "main.js.ejs"),
|
|
260
|
-
path2.join("src", "main.js"),
|
|
261
|
-
{
|
|
262
|
-
...feats
|
|
263
|
-
}
|
|
264
|
-
);
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
// src/app/features/pinia.ts
|
|
268
|
-
import fs4 from "fs-extra";
|
|
269
|
-
import path3 from "path";
|
|
270
|
-
var pinia_default = (files, feats) => {
|
|
271
|
-
const { usePinia, usePiniaPluginPersistedstate } = feats;
|
|
272
|
-
if (!usePinia) return;
|
|
273
|
-
const piniaPath = path3.join(templatePath, "pinia");
|
|
274
|
-
files.extendDepsPkg(fs4.readJSONSync(path3.join(piniaPath, "package.json")));
|
|
275
|
-
files.copy(
|
|
276
|
-
path3.join(piniaPath, "counter.js"),
|
|
277
|
-
path3.join("src", "stores", "counter.js")
|
|
278
|
-
);
|
|
279
|
-
if (!usePiniaPluginPersistedstate) return;
|
|
280
|
-
const persistPath = path3.join(piniaPath, "pinia-plugin-persistedstate");
|
|
281
|
-
files.extendDepsPkg(fs4.readJSONSync(path3.join(persistPath, "package.json")));
|
|
282
|
-
files.copy(
|
|
283
|
-
path3.join(persistPath, "key.js"),
|
|
284
|
-
path3.join("src", "stores", "key.js")
|
|
285
|
-
);
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
// src/app/features/eslint.ts
|
|
289
|
-
import fs5 from "fs-extra";
|
|
290
|
-
import path4 from "path";
|
|
291
|
-
var eslint_default = (files, feats) => {
|
|
292
|
-
const { useEslint, usePrettier } = feats;
|
|
293
|
-
if (!useEslint) return;
|
|
294
|
-
const eslintPath = path4.join(templatePath, "eslint");
|
|
295
|
-
const pkg = fs5.readJSONSync(path4.join(eslintPath, "package.json"));
|
|
296
|
-
files.extendDevDepsPkg(pkg);
|
|
297
|
-
files.extendScriptsPkg(pkg);
|
|
298
|
-
files.render(
|
|
299
|
-
path4.join(eslintPath, "eslint.config.js.ejs"),
|
|
300
|
-
"eslint.config.js",
|
|
301
|
-
{
|
|
302
|
-
usePrettier
|
|
303
|
-
}
|
|
304
|
-
);
|
|
305
|
-
if (!usePrettier) return;
|
|
306
|
-
files.extendDevDepsPkg(
|
|
307
|
-
fs5.readJSONSync(path4.join(eslintPath, "prettierPkg.json"))
|
|
308
|
-
);
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
// src/app/features/prettier.ts
|
|
312
|
-
import fs6 from "fs-extra";
|
|
313
|
-
import path5 from "path";
|
|
314
|
-
var prettier_default = (files, feats) => {
|
|
315
|
-
const { usePrettier } = feats;
|
|
316
|
-
if (!usePrettier) return;
|
|
317
|
-
const prettierPath = path5.join(templatePath, "prettier");
|
|
318
|
-
const pkg = fs6.readJSONSync(path5.join(prettierPath, "package.json"));
|
|
319
|
-
files.extendDevDepsPkg(pkg);
|
|
320
|
-
files.extendScriptsPkg(pkg);
|
|
321
|
-
files.copy(path5.join(prettierPath, ".prettierrc"), ".prettierrc");
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
// src/app/features/vueRouter.ts
|
|
325
|
-
import fs7 from "fs-extra";
|
|
326
|
-
import path6 from "path";
|
|
327
|
-
var vueRouter_default = (files, feats) => {
|
|
328
|
-
const { useVueRouter, usePiniaPluginPersistedstate } = feats;
|
|
329
|
-
if (!useVueRouter) return;
|
|
330
|
-
const vueRouterPath = path6.join(templatePath, "vue-router");
|
|
331
|
-
files.extendDepsPkg(
|
|
332
|
-
fs7.readJSONSync(path6.join(vueRouterPath, "package.json"))
|
|
333
|
-
);
|
|
334
|
-
files.copy(path6.join(vueRouterPath, "static"), "src");
|
|
335
|
-
files.render(
|
|
336
|
-
path6.join(vueRouterPath, "ejs", "AboutView.vue.ejs"),
|
|
337
|
-
path6.join("src", "views", "AboutView.vue"),
|
|
338
|
-
{ usePiniaPluginPersistedstate }
|
|
339
|
-
);
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
// src/app/core/featsManger.ts
|
|
343
|
-
var featsManger_default = async (files) => {
|
|
344
|
-
const featsList = await featsSelect();
|
|
345
|
-
base_default(files, featsList);
|
|
346
|
-
pinia_default(files, featsList);
|
|
347
|
-
eslint_default(files, featsList);
|
|
348
|
-
prettier_default(files, featsList);
|
|
349
|
-
vueRouter_default(files, featsList);
|
|
350
|
-
return featsList;
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
// src/app/CLI/main.ts
|
|
354
|
-
var main_default = async () => {
|
|
355
|
-
await PrintBANANA();
|
|
356
|
-
const projectName = await inputProjectName();
|
|
357
|
-
const targetDir = path7.join(process.cwd(), projectName);
|
|
358
|
-
await pathExists_default(projectName, targetDir);
|
|
359
|
-
const files = new Generator(targetDir);
|
|
360
|
-
const featsList = await featsManger_default(files);
|
|
361
|
-
files.generate();
|
|
362
|
-
rainbowPrint(
|
|
363
|
-
"\nProject initialization complete. You may now execute the following commands:\n"
|
|
364
|
-
);
|
|
365
|
-
outPkgCommand(projectName, featsList);
|
|
366
|
-
rainbowPrint("Initialize Git using the following command:\n");
|
|
367
|
-
outGitCommand();
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
// src/bin/index.ts
|
|
371
|
-
await main_default();
|
|
2
|
+
import re from"path";import h from"fs-extra";import{select as B}from"@inquirer/prompts";import V from"chalk";var F=async(e,t)=>{try{h.pathExistsSync(t)&&(await B({message:`The target folder "${e}" is not empty. ${V.yellow("Overwrite")}?`,choices:[{name:"Yes",value:!0},{name:"No",value:!1}]})?(await h.remove(t),await h.mkdir(t)):(console.log("canceled!"),process.exit(0)))}catch(r){console.error(r),process.exit(1)}},v=F;import g from"fs-extra";import j from"path";import z from"ejs";var u=class{targetDir;pkg;fileMiddlewares;constructor(t){this.targetDir=t,this.pkg={},this.fileMiddlewares=[]}writePkg(t){this.pkg={...this.pkg,...t}}extendDepsPkg(t){this.pkg.dependencies={...this.pkg.dependencies,...t.dependencies}}extendDevDepsPkg(t){this.pkg.devDependencies={...this.pkg.devDependencies,...t.devDependencies}}extendScriptsPkg(t){this.pkg.scripts={...this.pkg.scripts,...t.scripts}}copy(t,r){this.fileMiddlewares.push(()=>{g.copySync(t,j.join(this.targetDir,r))})}render(t,r,n){this.fileMiddlewares.push(()=>{g.writeFileSync(j.join(this.targetDir,r),z.render(g.readFileSync(t,"utf-8"),n))})}async generate(){this.fileMiddlewares.forEach(t=>t()),g.writeFileSync(j.join(this.targetDir,"package.json"),JSON.stringify(this.pkg,null,2))}};import P from"chalk";import{input as Y,checkbox as U,select as q}from"@inquirer/prompts";var x=async()=>await Y({message:`Enter your ${P.yellow("project name")}:`,required:!0}),b=async()=>{let e=await U({message:`Please select the ${P.yellow("features")} to include:`,choices:[{name:"Eslint",value:"eslint"},{name:"Prettier",value:"prettier"},{name:"Pinia",value:"pinia"},{name:"Vue-Router",value:"vue-router"}]}),t=e.includes("eslint"),r=e.includes("prettier"),n=e.includes("pinia"),o=e.includes("vue-router"),i=!1;return n&&(i=await q({message:`Do you want to use ${P.yellow.bold("pinia-plugin-persistedstate")} for Pinia state persistence?`,choices:[{name:"Yes",value:!0},{name:"No",value:!1}]})),{useEslint:t,usePrettier:r,usePinia:n,useVueRouter:o,usePiniaPluginPersistedstate:i}};import H from"figlet";var K=async e=>{try{return await H.text(e,{font:"Big Money-se",horizontalLayout:"default",verticalLayout:"default",width:80,whitespaceBreak:!0})}catch(t){console.log("Something went wrong..."),console.dir(t)}},N=K;import Q from"chalk";function W(e,t,r){t/=100,r/=100;let n=a=>(a+e/30)%12,o=t*Math.min(r,1-r),i=a=>r-o*Math.max(-1,Math.min(n(a)-3,Math.min(9-n(a),1)));return[Math.round(255*i(0)),Math.round(255*i(8)),Math.round(255*i(4))]}function X(e){return e.split("").map((t,r)=>{let n=r/e.length*360,[o,i,a]=W(n,100,50);return Q.rgb(o,i,a)(t)}).join("")}var k=X;import m from"chalk";import D from"boxen";var d=console.log,f=[22,198,12],A=(e,{useEslint:t,usePrettier:r})=>{let n=m.rgb(...f)(`
|
|
3
|
+
cd ${e} && pnpm i && pnpm lint && pnpm dev
|
|
4
|
+
`),o=m.rgb(...f)(`
|
|
5
|
+
cd ${e} && pnpm i && pnpm format && pnpm dev
|
|
6
|
+
`),i=m.rgb(...f)(`
|
|
7
|
+
cd ${e} && pnpm i && pnpm dev
|
|
8
|
+
`),a=t?n:r?o:i;d(m.cyan(D(a,{title:"commands",titleAlignment:"center"})),`
|
|
9
|
+
`)},G=()=>{d(m.cyan(D(m.rgb(...f)(`
|
|
10
|
+
git init && git add . && git commit -m "Initial commit"
|
|
11
|
+
`),{title:"commands",titleAlignment:"center"})))},O=async()=>{d(k(await N("BANANA")))},S=async e=>{d(k(e))};import _ from"fs-extra";import{fileURLToPath as Z}from"url";var s=Z(new URL("../dist/template",import.meta.url));import c from"path";var T=(e,t)=>{let r=c.join(s,"base");e.writePkg(_.readJSONSync(c.join(r,"static","package.json"))),e.copy(c.join(r,"static"),""),e.render(c.join(r,"ejs","App.vue.ejs"),c.join("src","App.vue"),{...t}),e.render(c.join(r,"ejs","main.js.ejs"),c.join("src","main.js"),{...t})};import J from"fs-extra";import p from"path";var M=(e,t)=>{let{usePinia:r,usePiniaPluginPersistedstate:n}=t;if(!r)return;let o=p.join(s,"pinia");if(e.extendDepsPkg(J.readJSONSync(p.join(o,"package.json"))),e.copy(p.join(o,"counter.js"),p.join("src","stores","counter.js")),!n)return;let i=p.join(o,"pinia-plugin-persistedstate");e.extendDepsPkg(J.readJSONSync(p.join(i,"package.json"))),e.copy(p.join(i,"key.js"),p.join("src","stores","key.js"))};import L from"fs-extra";import y from"path";var C=(e,t)=>{let{useEslint:r,usePrettier:n}=t;if(!r)return;let o=y.join(s,"eslint"),i=L.readJSONSync(y.join(o,"package.json"));e.extendDevDepsPkg(i),e.extendScriptsPkg(i),e.render(y.join(o,"eslint.config.js.ejs"),"eslint.config.js",{usePrettier:n}),n&&e.extendDevDepsPkg(L.readJSONSync(y.join(o,"prettierPkg.json")))};import ee from"fs-extra";import w from"path";var E=(e,t)=>{let{usePrettier:r}=t;if(!r)return;let n=w.join(s,"prettier"),o=ee.readJSONSync(w.join(n,"package.json"));e.extendDevDepsPkg(o),e.extendScriptsPkg(o),e.copy(w.join(n,".prettierrc"),".prettierrc")};import te from"fs-extra";import l from"path";var R=(e,t)=>{let{useVueRouter:r,usePiniaPluginPersistedstate:n}=t;if(!r)return;let o=l.join(s,"vue-router");e.extendDepsPkg(te.readJSONSync(l.join(o,"package.json"))),e.copy(l.join(o,"static"),"src"),e.render(l.join(o,"ejs","AboutView.vue.ejs"),l.join("src","views","AboutView.vue"),{usePiniaPluginPersistedstate:n})};var $=async e=>{let t=await b();return T(e,t),M(e,t),C(e,t),E(e,t),R(e,t),t};var I=async()=>{await O();let e=await x(),t=re.join(process.cwd(),e);await v(e,t);let r=new u(t),n=await $(r);r.generate(),S(`
|
|
12
|
+
Project initialization complete. You may now execute the following commands:
|
|
13
|
+
`),A(e,n),S(`Initialize Git using the following command:
|
|
14
|
+
`),G()};await I();
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -10,36 +10,40 @@
|
|
|
10
10
|
|
|
11
11
|
```text
|
|
12
12
|
create-tm
|
|
13
|
-
├─
|
|
14
|
-
│ └─
|
|
13
|
+
├─ script
|
|
14
|
+
│ └─ build.js
|
|
15
15
|
├─ src
|
|
16
|
-
│ ├─
|
|
17
|
-
│ │ ├─
|
|
18
|
-
│ │ ├─
|
|
19
|
-
│ │
|
|
20
|
-
│
|
|
21
|
-
│ │ ├─
|
|
22
|
-
│ │
|
|
23
|
-
│ └─
|
|
24
|
-
│
|
|
25
|
-
│ ├─
|
|
26
|
-
│ ├─
|
|
27
|
-
│ ├─
|
|
28
|
-
│
|
|
16
|
+
│ ├─ app
|
|
17
|
+
│ │ ├─ CLI
|
|
18
|
+
│ │ │ ├─ input.ts
|
|
19
|
+
│ │ │ ├─ main.ts
|
|
20
|
+
│ │ │ └─ output.ts
|
|
21
|
+
│ │ ├─ core
|
|
22
|
+
│ │ │ ├─ featsManger.ts
|
|
23
|
+
│ │ │ └─ generator.ts
|
|
24
|
+
│ │ └─ features
|
|
25
|
+
│ │ ├─ base.ts
|
|
26
|
+
│ │ ├─ eslint.ts
|
|
27
|
+
│ │ ├─ pinia.ts
|
|
28
|
+
│ │ ├─ prettier.ts
|
|
29
|
+
│ │ └─ vueRouter.ts
|
|
30
|
+
│ ├─ bin
|
|
31
|
+
│ │ └─ index.ts
|
|
32
|
+
│ └─ utils
|
|
33
|
+
│ ├─ figletPrint.ts
|
|
34
|
+
│ ├─ pathExists.ts
|
|
35
|
+
│ ├─ rainbow.ts
|
|
36
|
+
│ └─ URL.ts
|
|
29
37
|
├─ template
|
|
30
38
|
│ ├─ base
|
|
31
39
|
│ ├─ eslint
|
|
32
40
|
│ ├─ pinia
|
|
33
41
|
│ ├─ prettier
|
|
34
42
|
│ └─ vue-router
|
|
35
|
-
├─ utils
|
|
36
|
-
│ ├─ figletPrint.js
|
|
37
|
-
│ ├─ pathExists.js
|
|
38
|
-
│ ├─ rainbow.js
|
|
39
|
-
│ └─ URL.js
|
|
40
43
|
├─ eslint.config.js
|
|
41
44
|
├─ LICENSE
|
|
42
45
|
├─ package.json
|
|
43
46
|
├─ pnpm-lock.yaml
|
|
44
|
-
|
|
47
|
+
├─ readme.md
|
|
48
|
+
└─ tsconfig.json
|
|
45
49
|
```
|