@tarojs/service 3.5.0-alpha.0 → 3.5.0-alpha.11

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 CHANGED
@@ -11,19 +11,19 @@ class Config {
11
11
  this.init();
12
12
  }
13
13
  init() {
14
- this.configPath = helper_1.resolveScriptPath(path.join(this.appPath, constants_1.CONFIG_DIR_NAME, constants_1.DEFAULT_CONFIG_FILE));
14
+ this.configPath = (0, helper_1.resolveScriptPath)(path.join(this.appPath, constants_1.CONFIG_DIR_NAME, constants_1.DEFAULT_CONFIG_FILE));
15
15
  if (!fs.existsSync(this.configPath)) {
16
16
  this.initialConfig = {};
17
17
  this.isInitSuccess = false;
18
18
  }
19
19
  else {
20
- helper_1.createSwcRegister({
20
+ (0, helper_1.createSwcRegister)({
21
21
  only: [
22
22
  filePath => filePath.indexOf(path.join(this.appPath, constants_1.CONFIG_DIR_NAME)) >= 0
23
23
  ]
24
24
  });
25
25
  try {
26
- this.initialConfig = helper_1.getModuleDefaultExport(require(this.configPath))(merge);
26
+ this.initialConfig = (0, helper_1.getModuleDefaultExport)(require(this.configPath))(merge);
27
27
  this.isInitSuccess = true;
28
28
  }
29
29
  catch (err) {
@@ -39,7 +39,7 @@ class Config {
39
39
  const outputDirName = initialConfig.outputRoot || helper_1.OUTPUT_DIR;
40
40
  const sourceDir = path.join(this.appPath, sourceDirName);
41
41
  const entryName = helper_1.ENTRY;
42
- const entryFilePath = helper_1.resolveScriptPath(path.join(sourceDir, entryName));
42
+ const entryFilePath = (0, helper_1.resolveScriptPath)(path.join(sourceDir, entryName));
43
43
  const entry = {
44
44
  [entryName]: [entryFilePath]
45
45
  };
package/dist/Kernel.js CHANGED
@@ -22,7 +22,7 @@ const Config_1 = require("./Config");
22
22
  class Kernel extends events_1.EventEmitter {
23
23
  constructor(options) {
24
24
  super();
25
- this.debugger = process.env.DEBUG === 'Taro:Kernel' ? helper_1.createDebug('Taro:Kernel') : function () { };
25
+ this.debugger = process.env.DEBUG === 'Taro:Kernel' ? (0, helper_1.createDebug)('Taro:Kernel') : function () { };
26
26
  this.appPath = options.appPath || process.cwd();
27
27
  this.optsPresets = options.presets;
28
28
  this.optsPlugins = options.plugins;
@@ -44,7 +44,7 @@ class Kernel extends events_1.EventEmitter {
44
44
  initPaths() {
45
45
  this.paths = {
46
46
  appPath: this.appPath,
47
- nodeModulesPath: helper_1.recursiveFindNodeModules(path.join(this.appPath, helper_1.NODE_MODULES))
47
+ nodeModulesPath: (0, helper_1.recursiveFindNodeModules)(path.join(this.appPath, helper_1.NODE_MODULES))
48
48
  };
49
49
  if (this.config.isInitSuccess) {
50
50
  Object.assign(this.paths, {
@@ -61,11 +61,11 @@ class Kernel extends events_1.EventEmitter {
61
61
  }
62
62
  initPresetsAndPlugins() {
63
63
  const initialConfig = this.initialConfig;
64
- const allConfigPresets = utils_1.mergePlugins(this.optsPresets || [], initialConfig.presets || [])();
65
- const allConfigPlugins = utils_1.mergePlugins(this.optsPlugins || [], initialConfig.plugins || [])();
64
+ const allConfigPresets = (0, utils_1.mergePlugins)(this.optsPresets || [], initialConfig.presets || [])();
65
+ const allConfigPlugins = (0, utils_1.mergePlugins)(this.optsPlugins || [], initialConfig.plugins || [])();
66
66
  this.debugger('initPresetsAndPlugins', allConfigPresets, allConfigPlugins);
67
67
  process.env.NODE_ENV !== 'test' &&
68
- helper_1.createSwcRegister({
68
+ (0, helper_1.createSwcRegister)({
69
69
  only: [...Object.keys(allConfigPresets), ...Object.keys(allConfigPlugins)]
70
70
  });
71
71
  this.plugins = new Map();
@@ -74,14 +74,14 @@ class Kernel extends events_1.EventEmitter {
74
74
  this.resolvePlugins(allConfigPlugins);
75
75
  }
76
76
  resolvePresets(presets) {
77
- const allPresets = utils_1.resolvePresetsOrPlugins(this.appPath, presets, constants_1.PluginType.Preset);
77
+ const allPresets = (0, utils_1.resolvePresetsOrPlugins)(this.appPath, presets, constants_1.PluginType.Preset);
78
78
  while (allPresets.length) {
79
79
  this.initPreset(allPresets.shift());
80
80
  }
81
81
  }
82
82
  resolvePlugins(plugins) {
83
- plugins = lodash_1.merge(this.extraPlugins, plugins);
84
- const allPlugins = utils_1.resolvePresetsOrPlugins(this.appPath, plugins, constants_1.PluginType.Plugin);
83
+ plugins = (0, lodash_1.merge)(this.extraPlugins, plugins);
84
+ const allPlugins = (0, utils_1.resolvePresetsOrPlugins)(this.appPath, plugins, constants_1.PluginType.Plugin);
85
85
  while (allPlugins.length) {
86
86
  this.initPlugin(allPlugins.shift());
87
87
  }
@@ -94,13 +94,13 @@ class Kernel extends events_1.EventEmitter {
94
94
  const { presets, plugins } = apply()(pluginCtx, opts) || {};
95
95
  this.registerPlugin(preset);
96
96
  if (Array.isArray(presets)) {
97
- const _presets = utils_1.resolvePresetsOrPlugins(this.appPath, utils_1.convertPluginsToObject(presets)(), constants_1.PluginType.Preset);
97
+ const _presets = (0, utils_1.resolvePresetsOrPlugins)(this.appPath, (0, utils_1.convertPluginsToObject)(presets)(), constants_1.PluginType.Preset);
98
98
  while (_presets.length) {
99
99
  this.initPreset(_presets.shift());
100
100
  }
101
101
  }
102
102
  if (Array.isArray(plugins)) {
103
- this.extraPlugins = lodash_1.merge(this.extraPlugins, utils_1.convertPluginsToObject(plugins)());
103
+ this.extraPlugins = (0, lodash_1.merge)(this.extraPlugins, (0, utils_1.convertPluginsToObject)(plugins)());
104
104
  }
105
105
  }
106
106
  initPlugin(plugin) {
@@ -238,7 +238,7 @@ class Kernel extends events_1.EventEmitter {
238
238
  customOptionsMap = new Map(Object.entries(command === null || command === void 0 ? void 0 : command.optionsMap));
239
239
  }
240
240
  const optionsMap = new Map([...customOptionsMap, ...defaultOptionsMap]);
241
- 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());
241
+ (0, 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());
242
242
  }
243
243
  run(args) {
244
244
  var _a;
package/dist/Plugin.js CHANGED
@@ -29,7 +29,7 @@ class Plugin {
29
29
  if (this.ctx.platforms.has(platform.name)) {
30
30
  throw new Error(`适配平台 ${platform.name} 已存在`);
31
31
  }
32
- helper_1.addPlatforms(platform.name);
32
+ (0, helper_1.addPlatforms)(platform.name);
33
33
  this.ctx.platforms.set(platform.name, platform);
34
34
  this.register(platform);
35
35
  }
@@ -8,7 +8,7 @@ const helper_1 = require("@tarojs/helper");
8
8
  const isNpmPkg = name => !(/^(\.|\/)/.test(name));
9
9
  exports.isNpmPkg = isNpmPkg;
10
10
  function getPluginPath(pluginPath) {
11
- if (exports.isNpmPkg(pluginPath) || path.isAbsolute(pluginPath))
11
+ if ((0, exports.isNpmPkg)(pluginPath) || path.isAbsolute(pluginPath))
12
12
  return pluginPath;
13
13
  throw new Error('plugin 和 preset 配置必须为绝对路径或者包名');
14
14
  }
@@ -36,7 +36,7 @@ function mergePlugins(dist, src) {
36
36
  return () => {
37
37
  const srcObj = convertPluginsToObject(src)();
38
38
  const distObj = convertPluginsToObject(dist)();
39
- return lodash_1.merge(distObj, srcObj);
39
+ return (0, lodash_1.merge)(distObj, srcObj);
40
40
  };
41
41
  }
42
42
  exports.mergePlugins = mergePlugins;
@@ -67,7 +67,7 @@ function resolvePresetsOrPlugins(root, args, type) {
67
67
  type,
68
68
  opts: args[item] || {},
69
69
  apply() {
70
- return helper_1.getModuleDefaultExport(require(fPath));
70
+ return (0, helper_1.getModuleDefaultExport)(require(fPath));
71
71
  }
72
72
  };
73
73
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/service",
3
- "version": "3.5.0-alpha.0",
3
+ "version": "3.5.0-alpha.11",
4
4
  "description": "Taro Service",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -33,9 +33,9 @@
33
33
  },
34
34
  "homepage": "https://github.com/NervJS/taro#readme",
35
35
  "dependencies": {
36
- "@tarojs/helper": "3.5.0-alpha.0",
37
- "@tarojs/shared": "3.5.0-alpha.0",
38
- "@tarojs/taro": "3.5.0-alpha.0",
36
+ "@tarojs/helper": "3.5.0-alpha.11",
37
+ "@tarojs/shared": "3.5.0-alpha.11",
38
+ "@tarojs/taro": "3.5.0-alpha.11",
39
39
  "fs-extra": "^8.1.0",
40
40
  "joi": "^17.6.0",
41
41
  "lodash": "^4.17.21",
@@ -43,5 +43,5 @@
43
43
  "tapable": "^1.1.3",
44
44
  "webpack-merge": "^4.2.2"
45
45
  },
46
- "gitHead": "8b2acf55c5f98e54bb2788a723a2ef0e0a1b75b6"
46
+ "gitHead": "76bf76f1e10cf758c5ccada90ddea8674eb69aac"
47
47
  }