swico 0.8.2-beta3 → 0.8.2-beta4

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.2-beta3",
3
+ "version": "0.8.2-beta4",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -57,10 +57,12 @@ var tools_1 = require("../utils/tools");
57
57
  var config_1 = require("../utils/config");
58
58
  var chokidar_1 = __importDefault(require("chokidar"));
59
59
  var path_1 = __importDefault(require("path"));
60
+ var ora_1 = __importDefault(require("ora"));
60
61
  var cross_spawn_1 = __importDefault(require("cross-spawn"));
61
62
  var _a = process.env, envPort = _a.PORT, RESTART = _a.RESTART;
62
63
  var package_json_1 = __importDefault(require("../../package.json"));
63
64
  var chalk_1 = __importDefault(require("chalk"));
65
+ var spinner = (0, ora_1.default)();
64
66
  var handleWatch = function (projectPath, devServer) {
65
67
  var configFilesWatcher = chokidar_1.default
66
68
  .watch([
@@ -164,15 +166,15 @@ function start() {
164
166
  oriLogger = compiler.getInfrastructureLogger;
165
167
  compiler.getInfrastructureLogger = getMockGetLogger(compiler);
166
168
  devServer = new webpack_dev_server_1.default(__assign(__assign({}, startConfig.devServer), { port: availablePort }), compiler);
167
- compiler.hooks.beforeCompile.tap('xxx', function () {
168
- tools_1.toast.info('Compiling...');
169
+ compiler.hooks.beforeCompile.tap('beforeCompile', function () {
170
+ tools_1.toast.info('Compiling...', { wrap: false });
169
171
  });
170
- compiler.hooks.done.tap('yyy', function (stats) {
172
+ compiler.watch({}, function (err, stats) {
171
173
  var info = stats.toJson();
172
- if (stats.hasErrors() || stats.hasWarnings()) {
174
+ if (err || stats.hasErrors() || stats.hasWarnings()) {
173
175
  return;
174
176
  }
175
- tools_1.toast.info("Compiled successfully in ".concat(info.time, "ms"));
177
+ tools_1.toast.info("Compiled successfully in ".concat(info.time, "ms"), { wrap: false });
176
178
  });
177
179
  _b.label = 7;
178
180
  case 7:
@@ -182,7 +184,7 @@ function start() {
182
184
  _b.sent();
183
185
  compiler.getInfrastructureLogger = oriLogger;
184
186
  handleWatch(projectPath, devServer);
185
- tools_1.toast.info("Project is running at\uFF1A".concat(chalk_1.default.hex('#29abe0')("".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/"))));
187
+ tools_1.toast.info("Project is running at\uFF1A".concat((chalk_1.default.hex('#29abe0')("".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/")), { wrap: false })));
186
188
  return [3, 10];
187
189
  case 9:
188
190
  e_1 = _b.sent();
@@ -3,10 +3,14 @@ export declare const copyDirFiles: (src: any, dest: any, filter?: (fileName: any
3
3
  export declare const getFormatRouter: (projectPath: string, routes: ConfigRouterType['routes'], templateType: any) => any[];
4
4
  export declare const getPort: () => Promise<number>;
5
5
  export declare const themeColor = "#7888FCFF";
6
+ interface ToastOptions {
7
+ wrap: boolean;
8
+ }
6
9
  export declare const toast: {
7
- info: (message: string) => void;
8
- success: (message: string) => void;
10
+ info: (message: string, options?: ToastOptions) => void;
11
+ success: (message: string, options?: ToastOptions) => void;
9
12
  error: (message: string | string[]) => void;
10
13
  warning: (message: string | string[]) => void;
11
14
  };
12
15
  export declare const initIndexFile: () => Promise<void>;
16
+ export {};
@@ -206,11 +206,13 @@ var getPort = function () {
206
206
  exports.getPort = getPort;
207
207
  exports.themeColor = '#7888FCFF';
208
208
  exports.toast = {
209
- info: function (message) {
210
- console.log("".concat(chalk_1.default.hex(exports.themeColor).bold('swico'), " - ").concat(message, "\n"));
209
+ info: function (message, options) {
210
+ var _a = (options || {}).wrap, wrap = _a === void 0 ? true : _a;
211
+ console.log("".concat(chalk_1.default.hex(exports.themeColor).bold('swico'), " - ").concat(message).concat(wrap ? '\n' : ''));
211
212
  },
212
- success: function (message) {
213
- console.log("".concat(chalk_1.default.hex('#32f264').bold('swico'), " - ").concat(message, "\n"));
213
+ success: function (message, options) {
214
+ var _a = (options || {}).wrap, wrap = _a === void 0 ? true : _a;
215
+ console.log("".concat(chalk_1.default.hex('#32f264').bold('swico'), " - ").concat(message).concat(wrap ? '\n' : ''));
214
216
  },
215
217
  error: function (message) {
216
218
  console.log("".concat(chalk_1.default.red.bold('error'), " - There are some errors about Swico\uFF1A \n"));