@tarojs/service 3.4.0-beta.2 → 3.4.2
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/Config.js +2 -2
- package/dist/Kernel.d.ts +1 -0
- package/dist/Kernel.js +12 -10
- package/package.json +7 -6
- package/src/Config.ts +1 -1
- package/src/Kernel.ts +13 -10
package/dist/Config.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const fs = require("fs-extra");
|
|
5
|
-
const
|
|
5
|
+
const merge = require("webpack-merge");
|
|
6
6
|
const helper_1 = require("@tarojs/helper");
|
|
7
7
|
const constants_1 = require("./utils/constants");
|
|
8
8
|
class Config {
|
|
@@ -23,7 +23,7 @@ class Config {
|
|
|
23
23
|
]
|
|
24
24
|
});
|
|
25
25
|
try {
|
|
26
|
-
this.initialConfig = helper_1.getModuleDefaultExport(require(this.configPath))(
|
|
26
|
+
this.initialConfig = helper_1.getModuleDefaultExport(require(this.configPath))(merge);
|
|
27
27
|
this.isInitSuccess = true;
|
|
28
28
|
}
|
|
29
29
|
catch (err) {
|
package/dist/Kernel.d.ts
CHANGED
package/dist/Kernel.js
CHANGED
|
@@ -233,6 +233,17 @@ class Kernel extends events_1.EventEmitter {
|
|
|
233
233
|
setRunOpts(opts) {
|
|
234
234
|
this.runOpts = opts;
|
|
235
235
|
}
|
|
236
|
+
runHelp(name) {
|
|
237
|
+
const command = this.commands.get(name);
|
|
238
|
+
const defaultOptionsMap = new Map();
|
|
239
|
+
defaultOptionsMap.set('-h, --help', 'output usage information');
|
|
240
|
+
let customOptionsMap = new Map();
|
|
241
|
+
if (command === null || command === void 0 ? void 0 : command.optionsMap) {
|
|
242
|
+
customOptionsMap = new Map(Object.entries(command === null || command === void 0 ? void 0 : command.optionsMap));
|
|
243
|
+
}
|
|
244
|
+
const optionsMap = new Map([...customOptionsMap, ...defaultOptionsMap]);
|
|
245
|
+
utils_1.printHelpLog(name, optionsMap, (command === null || command === void 0 ? void 0 : command.synopsisList) ? new Set(command === null || command === void 0 ? void 0 : command.synopsisList) : new Set());
|
|
246
|
+
}
|
|
236
247
|
run(args) {
|
|
237
248
|
var _a;
|
|
238
249
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -257,16 +268,7 @@ class Kernel extends events_1.EventEmitter {
|
|
|
257
268
|
throw new Error(`${name} 命令不存在`);
|
|
258
269
|
}
|
|
259
270
|
if (opts === null || opts === void 0 ? void 0 : opts.isHelp) {
|
|
260
|
-
|
|
261
|
-
const defaultOptionsMap = new Map();
|
|
262
|
-
defaultOptionsMap.set('-h, --help', 'output usage information');
|
|
263
|
-
let customOptionsMap = new Map();
|
|
264
|
-
if (command === null || command === void 0 ? void 0 : command.optionsMap) {
|
|
265
|
-
customOptionsMap = new Map(Object.entries(command === null || command === void 0 ? void 0 : command.optionsMap));
|
|
266
|
-
}
|
|
267
|
-
const optionsMap = new Map([...customOptionsMap, ...defaultOptionsMap]);
|
|
268
|
-
utils_1.printHelpLog(name, optionsMap, (command === null || command === void 0 ? void 0 : command.synopsisList) ? new Set(command === null || command === void 0 ? void 0 : command.synopsisList) : new Set());
|
|
269
|
-
return;
|
|
271
|
+
return this.runHelp(name);
|
|
270
272
|
}
|
|
271
273
|
if ((_a = opts === null || opts === void 0 ? void 0 : opts.options) === null || _a === void 0 ? void 0 : _a.platform) {
|
|
272
274
|
opts.config = this.runWithPlatform(opts.options.platform);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/service",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Taro Service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -34,13 +34,14 @@
|
|
|
34
34
|
"homepage": "https://github.com/NervJS/taro#readme",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@hapi/joi": "17.1.1",
|
|
37
|
-
"@tarojs/helper": "3.4.
|
|
38
|
-
"@tarojs/shared": "3.4.
|
|
39
|
-
"@tarojs/taro": "3.4.
|
|
37
|
+
"@tarojs/helper": "3.4.2",
|
|
38
|
+
"@tarojs/shared": "3.4.2",
|
|
39
|
+
"@tarojs/taro": "3.4.2",
|
|
40
40
|
"fs-extra": "^8.0.1",
|
|
41
41
|
"lodash": "^4.17.21",
|
|
42
42
|
"resolve": "^1.6.0",
|
|
43
|
-
"tapable": "^1.1.3"
|
|
43
|
+
"tapable": "^1.1.3",
|
|
44
|
+
"webpack-merge": "^4.2.2"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "26b329326c6a7da652e8d712ee33df01ab8d2d0e"
|
|
46
47
|
}
|
package/src/Config.ts
CHANGED
package/src/Kernel.ts
CHANGED
|
@@ -280,6 +280,18 @@ export default class Kernel extends EventEmitter {
|
|
|
280
280
|
this.runOpts = opts
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
runHelp (name: string) {
|
|
284
|
+
const command = this.commands.get(name)
|
|
285
|
+
const defaultOptionsMap = new Map()
|
|
286
|
+
defaultOptionsMap.set('-h, --help', 'output usage information')
|
|
287
|
+
let customOptionsMap = new Map()
|
|
288
|
+
if (command?.optionsMap) {
|
|
289
|
+
customOptionsMap = new Map(Object.entries(command?.optionsMap))
|
|
290
|
+
}
|
|
291
|
+
const optionsMap = new Map([...customOptionsMap, ...defaultOptionsMap])
|
|
292
|
+
printHelpLog(name, optionsMap, command?.synopsisList ? new Set(command?.synopsisList) : new Set())
|
|
293
|
+
}
|
|
294
|
+
|
|
283
295
|
async run (args: string | { name: string, opts?: any }) {
|
|
284
296
|
let name
|
|
285
297
|
let opts
|
|
@@ -301,16 +313,7 @@ export default class Kernel extends EventEmitter {
|
|
|
301
313
|
throw new Error(`${name} 命令不存在`)
|
|
302
314
|
}
|
|
303
315
|
if (opts?.isHelp) {
|
|
304
|
-
|
|
305
|
-
const defaultOptionsMap = new Map()
|
|
306
|
-
defaultOptionsMap.set('-h, --help', 'output usage information')
|
|
307
|
-
let customOptionsMap = new Map()
|
|
308
|
-
if (command?.optionsMap) {
|
|
309
|
-
customOptionsMap = new Map(Object.entries(command?.optionsMap))
|
|
310
|
-
}
|
|
311
|
-
const optionsMap = new Map([...customOptionsMap, ...defaultOptionsMap])
|
|
312
|
-
printHelpLog(name, optionsMap, command?.synopsisList ? new Set(command?.synopsisList) : new Set())
|
|
313
|
-
return
|
|
316
|
+
return this.runHelp(name)
|
|
314
317
|
}
|
|
315
318
|
if (opts?.options?.platform) {
|
|
316
319
|
opts.config = this.runWithPlatform(opts.options.platform)
|