swico 0.8.1-beta13 → 0.8.1-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
package/src/command/start.js
CHANGED
|
@@ -60,6 +60,7 @@ var path_1 = __importDefault(require("path"));
|
|
|
60
60
|
var cross_spawn_1 = __importDefault(require("cross-spawn"));
|
|
61
61
|
var _a = process.env, envPort = _a.PORT, RESTART = _a.RESTART;
|
|
62
62
|
var package_json_1 = __importDefault(require("../../package.json"));
|
|
63
|
+
var chalk_1 = __importDefault(require("chalk"));
|
|
63
64
|
var handleWatch = function (projectPath, devServer) {
|
|
64
65
|
var configFilesWatcher = chokidar_1.default
|
|
65
66
|
.watch([
|
|
@@ -163,6 +164,9 @@ function start() {
|
|
|
163
164
|
oriLogger = compiler.getInfrastructureLogger;
|
|
164
165
|
compiler.getInfrastructureLogger = getMockGetLogger(compiler);
|
|
165
166
|
devServer = new webpack_dev_server_1.default(__assign(__assign({}, startConfig.devServer), { port: availablePort }), compiler);
|
|
167
|
+
devServer.stopCallback(function () {
|
|
168
|
+
process.exit(1);
|
|
169
|
+
});
|
|
166
170
|
_b.label = 7;
|
|
167
171
|
case 7:
|
|
168
172
|
_b.trys.push([7, 9, , 10]);
|
|
@@ -171,7 +175,7 @@ function start() {
|
|
|
171
175
|
_b.sent();
|
|
172
176
|
compiler.getInfrastructureLogger = oriLogger;
|
|
173
177
|
handleWatch(projectPath, devServer);
|
|
174
|
-
tools_1.toast.info("Project is running at\uFF1A".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/"));
|
|
178
|
+
tools_1.toast.info("Project is running at\uFF1A".concat(chalk_1.default.hex('#29abe0')("".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/"))));
|
|
175
179
|
return [3, 10];
|
|
176
180
|
case 9:
|
|
177
181
|
e_1 = _b.sent();
|
|
@@ -66,6 +66,7 @@ var html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
|
|
|
66
66
|
var fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
|
|
67
67
|
var webpack_1 = __importDefault(require("webpack"));
|
|
68
68
|
var webpackbar_1 = __importDefault(require("webpackbar"));
|
|
69
|
+
var tools_1 = require("../utils/tools");
|
|
69
70
|
function default_1(_a) {
|
|
70
71
|
var _b, _c, _d;
|
|
71
72
|
var projectPath = _a.projectPath, entryPath = _a.entryPath, env = _a.env, customConfig = _a.customConfig;
|
|
@@ -274,7 +275,7 @@ function default_1(_a) {
|
|
|
274
275
|
}),
|
|
275
276
|
new webpackbar_1.default({
|
|
276
277
|
name: 'Swico',
|
|
277
|
-
color:
|
|
278
|
+
color: tools_1.themeColor,
|
|
278
279
|
profile: false
|
|
279
280
|
})
|
|
280
281
|
], false), ((customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.plugins) || config_1.initConfig.plugins), true)
|
|
@@ -63,9 +63,11 @@ var path_1 = __importDefault(require("path"));
|
|
|
63
63
|
var mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
64
64
|
var config_1 = require("../utils/config");
|
|
65
65
|
var html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
|
|
66
|
+
var fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
|
|
66
67
|
var webpack_1 = __importDefault(require("webpack"));
|
|
67
68
|
var vue_loader_1 = require("vue-loader");
|
|
68
69
|
var webpackbar_1 = __importDefault(require("webpackbar"));
|
|
70
|
+
var tools_1 = require("../utils/tools");
|
|
69
71
|
function default_1(_a) {
|
|
70
72
|
var _b, _c, _d;
|
|
71
73
|
var projectPath = _a.projectPath, entryPath = _a.entryPath, env = _a.env, customConfig = _a.customConfig;
|
|
@@ -276,13 +278,21 @@ function default_1(_a) {
|
|
|
276
278
|
},
|
|
277
279
|
hash: true
|
|
278
280
|
}),
|
|
281
|
+
new fork_ts_checker_webpack_plugin_1.default({
|
|
282
|
+
typescript: {
|
|
283
|
+
diagnosticOptions: {
|
|
284
|
+
semantic: true,
|
|
285
|
+
syntactic: true
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}),
|
|
279
289
|
new mini_css_extract_plugin_1.default({
|
|
280
290
|
filename: env === 'dev' ? 'css/[name].css' : 'css/[name].[contenthash].css',
|
|
281
291
|
ignoreOrder: true
|
|
282
292
|
}),
|
|
283
293
|
new webpackbar_1.default({
|
|
284
294
|
name: 'Swico',
|
|
285
|
-
color:
|
|
295
|
+
color: tools_1.themeColor,
|
|
286
296
|
profile: false
|
|
287
297
|
})
|
|
288
298
|
], false), ((customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.plugins) || config_1.initConfig.plugins), true)
|
package/src/utils/tools.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ConfigRouterType } from './config';
|
|
|
2
2
|
export declare const copyDirFiles: (src: any, dest: any, filter?: (fileName: any) => boolean) => Promise<void>;
|
|
3
3
|
export declare const getFormatRouter: (projectPath: string, routes: ConfigRouterType['routes'], templateType: any) => any[];
|
|
4
4
|
export declare const getPort: () => Promise<number>;
|
|
5
|
+
export declare const themeColor = "#7888FCFF";
|
|
5
6
|
export declare const toast: {
|
|
6
7
|
info: (message: string) => void;
|
|
7
8
|
error: (message: string | string[]) => void;
|
package/src/utils/tools.js
CHANGED
|
@@ -80,7 +80,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
80
80
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
81
81
|
};
|
|
82
82
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
83
|
-
exports.initIndexFile = exports.toast = exports.getPort = exports.getFormatRouter = exports.copyDirFiles = void 0;
|
|
83
|
+
exports.initIndexFile = exports.toast = exports.themeColor = exports.getPort = exports.getFormatRouter = exports.copyDirFiles = void 0;
|
|
84
84
|
var portfinder_1 = __importDefault(require("portfinder"));
|
|
85
85
|
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
86
86
|
var path_1 = __importDefault(require("path"));
|
|
@@ -206,12 +206,13 @@ var getPort = function () {
|
|
|
206
206
|
});
|
|
207
207
|
};
|
|
208
208
|
exports.getPort = getPort;
|
|
209
|
+
exports.themeColor = '#7888FCFF';
|
|
209
210
|
exports.toast = {
|
|
210
211
|
info: function (message) {
|
|
211
|
-
console.log("> ".concat(chalk_1.default.hex(
|
|
212
|
+
console.log("> ".concat(chalk_1.default.hex(exports.themeColor)(message), "\n"));
|
|
212
213
|
},
|
|
213
214
|
error: function (message) {
|
|
214
|
-
console.log("\n> ".concat(chalk_1.default.hex(
|
|
215
|
+
console.log("\n> ".concat(chalk_1.default.hex(exports.themeColor)('There are some errors about Swico:'), " \n"));
|
|
215
216
|
if (Array.isArray(message)) {
|
|
216
217
|
message.forEach(function (item) {
|
|
217
218
|
console.log(" > ".concat(chalk_1.default.red.bold(item), " \n"));
|
|
@@ -222,7 +223,7 @@ exports.toast = {
|
|
|
222
223
|
}
|
|
223
224
|
},
|
|
224
225
|
warning: function (message) {
|
|
225
|
-
console.log("\n> ".concat(chalk_1.default.hex(
|
|
226
|
+
console.log("\n> ".concat(chalk_1.default.hex(exports.themeColor)('There are some warnings about Swico:'), " \n"));
|
|
226
227
|
if (Array.isArray(message)) {
|
|
227
228
|
message.forEach(function (item) {
|
|
228
229
|
console.log(" > ".concat(chalk_1.default.hex('#fb8918').bold(item), " \n"));
|