swico 0.8.1-beta20 → 0.8.1-beta22
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 +2 -2
- package/src/command/build.js +2 -2
- package/src/command/start.js +3 -11
- package/src/utils/tools.js +6 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swico",
|
|
3
|
-
"version": "0.8.1-
|
|
3
|
+
"version": "0.8.1-beta22",
|
|
4
4
|
"description": "Simple, efficient, and practical front-end framework",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"webpack-cli": "5.1.4",
|
|
52
52
|
"webpack-dev-server": "4.15.2",
|
|
53
53
|
"webpack-merge": "5.9.0",
|
|
54
|
-
"webpackbar": "6.0.
|
|
54
|
+
"webpackbar": "6.0.1",
|
|
55
55
|
"@babel/types": "7.23.9",
|
|
56
56
|
"@commitlint/cli": "18.5.0",
|
|
57
57
|
"@commitlint/config-conventional": "18.5.0",
|
package/src/command/build.js
CHANGED
|
@@ -51,8 +51,8 @@ function default_1() {
|
|
|
51
51
|
switch (_a.label) {
|
|
52
52
|
case 0:
|
|
53
53
|
process.env.SWICO_ENV = 'prod';
|
|
54
|
-
tools_1.toast.info("
|
|
55
|
-
tools_1.toast.info('Initializing
|
|
54
|
+
tools_1.toast.info("v".concat(package_json_1.default.version));
|
|
55
|
+
tools_1.toast.info('Initializing production config...');
|
|
56
56
|
return [4, (0, tools_1.initIndexFile)()];
|
|
57
57
|
case 1:
|
|
58
58
|
_a.sent();
|
package/src/command/start.js
CHANGED
|
@@ -138,8 +138,8 @@ function start() {
|
|
|
138
138
|
case 0:
|
|
139
139
|
process.env.SWICO_ENV = 'dev';
|
|
140
140
|
if (RESTART !== 'true') {
|
|
141
|
-
tools_1.toast.info("
|
|
142
|
-
tools_1.toast.info('Initializing
|
|
141
|
+
tools_1.toast.info("v".concat(package_json_1.default.version));
|
|
142
|
+
tools_1.toast.info('Initializing development config...');
|
|
143
143
|
}
|
|
144
144
|
return [4, (0, tools_1.initIndexFile)()];
|
|
145
145
|
case 1:
|
|
@@ -165,18 +165,10 @@ function start() {
|
|
|
165
165
|
compiler.getInfrastructureLogger = getMockGetLogger(compiler);
|
|
166
166
|
devServer = new webpack_dev_server_1.default(__assign(__assign({}, startConfig.devServer), { port: availablePort }), compiler);
|
|
167
167
|
compiler.watch({}, function (err, stats) {
|
|
168
|
-
if (err) {
|
|
169
|
-
tools_1.toast.error(err.stack || err.toString());
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
168
|
var info = stats.toJson();
|
|
173
|
-
if (stats.hasErrors()) {
|
|
174
|
-
tools_1.toast.error(info.errors.map(function (item) { return item.stack; }));
|
|
169
|
+
if (err || stats.hasErrors() || stats.hasWarnings()) {
|
|
175
170
|
return;
|
|
176
171
|
}
|
|
177
|
-
if (stats.hasWarnings()) {
|
|
178
|
-
tools_1.toast.warning(info.warnings.map(function (item) { return item.stack; }));
|
|
179
|
-
}
|
|
180
172
|
tools_1.toast.info("Compiled successfully in ".concat(info.time, "ms"));
|
|
181
173
|
});
|
|
182
174
|
_b.label = 7;
|
package/src/utils/tools.js
CHANGED
|
@@ -86,8 +86,6 @@ var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
86
86
|
var path_1 = __importDefault(require("path"));
|
|
87
87
|
var chalk_1 = __importDefault(require("chalk"));
|
|
88
88
|
var process = __importStar(require("process"));
|
|
89
|
-
var ora_1 = __importDefault(require("ora"));
|
|
90
|
-
var spinner = (0, ora_1.default)();
|
|
91
89
|
var copyDirFiles = function (src, dest, filter) { return __awaiter(void 0, void 0, void 0, function () {
|
|
92
90
|
var _copy, e_1;
|
|
93
91
|
return __generator(this, function (_a) {
|
|
@@ -209,30 +207,30 @@ exports.getPort = getPort;
|
|
|
209
207
|
exports.themeColor = '#7888FCFF';
|
|
210
208
|
exports.toast = {
|
|
211
209
|
info: function (message) {
|
|
212
|
-
console.log("".concat(chalk_1.default.hex(exports.themeColor)('
|
|
210
|
+
console.log("".concat(chalk_1.default.hex(exports.themeColor).bold('swico'), " - ").concat(message, "\n"));
|
|
213
211
|
},
|
|
214
212
|
success: function (message) {
|
|
215
|
-
console.log("".concat(chalk_1.default.hex('#32f264')('
|
|
213
|
+
console.log("".concat(chalk_1.default.hex('#32f264').bold('swico'), " - ").concat(message, "\n"));
|
|
216
214
|
},
|
|
217
215
|
error: function (message) {
|
|
218
|
-
console.log("".concat(chalk_1.default.red('error'), " - There are some errors about Swico\uFF1A \n"));
|
|
216
|
+
console.log("".concat(chalk_1.default.red.bold('error'), " - There are some errors about Swico\uFF1A \n"));
|
|
219
217
|
if (Array.isArray(message)) {
|
|
220
218
|
message.forEach(function (item) {
|
|
221
219
|
console.log(" > ".concat(chalk_1.default.red.bold(item), " \n"));
|
|
222
220
|
});
|
|
223
221
|
}
|
|
224
|
-
else {
|
|
222
|
+
else if (message) {
|
|
225
223
|
console.log(" > ".concat(chalk_1.default.red.bold(message), " \n"));
|
|
226
224
|
}
|
|
227
225
|
},
|
|
228
226
|
warning: function (message) {
|
|
229
|
-
console.log("".concat(chalk_1.default.red('#fb8918'), " - There are some errors about Swico\uFF1A \n"));
|
|
227
|
+
console.log("".concat(chalk_1.default.red.bold('#fb8918'), " - There are some errors about Swico\uFF1A \n"));
|
|
230
228
|
if (Array.isArray(message)) {
|
|
231
229
|
message.forEach(function (item) {
|
|
232
230
|
console.log(" > ".concat(chalk_1.default.hex('#fb8918').bold(item), " \n"));
|
|
233
231
|
});
|
|
234
232
|
}
|
|
235
|
-
else {
|
|
233
|
+
else if (message) {
|
|
236
234
|
console.log(" > ".concat(chalk_1.default.hex('#fb8918').bold(message), " \n"));
|
|
237
235
|
}
|
|
238
236
|
}
|