swico 0.8.4-beta3 → 0.8.4-beta5
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 +1 -1
- package/src/command/start.js +3 -1
- package/src/utils/config.js +8 -8
- package/src/utils/tools.js +0 -2
package/package.json
CHANGED
package/src/command/start.js
CHANGED
|
@@ -199,7 +199,9 @@ function start() {
|
|
|
199
199
|
createCompileListener(compiler);
|
|
200
200
|
compiler.getInfrastructureLogger = oriLogger;
|
|
201
201
|
handleWatch(projectPath, devServer);
|
|
202
|
-
|
|
202
|
+
if (RESTART !== 'true') {
|
|
203
|
+
tools_1.toast.info("Project is running at\uFF1A".concat(chalk_1.default.hex('#29abe0')("".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/"))));
|
|
204
|
+
}
|
|
203
205
|
return [3, 10];
|
|
204
206
|
case 9:
|
|
205
207
|
e_1 = _b.sent();
|
package/src/utils/config.js
CHANGED
|
@@ -132,22 +132,22 @@ var getProjectConfig = function (env) { return __awaiter(void 0, void 0, void 0,
|
|
|
132
132
|
}
|
|
133
133
|
unSupportedField = configFields.find(function (field) { return !supportedFieldList_1.includes(field); });
|
|
134
134
|
if (configFields.length > 0 && unSupportedField) {
|
|
135
|
-
msgText = "
|
|
135
|
+
msgText = "The Swico configuration file '".concat(chalk_1.default.blue(configFileName), "' does not support the field '").concat(chalk_1.default.red(unSupportedField), "' ");
|
|
136
136
|
tools_1.toast.error(msgText);
|
|
137
|
-
process.exit();
|
|
137
|
+
process.exit(1);
|
|
138
138
|
}
|
|
139
139
|
if (key === 'base' && !['vue', 'react'].includes(configObj['template'])) {
|
|
140
|
-
tools_1.toast.error("The field '".concat(chalk_1.default.blue('template'), "' does not support the value '").concat(chalk_1.default.red(configObj['template']), "',the value
|
|
141
|
-
process.exit();
|
|
140
|
+
tools_1.toast.error("The field '".concat(chalk_1.default.blue('template'), "' does not support the value '").concat(chalk_1.default.red(configObj['template']), "',the value should be 'vue' or 'react' "), { title: "Swico config => ".concat(configFileName) });
|
|
141
|
+
process.exit(1);
|
|
142
142
|
}
|
|
143
143
|
if (key === 'base' &&
|
|
144
144
|
!['npm', 'pnpm'].includes((_b = configObj['npmType']) !== null && _b !== void 0 ? _b : exports.initConfig.npmType)) {
|
|
145
|
-
tools_1.toast.error("The field '".concat(chalk_1.default.blue('npmType'), "' does not support the value '").concat(chalk_1.default.red(configObj['npmType']), "',the value
|
|
146
|
-
process.exit();
|
|
145
|
+
tools_1.toast.error("The field '".concat(chalk_1.default.blue('npmType'), "' does not support the value '").concat(chalk_1.default.red(configObj['npmType']), "',the value should be 'npm' or 'pnpm' "), { title: "Swico config => ".concat(configFileName) });
|
|
146
|
+
process.exit(1);
|
|
147
147
|
}
|
|
148
148
|
if (!['hash', 'browser'].includes((_d = (_c = configObj['router']) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : exports.initConfig.router.type)) {
|
|
149
|
-
tools_1.toast.error("The field '".concat(chalk_1.default.blue('router.type'), "' does not support the value '").concat(chalk_1.default.red(configObj['router'].type), "',the value
|
|
150
|
-
process.exit();
|
|
149
|
+
tools_1.toast.error("The field '".concat(chalk_1.default.blue('router.type'), "' does not support the value '").concat(chalk_1.default.red(configObj['router'].type), "',the value should be 'browser' or 'hash' "), { title: "Swico config => ".concat(configFileName) });
|
|
150
|
+
process.exit(1);
|
|
151
151
|
}
|
|
152
152
|
_f = customConfig;
|
|
153
153
|
_g = key;
|
package/src/utils/tools.js
CHANGED
|
@@ -235,7 +235,6 @@ exports.toast = {
|
|
|
235
235
|
console.log("> ".concat(chalk_1.default.red.bold(message)));
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
console.log('\n');
|
|
239
238
|
},
|
|
240
239
|
warning: function (message, options) {
|
|
241
240
|
var _a = options || {}, inline = _a.inline, title = _a.title;
|
|
@@ -254,7 +253,6 @@ exports.toast = {
|
|
|
254
253
|
console.log("> ".concat(chalk_1.default.hex(color).bold(message)));
|
|
255
254
|
}
|
|
256
255
|
}
|
|
257
|
-
console.log('\n');
|
|
258
256
|
}
|
|
259
257
|
};
|
|
260
258
|
var initIndexFile = function () { return __awaiter(void 0, void 0, void 0, function () {
|