xhs-mp-compiler-cli 2.0.21 → 2.0.23

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/compiler.js CHANGED
@@ -210,8 +210,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
210
210
  }
211
211
  catch (error) {
212
212
  todoPkgs.forEach(pkg => {
213
- var _a, _b;
214
- (_b = (_a = this.pendingPkgs[pkg].reject) === null || _a === void 0 ? void 0 : _a.forEach) === null || _b === void 0 ? void 0 : _b.call(_a, fn => fn(error));
213
+ var _a, _b, _c;
214
+ (_c = (_b = (_a = this.pendingPkgs[pkg]) === null || _a === void 0 ? void 0 : _a.reject) === null || _b === void 0 ? void 0 : _b.forEach) === null || _c === void 0 ? void 0 : _c.call(_b, fn => fn(error));
215
215
  delete this.pendingPkgs[pkg];
216
216
  });
217
217
  }
@@ -297,13 +297,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
297
297
  }
298
298
  doCompilePkgs(opts) {
299
299
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
300
- var _a, _b, _c, _d;
300
+ var _a, _b, _c, _d, _e, _f, _g, _h;
301
301
  if (this.watching) {
302
302
  return resolve(null);
303
303
  }
304
304
  if (this.pendingTask) {
305
- (_a = this.pendingTask.resolve) === null || _a === void 0 ? void 0 : _a.push(resolve);
306
- (_b = this.pendingTask.reject) === null || _b === void 0 ? void 0 : _b.push(reject);
305
+ (_b = (_a = this.pendingTask) === null || _a === void 0 ? void 0 : _a.resolve) === null || _b === void 0 ? void 0 : _b.push(resolve);
306
+ (_d = (_c = this.pendingTask) === null || _c === void 0 ? void 0 : _c.reject) === null || _d === void 0 ? void 0 : _d.push(reject);
307
307
  return;
308
308
  }
309
309
  this.pendingTask = {
@@ -314,13 +314,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
314
314
  this.emit('buildStart');
315
315
  yield this.call('runTask', Object.assign({ action: 'dev' }, opts));
316
316
  this.watching = true;
317
- (_c = this.pendingTask.resolve) === null || _c === void 0 ? void 0 : _c.forEach(fn => fn());
317
+ (_f = (_e = this.pendingTask) === null || _e === void 0 ? void 0 : _e.resolve) === null || _f === void 0 ? void 0 : _f.forEach(fn => fn());
318
318
  this.emit('buildEnd');
319
319
  }
320
320
  catch (error) {
321
321
  this.watching = false;
322
- (_d = this.pendingTask.reject) === null || _d === void 0 ? void 0 : _d.forEach(fn => fn(error));
323
- throw error;
322
+ (_h = (_g = this.pendingTask) === null || _g === void 0 ? void 0 : _g.reject) === null || _h === void 0 ? void 0 : _h.forEach(fn => fn(error));
324
323
  }
325
324
  finally {
326
325
  this.pendingTask = undefined;
@@ -236,12 +236,11 @@ const handlers = {
236
236
  // 修改文件时构建
237
237
  const hasError = err || ((_a = stats === null || stats === void 0 ? void 0 : stats.hasErrors) === null || _a === void 0 ? void 0 : _a.call(stats));
238
238
  if (hasError) {
239
- throw formatOutputError(err, stats);
240
- // sendMessage({
241
- // event: 'compileErrorWhenFileChange',
242
- // data: formatOutputError(err, stats)
243
- // })
244
- // return
239
+ sendMessage({
240
+ event: 'compileErrorWhenFileChange',
241
+ data: formatOutputError(err, stats)
242
+ });
243
+ return;
245
244
  }
246
245
  sendMessage({
247
246
  event: 'compileFinishWhenFileChange'
@@ -306,3 +305,7 @@ workerPool.worker(handlers);
306
305
  // } catch (error) {
307
306
  // console.error('workerPool error:', error)
308
307
  // }
308
+ // @ts-ignore
309
+ globalThis.addEventListener('unhandledrejection', (err) => {
310
+ console.log(111, 'err', err);
311
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xhs-mp-compiler-cli",
3
- "version": "2.0.21",
3
+ "version": "2.0.23",
4
4
  "description": "xhs mp command tool.",
5
5
  "preferGlobal": true,
6
6
  "category": "esm",
@@ -88,18 +88,18 @@
88
88
  "webpack-chain": "^6.5.1",
89
89
  "webpack-sources": "^3.2.2",
90
90
  "xhs-mp-workerpool": "^9.2.0",
91
- "xhs-mp-ml-loader": "2.0.21",
92
- "xhs-mp-compiler-utils": "2.0.21",
93
- "xhs-mp-pack": "2.0.21",
94
- "xhs-mp-project": "2.0.21",
95
- "xhs-mp-shared": "2.0.21",
96
- "xhs-mp-shared-fs": "2.0.21",
97
- "xhs-mp-sjs-loader": "2.0.21",
98
- "xhs-mp-sketch-loader": "2.0.21",
91
+ "xhs-mp-ml-loader": "2.0.23",
92
+ "xhs-mp-compiler-utils": "2.0.23",
93
+ "xhs-mp-pack": "2.0.23",
94
+ "xhs-mp-project": "2.0.23",
95
+ "xhs-mp-shared": "2.0.23",
96
+ "xhs-mp-shared-fs": "2.0.23",
97
+ "xhs-mp-sjs-loader": "2.0.23",
98
+ "xhs-mp-sketch-loader": "2.0.23",
99
99
  "yauzl": "^2.10.0"
100
100
  },
101
101
  "peerDependencies": {
102
- "xhs-mp-ml-parser": "2.0.21"
102
+ "xhs-mp-ml-parser": "2.0.23"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@types/babel__generator": "7.6.3",
@@ -122,7 +122,7 @@
122
122
  "@types/node": "14",
123
123
  "typescript": "5.1.6",
124
124
  "webpack-dev-server": "4.0.0-beta.3",
125
- "xhs-mp-ml-parser": "2.0.21"
125
+ "xhs-mp-ml-parser": "2.0.23"
126
126
  },
127
127
  "scripts": {
128
128
  "version": "formula changelog && git add .",