swico 0.8.1-beta13 → 0.8.1-beta14

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.1-beta13",
3
+ "version": "0.8.1-beta14",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
13
36
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
37
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
38
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -60,6 +83,8 @@ var path_1 = __importDefault(require("path"));
60
83
  var cross_spawn_1 = __importDefault(require("cross-spawn"));
61
84
  var _a = process.env, envPort = _a.PORT, RESTART = _a.RESTART;
62
85
  var package_json_1 = __importDefault(require("../../package.json"));
86
+ var process = __importStar(require("node:process"));
87
+ var chalk_1 = __importDefault(require("chalk"));
63
88
  var handleWatch = function (projectPath, devServer) {
64
89
  var configFilesWatcher = chokidar_1.default
65
90
  .watch([
@@ -163,6 +188,9 @@ function start() {
163
188
  oriLogger = compiler.getInfrastructureLogger;
164
189
  compiler.getInfrastructureLogger = getMockGetLogger(compiler);
165
190
  devServer = new webpack_dev_server_1.default(__assign(__assign({}, startConfig.devServer), { port: availablePort }), compiler);
191
+ devServer.stopCallback(function () {
192
+ process.exit(1);
193
+ });
166
194
  _b.label = 7;
167
195
  case 7:
168
196
  _b.trys.push([7, 9, , 10]);
@@ -171,7 +199,7 @@ function start() {
171
199
  _b.sent();
172
200
  compiler.getInfrastructureLogger = oriLogger;
173
201
  handleWatch(projectPath, devServer);
174
- tools_1.toast.info("Project is running at\uFF1A".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/"));
202
+ tools_1.toast.info("Project is running at\uFF1A".concat(chalk_1.default.hex('#29abe0')("".concat(startConfig.devServer.server, "://localhost:").concat(availablePort, "/"))));
175
203
  return [3, 10];
176
204
  case 9:
177
205
  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: '#7888FCFF',
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)
@@ -66,6 +66,7 @@ var html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
66
66
  var webpack_1 = __importDefault(require("webpack"));
67
67
  var vue_loader_1 = require("vue-loader");
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;
@@ -282,7 +283,7 @@ function default_1(_a) {
282
283
  }),
283
284
  new webpackbar_1.default({
284
285
  name: 'Swico',
285
- color: '#7888FCFF',
286
+ color: tools_1.themeColor,
286
287
  profile: false
287
288
  })
288
289
  ], false), ((customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.plugins) || config_1.initConfig.plugins), true)
@@ -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;
@@ -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('#7888FCFF')(message), "\n"));
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('#7888FCFF')('There are some errors about Swico:'), " \n"));
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('#7888FCFF')('There are some warnings about Swico:'), " \n"));
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"));