create-unibest 4.0.5 → 4.0.7
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 +85 -77
- package/features/i18n/hooks.js +7 -0
- package/features/login/hooks.js +7 -0
- package/package.json +1 -1
- package/features/i18n/hooks.ts +0 -9
- package/features/login/hooks.ts +0 -9
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import process6 from "process";
|
|
5
|
-
import { green as
|
|
5
|
+
import { green as green5, yellow as yellow4 } from "kolorist";
|
|
6
6
|
import minimist from "minimist";
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
|
-
var version = "4.0.
|
|
9
|
+
var version = "4.0.7";
|
|
10
10
|
var package_default = {
|
|
11
11
|
name: "create-unibest",
|
|
12
12
|
type: "module",
|
|
@@ -56,8 +56,8 @@ var package_default = {
|
|
|
56
56
|
import fs4 from "fs";
|
|
57
57
|
import path3 from "path";
|
|
58
58
|
import process2 from "process";
|
|
59
|
-
import { cancel, intro, isCancel, log, multiselect } from "@clack/prompts";
|
|
60
|
-
import { bold as bold2, green
|
|
59
|
+
import { cancel, intro, isCancel, log as log2, multiselect } from "@clack/prompts";
|
|
60
|
+
import { bold as bold2, green } from "kolorist";
|
|
61
61
|
|
|
62
62
|
// src/features/interface.ts
|
|
63
63
|
var AVAILABLE_FEATURES = [
|
|
@@ -99,7 +99,7 @@ var __filename = fileURLToPath(import.meta.url);
|
|
|
99
99
|
var __dirname = path.dirname(__filename);
|
|
100
100
|
var FEATURES_DIR = path.resolve(__dirname, "..", "features");
|
|
101
101
|
async function loadFeatureHooks(featureName) {
|
|
102
|
-
const hooksPath = path.join(FEATURES_DIR, featureName, "hooks.
|
|
102
|
+
const hooksPath = path.join(FEATURES_DIR, featureName, "hooks.js");
|
|
103
103
|
if (!fs.existsSync(hooksPath)) {
|
|
104
104
|
return null;
|
|
105
105
|
}
|
|
@@ -254,27 +254,37 @@ async function injectLogin(projectPath) {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
// src/utils/logger.ts
|
|
257
|
-
import {
|
|
257
|
+
import { log, spinner } from "@clack/prompts";
|
|
258
|
+
import { bold, red } from "kolorist";
|
|
258
259
|
var logger = {
|
|
259
260
|
/** 普通信息日志 */
|
|
260
261
|
info: (message) => {
|
|
261
|
-
|
|
262
|
+
log.info(bold(message));
|
|
262
263
|
},
|
|
263
264
|
/** 成功日志 */
|
|
264
265
|
success: (message) => {
|
|
265
|
-
|
|
266
|
+
log.success(bold(message));
|
|
266
267
|
},
|
|
267
268
|
/** 错误日志 */
|
|
268
269
|
error: (message) => {
|
|
269
|
-
|
|
270
|
+
log.error(bold(message));
|
|
270
271
|
},
|
|
271
272
|
/** 警告日志 */
|
|
272
273
|
warn: (message) => {
|
|
273
|
-
|
|
274
|
+
log.warn(bold(message));
|
|
274
275
|
},
|
|
275
276
|
/** 提示日志 */
|
|
276
277
|
tip: (message) => {
|
|
277
|
-
|
|
278
|
+
log.info(bold(message));
|
|
279
|
+
},
|
|
280
|
+
/** 开始一个带有 spinner 的任务 */
|
|
281
|
+
start: (message) => {
|
|
282
|
+
const s = spinner();
|
|
283
|
+
s.start(bold(message));
|
|
284
|
+
return {
|
|
285
|
+
stop: (msg) => s.stop(msg ? bold(msg) : void 0),
|
|
286
|
+
fail: (msg) => s.stop(msg ? bold(red(msg)) : void 0)
|
|
287
|
+
};
|
|
278
288
|
}
|
|
279
289
|
};
|
|
280
290
|
|
|
@@ -345,7 +355,7 @@ async function addFeature(featureName, projectPath, options = {}) {
|
|
|
345
355
|
logger.warn(`Feature ${featureName} \u5DF2\u6DFB\u52A0\u8FC7\uFF0C\u5982\u9700\u91CD\u65B0\u6CE8\u5165\u8BF7\u4F7F\u7528 --force \u53C2\u6570`);
|
|
346
356
|
return true;
|
|
347
357
|
}
|
|
348
|
-
|
|
358
|
+
log2.info(`\u6B63\u5728\u6DFB\u52A0 Feature: ${green(featureName)} - ${feature.description}`);
|
|
349
359
|
try {
|
|
350
360
|
let results;
|
|
351
361
|
switch (featureName) {
|
|
@@ -392,7 +402,7 @@ async function addCommand(args) {
|
|
|
392
402
|
feature: args._[1] || args.feature || args.f,
|
|
393
403
|
force: args.force || args.f
|
|
394
404
|
};
|
|
395
|
-
intro(bold2(
|
|
405
|
+
intro(bold2(green(`create-unibest@v${version} \u6DFB\u52A0 Feature`)));
|
|
396
406
|
const projectPath = path3.isAbsolute(options.path) ? options.path : path3.join(process2.cwd(), options.path);
|
|
397
407
|
const pkgPath = path3.join(projectPath, "package.json");
|
|
398
408
|
if (!fs4.existsSync(pkgPath)) {
|
|
@@ -452,7 +462,7 @@ import { text, multiselect as multiselect2, select, confirm, cancel as cancel2,
|
|
|
452
462
|
|
|
453
463
|
// src/utils/validate.ts
|
|
454
464
|
import { existsSync } from "fs";
|
|
455
|
-
import { yellow
|
|
465
|
+
import { yellow } from "kolorist";
|
|
456
466
|
import { join } from "path";
|
|
457
467
|
function validateProjectName(name) {
|
|
458
468
|
const reg = /^[a-zA-Z0-9_-]+$/;
|
|
@@ -467,16 +477,16 @@ function validateProjectName(name) {
|
|
|
467
477
|
function checkProjectNameExistAndValidate(_projectName) {
|
|
468
478
|
const projectName = _projectName.trim();
|
|
469
479
|
if (existsSync(join(process.cwd(), projectName))) {
|
|
470
|
-
return `\u76EE\u5F55 ${
|
|
480
|
+
return `\u76EE\u5F55 ${yellow(projectName)} \u5DF2\u5B58\u5728\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6\u540D\u79F0`;
|
|
471
481
|
}
|
|
472
482
|
if (!validateProjectName(projectName)) {
|
|
473
|
-
return `\u9879\u76EE\u540D\u79F0 ${
|
|
483
|
+
return `\u9879\u76EE\u540D\u79F0 ${yellow(projectName)} \u4E0D\u7B26\u5408\u89C4\u8303\uFF0C\u8BF7\u4F7F\u7528\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u8FDE\u5B57\u7B26\u6216\u4E0B\u5212\u7EBF`;
|
|
474
484
|
}
|
|
475
485
|
return "";
|
|
476
486
|
}
|
|
477
487
|
|
|
478
488
|
// src/commands/create/prompts.ts
|
|
479
|
-
import { green as
|
|
489
|
+
import { green as green2, red as red2 } from "kolorist";
|
|
480
490
|
import process3 from "process";
|
|
481
491
|
var VALID_PLATFORMS = ["h5", "mp-weixin", "app", "mp-alipay", "mp-toutiao"];
|
|
482
492
|
var VALID_UI_LIBRARIES = ["none", "wot-ui", "uview-pro", "sard-uniapp", "uv-ui", "uview-plus"];
|
|
@@ -525,7 +535,7 @@ async function promptUser(projectName, argv = {}) {
|
|
|
525
535
|
try {
|
|
526
536
|
if (!projectName) {
|
|
527
537
|
const inputProjectName = await text({
|
|
528
|
-
message: `\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0${
|
|
538
|
+
message: `\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0${green2("[\u9879\u76EE\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u548C\u77ED\u6A2A\u7EBF\uFF0C\u5343\u4E07\u522B\u5199\u4E2D\u6587]")}`,
|
|
529
539
|
initialValue: "",
|
|
530
540
|
validate: (value) => {
|
|
531
541
|
if (!value.trim()) return "\u9879\u76EE\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";
|
|
@@ -542,7 +552,7 @@ async function promptUser(projectName, argv = {}) {
|
|
|
542
552
|
}
|
|
543
553
|
if (!platforms) {
|
|
544
554
|
const selectedPlatforms = await multiselect2({
|
|
545
|
-
message: `\u8BF7\u9009\u62E9\u9700\u8981\u652F\u6301\u7684\u5E73\u53F0\uFF08\u591A\u9009\uFF09${
|
|
555
|
+
message: `\u8BF7\u9009\u62E9\u9700\u8981\u652F\u6301\u7684\u5E73\u53F0\uFF08\u591A\u9009\uFF09${green2("[\u811A\u624B\u67B6\u5C06\u6839\u636E\u6240\u9009\u5E73\u53F0\u751F\u6210\u5BF9\u5E94\u7684\u5E73\u53F0\u4EE3\u7801\uFF0C\u8BF7\u6839\u636E\u5B9E\u9645\u60C5\u51B5\u9009\u62E9]")}`,
|
|
546
556
|
options: [
|
|
547
557
|
{ value: "h5", label: "H5" },
|
|
548
558
|
{ value: "mp-weixin", label: "\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F" },
|
|
@@ -581,7 +591,7 @@ async function promptUser(projectName, argv = {}) {
|
|
|
581
591
|
}
|
|
582
592
|
if (loginStrategy === void 0) {
|
|
583
593
|
const selectedLoginStrategy = await confirm({
|
|
584
|
-
message: `\u662F\u5426\u9700\u8981\u767B\u5F55\u7B56\u7565\uFF08\u9ED1\u767D\u540D\u5355\u3001\u767B\u5F55\u62E6\u622A\u7B49\uFF09\uFF1F${
|
|
594
|
+
message: `\u662F\u5426\u9700\u8981\u767B\u5F55\u7B56\u7565\uFF08\u9ED1\u767D\u540D\u5355\u3001\u767B\u5F55\u62E6\u622A\u7B49\uFF09\uFF1F${green2("[\u6682\u4E0D\u77E5\u9053\u7684\uFF0C\u9009No\u5373\u53EF\uFF0C\u9879\u76EE\u751F\u6210\u540E\u4E5F\u53EF\u4EE5\u52A0\u8BE5\u7B56\u7565]")}`,
|
|
585
595
|
initialValue: false
|
|
586
596
|
});
|
|
587
597
|
if (isCancel2(selectedLoginStrategy)) {
|
|
@@ -618,15 +628,17 @@ async function promptUser(projectName, argv = {}) {
|
|
|
618
628
|
}
|
|
619
629
|
|
|
620
630
|
// src/commands/create/generate.ts
|
|
631
|
+
import path4 from "path";
|
|
621
632
|
import process5 from "process";
|
|
622
|
-
import { log as
|
|
633
|
+
import { log as log4 } from "@clack/prompts";
|
|
623
634
|
|
|
624
635
|
// src/utils/cloneRepo.ts
|
|
625
636
|
import { exec } from "child_process";
|
|
626
637
|
import { promises as fsPromises } from "fs";
|
|
627
|
-
import {
|
|
628
|
-
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
638
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
629
639
|
import process4 from "process";
|
|
640
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
641
|
+
import { log as log3 } from "@clack/prompts";
|
|
630
642
|
import { red as red3 } from "kolorist";
|
|
631
643
|
|
|
632
644
|
// src/utils/replacePackageJson.ts
|
|
@@ -687,7 +699,8 @@ var __dirname3 = dirname2(__filename3);
|
|
|
687
699
|
var USE_LOCAL_TEMPLATE = process4.env.LOCAL_TEMPLATE === "true";
|
|
688
700
|
var TEMPLATE_BASE_PATH = null;
|
|
689
701
|
async function getTemplateBasePath() {
|
|
690
|
-
if (TEMPLATE_BASE_PATH)
|
|
702
|
+
if (TEMPLATE_BASE_PATH)
|
|
703
|
+
return TEMPLATE_BASE_PATH;
|
|
691
704
|
const candidates = [
|
|
692
705
|
join3(__dirname3, "..", "..", "..", "packages", "template-base"),
|
|
693
706
|
join3(__dirname3, "..", "..", "packages", "template-base")
|
|
@@ -707,36 +720,34 @@ async function removeGitFolder(localPath) {
|
|
|
707
720
|
}
|
|
708
721
|
var REPO_URL = "https://gitee.com/feige996/unibest.git";
|
|
709
722
|
async function cloneRepo(projectName, branch) {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
723
|
+
log3.info("\u4ECE Git \u514B\u9686\u57FA\u7840\u6A21\u677F...");
|
|
724
|
+
await new Promise((resolve, reject) => {
|
|
725
|
+
const execStr = `git clone --depth=1 -b ${branch} ${REPO_URL} "${projectName}"`;
|
|
726
|
+
exec(execStr, async (error) => {
|
|
727
|
+
if (error) {
|
|
728
|
+
log3.error(`${red3("\u514B\u9686\u6A21\u677F\u5931\u8D25:")} ${error}`);
|
|
729
|
+
reject(error);
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
try {
|
|
733
|
+
await removeGitFolder(projectName);
|
|
734
|
+
resolve();
|
|
735
|
+
} catch (error2) {
|
|
736
|
+
log3.error(`${red3("\u79FB\u9664 .git \u6587\u4EF6\u5939\u5931\u8D25:")} ${error2}`);
|
|
737
|
+
reject(error2);
|
|
738
|
+
}
|
|
726
739
|
});
|
|
727
|
-
|
|
728
|
-
} catch (error) {
|
|
729
|
-
console.error(`${red3("cloneRepo error:")} ${error}`);
|
|
730
|
-
throw new Error("cloneRepo error");
|
|
731
|
-
}
|
|
740
|
+
});
|
|
732
741
|
}
|
|
733
742
|
async function copyLocalTemplate(projectName) {
|
|
734
743
|
const projectPath = join3(process4.cwd(), projectName);
|
|
735
744
|
const sourcePath = await getTemplateBasePath();
|
|
745
|
+
log3.info("\u4F7F\u7528\u672C\u5730\u6A21\u677F...");
|
|
736
746
|
await new Promise((resolve, reject) => {
|
|
737
747
|
const execStr = `cp -r "${sourcePath}/." "${projectPath}/"`;
|
|
738
748
|
exec(execStr, (error) => {
|
|
739
749
|
if (error) {
|
|
750
|
+
log3.error(`${red3("\u590D\u5236\u6A21\u677F\u5931\u8D25:")} ${error}`);
|
|
740
751
|
reject(error);
|
|
741
752
|
} else {
|
|
742
753
|
resolve();
|
|
@@ -748,20 +759,28 @@ async function copyLocalTemplate(projectName) {
|
|
|
748
759
|
async function cloneRepoByBranch(root2, name, branch, options) {
|
|
749
760
|
try {
|
|
750
761
|
if (USE_LOCAL_TEMPLATE) {
|
|
751
|
-
console.log("\u4F7F\u7528\u672C\u5730\u6A21\u677F\u6D4B\u8BD5...");
|
|
752
762
|
await copyLocalTemplate(name);
|
|
753
763
|
} else {
|
|
754
|
-
console.log("\u4ECE Git \u514B\u9686\u57FA\u7840\u6A21\u677F...");
|
|
755
764
|
await cloneRepo(name, "base");
|
|
756
765
|
}
|
|
757
766
|
} catch (error) {
|
|
758
|
-
|
|
767
|
+
log3.error(`${red3(`\u6A21\u677F\u4E0B\u8F7D\u5931\u8D25\uFF01`)} ${error}`);
|
|
759
768
|
process4.exit(1);
|
|
760
769
|
}
|
|
761
770
|
const projectPath = join3(root2, name);
|
|
762
771
|
replacePackageJson(projectPath, name, "1.0.0", options);
|
|
763
772
|
}
|
|
764
773
|
|
|
774
|
+
// src/utils/debug.ts
|
|
775
|
+
import { magenta } from "kolorist";
|
|
776
|
+
function debug(...args) {
|
|
777
|
+
const isDev = process.env.NODE_ENV === "development";
|
|
778
|
+
if (isDev) {
|
|
779
|
+
const debugPrefix = magenta("[debug]");
|
|
780
|
+
console.log(debugPrefix, ...args);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
765
784
|
// src/utils/uiLibrary.ts
|
|
766
785
|
import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2 } from "fs";
|
|
767
786
|
import { join as join4 } from "path";
|
|
@@ -1107,18 +1126,7 @@ function ensureTrailingNewline(value) {
|
|
|
1107
1126
|
`;
|
|
1108
1127
|
}
|
|
1109
1128
|
|
|
1110
|
-
// src/utils/debug.ts
|
|
1111
|
-
import { magenta } from "kolorist";
|
|
1112
|
-
function debug(...args) {
|
|
1113
|
-
const isDev = process.env.NODE_ENV === "development";
|
|
1114
|
-
if (isDev) {
|
|
1115
|
-
const debugPrefix = magenta("[debug]");
|
|
1116
|
-
console.log(debugPrefix, ...args);
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
1129
|
// src/commands/create/generate.ts
|
|
1121
|
-
import path4 from "path";
|
|
1122
1130
|
var root = process5.cwd();
|
|
1123
1131
|
async function generateProject(options) {
|
|
1124
1132
|
debug("generateProject options", options);
|
|
@@ -1168,16 +1176,16 @@ async function generateProject(options) {
|
|
|
1168
1176
|
}
|
|
1169
1177
|
}
|
|
1170
1178
|
if (Object.keys(allDeps).length > 0) {
|
|
1171
|
-
|
|
1179
|
+
log4.info(`Feature \u4F9D\u8D56: ${Object.keys(allDeps).join(", ")}`);
|
|
1172
1180
|
}
|
|
1173
1181
|
try {
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1182
|
+
log4.success(`\u9879\u76EE${projectName}\u521B\u5EFA\u6210\u529F\uFF01`);
|
|
1183
|
+
console.log("\u4E0B\u4E00\u6B65:");
|
|
1184
|
+
console.log(` cd ${projectName}`);
|
|
1185
|
+
console.log(" pnpm i");
|
|
1186
|
+
console.log(" pnpm dev");
|
|
1187
|
+
console.log(" \u8FD0\u884C\u5B8C\u4EE5\u4E0A\u547D\u4EE4\u540E\uFF0C\u518D\u8FD0\u884C\u5176\u4ED6\u5E73\u53F0");
|
|
1188
|
+
console.log(" \u5982\uFF1Apnpm dev:mp, pnpm dev:app \u7B49");
|
|
1181
1189
|
} catch (error) {
|
|
1182
1190
|
logger.error(`\u751F\u6210\u9879\u76EE\u5931\u8D25: ${error.message}`);
|
|
1183
1191
|
throw error;
|
|
@@ -1185,8 +1193,8 @@ async function generateProject(options) {
|
|
|
1185
1193
|
}
|
|
1186
1194
|
|
|
1187
1195
|
// src/commands/create.ts
|
|
1188
|
-
import { intro as intro2, log as
|
|
1189
|
-
import { bold as bold3, yellow as
|
|
1196
|
+
import { intro as intro2, log as log5 } from "@clack/prompts";
|
|
1197
|
+
import { bold as bold3, yellow as yellow2, green as green3 } from "kolorist";
|
|
1190
1198
|
|
|
1191
1199
|
// src/utils/unibestVersion.ts
|
|
1192
1200
|
import fetch from "node-fetch";
|
|
@@ -1263,11 +1271,11 @@ function generateDeviceIdentifier() {
|
|
|
1263
1271
|
async function createCommand(args) {
|
|
1264
1272
|
const projectName = args._[1] || args._[0];
|
|
1265
1273
|
const versionUnibest = await getUnibestVersionFromGitee() || "4.0.0";
|
|
1266
|
-
intro2(bold3(
|
|
1274
|
+
intro2(bold3(green3(`create-unibest@v${version} \u5FEB\u901F\u521B\u5EFA ${yellow2(`unibest@v${versionUnibest}`)} \u9879\u76EE`)));
|
|
1267
1275
|
if (projectName) {
|
|
1268
1276
|
const errorMessage = checkProjectNameExistAndValidate(projectName);
|
|
1269
1277
|
if (errorMessage) {
|
|
1270
|
-
|
|
1278
|
+
log5.error(errorMessage);
|
|
1271
1279
|
process.exit(1);
|
|
1272
1280
|
}
|
|
1273
1281
|
}
|
|
@@ -1276,19 +1284,19 @@ async function createCommand(args) {
|
|
|
1276
1284
|
await generateProject(projectOptions);
|
|
1277
1285
|
beacon(projectOptions);
|
|
1278
1286
|
} catch (error) {
|
|
1279
|
-
|
|
1287
|
+
log5.error(`\u521B\u5EFA\u9879\u76EE\u5931\u8D25: ${error.message}`);
|
|
1280
1288
|
process.exit(1);
|
|
1281
1289
|
}
|
|
1282
1290
|
}
|
|
1283
1291
|
|
|
1284
1292
|
// src/utils/color.ts
|
|
1285
|
-
import { blue, green as
|
|
1293
|
+
import { blue, green as green4, magenta as magenta2, red as red4, yellow as yellow3 } from "kolorist";
|
|
1286
1294
|
var color = {
|
|
1287
1295
|
blue,
|
|
1288
|
-
green:
|
|
1296
|
+
green: green4,
|
|
1289
1297
|
magenta: magenta2,
|
|
1290
1298
|
red: red4,
|
|
1291
|
-
yellow:
|
|
1299
|
+
yellow: yellow3
|
|
1292
1300
|
};
|
|
1293
1301
|
|
|
1294
1302
|
// src/utils/help.ts
|
|
@@ -1382,8 +1390,8 @@ async function printVersion() {
|
|
|
1382
1390
|
const cliVersion = version;
|
|
1383
1391
|
const latestVersion = await getUnibestVersionFromGitee();
|
|
1384
1392
|
if (latestVersion && latestVersion !== cliVersion) {
|
|
1385
|
-
console.log(`unibest-cli ${cliVersion} ${
|
|
1386
|
-
console.log(`\u4F7F\u7528 ${
|
|
1393
|
+
console.log(`unibest-cli ${cliVersion} ${yellow4(`->`)} ${green5(`\u6700\u65B0\u7248\u672C: ${latestVersion}`)}`);
|
|
1394
|
+
console.log(`\u4F7F\u7528 ${green5(`npm update -g create-unibest`)} \u6216 ${green5(`pnpm add -g create-unibest`)} \u66F4\u65B0`);
|
|
1387
1395
|
console.log();
|
|
1388
1396
|
} else {
|
|
1389
1397
|
console.log(`unibest-cli ${cliVersion}`);
|
package/package.json
CHANGED
package/features/i18n/hooks.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { FeatureContext } from '../../packages/cli/src/features/interface'
|
|
2
|
-
|
|
3
|
-
export async function preApply(ctx: FeatureContext) {
|
|
4
|
-
console.log(`[i18n] Pre-apply for ${ctx.projectPath}`)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export async function postApply(ctx: FeatureContext) {
|
|
8
|
-
console.log(`[i18n] Post-apply for ${ctx.projectPath}`)
|
|
9
|
-
}
|
package/features/login/hooks.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { FeatureContext } from '../../packages/cli/src/features/interface'
|
|
2
|
-
|
|
3
|
-
export async function preApply(ctx: FeatureContext) {
|
|
4
|
-
console.log(`[login] Pre-apply for ${ctx.projectPath}`)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export async function postApply(ctx: FeatureContext) {
|
|
8
|
-
console.log(`[login] Post-apply for ${ctx.projectPath}`)
|
|
9
|
-
}
|