@robot-admin/git-standards 1.0.0

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.
@@ -0,0 +1,1032 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/cli/init.ts
31
+ var init_exports = {};
32
+ __export(init_exports, {
33
+ init: () => init
34
+ });
35
+ module.exports = __toCommonJS(init_exports);
36
+ var import_node_path4 = require("path");
37
+ var import_node_fs4 = require("fs");
38
+ var import_chalk = __toESM(require("chalk"), 1);
39
+ var import_ora = __toESM(require("ora"), 1);
40
+ var import_execa2 = require("execa");
41
+
42
+ // src/utils/package-manager.ts
43
+ var import_node_fs = require("fs");
44
+ var import_node_path = require("path");
45
+ async function detectPackageManager(cwd = process.cwd()) {
46
+ if ((0, import_node_fs.existsSync)((0, import_node_path.resolve)(cwd, "bun.lockb")) || (0, import_node_fs.existsSync)((0, import_node_path.resolve)(cwd, "bun.lock"))) {
47
+ return "bun";
48
+ }
49
+ if ((0, import_node_fs.existsSync)((0, import_node_path.resolve)(cwd, "pnpm-lock.yaml"))) {
50
+ return "pnpm";
51
+ }
52
+ if ((0, import_node_fs.existsSync)((0, import_node_path.resolve)(cwd, "yarn.lock"))) {
53
+ return "yarn";
54
+ }
55
+ if ((0, import_node_fs.existsSync)((0, import_node_path.resolve)(cwd, "package-lock.json"))) {
56
+ return "npm";
57
+ }
58
+ return "npm";
59
+ }
60
+ function getInstallCommand(pm) {
61
+ const commands = {
62
+ npm: "npm install --save-dev",
63
+ yarn: "yarn add --dev",
64
+ pnpm: "pnpm add -D",
65
+ bun: "bun add --dev"
66
+ };
67
+ return commands[pm];
68
+ }
69
+ function getExecCommand(pm) {
70
+ const commands = {
71
+ npm: "npx --no",
72
+ yarn: "yarn",
73
+ pnpm: "pnpm dlx",
74
+ bun: "bunx"
75
+ };
76
+ return commands[pm];
77
+ }
78
+ function getPackageManagerName(pm) {
79
+ const names = {
80
+ npm: "npm",
81
+ yarn: "Yarn",
82
+ pnpm: "pnpm",
83
+ bun: "Bun"
84
+ };
85
+ return names[pm];
86
+ }
87
+
88
+ // src/utils/git.ts
89
+ var import_node_fs2 = require("fs");
90
+ var import_node_path2 = require("path");
91
+ var import_execa = require("execa");
92
+ function isGitRepository(cwd = process.cwd()) {
93
+ return (0, import_node_fs2.existsSync)((0, import_node_path2.resolve)(cwd, ".git"));
94
+ }
95
+ async function initGitRepository(cwd = process.cwd()) {
96
+ if (!isGitRepository(cwd)) {
97
+ await (0, import_execa.execa)("git", ["init"], { cwd });
98
+ }
99
+ }
100
+
101
+ // src/utils/file.ts
102
+ var import_node_fs3 = require("fs");
103
+ var import_promises = require("fs/promises");
104
+ var import_node_path3 = require("path");
105
+ async function readFileContent(filePath) {
106
+ return await (0, import_promises.readFile)(filePath, "utf-8");
107
+ }
108
+ async function writeFileContent(filePath, content) {
109
+ const dir = (0, import_node_path3.dirname)(filePath);
110
+ if (!(0, import_node_fs3.existsSync)(dir)) {
111
+ await (0, import_promises.mkdir)(dir, { recursive: true });
112
+ }
113
+ await (0, import_promises.writeFile)(filePath, content, "utf-8");
114
+ }
115
+ async function readJsonFile(filePath) {
116
+ const content = await readFileContent(filePath);
117
+ return JSON.parse(content);
118
+ }
119
+ async function writeJsonFile(filePath, data, pretty = true) {
120
+ const content = pretty ? JSON.stringify(data, null, 2) + "\n" : JSON.stringify(data);
121
+ await writeFileContent(filePath, content);
122
+ }
123
+ async function updatePackageJson(updates, cwd = process.cwd()) {
124
+ const packageJsonPath = (0, import_node_path3.resolve)(cwd, "package.json");
125
+ const packageJson = await readJsonFile(packageJsonPath);
126
+ const updated = { ...packageJson, ...updates };
127
+ await writeJsonFile(packageJsonPath, updated);
128
+ }
129
+
130
+ // src/configs/lint-staged.ts
131
+ function createLintStagedConfig(options = {}) {
132
+ const codePattern = options.filePatterns?.code || "src/**/*.{js,jsx,ts,tsx,vue}";
133
+ const markupPattern = options.filePatterns?.markup || "*.{json,md,yml,yaml}";
134
+ const codeCommands = [];
135
+ if (options.oxlint !== false) {
136
+ codeCommands.push("oxlint --max-warnings 0 --deny-warnings");
137
+ }
138
+ if (options.eslint !== false) {
139
+ codeCommands.push("eslint --fix --no-cache");
140
+ }
141
+ if (options.prettier !== false) {
142
+ codeCommands.push("prettier --write");
143
+ }
144
+ const config = {};
145
+ if (codeCommands.length > 0) {
146
+ config[codePattern] = codeCommands;
147
+ }
148
+ if (options.prettier !== false) {
149
+ config[markupPattern] = ["prettier --write"];
150
+ }
151
+ return config;
152
+ }
153
+ function generateLintStagedConfig(options = {}) {
154
+ return createLintStagedConfig(options);
155
+ }
156
+
157
+ // src/cli/init.ts
158
+ var BRAND = "#7C3AED";
159
+ var S = {
160
+ LOGO: import_chalk.default.hex(BRAND).bold("[RS]"),
161
+ OK: import_chalk.default.green("\u2714"),
162
+ FAIL: import_chalk.default.red("\u2716"),
163
+ WARN: import_chalk.default.yellow("\u25B2"),
164
+ STEP: import_chalk.default.hex(BRAND)("\u25C6"),
165
+ ARROW: import_chalk.default.cyan("\u25B8"),
166
+ DOT: import_chalk.default.gray("\u25CF"),
167
+ INFO: import_chalk.default.blue("\u2139"),
168
+ LINE: import_chalk.default.gray("\u2500".repeat(48))
169
+ };
170
+ var PRESETS = {
171
+ minimal: {
172
+ name: "\u6781\u7B80\u6A21\u5F0F",
173
+ desc: "\u4EC5 Git \u63D0\u4EA4\u89C4\u8303 (Commitizen + Commitlint)",
174
+ features: {
175
+ eslint: false,
176
+ lintStaged: false,
177
+ prettier: false,
178
+ oxlint: false,
179
+ editorconfig: false
180
+ }
181
+ },
182
+ standard: {
183
+ name: "\u6807\u51C6\u6A21\u5F0F",
184
+ desc: "\u63D0\u4EA4\u89C4\u8303 + \u4EE3\u7801\u8D28\u91CF\u68C0\u67E5 (+ ESLint + lint-staged)",
185
+ features: {
186
+ eslint: true,
187
+ lintStaged: true,
188
+ prettier: false,
189
+ oxlint: false,
190
+ editorconfig: true
191
+ }
192
+ },
193
+ full: {
194
+ name: "\u5B8C\u6574\u6A21\u5F0F",
195
+ desc: "\u5168\u90E8\u5DE5\u5177\u94FE (+ Prettier + Oxlint + EditorConfig)",
196
+ features: {
197
+ eslint: true,
198
+ lintStaged: true,
199
+ prettier: true,
200
+ oxlint: true,
201
+ editorconfig: true
202
+ }
203
+ }
204
+ };
205
+ async function init(options = {}) {
206
+ const cwd = options.cwd || process.cwd();
207
+ printBanner();
208
+ console.log(` ${S.STEP} ${import_chalk.default.bold("\u73AF\u5883\u68C0\u6D4B")}`);
209
+ console.log();
210
+ if (!isGitRepository(cwd)) {
211
+ const spinner = (0, import_ora.default)({
212
+ text: import_chalk.default.gray("\u521D\u59CB\u5316 Git \u4ED3\u5E93..."),
213
+ prefixText: " ",
214
+ spinner: "dots"
215
+ }).start();
216
+ await initGitRepository(cwd);
217
+ spinner.succeed(import_chalk.default.white("Git \u4ED3\u5E93\u521D\u59CB\u5316\u5B8C\u6210"));
218
+ } else {
219
+ console.log(` ${S.OK} Git \u4ED3\u5E93\u5DF2\u5C31\u7EEA`);
220
+ }
221
+ const pm = await detectPackageManager(cwd);
222
+ const pmName = getPackageManagerName(pm);
223
+ console.log(` ${S.OK} \u5305\u7BA1\u7406\u5668: ${import_chalk.default.cyan.bold(pmName)}`);
224
+ console.log();
225
+ let features;
226
+ let eslintOpts = {
227
+ framework: "vue",
228
+ typescript: true,
229
+ jsdoc: false
230
+ };
231
+ if (options.ci) {
232
+ const presetId = options.preset || "standard";
233
+ if (presetId === "custom") {
234
+ features = {
235
+ eslint: true,
236
+ lintStaged: true,
237
+ prettier: options.prettier ?? true,
238
+ oxlint: options.oxlint ?? true,
239
+ editorconfig: true
240
+ };
241
+ } else {
242
+ features = { ...PRESETS[presetId].features };
243
+ }
244
+ if (options.prettier !== void 0) features.prettier = options.prettier;
245
+ if (options.oxlint !== void 0) features.oxlint = options.oxlint;
246
+ const jsdocDefault = presetId === "full" ? true : false;
247
+ eslintOpts = {
248
+ framework: options.framework || "vue",
249
+ typescript: options.typescript ?? true,
250
+ jsdoc: options.jsdoc ?? jsdocDefault
251
+ };
252
+ console.log(
253
+ ` ${S.INFO} ${import_chalk.default.gray("CI \u6A21\u5F0F")} ${import_chalk.default.white(
254
+ "\u9884\u8BBE:"
255
+ )} ${import_chalk.default.cyan(presetId)}`
256
+ );
257
+ console.log();
258
+ } else {
259
+ const result = await interactiveSetup(options);
260
+ features = result.features;
261
+ eslintOpts = result.eslintOpts;
262
+ }
263
+ printSummary(features, eslintOpts, pmName);
264
+ if (!options.ci) {
265
+ const { confirm } = await import("@inquirer/prompts");
266
+ const proceed = await confirm({
267
+ message: import_chalk.default.white("\u786E\u8BA4\u4EE5\u4E0A\u914D\u7F6E\u5E76\u5F00\u59CB\u5B89\u88C5?"),
268
+ default: true,
269
+ theme: { prefix: ` ${S.ARROW}` }
270
+ });
271
+ if (!proceed) {
272
+ console.log();
273
+ console.log(` ${S.INFO} ${import_chalk.default.gray("\u91CD\u65B0\u9009\u62E9\u914D\u7F6E...")}`);
274
+ console.log();
275
+ const result = await interactiveSetup(options);
276
+ features = result.features;
277
+ eslintOpts = result.eslintOpts;
278
+ printSummary(features, eslintOpts, pmName);
279
+ }
280
+ }
281
+ console.log();
282
+ await installDependencies(cwd, pm, features, eslintOpts);
283
+ await generateConfigFiles(cwd, features, eslintOpts);
284
+ await setupHusky(cwd, pm, features);
285
+ await addPackageScripts(cwd, pm, features);
286
+ printCompletion(pm, features);
287
+ }
288
+ function printBanner() {
289
+ console.log();
290
+ console.log(S.LINE);
291
+ console.log(
292
+ ` ${S.LOGO} ${import_chalk.default.bold("Robot Standards")} ${import_chalk.default.gray("v1.0.0")}`
293
+ );
294
+ console.log(` ${import_chalk.default.gray("\u96F6\u914D\u7F6E \xB7 \u6A21\u5757\u5316 \xB7 Git \u5DE5\u7A0B\u5316\u6807\u51C6\u5DE5\u5177\u5305")}`);
295
+ console.log(S.LINE);
296
+ console.log();
297
+ }
298
+ async function interactiveSetup(options) {
299
+ const { select, checkbox, confirm } = await import("@inquirer/prompts");
300
+ while (true) {
301
+ console.log(` ${S.STEP} ${import_chalk.default.bold("\u9009\u62E9\u6A21\u5F0F")}`);
302
+ console.log();
303
+ const presetId = await select({
304
+ message: import_chalk.default.white("\u9009\u62E9\u9884\u8BBE\u65B9\u6848"),
305
+ choices: [
306
+ {
307
+ name: `\u6781\u7B80\u6A21\u5F0F ${import_chalk.default.gray(
308
+ "\u2500\u2500 \u4EC5\u63D0\u4EA4\u89C4\u8303 (Commitizen + Commitlint)"
309
+ )}`,
310
+ value: "minimal",
311
+ description: import_chalk.default.gray("\u9002\u5408\u53EA\u9700\u89C4\u8303\u63D0\u4EA4\u4FE1\u606F\u7684\u9879\u76EE")
312
+ },
313
+ {
314
+ name: `\u6807\u51C6\u6A21\u5F0F ${import_chalk.default.gray("\u2500\u2500 \u63D0\u4EA4\u89C4\u8303 + \u4EE3\u7801\u68C0\u67E5 (+ ESLint)")}`,
315
+ value: "standard",
316
+ description: import_chalk.default.gray("\u9002\u5408\u5927\u591A\u6570\u9879\u76EE")
317
+ },
318
+ {
319
+ name: `\u5B8C\u6574\u6A21\u5F0F ${import_chalk.default.gray(
320
+ "\u2500\u2500 \u5168\u90E8\u5DE5\u5177\u94FE (+ Prettier + Oxlint)"
321
+ )} ${import_chalk.default.hex(BRAND)("\u4E3B\u9879\u76EE(Robot_Admin)")}`,
322
+ value: "full",
323
+ description: import_chalk.default.gray("\u5168\u9762\u4EE3\u7801\u8D28\u91CF\u7BA1\u63A7")
324
+ },
325
+ {
326
+ name: `\u81EA\u5B9A\u4E49 ${import_chalk.default.gray("\u2500\u2500 \u81EA\u7531\u7EC4\u5408\u9700\u8981\u7684\u5DE5\u5177\u94FE")}`,
327
+ value: "custom",
328
+ description: import_chalk.default.gray("\u7CBE\u786E\u63A7\u5236\u6BCF\u4E2A\u529F\u80FD\u6A21\u5757")
329
+ }
330
+ ],
331
+ default: "standard",
332
+ theme: { prefix: ` ${S.ARROW}` }
333
+ });
334
+ let features;
335
+ if (presetId === "custom") {
336
+ console.log();
337
+ console.log(
338
+ ` ${S.STEP} ${import_chalk.default.bold("\u9009\u62E9\u529F\u80FD")} ${import_chalk.default.gray(
339
+ "(Git \u63D0\u4EA4\u89C4\u8303\u9ED8\u8BA4\u5305\u542B)"
340
+ )}`
341
+ );
342
+ console.log();
343
+ const selected = await checkbox({
344
+ message: import_chalk.default.white("\u9009\u62E9\u9644\u52A0\u529F\u80FD (\u7A7A\u683C\u5207\u6362, \u56DE\u8F66\u786E\u8BA4)"),
345
+ choices: [
346
+ {
347
+ name: `ESLint ${import_chalk.default.gray("\u4EE3\u7801\u8D28\u91CF\u68C0\u67E5")}`,
348
+ value: "eslint"
349
+ },
350
+ {
351
+ name: `lint-staged ${import_chalk.default.gray("\u6682\u5B58\u533A\u589E\u91CF\u68C0\u67E5")}`,
352
+ value: "lintStaged"
353
+ },
354
+ {
355
+ name: `Prettier ${import_chalk.default.gray("\u4EE3\u7801\u81EA\u52A8\u683C\u5F0F\u5316")}`,
356
+ value: "prettier"
357
+ },
358
+ {
359
+ name: `Oxlint ${import_chalk.default.gray(
360
+ "\u9AD8\u6027\u80FD Lint \u5F15\u64CE (50x faster)"
361
+ )}`,
362
+ value: "oxlint"
363
+ },
364
+ {
365
+ name: `EditorConfig ${import_chalk.default.gray("\u7F16\u8F91\u5668\u7EDF\u4E00\u914D\u7F6E")}`,
366
+ value: "editorconfig"
367
+ },
368
+ {
369
+ name: import_chalk.default.yellow("\u21A9 \u8FD4\u56DE\u4E0A\u4E00\u6B65"),
370
+ value: "__back__"
371
+ }
372
+ ],
373
+ theme: { prefix: ` ${S.ARROW}` }
374
+ });
375
+ if (selected.includes("__back__")) continue;
376
+ features = {
377
+ eslint: selected.includes("eslint"),
378
+ lintStaged: selected.includes("lintStaged"),
379
+ prettier: selected.includes("prettier"),
380
+ oxlint: selected.includes("oxlint"),
381
+ editorconfig: selected.includes("editorconfig")
382
+ };
383
+ if (features.oxlint && !features.eslint) {
384
+ console.log(
385
+ `
386
+ ${S.INFO} ${import_chalk.default.gray(
387
+ "Oxlint \u9700\u8981 ESLint \u914D\u5408\uFF0C\u5DF2\u81EA\u52A8\u542F\u7528 ESLint"
388
+ )}`
389
+ );
390
+ features.eslint = true;
391
+ }
392
+ if (features.lintStaged && !features.eslint && !features.prettier) {
393
+ console.log(
394
+ `
395
+ ${S.INFO} ${import_chalk.default.gray(
396
+ "lint-staged \u9700\u8981 ESLint \u6216 Prettier\uFF0C\u5DF2\u81EA\u52A8\u542F\u7528 ESLint"
397
+ )}`
398
+ );
399
+ features.eslint = true;
400
+ }
401
+ } else {
402
+ features = { ...PRESETS[presetId].features };
403
+ }
404
+ let eslintOpts = {
405
+ framework: "vue",
406
+ typescript: true,
407
+ jsdoc: false
408
+ };
409
+ if (features.eslint) {
410
+ console.log();
411
+ console.log(` ${S.STEP} ${import_chalk.default.bold("ESLint \u914D\u7F6E")}`);
412
+ console.log();
413
+ const framework = await select({
414
+ message: import_chalk.default.white("\u9879\u76EE\u6846\u67B6"),
415
+ choices: [
416
+ {
417
+ name: "Vue 3",
418
+ value: "vue"
419
+ },
420
+ { name: "React", value: "react" },
421
+ { name: "Vanilla JS / TS", value: "vanilla" },
422
+ {
423
+ name: import_chalk.default.yellow("\u21A9 \u8FD4\u56DE\u4E0A\u4E00\u6B65"),
424
+ value: "__back__"
425
+ }
426
+ ],
427
+ default: options.framework || "vue",
428
+ theme: { prefix: ` ${S.ARROW}` }
429
+ });
430
+ if (framework === "__back__") continue;
431
+ const typescript = await confirm({
432
+ message: import_chalk.default.white("\u4F7F\u7528 TypeScript"),
433
+ default: options.typescript ?? true,
434
+ theme: { prefix: ` ${S.ARROW}` }
435
+ });
436
+ const jsdoc = await confirm({
437
+ message: import_chalk.default.white("\u5F3A\u5236 JSDoc \u6CE8\u91CA"),
438
+ default: options.jsdoc ?? true,
439
+ theme: { prefix: ` ${S.ARROW}` }
440
+ });
441
+ eslintOpts = { framework, typescript, jsdoc };
442
+ }
443
+ return { features, eslintOpts };
444
+ }
445
+ }
446
+ function printSummary(features, eslintOpts, pmName) {
447
+ console.log();
448
+ console.log(` ${S.STEP} ${import_chalk.default.bold("\u914D\u7F6E\u6458\u8981")}`);
449
+ console.log();
450
+ console.log(
451
+ ` ${S.OK} ${import_chalk.default.white("\u6838\u5FC3")} Commitizen + Commitlint + Husky`
452
+ );
453
+ if (features.eslint) {
454
+ const fw = eslintOpts.framework === "vue" ? "Vue 3" : eslintOpts.framework === "react" ? "React" : "Vanilla";
455
+ const ts = eslintOpts.typescript ? " + TS" : "";
456
+ const jsdoc = eslintOpts.jsdoc ? " + JSDoc" : "";
457
+ console.log(
458
+ ` ${S.OK} ${import_chalk.default.white("\u68C0\u67E5")} ESLint (${fw}${ts}${jsdoc})`
459
+ );
460
+ }
461
+ if (features.lintStaged) {
462
+ console.log(` ${S.OK} ${import_chalk.default.white("\u6682\u5B58")} lint-staged`);
463
+ }
464
+ if (features.oxlint) {
465
+ console.log(
466
+ ` ${S.OK} ${import_chalk.default.white("\u52A0\u901F")} Oxlint ${import_chalk.default.gray("(50x faster)")}`
467
+ );
468
+ }
469
+ if (features.prettier) {
470
+ console.log(` ${S.OK} ${import_chalk.default.white("\u683C\u5F0F")} Prettier`);
471
+ }
472
+ if (features.editorconfig) {
473
+ console.log(` ${S.OK} ${import_chalk.default.white("\u7F16\u8F91")} EditorConfig`);
474
+ }
475
+ console.log(` ${S.DOT} ${import_chalk.default.gray("\u7BA1\u7406")} ${pmName}`);
476
+ console.log();
477
+ }
478
+ async function installDependencies(cwd, pm, features, eslintOpts) {
479
+ const spinner = (0, import_ora.default)({
480
+ text: import_chalk.default.gray("\u5206\u6790\u4F9D\u8D56..."),
481
+ prefixText: " ",
482
+ spinner: "dots"
483
+ }).start();
484
+ const deps = [
485
+ "@commitlint/cli",
486
+ "@commitlint/config-conventional",
487
+ "commitizen",
488
+ "cz-customizable",
489
+ "husky"
490
+ ];
491
+ if (features.eslint) {
492
+ deps.push("eslint");
493
+ if (eslintOpts.framework === "vue") {
494
+ deps.push("eslint-plugin-vue", "@vue/eslint-config-typescript");
495
+ }
496
+ if (eslintOpts.typescript) {
497
+ deps.push(
498
+ "@typescript-eslint/eslint-plugin",
499
+ "@typescript-eslint/parser"
500
+ );
501
+ }
502
+ if (eslintOpts.jsdoc) {
503
+ deps.push("eslint-plugin-jsdoc");
504
+ }
505
+ }
506
+ if (features.lintStaged) {
507
+ deps.push("lint-staged");
508
+ }
509
+ if (features.oxlint) {
510
+ deps.push("oxlint", "eslint-plugin-oxlint");
511
+ }
512
+ if (features.prettier) {
513
+ deps.push("prettier");
514
+ if (features.eslint && eslintOpts.framework === "vue") {
515
+ deps.push("@vue/eslint-config-prettier");
516
+ }
517
+ }
518
+ spinner.text = import_chalk.default.gray(`\u5B89\u88C5 ${deps.length} \u4E2A\u4F9D\u8D56...`);
519
+ try {
520
+ const installCmd = getInstallCommand(pm);
521
+ await (0, import_execa2.execa)(
522
+ installCmd.split(" ")[0],
523
+ [...installCmd.split(" ").slice(1), ...deps],
524
+ { cwd, stdio: "pipe" }
525
+ );
526
+ spinner.succeed(
527
+ import_chalk.default.white("\u4F9D\u8D56\u5B89\u88C5\u5B8C\u6210 ") + import_chalk.default.gray(`(${deps.length} packages)`)
528
+ );
529
+ } catch (error) {
530
+ spinner.fail(import_chalk.default.red("\u4F9D\u8D56\u5B89\u88C5\u5931\u8D25"));
531
+ throw error;
532
+ }
533
+ }
534
+ async function generateConfigFiles(cwd, features, eslintOpts) {
535
+ const spinner = (0, import_ora.default)({
536
+ text: import_chalk.default.gray("\u751F\u6210\u914D\u7F6E\u6587\u4EF6..."),
537
+ prefixText: " ",
538
+ spinner: "dots"
539
+ }).start();
540
+ const generated = [];
541
+ try {
542
+ const czConfig = `/*
543
+ * Commitizen \u81EA\u5B9A\u4E49\u914D\u7F6E (cz-customizable)
544
+ * @generated by @robot-admin/git-standards
545
+ *
546
+ * \u76F4\u63A5\u4FEE\u6539\u6B64\u6587\u4EF6\u5373\u53EF\u81EA\u5B9A\u4E49\u63D0\u4EA4\u89C4\u8303
547
+ */
548
+ module.exports = {
549
+ scopes: [],
550
+ allowEmptyScopes: false,
551
+ allowCustomScopes: true,
552
+
553
+ types: [
554
+ { value: 'wip', name: 'wip: \u{1F6A7} \u5F00\u53D1\u4E2D' },
555
+ { value: 'feat', name: 'feat: \u{1F3AF} \u65B0\u529F\u80FD' },
556
+ { value: 'fix', name: 'fix: \u{1F41B} Bug \u4FEE\u590D' },
557
+ { value: 'perf', name: 'perf: \u26A1\uFE0F \u6027\u80FD\u4F18\u5316' },
558
+ { value: 'deps', name: 'deps: \u{1F4E6} \u4F9D\u8D56\u66F4\u65B0' },
559
+ { value: 'refactor', name: 'refactor: \u267B\uFE0F \u91CD\u6784' },
560
+ { value: 'docs', name: 'docs: \u{1F4DA} \u6587\u6863\u53D8\u66F4' },
561
+ { value: 'test', name: 'test: \u{1F50E} \u6D4B\u8BD5\u76F8\u5173' },
562
+ { value: 'style', name: 'style: \u{1F484} \u4EE3\u7801\u6837\u5F0F' },
563
+ { value: 'build', name: 'build: \u{1F9F3} \u6784\u5EFA/\u6253\u5305' },
564
+ { value: 'chore', name: 'chore: \u{1F527} \u5176\u4ED6\u6742\u9879' },
565
+ { value: 'revert', name: 'revert: \u{1F519} \u56DE\u9000' },
566
+ ],
567
+
568
+ messages: {
569
+ type: '\u8BF7\u9009\u62E9\u63D0\u4EA4\u7C7B\u578B:',
570
+ customScope: '\u8BF7\u8F93\u5165\u4FEE\u6539\u8303\u56F4(\u5FC5\u586B\uFF0C\u683C\u5F0F\u5982\uFF1A\u6A21\u5757/\u5B50\u6A21\u5757):',
571
+ subject: '\u8BF7\u7B80\u8981\u63CF\u8FF0\u63D0\u4EA4(\u5FC5\u586B\uFF0C\u4E0D\u52A0\u53E5\u53F7):',
572
+ body: '\u8BF7\u8F93\u5165\u66F4\u8BE6\u7EC6\u7684\u8BF4\u660E(\u53EF\u9009):\\n',
573
+ footer: 'Footer(\u53EF\u9009): \u4F8B\u5982 "Closes #123" \u6216 "Release-As: 1.3.1"\\n',
574
+ confirmCommit: '\u786E\u8BA4\u63D0\u4EA4\u4EE5\u4E0A\u5185\u5BB9\uFF1F(y/n/e/h)',
575
+ },
576
+
577
+ skipQuestions: ['body'],
578
+
579
+ allowBreakingChanges: ['feat', 'fix', 'refactor'],
580
+ breakingPrefix: 'BREAKING CHANGE:',
581
+
582
+ subjectLimit: 88,
583
+ }
584
+ `;
585
+ await writeFileContent((0, import_node_path4.resolve)(cwd, ".cz-config.js"), czConfig);
586
+ generated.push(".cz-config.js");
587
+ const commitlintConfig = `/*
588
+ * Commitlint \u914D\u7F6E
589
+ * @generated by @robot-admin/git-standards
590
+ *
591
+ * \u76F4\u63A5\u4FEE\u6539\u6B64\u6587\u4EF6\u5373\u53EF\u81EA\u5B9A\u4E49\u63D0\u4EA4\u6821\u9A8C\u89C4\u5219
592
+ */
593
+ module.exports = {
594
+ extends: ['@commitlint/config-conventional'],
595
+ rules: {
596
+ 'type-enum': [
597
+ 2,
598
+ 'always',
599
+ [
600
+ 'wip', 'feat', 'fix', 'docs', 'style', 'refactor',
601
+ 'perf', 'test', 'chore', 'revert', 'build', 'deps',
602
+ ],
603
+ ],
604
+ 'subject-case': [0],
605
+ },
606
+ }
607
+ `;
608
+ await writeFileContent(
609
+ (0, import_node_path4.resolve)(cwd, "commitlint.config.js"),
610
+ commitlintConfig
611
+ );
612
+ generated.push("commitlint.config.js");
613
+ if (features.prettier) {
614
+ const prettierConfig = `/*
615
+ * Prettier \u914D\u7F6E
616
+ * @generated by @robot-admin/git-standards
617
+ *
618
+ * \u76F4\u63A5\u4FEE\u6539\u6B64\u6587\u4EF6\u5373\u53EF\u81EA\u5B9A\u4E49\u683C\u5F0F\u5316\u89C4\u5219
619
+ */
620
+ module.exports = {
621
+ $schema: 'https://json.schemastore.org/prettierrc',
622
+ semi: false,
623
+ singleQuote: true,
624
+ printWidth: 80,
625
+ tabWidth: 2,
626
+ quoteProps: 'as-needed',
627
+ trailingComma: 'es5',
628
+ bracketSpacing: true,
629
+ jsxSingleQuote: true,
630
+ arrowParens: 'avoid',
631
+ endOfLine: 'auto',
632
+ htmlWhitespaceSensitivity: 'strict',
633
+ vueIndentScriptAndStyle: true,
634
+ singleAttributePerLine: true,
635
+ }
636
+ `;
637
+ await writeFileContent((0, import_node_path4.resolve)(cwd, ".prettierrc.js"), prettierConfig);
638
+ generated.push(".prettierrc.js");
639
+ }
640
+ if (features.eslint) {
641
+ const hasOxlint = features.oxlint;
642
+ const hasPrettier = features.prettier;
643
+ const hasJsdoc = eslintOpts.jsdoc;
644
+ const isVue = eslintOpts.framework === "vue";
645
+ const isTs = eslintOpts.typescript;
646
+ const importLines = [];
647
+ if (isVue) importLines.push("import pluginVue from 'eslint-plugin-vue'");
648
+ if (isVue && isTs) {
649
+ importLines.push(
650
+ "import {\n defineConfigWithVueTs,\n vueTsConfigs,\n} from '@vue/eslint-config-typescript'"
651
+ );
652
+ }
653
+ if (hasOxlint)
654
+ importLines.push("import oxlint from 'eslint-plugin-oxlint'");
655
+ if (hasPrettier && isVue) {
656
+ importLines.push(
657
+ "import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'"
658
+ );
659
+ }
660
+ if (hasJsdoc)
661
+ importLines.push("import jsdocPlugin from 'eslint-plugin-jsdoc'");
662
+ const fileExts = isTs ? "js,ts,mts,tsx,vue" : "js,jsx,vue";
663
+ const vue2DeprecationRules = isVue ? `
664
+ //! \u4E3B\u52A8\u7981\u6B62 Vue 2 \u5199\u6CD5
665
+ 'vue/no-deprecated-props-default-this': 'error',
666
+ 'vue/no-deprecated-events-api': 'error',
667
+ 'vue/no-deprecated-filter': 'error',
668
+ 'vue/no-deprecated-functional-template': 'error',
669
+ ` : "";
670
+ const vueComponentRules = isVue ? `
671
+ // Vue \u89C4\u8303
672
+ //! PascalCase \u547D\u540D\u89C4\u8303
673
+ 'vue/component-name-in-template-casing': [
674
+ 'error',
675
+ 'PascalCase',
676
+ {
677
+ registeredComponentsOnly: false,
678
+ ignores: [
679
+ 'router-view',
680
+ 'router-link',
681
+ 'transition',
682
+ 'draggable',
683
+ '/^icon-/i',
684
+ '/^C_/',
685
+ '/^c_/',
686
+ 'v-md-editor',
687
+ ],
688
+ },
689
+ ],
690
+ 'vue/multi-word-component-names': [
691
+ 'error',
692
+ {
693
+ ignores: ['index'],
694
+ },
695
+ ],
696
+ //! \u7981\u6B62\u5728\u6A21\u677F\u4E2D\u6CE8\u518C\u4F46\u672A\u4F7F\u7528\u7684\u7EC4\u4EF6
697
+ 'vue/no-unused-components': 'error',
698
+ ${vue2DeprecationRules}` : "";
699
+ const jsdocBlock = hasJsdoc ? `
700
+ //MARK: \u81EA\u5B9A\u4E49\u89C4\u5219\u7EC4\uFF08\u4F18\u5148\u7EA7\u6700\u9AD8\uFF09
701
+ {
702
+ plugins: {
703
+ jsdoc: jsdocPlugin,
704
+ },
705
+ rules: {
706
+ //! JSDoc \u6CE8\u91CA\u89C4\u5219
707
+ 'jsdoc/require-jsdoc': [
708
+ 'error',
709
+ {
710
+ require: {
711
+ FunctionDeclaration: true,
712
+ MethodDefinition: true,
713
+ ClassDeclaration: true,
714
+ ArrowFunctionExpression: false,
715
+ FunctionExpression: true,
716
+ },
717
+ contexts: [
718
+ 'FunctionDeclaration',
719
+ 'ClassDeclaration',
720
+ 'ClassProperty',
721
+ 'MethodDefinition',
722
+ 'FunctionExpression',
723
+ ],
724
+ checkConstructors: true,
725
+ checkGetters: true,
726
+ checkSetters: true,
727
+ },
728
+ ],
729
+ ` : `
730
+ // \u81EA\u5B9A\u4E49\u89C4\u5219\u7EC4
731
+ {
732
+ rules: {
733
+ `;
734
+ const fileTypeOverrides = isTs ? `
735
+ //MARK: \u6587\u4EF6\u7C7B\u578B\u8986\u76D6\u89C4\u5219
736
+
737
+ //! \u53D8\u91CF\u4F7F\u7528\u89C4\u5219
738
+ {
739
+ files: ['**/*.js'],
740
+ rules: {
741
+ 'no-unused-vars': 'error',
742
+ '@typescript-eslint/no-unused-vars': 'off',
743
+ },
744
+ },
745
+ {
746
+ files: ['**/*.{ts,mts,tsx,vue}'],
747
+ rules: {
748
+ 'no-unused-vars': 'off',
749
+ '@typescript-eslint/no-unused-vars': 'error',
750
+ },
751
+ },
752
+ ` : "";
753
+ const jsdocWhitelist = hasJsdoc ? `
754
+ //MARK: JSDoc \u767D\u540D\u5355\u8986\u76D6\u89C4\u5219
755
+ {
756
+ files: [
757
+ 'src/router/**/*.ts',
758
+ 'src/stores/**/*.ts',
759
+ 'src/views/**/components/*.vue',
760
+ ],
761
+ rules: {
762
+ 'jsdoc/require-jsdoc': 'off',
763
+ '@typescript-eslint/require-jsdoc': 'off',
764
+ },
765
+ },
766
+ ` : "";
767
+ const ignoreAssets = `
768
+ //MARK: ESLINT \u767D\u540D\u5355\u914D\u7F6E\u7EC4
769
+ {
770
+ name: 'app/ignore-assets',
771
+ ignores: [
772
+ 'src/assets/images/**/*',
773
+ '**/*.d.ts',
774
+ '**/auto-imports.d.ts',
775
+ 'src/views/**/components/*.vue',
776
+ 'scripts/**/*',
777
+ ],
778
+ },
779
+ `;
780
+ const tsRules = isTs ? `
781
+ //! \u5173\u95ED\u4E0E oxlint \u91CD\u590D\u7684 ESLint \u89C4\u5219
782
+ 'no-undef': 'off',
783
+
784
+ //! \u5F15\u53F7\u89C4\u8303
785
+ '@typescript-eslint/quotes': ['error', 'single'],${isVue ? "\n 'vue/html-quotes': ['error', 'double']," : ""}
786
+
787
+ //! TypeScript \u5B89\u5168
788
+ '@typescript-eslint/no-explicit-any': 'off',
789
+ '@typescript-eslint/ban-ts-comment': [
790
+ 'error',
791
+ {
792
+ 'ts-ignore': 'allow-with-description',
793
+ },
794
+ ],
795
+
796
+ //! \u8868\u8FBE\u5F0F\u89C4\u8303
797
+ '@typescript-eslint/no-unused-expressions': [
798
+ 'error',
799
+ {
800
+ allowShortCircuit: true,
801
+ allowTernary: false,
802
+ allowTaggedTemplates: false,
803
+ enforceForJSX: true,
804
+ },
805
+ ],
806
+ ` : "";
807
+ const useWrapper = isVue && isTs;
808
+ const wrapperStart = useWrapper ? "export default defineConfigWithVueTs(" : "export default [";
809
+ const wrapperEnd = useWrapper ? ")" : "]";
810
+ const oxlintLine = hasOxlint ? "\n ...oxlint.configs['flat/recommended'], // \u9AD8\u6027\u80FD\u57FA\u7840\u6821\u9A8C\n" : "";
811
+ const vueLine = isVue ? `
812
+ //! \u5FFD\u7565\u8F6C\u4E49\u5B57\u7B26
813
+ {
814
+ rules: {
815
+ 'no-useless-escape': 'off',
816
+ },
817
+ },
818
+
819
+ pluginVue.configs['flat/essential'], // Vue \u4E13\u7528\u89C4\u5219` : "";
820
+ const tsLine = isVue && isTs ? "\n vueTsConfigs.recommended, // TS \u4E13\u7528\u89C4\u5219" : "";
821
+ const skipLine = hasPrettier && isVue ? "\n skipFormatting" : "";
822
+ const eslintConfig = `/*
823
+ * ESLint Flat Config
824
+ * @generated by @robot-admin/git-standards
825
+ *
826
+ * \u76F4\u63A5\u4FEE\u6539\u6B64\u6587\u4EF6\u5373\u53EF\u81EA\u5B9A\u4E49 ESLint \u89C4\u5219
827
+ */
828
+ ${importLines.join("\n")}
829
+
830
+ ${wrapperStart}
831
+ //MARK: \u57FA\u7840\u914D\u7F6E\u7EC4
832
+ {
833
+ name: 'app/files-to-lint',
834
+ files: ['**/*.{${fileExts}}'],
835
+ },
836
+
837
+ {
838
+ name: 'app/files-to-ignore',
839
+ ignores: [
840
+ '**/dist/**',
841
+ '**/dist-ssr/**',
842
+ '**/coverage/**',
843
+ ],
844
+ },
845
+
846
+ //MARK: \u6838\u5FC3\u89C4\u5219\u7EC4\uFF08\u6309\u4F18\u5148\u7EA7\u6392\u5E8F\uFF09
847
+ ${oxlintLine}${vueLine}${tsLine}
848
+ ${fileTypeOverrides}
849
+ ${jsdocBlock}${tsRules}
850
+ //! \u4EE3\u7801\u590D\u6742\u5EA6
851
+ 'max-depth': ['error', 4],
852
+ complexity: ['warn', 10],
853
+
854
+ //! \u5F02\u6B65\u4EE3\u7801\u89C4\u8303
855
+ 'no-await-in-loop': 'error',
856
+ ${vueComponentRules}
857
+ //MARK: \u683C\u5F0F\u89C4\u8303
858
+ 'no-irregular-whitespace': 'error',
859
+ 'no-multi-spaces': 'error',
860
+ 'space-infix-ops': 'error',
861
+ 'array-bracket-spacing': ['error', 'never'],
862
+ 'arrow-spacing': ['error', { before: true, after: true }],
863
+ 'max-params': ['warn', 6],
864
+ 'no-eval': 'error',
865
+ 'prefer-const': 'warn',
866
+ 'no-var': 'warn',
867
+ 'prefer-destructuring': [
868
+ 1,
869
+ { object: true, array: false },
870
+ ],
871
+ 'no-duplicate-imports': 'error',
872
+ },
873
+ },
874
+ ${ignoreAssets}${jsdocWhitelist}${skipLine}
875
+ ${wrapperEnd}
876
+ `;
877
+ await writeFileContent((0, import_node_path4.resolve)(cwd, "eslint.config.ts"), eslintConfig);
878
+ generated.push("eslint.config.ts");
879
+ }
880
+ if (features.editorconfig) {
881
+ const editorConfig = `# EditorConfig - \u7F16\u8F91\u5668\u7EDF\u4E00\u914D\u7F6E
882
+ # @generated by @robot-admin/git-standards
883
+ # \u53C2\u8003: https://editorconfig.org
884
+
885
+ root = true
886
+
887
+ [*]
888
+ charset = utf-8
889
+ indent_style = space
890
+ indent_size = 2
891
+ end_of_line = lf
892
+ insert_final_newline = true
893
+ trim_trailing_whitespace = true
894
+
895
+ [*.md]
896
+ trim_trailing_whitespace = false
897
+
898
+ [*.{yml,yaml}]
899
+ indent_size = 2
900
+
901
+ [Makefile]
902
+ indent_style = tab
903
+ `;
904
+ await writeFileContent((0, import_node_path4.resolve)(cwd, ".editorconfig"), editorConfig);
905
+ generated.push(".editorconfig");
906
+ }
907
+ spinner.succeed(
908
+ import_chalk.default.white("\u914D\u7F6E\u6587\u4EF6\u751F\u6210\u5B8C\u6210 ") + import_chalk.default.gray(`(${generated.join(", ")})`)
909
+ );
910
+ } catch (error) {
911
+ spinner.fail(import_chalk.default.red("\u914D\u7F6E\u6587\u4EF6\u751F\u6210\u5931\u8D25"));
912
+ throw error;
913
+ }
914
+ }
915
+ async function setupHusky(cwd, pm, features) {
916
+ const spinner = (0, import_ora.default)({
917
+ text: import_chalk.default.gray("\u521D\u59CB\u5316 Husky..."),
918
+ prefixText: " ",
919
+ spinner: "dots"
920
+ }).start();
921
+ try {
922
+ const execCmd = getExecCommand(pm);
923
+ await (0, import_execa2.execa)(execCmd, ["husky", "init"], { cwd, stdio: "pipe" });
924
+ const legacyDir = (0, import_node_path4.resolve)(cwd, ".husky/_");
925
+ if ((0, import_node_fs4.existsSync)(legacyDir)) {
926
+ (0, import_node_fs4.rmSync)(legacyDir, { recursive: true, force: true });
927
+ }
928
+ const commitMsg = `${execCmd} --no-install commitlint --edit "$1"
929
+ `;
930
+ await writeFileContent((0, import_node_path4.resolve)(cwd, ".husky/commit-msg"), commitMsg);
931
+ const hooks = ["commit-msg"];
932
+ const needsPreCommit = features.eslint || features.lintStaged || features.oxlint;
933
+ if (needsPreCommit) {
934
+ const cmds = [];
935
+ if (features.oxlint) {
936
+ cmds.push(`${execCmd} oxlint --max-warnings 0`);
937
+ }
938
+ if (features.lintStaged) {
939
+ cmds.push(`${execCmd} lint-staged`);
940
+ } else if (features.eslint) {
941
+ cmds.push(`${execCmd} eslint . --fix`);
942
+ }
943
+ await writeFileContent(
944
+ (0, import_node_path4.resolve)(cwd, ".husky/pre-commit"),
945
+ cmds.join("\n") + "\n"
946
+ );
947
+ hooks.push("pre-commit");
948
+ } else {
949
+ const defaultPreCommit = (0, import_node_path4.resolve)(cwd, ".husky/pre-commit");
950
+ if ((0, import_node_fs4.existsSync)(defaultPreCommit)) {
951
+ (0, import_node_fs4.unlinkSync)(defaultPreCommit);
952
+ }
953
+ }
954
+ spinner.succeed(
955
+ import_chalk.default.white("Husky \u521D\u59CB\u5316\u5B8C\u6210 ") + import_chalk.default.gray(`(${hooks.join(", ")})`)
956
+ );
957
+ } catch (error) {
958
+ spinner.fail(import_chalk.default.red("Husky \u521D\u59CB\u5316\u5931\u8D25"));
959
+ throw error;
960
+ }
961
+ }
962
+ async function addPackageScripts(cwd, pm, features) {
963
+ const spinner = (0, import_ora.default)({
964
+ text: import_chalk.default.gray("\u66F4\u65B0 package.json..."),
965
+ prefixText: " ",
966
+ spinner: "dots"
967
+ }).start();
968
+ try {
969
+ const packageJsonPath = (0, import_node_path4.resolve)(cwd, "package.json");
970
+ const packageJson = await readJsonFile(packageJsonPath);
971
+ const scripts = packageJson.scripts || {};
972
+ scripts.cz = "git-cz";
973
+ scripts.prepare = "husky";
974
+ if (features.eslint) {
975
+ scripts.lint = features.oxlint ? "oxlint . --fix -D correctness --ignore-path .gitignore && eslint . --fix" : "eslint . --fix";
976
+ }
977
+ if (features.prettier) {
978
+ scripts.format = "prettier --write src/";
979
+ }
980
+ const czConfig = {
981
+ commitizen: { path: "node_modules/cz-customizable" }
982
+ };
983
+ const updates = { scripts, config: czConfig };
984
+ if (features.lintStaged) {
985
+ updates["lint-staged"] = generateLintStagedConfig({
986
+ eslint: features.eslint,
987
+ oxlint: features.oxlint,
988
+ prettier: features.prettier
989
+ });
990
+ }
991
+ await updatePackageJson(updates, cwd);
992
+ const parts = ["scripts"];
993
+ if (features.lintStaged) parts.push("lint-staged");
994
+ spinner.succeed(
995
+ import_chalk.default.white("package.json \u66F4\u65B0\u5B8C\u6210 ") + import_chalk.default.gray(`(${parts.join(" + ")})`)
996
+ );
997
+ } catch (error) {
998
+ spinner.fail(import_chalk.default.red("package.json \u66F4\u65B0\u5931\u8D25"));
999
+ throw error;
1000
+ }
1001
+ }
1002
+ function printCompletion(pm, features) {
1003
+ console.log();
1004
+ console.log(S.LINE);
1005
+ console.log(` ${S.OK} ${import_chalk.default.green.bold("\u521D\u59CB\u5316\u5B8C\u6210!")}`);
1006
+ console.log(S.LINE);
1007
+ console.log();
1008
+ console.log(` ${import_chalk.default.bold("\u5FEB\u901F\u5F00\u59CB:")}`);
1009
+ console.log();
1010
+ console.log(` ${S.DOT} \u63D0\u4EA4\u4EE3\u7801 ${import_chalk.default.cyan(`${pm} run cz`)}`);
1011
+ if (features.eslint) {
1012
+ console.log(` ${S.DOT} \u68C0\u67E5\u4EE3\u7801 ${import_chalk.default.cyan(`${pm} run lint`)}`);
1013
+ }
1014
+ if (features.prettier) {
1015
+ console.log(` ${S.DOT} \u683C\u5F0F\u5316 ${import_chalk.default.cyan(`${pm} run format`)}`);
1016
+ }
1017
+ console.log();
1018
+ console.log(
1019
+ ` ${S.INFO} ${import_chalk.default.gray("\u5168\u5C40\u5B89\u88C5 commitizen \u540E\u53EF\u76F4\u63A5\u4F7F\u7528 git cz \u63D0\u4EA4")}`
1020
+ );
1021
+ console.log(` ${S.DOT} ${import_chalk.default.gray(`npm install -g commitizen`)}`);
1022
+ console.log();
1023
+ console.log(
1024
+ ` ${S.INFO} ${import_chalk.default.gray("\u6240\u6709\u914D\u7F6E\u6587\u4EF6\u5747\u652F\u6301\u8986\u76D6\u6269\u5C55\uFF0C\u8BE6\u89C1 README.md")}`
1025
+ );
1026
+ console.log();
1027
+ }
1028
+ // Annotate the CommonJS export names for ESM import in node:
1029
+ 0 && (module.exports = {
1030
+ init
1031
+ });
1032
+ //# sourceMappingURL=init.cjs.map