swico 0.8.3-beta9 → 0.8.4-beta1

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-beta9",
3
+ "version": "0.8.4-beta1",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -79,7 +79,7 @@ var handleWatch = function (projectPath, devServer) {
79
79
  return __generator(this, function (_a) {
80
80
  switch (_a.label) {
81
81
  case 0:
82
- tools_1.toast.warning('Swico configuration files have been modified. The devServer is being restarted...');
82
+ tools_1.toast.warning('Swico configuration files have been modified. The devServer is being restarted...', { inline: true });
83
83
  return [4, devServer.stop()];
84
84
  case 1:
85
85
  _a.sent();
@@ -147,10 +147,11 @@ var createCompileListener = function (compiler) {
147
147
  warnings.some(function (item) {
148
148
  var msg = item.message || item.stack;
149
149
  if (msg.startsWith('[eslint]')) {
150
- tools_1.toast.warning(msg, 'ESLint Error');
150
+ tools_1.toast.warning(msg, { title: 'ESLint errors' });
151
151
  return;
152
152
  }
153
153
  });
154
+ return;
154
155
  }
155
156
  tools_1.toast.info("Compiled complete in ".concat(info === null || info === void 0 ? void 0 : info.time, "ms"));
156
157
  });
@@ -264,7 +264,7 @@ function default_1(_a) {
264
264
  logger: {
265
265
  log: function () { },
266
266
  error: function (message) {
267
- tools_1.toast.error(message, 'TypeScript Error');
267
+ tools_1.toast.error(message, { title: 'TypeScript errors' });
268
268
  }
269
269
  },
270
270
  typescript: {
@@ -281,7 +281,7 @@ function default_1(_a) {
281
281
  logger: {
282
282
  log: function () { },
283
283
  error: function (message) {
284
- tools_1.toast.error(message, 'TypeScript Error');
284
+ tools_1.toast.error(message, { title: 'TypeScript errors' });
285
285
  }
286
286
  },
287
287
  typescript: {
@@ -4,13 +4,15 @@ export declare const getFormatRouter: (projectPath: string, routes: ConfigRouter
4
4
  export declare const getPort: () => Promise<number>;
5
5
  export declare const themeColor = "#7888FCFF";
6
6
  interface ToastOptions {
7
- wrap: boolean;
7
+ wrap?: boolean;
8
+ inline?: boolean;
9
+ title?: string;
8
10
  }
9
11
  export declare const toast: {
10
12
  info: (message: string, options?: ToastOptions) => void;
11
13
  success: (message: string, options?: ToastOptions) => void;
12
- error: (message: string | string[], title?: string) => void;
13
- warning: (message: string | string[], title?: string) => void;
14
+ error: (message: string | string[], options?: ToastOptions) => void;
15
+ warning: (message: string | string[], options?: ToastOptions) => void;
14
16
  };
15
17
  export declare const initIndexFile: () => Promise<void>;
16
18
  export {};
@@ -214,8 +214,9 @@ 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, title) {
218
- console.log("".concat(chalk_1.default.red.bold('error'), " - ").concat(title || 'There are some errors about Swico', "\uFF1A"));
217
+ error: function (message, options) {
218
+ var _a = options || {}, inline = _a.inline, title = _a.title;
219
+ console.log("".concat(chalk_1.default.red.bold('error'), " - ").concat(inline ? message : "".concat(title || 'There are some errors about Swico', "\uFF1A")));
219
220
  if (Array.isArray(message)) {
220
221
  message.forEach(function (item) {
221
222
  console.log("> ".concat(chalk_1.default.red.bold(item)));
@@ -226,8 +227,9 @@ exports.toast = {
226
227
  }
227
228
  console.log('\n');
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"));
230
+ warning: function (message, options) {
231
+ var _a = options || {}, inline = _a.inline, title = _a.title;
232
+ console.log("".concat(chalk_1.default.hex('#fb8918').bold('warning'), " - ").concat(inline ? message : "".concat(title || 'There are some warnings about Swico', "\uFF1A")));
231
233
  if (Array.isArray(message)) {
232
234
  message.forEach(function (item) {
233
235
  console.log("> ".concat(chalk_1.default.hex('#fb8918').bold(item)));