aiot-toolkit 2.0.2-dev.4 → 2.0.2-dev.5
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/lib/builder/UxBuilder.js
CHANGED
|
@@ -32,6 +32,7 @@ const file_lane_1 = require("file-lane");
|
|
|
32
32
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
33
33
|
const lodash_1 = __importDefault(require("lodash"));
|
|
34
34
|
const path_1 = __importDefault(require("path"));
|
|
35
|
+
const UxBuilderUtils_1 = __importDefault(require("../utils/UxBuilderUtils"));
|
|
35
36
|
/**
|
|
36
37
|
* UxBuilder
|
|
37
38
|
*/
|
|
@@ -44,6 +45,7 @@ class UxBuilder {
|
|
|
44
45
|
description: 'inject test-suite for current project'
|
|
45
46
|
},
|
|
46
47
|
{
|
|
48
|
+
type: 'string',
|
|
47
49
|
name: 'devtool',
|
|
48
50
|
description: 'source map config'
|
|
49
51
|
},
|
|
@@ -55,8 +57,7 @@ class UxBuilder {
|
|
|
55
57
|
type: 'confirm',
|
|
56
58
|
name: 'disabled-jsc',
|
|
57
59
|
description: 'disabled jsc bundle',
|
|
58
|
-
defaultValue: false
|
|
59
|
-
enableInquirer: true
|
|
60
|
+
defaultValue: false
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
name: 'enable-protobuf',
|
|
@@ -86,7 +87,8 @@ class UxBuilder {
|
|
|
86
87
|
projectPath: path_1.default.join(projectPath, uxProjectConfig.output),
|
|
87
88
|
mode: options.mode || CompileMode_1.default.DEVELOPMENT,
|
|
88
89
|
disabledJSC: options.disabledJsc,
|
|
89
|
-
enableProtobuf: options.enableProtobuf
|
|
90
|
+
enableProtobuf: options.enableProtobuf,
|
|
91
|
+
devtool: UxBuilderUtils_1.default.getDevtoolValue(options.mode, options.devtool)
|
|
90
92
|
}, JavascriptDefaultCompileOption_1.default, otherConfig);
|
|
91
93
|
ColorConsole_1.default.info('start build: ', {
|
|
92
94
|
style: ColorConsole_1.default.getStyle(shared_utils_1.LOG_LEVEL.Info),
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ColorConsole_1 = __importDefault(require("@aiot-toolkit/shared-utils/lib/ColorConsole"));
|
|
7
|
+
/**
|
|
8
|
+
* UxBuilderUtils
|
|
9
|
+
*/
|
|
10
|
+
class UxBuilderUtils {
|
|
11
|
+
static getDevtoolValue(mode, devtool) {
|
|
12
|
+
const sourcemaps = {
|
|
13
|
+
development: {
|
|
14
|
+
default: 'cheap-source-map',
|
|
15
|
+
options: [
|
|
16
|
+
false,
|
|
17
|
+
'cheap-source-map',
|
|
18
|
+
'cheap-module-source-map',
|
|
19
|
+
'inline-cheap-source-map',
|
|
20
|
+
'inline-cheap-module-source-map',
|
|
21
|
+
'source-map',
|
|
22
|
+
'inline-source-map',
|
|
23
|
+
'hidden-source-map',
|
|
24
|
+
'nosources-source-map'
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
production: {
|
|
28
|
+
default: false,
|
|
29
|
+
options: [
|
|
30
|
+
false,
|
|
31
|
+
'cheap-source-map',
|
|
32
|
+
'cheap-module-source-map',
|
|
33
|
+
'source-map',
|
|
34
|
+
'hidden-source-map',
|
|
35
|
+
'nosources-source-map'
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const sourcemapArr = sourcemaps[mode].options;
|
|
40
|
+
const defaultSourcemap = sourcemaps[mode].default;
|
|
41
|
+
if (typeof devtool !== 'string' && typeof devtool !== 'boolean') {
|
|
42
|
+
return defaultSourcemap;
|
|
43
|
+
}
|
|
44
|
+
if (sourcemapArr.indexOf(devtool) === -1) {
|
|
45
|
+
ColorConsole_1.default.warn(`The devtool in ${mode} mode does not support '${devtool}', change to default '${defaultSourcemap}'`);
|
|
46
|
+
return defaultSourcemap;
|
|
47
|
+
}
|
|
48
|
+
return devtool;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = UxBuilderUtils;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiot-toolkit",
|
|
3
|
-
"version": "2.0.2-dev.
|
|
3
|
+
"version": "2.0.2-dev.5",
|
|
4
4
|
"description": "Tools for creating, developing, and packaging aiot applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aiot"
|
|
@@ -21,22 +21,22 @@
|
|
|
21
21
|
"test": "node ./__tests__/aiot-toolkit.test.js"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@aiot-toolkit/commander": "2.0.2-dev.
|
|
25
|
-
"@aiot-toolkit/emulator": "2.0.2-dev.
|
|
26
|
-
"@aiot-toolkit/shared-utils": "2.0.2-dev.
|
|
24
|
+
"@aiot-toolkit/commander": "2.0.2-dev.5",
|
|
25
|
+
"@aiot-toolkit/emulator": "2.0.2-dev.5",
|
|
26
|
+
"@aiot-toolkit/shared-utils": "2.0.2-dev.5",
|
|
27
27
|
"@miwt/adb": "^0.7.1",
|
|
28
28
|
"adb-commander": "^0.1.9",
|
|
29
29
|
"adm-zip": "^0.5.10",
|
|
30
30
|
"axios": "^1.5.0",
|
|
31
31
|
"cli-progress": "^3.12.0",
|
|
32
|
-
"create-aiot": "2.0.2-dev.
|
|
32
|
+
"create-aiot": "2.0.2-dev.5",
|
|
33
33
|
"fast-glob": "^3.3.2",
|
|
34
|
-
"file-lane": "2.0.2-dev.
|
|
34
|
+
"file-lane": "2.0.2-dev.5",
|
|
35
35
|
"ws": "^8.15.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/adm-zip": "^0.5.4",
|
|
39
39
|
"@types/ws": "^8.5.10"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "0c123fdd458966a4ca438cca03cc9efc2b5f634c"
|
|
42
42
|
}
|