swico 0.8.3-beta7 → 0.8.3-beta9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swico",
3
- "version": "0.8.3-beta7",
3
+ "version": "0.8.3-beta9",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -137,16 +137,20 @@ var createCompileListener = function (compiler) {
137
137
  tools_1.toast.info('Compiling...', { wrap: false });
138
138
  });
139
139
  compiler.hooks.done.tap('done', function (stats) {
140
- var _a;
141
140
  var info = stats === null || stats === void 0 ? void 0 : stats.toJson();
142
141
  if (stats === null || stats === void 0 ? void 0 : stats.hasErrors()) {
143
142
  tools_1.toast.error(info === null || info === void 0 ? void 0 : info.errors.map(function (item) { return item.message || item.stack; }));
144
143
  return;
145
144
  }
146
145
  if (stats === null || stats === void 0 ? void 0 : stats.hasWarnings()) {
147
- var first = (_a = info.warnings) === null || _a === void 0 ? void 0 : _a[0];
148
- console.log('eslint', first === null || first === void 0 ? void 0 : first.chunkName, first === null || first === void 0 ? void 0 : first.moduleName);
149
- tools_1.toast.warning(info === null || info === void 0 ? void 0 : info.warnings.map(function (item) { return item.message || item.stack; }));
146
+ var warnings = info.warnings;
147
+ warnings.some(function (item) {
148
+ var msg = item.message || item.stack;
149
+ if (msg.startsWith('[eslint]')) {
150
+ tools_1.toast.warning(msg, 'ESLint Error');
151
+ return;
152
+ }
153
+ });
150
154
  }
151
155
  tools_1.toast.info("Compiled complete in ".concat(info === null || info === void 0 ? void 0 : info.time, "ms"));
152
156
  });
@@ -215,7 +215,7 @@ exports.toast = {
215
215
  console.log("".concat(chalk_1.default.hex('#32f264').bold('swico'), " - ").concat(message).concat(wrap ? '\n' : ''));
216
216
  },
217
217
  error: function (message, title) {
218
- console.log("".concat(chalk_1.default.red.bold('error'), " - ").concat(title || 'There are some errors about Swico', "\uFF1A \n"));
218
+ console.log("".concat(chalk_1.default.red.bold('error'), " - ").concat(title || 'There are some errors about Swico', "\uFF1A"));
219
219
  if (Array.isArray(message)) {
220
220
  message.forEach(function (item) {
221
221
  console.log("> ".concat(chalk_1.default.red.bold(item)));
@@ -227,7 +227,7 @@ exports.toast = {
227
227
  console.log('\n');
228
228
  },
229
229
  warning: function (message, title) {
230
- console.log("".concat(chalk_1.default.hex('#fb8918').bold('warning'), " - ").concat(title || 'There are some warnings about Swico', "\uFF1A \n"));
230
+ console.log("".concat(chalk_1.default.hex('#fb8918').bold('warning'), " - ").concat(title || 'There are some warnings about Swico', "\uFF1A"));
231
231
  if (Array.isArray(message)) {
232
232
  message.forEach(function (item) {
233
233
  console.log("> ".concat(chalk_1.default.hex('#fb8918').bold(item)));