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
package/src/command/start.js
CHANGED
|
@@ -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
|
|
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
|
});
|
package/src/utils/tools.d.ts
CHANGED
|
@@ -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
|
|
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[],
|
|
13
|
-
warning: (message: string | string[],
|
|
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 {};
|
package/src/utils/tools.js
CHANGED
|
@@ -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,
|
|
218
|
-
|
|
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,
|
|
230
|
-
|
|
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)));
|