swico 0.8.2-beta13 → 0.8.2-beta15

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.2-beta13",
3
+ "version": "0.8.2-beta15",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -77,11 +77,11 @@ function default_1() {
77
77
  }
78
78
  var info = stats.toJson();
79
79
  if (stats.hasErrors()) {
80
- tools_1.toast.error(info.errors.map(function (item) { return item.stack; }));
80
+ tools_1.toast.error(info.errors.map(function (item) { return item.stack || item.message; }));
81
81
  return;
82
82
  }
83
83
  if (stats.hasWarnings()) {
84
- tools_1.toast.warning(info.warnings.map(function (item) { return item.stack; }));
84
+ tools_1.toast.warning(info.warnings.map(function (item) { return item.stack || item.message; }));
85
85
  }
86
86
  tools_1.toast.success('Building complete');
87
87
  });
@@ -139,10 +139,12 @@ var createCompileListener = function (compiler) {
139
139
  compiler.hooks.done.tap('done', function (stats) {
140
140
  var info = stats === null || stats === void 0 ? void 0 : stats.toJson();
141
141
  if (stats === null || stats === void 0 ? void 0 : stats.hasErrors()) {
142
+ console.log('done-error');
142
143
  tools_1.toast.error(info === null || info === void 0 ? void 0 : info.errors.map(function (item) { return item.message || item.stack; }));
143
144
  return;
144
145
  }
145
146
  if (stats === null || stats === void 0 ? void 0 : stats.hasWarnings()) {
147
+ console.log('done-warning');
146
148
  tools_1.toast.warning(info === null || info === void 0 ? void 0 : info.warnings.map(function (item) { return item.message || item.stack; }));
147
149
  }
148
150
  tools_1.toast.info("Compiled complete in ".concat(info === null || info === void 0 ? void 0 : info.time, "ms"));
@@ -129,8 +129,9 @@ function default_1(options) {
129
129
  new eslint_webpack_plugin_1.default({
130
130
  context: path_1.default.join(projectPath, '/src'),
131
131
  failOnError: false,
132
- failOnWarning: false,
132
+ failOnWarning: true,
133
133
  extensions: templateType === 'vue' ? ['vue', 'ts', 'js'] : ['tsx', 'ts', 'js'],
134
+ emitWarning: false,
134
135
  cache: true
135
136
  })
136
137
  ], ((_e = (_d = customConfig.dev) === null || _d === void 0 ? void 0 : _d.plugins) !== null && _e !== void 0 ? _e : []), true)
@@ -9,8 +9,8 @@ interface ToastOptions {
9
9
  export declare const toast: {
10
10
  info: (message: string, options?: ToastOptions) => void;
11
11
  success: (message: string, options?: ToastOptions) => void;
12
- error: (message: string | string[]) => void;
13
- warning: (message: string | string[]) => void;
12
+ error: (message: string | string[], title?: string) => void;
13
+ warning: (message: string | string[], title?: string) => void;
14
14
  };
15
15
  export declare const initIndexFile: () => Promise<void>;
16
16
  export {};
@@ -214,8 +214,8 @@ exports.toast = {
214
214
  var _a = (options || {}).wrap, wrap = _a === void 0 ? true : _a;
215
215
  console.log("".concat(chalk_1.default.hex('#32f264').bold('swico'), " - ").concat(message).concat(wrap ? '\n' : ''));
216
216
  },
217
- error: function (message) {
218
- console.log("".concat(chalk_1.default.red.bold('error'), " - There are some errors about Swico\uFF1A \n"));
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"));
219
219
  if (Array.isArray(message)) {
220
220
  message.forEach(function (item) {
221
221
  console.log(" > ".concat(chalk_1.default.red.bold(item), " \n"));
@@ -225,8 +225,8 @@ exports.toast = {
225
225
  console.log(" > ".concat(chalk_1.default.red.bold(message), " \n"));
226
226
  }
227
227
  },
228
- warning: function (message) {
229
- console.log("".concat(chalk_1.default.hex('#fb8918').bold('warning'), " - There are some warnings about Swico\uFF1A \n"));
228
+ warning: function (message, title) {
229
+ console.log("".concat(chalk_1.default.hex('#fb8918').bold('warning'), " - ").concat(title || 'There are some warnings about Swico', "\uFF1A \n"));
230
230
  if (Array.isArray(message)) {
231
231
  message.forEach(function (item) {
232
232
  console.log(" > ".concat(chalk_1.default.hex('#fb8918').bold(item), " \n"));