@tmsfe/tmskit 0.0.29 → 0.0.30

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.cjs.js CHANGED
@@ -1587,7 +1587,7 @@ const fixAppJson = appJson => {
1587
1587
  */
1588
1588
 
1589
1589
 
1590
- function buildOutputAppJson$2(tmsConfig, modules) {
1590
+ async function buildOutputAppJson$2(tmsConfig, modules) {
1591
1591
  try {
1592
1592
  var _tmsConfig$hooks;
1593
1593
 
@@ -1609,13 +1609,13 @@ function buildOutputAppJson$2(tmsConfig, modules) {
1609
1609
  if (typeof (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$hooks = tmsConfig.hooks) === null || _tmsConfig$hooks === void 0 ? void 0 : _tmsConfig$hooks.updateAppJson) === 'function') {
1610
1610
  var _tmsConfig$hooks2;
1611
1611
 
1612
- tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$hooks2 = tmsConfig.hooks) === null || _tmsConfig$hooks2 === void 0 ? void 0 : _tmsConfig$hooks2.updateAppJson({
1612
+ await (tmsConfig === null || tmsConfig === void 0 ? void 0 : (_tmsConfig$hooks2 = tmsConfig.hooks) === null || _tmsConfig$hooks2 === void 0 ? void 0 : _tmsConfig$hooks2.updateAppJson({
1613
1613
  tmsConfig: filterField$6(tmsConfig, ['gitAccount']),
1614
1614
  cmdOptions: global$9.getData('cmdOptions'),
1615
1615
  modules,
1616
1616
  appJson,
1617
1617
  isDev: global$9.getData('isDev')
1618
- });
1618
+ }));
1619
1619
  report$8('hooks:updateAppJson');
1620
1620
  }
1621
1621
 
@@ -3008,7 +3008,7 @@ const getTargetFile$1 = (sourceFile, module, outputDir) => {
3008
3008
  var watch_1 = function (globValue, watchOptions, callback, module) {
3009
3009
  watch$2(globValue, { // readDelay: 100,
3010
3010
  ...watchOptions
3011
- }, vinyl => {
3011
+ }, async vinyl => {
3012
3012
  const sourceFile = vinyl.history[0];
3013
3013
  const sourceFileDirArr = sourceFile.replace(/\\/g, '/').split('/');
3014
3014
  const sourceFileName = sourceFileDirArr.slice(sourceFileDirArr.length - 2).join('/');
@@ -3022,7 +3022,7 @@ var watch_1 = function (globValue, watchOptions, callback, module) {
3022
3022
  return;
3023
3023
  }
3024
3024
 
3025
- runCallback({
3025
+ await runCallback({
3026
3026
  tmsConfig,
3027
3027
  sourceFile,
3028
3028
  targetFile,
@@ -3211,7 +3211,7 @@ var dev$4 = async (tmsConfig, modules, isDev = true) => {
3211
3211
  watch$1([resolve$9('app.json')], {
3212
3212
  ignoreInitial: false,
3213
3213
  events: watchEvents
3214
- }, () => buildOutputAppJson(tmsConfig, modules, isDev), {
3214
+ }, async () => await buildOutputAppJson(tmsConfig, modules, isDev), {
3215
3215
  from: resolve$9(),
3216
3216
  to: resolve$9(tmsConfig.outputDir)
3217
3217
  }); // 监听其他文件
@@ -3226,7 +3226,7 @@ var dev$4 = async (tmsConfig, modules, isDev = true) => {
3226
3226
  }, taskFn, module);
3227
3227
  });
3228
3228
  } else {
3229
- buildOutputAppJson(tmsConfig, modules, isDev);
3229
+ await buildOutputAppJson(tmsConfig, modules, isDev);
3230
3230
  }
3231
3231
 
3232
3232
  eTime = new Date().getTime() - sTime;
@@ -4200,7 +4200,7 @@ var entry = [{
4200
4200
 
4201
4201
  var require$$12 = {
4202
4202
  name: "@tmsfe/tmskit",
4203
- version: "0.0.29",
4203
+ version: "0.0.30",
4204
4204
  description: "tmskit",
4205
4205
  main: "dist/index.cjs",
4206
4206
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmsfe/tmskit",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "tmskit",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {
@@ -103,7 +103,7 @@ module.exports = async (tmsConfig, modules, isDev = true) => {
103
103
  watch(
104
104
  [resolve('app.json')],
105
105
  { ignoreInitial: false, events: watchEvents },
106
- () => buildOutputAppJson(tmsConfig, modules, isDev),
106
+ async () => await buildOutputAppJson(tmsConfig, modules, isDev),
107
107
  { from: resolve(), to: resolve(tmsConfig.outputDir) },
108
108
  );
109
109
  // 监听其他文件
@@ -111,7 +111,7 @@ module.exports = async (tmsConfig, modules, isDev = true) => {
111
111
  watch(globValue, { ignoreInitial: true, events: watchEvents }, taskFn, module);
112
112
  });
113
113
  } else {
114
- buildOutputAppJson(tmsConfig, modules, isDev);
114
+ await buildOutputAppJson(tmsConfig, modules, isDev);
115
115
  }
116
116
  eTime = new Date().getTime() - sTime;
117
117
  if (typeof tmsConfig?.hooks?.afterFirstCompile === 'function') {
@@ -52,7 +52,7 @@ module.exports = function (globValue, watchOptions, callback, module) {
52
52
  watch(globValue, {
53
53
  // readDelay: 100,
54
54
  ...watchOptions,
55
- }, (vinyl) => {
55
+ }, async (vinyl) => {
56
56
  const sourceFile = vinyl.history[0];
57
57
  const sourceFileDirArr = sourceFile.replace(/\\/g, '/').split('/');
58
58
  const sourceFileName = sourceFileDirArr.slice(sourceFileDirArr.length - 2).join('/');
@@ -66,7 +66,7 @@ module.exports = function (globValue, watchOptions, callback, module) {
66
66
  updateFileHook(tmsConfig, sourceFile, targetFile, vinyl.event);
67
67
  return;
68
68
  }
69
- runCallback({
69
+ await runCallback({
70
70
  tmsConfig,
71
71
  sourceFile,
72
72
  targetFile,
@@ -120,7 +120,7 @@ const fixAppJson = (appJson) => {
120
120
  * @param {array} modules 用户要编译的模块列表
121
121
  * @returns
122
122
  */
123
- function buildOutputAppJson(tmsConfig, modules) {
123
+ async function buildOutputAppJson(tmsConfig, modules) {
124
124
  try {
125
125
  // 获取所有模块,合并模块依赖的模块
126
126
  const modulesConfig = getModulesConfig(modules, tmsConfig.appName, false);
@@ -141,7 +141,7 @@ function buildOutputAppJson(tmsConfig, modules) {
141
141
  fs.writeFileSync(resolve(`${tmsConfig.outputDir}/app.json`), JSON.stringify(appJson, null, 2), 'utf8');
142
142
 
143
143
  if (typeof tmsConfig?.hooks?.updateAppJson === 'function') {
144
- tmsConfig?.hooks?.updateAppJson({
144
+ await tmsConfig?.hooks?.updateAppJson({
145
145
  tmsConfig: filterField(tmsConfig, ['gitAccount']),
146
146
  cmdOptions: global.getData('cmdOptions'),
147
147
  modules,