@cyber-tools/create-cyber-tools 9.2.0 → 9.3.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.
package/dist/index.js
CHANGED
|
@@ -85732,6 +85732,9 @@ var CommandLineToast = class {
|
|
|
85732
85732
|
constructor() {
|
|
85733
85733
|
this.toast = (0, import_ora.default)(import_cli_spinners.dots);
|
|
85734
85734
|
}
|
|
85735
|
+
warn(...params) {
|
|
85736
|
+
this.toast.warn(...arguments);
|
|
85737
|
+
}
|
|
85735
85738
|
start(...params) {
|
|
85736
85739
|
this.toast.start(...arguments);
|
|
85737
85740
|
}
|
|
@@ -85875,11 +85878,11 @@ var CommandLineUtils = class {
|
|
|
85875
85878
|
const isValidate = validForNewPackages && validForOldPackages;
|
|
85876
85879
|
const isAvailable = await (0, import_npm_name.default)(name2);
|
|
85877
85880
|
if (isValidate && isAvailable) {
|
|
85878
|
-
this.$CommandLineToast.
|
|
85881
|
+
this.$CommandLineToast.succeed(["\u5305\u540D(", name2, ")\u53EF\u7528!"].join(""));
|
|
85879
85882
|
return true;
|
|
85880
85883
|
}
|
|
85881
85884
|
;
|
|
85882
|
-
this.$CommandLineToast.
|
|
85885
|
+
this.$CommandLineToast.fail(["\u5305\u540D(", name2, ")\u4E0D\u53EF\u7528!"].join(""));
|
|
85883
85886
|
return false;
|
|
85884
85887
|
} catch (error) {
|
|
85885
85888
|
throw error;
|
|
@@ -85907,7 +85910,7 @@ var CommandLineUtils = class {
|
|
|
85907
85910
|
* **/
|
|
85908
85911
|
async changeJsonFile({ folderName, projectName, devDependencies }) {
|
|
85909
85912
|
try {
|
|
85910
|
-
this.$CommandLineToast.
|
|
85913
|
+
this.$CommandLineToast.start("\u4FEE\u6539package.json");
|
|
85911
85914
|
const jsonFilePath = import_path2.default.resolve(process.cwd(), folderName, "./package.json");
|
|
85912
85915
|
const jsonObject = await (0, import_util.promisify)(import_jsonfile2.readFile)(jsonFilePath);
|
|
85913
85916
|
const rewriteJsonObject = Object.assign({}, jsonObject, {
|
package/package.json
CHANGED
|
@@ -6,7 +6,11 @@ import { IOCContainer } from "@/commons/IOCContainer";
|
|
|
6
6
|
@injectable()
|
|
7
7
|
export class CommandLineToast {
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
private toast = ora(dots);
|
|
10
|
+
|
|
11
|
+
public warn(...params: any) {
|
|
12
|
+
this.toast.warn(...arguments);
|
|
13
|
+
};
|
|
10
14
|
|
|
11
15
|
public start(...params: any) {
|
|
12
16
|
this.toast.start(...arguments);
|
|
@@ -90,10 +90,10 @@ export class CommandLineUtils {
|
|
|
90
90
|
const isValidate = (validForNewPackages && validForOldPackages);
|
|
91
91
|
const isAvailable = await npmName(name);
|
|
92
92
|
if (isValidate && isAvailable) {
|
|
93
|
-
this.$CommandLineToast.
|
|
93
|
+
this.$CommandLineToast.succeed(["包名(", name, ")可用!"].join(""));
|
|
94
94
|
return true;
|
|
95
95
|
};
|
|
96
|
-
this.$CommandLineToast.
|
|
96
|
+
this.$CommandLineToast.fail(["包名(", name, ")不可用!"].join(""));
|
|
97
97
|
return false;
|
|
98
98
|
} catch (error) {
|
|
99
99
|
throw error;
|
|
@@ -121,7 +121,7 @@ export class CommandLineUtils {
|
|
|
121
121
|
* **/
|
|
122
122
|
public async changeJsonFile({ folderName, projectName, devDependencies }) {
|
|
123
123
|
try {
|
|
124
|
-
this.$CommandLineToast.
|
|
124
|
+
this.$CommandLineToast.start("修改package.json");
|
|
125
125
|
const jsonFilePath = path.resolve(process.cwd(), folderName, "./package.json");
|
|
126
126
|
const jsonObject = await promisify(readFile)(jsonFilePath);
|
|
127
127
|
const rewriteJsonObject = Object.assign({}, jsonObject, {
|