@aiot-toolkit/shared-utils 2.0.2-beta.13 → 2.0.2-beta.14
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.
|
@@ -9,6 +9,12 @@ declare enum ProjectType {
|
|
|
9
9
|
declare namespace ProjectType {
|
|
10
10
|
/**
|
|
11
11
|
* 获取项目类型
|
|
12
|
+
*
|
|
13
|
+
* 1. 存在`app/app.xts`:velaXts项目
|
|
14
|
+
* 2. 存在`src/app.ux`
|
|
15
|
+
* 1. `src/manifest.json`文件的 `deviceTypeList` 字段包含`watch`:velaUx
|
|
16
|
+
* 2. 否则:androidUx
|
|
17
|
+
* 3. 否则:velaUx
|
|
12
18
|
* @param projectPath
|
|
13
19
|
* @returns
|
|
14
20
|
*/
|
package/lib/enum/ProjectType.js
CHANGED
|
@@ -17,6 +17,12 @@ var ProjectType;
|
|
|
17
17
|
(function (ProjectType) {
|
|
18
18
|
/**
|
|
19
19
|
* 获取项目类型
|
|
20
|
+
*
|
|
21
|
+
* 1. 存在`app/app.xts`:velaXts项目
|
|
22
|
+
* 2. 存在`src/app.ux`
|
|
23
|
+
* 1. `src/manifest.json`文件的 `deviceTypeList` 字段包含`watch`:velaUx
|
|
24
|
+
* 2. 否则:androidUx
|
|
25
|
+
* 3. 否则:velaUx
|
|
20
26
|
* @param projectPath
|
|
21
27
|
* @returns
|
|
22
28
|
*/
|
|
@@ -26,7 +32,7 @@ var ProjectType;
|
|
|
26
32
|
if (isXts) {
|
|
27
33
|
return ProjectType.VELA_XTS;
|
|
28
34
|
}
|
|
29
|
-
const isUx = fs_extra_1.default.existsSync(path_1.default.resolve(projectPath, '
|
|
35
|
+
const isUx = fs_extra_1.default.existsSync(path_1.default.resolve(projectPath, src, 'app.ux'));
|
|
30
36
|
if (isUx) {
|
|
31
37
|
const mainfest = fs_extra_1.default.readJSONSync(path_1.default.join(projectPath, src, 'manifest.json'));
|
|
32
38
|
const isVela = (_a = mainfest.deviceTypeList) === null || _a === void 0 ? void 0 : _a.includes('watch');
|
|
@@ -41,7 +41,7 @@ declare class CommonUtil {
|
|
|
41
41
|
* @returns
|
|
42
42
|
*/
|
|
43
43
|
static validateJson(json: JSON, schema: JSONSchemaType): Error[] | undefined;
|
|
44
|
-
static outputQRCodeOnTerminal(text: string): void
|
|
44
|
+
static outputQRCodeOnTerminal(text: string): Promise<void>;
|
|
45
45
|
/**
|
|
46
46
|
* 终端环境下处理日志列表
|
|
47
47
|
*
|
package/lib/utils/CommonUtil.js
CHANGED
|
@@ -7,7 +7,7 @@ const crypto_1 = __importDefault(require("crypto"));
|
|
|
7
7
|
const ajv_1 = __importDefault(require("ajv"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const
|
|
10
|
+
const qrcode_1 = __importDefault(require("qrcode"));
|
|
11
11
|
const ColorConsole_1 = __importDefault(require("../ColorConsole"));
|
|
12
12
|
const ILog_1 = require("../interface/ILog");
|
|
13
13
|
/**
|
|
@@ -108,7 +108,9 @@ class CommonUtil {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
static outputQRCodeOnTerminal(text) {
|
|
111
|
-
|
|
111
|
+
return qrcode_1.default.toString(text, { type: 'utf8', margin: 0 }).then((qrcode) => {
|
|
112
|
+
console.log(qrcode);
|
|
113
|
+
});
|
|
112
114
|
}
|
|
113
115
|
/**
|
|
114
116
|
* 终端环境下处理日志列表
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiot-toolkit/shared-utils",
|
|
3
|
-
"version": "2.0.2-beta.
|
|
3
|
+
"version": "2.0.2-beta.14",
|
|
4
4
|
"description": "The common method functions of the aiot-toolkit.",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,21 +17,25 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"ajv": "^8.12.0",
|
|
20
|
+
"ansi-colors": "^4.1.3",
|
|
20
21
|
"chalk": "^4.0.0",
|
|
22
|
+
"cli-progress": "^3.12.0",
|
|
21
23
|
"dayjs": "^1.11.9",
|
|
22
24
|
"fs-extra": "^11.2.0",
|
|
23
25
|
"koa": "^2.15.3",
|
|
24
26
|
"koa-router": "^12.0.1",
|
|
25
27
|
"koa-static": "^5.0.0",
|
|
26
28
|
"portfinder": "^1.0.32",
|
|
27
|
-
"qrcode
|
|
29
|
+
"qrcode": "^1.5.4",
|
|
30
|
+
"simple-git": "^3.25.0"
|
|
28
31
|
},
|
|
29
32
|
"devDependencies": {
|
|
33
|
+
"@types/cli-progress": "^3.11.6",
|
|
30
34
|
"@types/fs-extra": "^11.0.4",
|
|
31
35
|
"@types/koa": "^2.15.0",
|
|
32
36
|
"@types/koa-router": "^7.4.8",
|
|
33
37
|
"@types/koa-static": "^4.0.4",
|
|
34
|
-
"@types/qrcode
|
|
38
|
+
"@types/qrcode": "^1.5.5"
|
|
35
39
|
},
|
|
36
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "c6093733d0267d2d1359fec0af8f7a253955e3e3"
|
|
37
41
|
}
|