@yumerijs/core 1.0.12 → 1.0.13

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/dist/index.d.ts CHANGED
@@ -7,4 +7,5 @@ import { Core } from './core';
7
7
  import { Session } from './session';
8
8
  import { Command } from './command';
9
9
  import { Config } from './config';
10
- export { Core, Session, Command, Config };
10
+ import { Logger } from './logger';
11
+ export { Core, Session, Command, Config, Logger };
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * WindyPear-Team All right reserved
6
6
  **/
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Config = exports.Command = exports.Session = exports.Core = void 0;
8
+ exports.Logger = exports.Config = exports.Command = exports.Session = exports.Core = void 0;
9
9
  const core_1 = require("./core");
10
10
  Object.defineProperty(exports, "Core", { enumerable: true, get: function () { return core_1.Core; } });
11
11
  const session_1 = require("./session");
@@ -14,4 +14,6 @@ const command_1 = require("./command");
14
14
  Object.defineProperty(exports, "Command", { enumerable: true, get: function () { return command_1.Command; } });
15
15
  const config_1 = require("./config");
16
16
  Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
17
+ const logger_1 = require("./logger");
18
+ Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
17
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;IAII;;;AAEJ,iCAA8B;AAKrB,qFALA,WAAI,OAKA;AAJb,uCAAoC;AAIrB,wFAJN,iBAAO,OAIM;AAHtB,uCAAoC;AAGZ,wFAHf,iBAAO,OAGe;AAF/B,qCAAkC;AAED,uFAFxB,eAAM,OAEwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;IAII;;;AAEJ,iCAA8B;AAMrB,qFANA,WAAI,OAMA;AALb,uCAAoC;AAKrB,wFALN,iBAAO,OAKM;AAJtB,uCAAoC;AAIZ,wFAJf,iBAAO,OAIe;AAH/B,qCAAkC;AAGD,uFAHxB,eAAM,OAGwB;AAFvC,qCAAkC;AAEO,uFAFhC,eAAM,OAEgC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @time: 2025/03/24 22:35
3
+ * @author: FireGuo
4
+ * WindyPear-Team All right reserved
5
+ **/
6
+ export declare class Logger {
7
+ private title;
8
+ private titleColor;
9
+ constructor(title: string);
10
+ private getRandomColor;
11
+ private log;
12
+ info(content: string): void;
13
+ warn(content: string): void;
14
+ error(content: string): void;
15
+ }
package/dist/logger.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * @time: 2025/03/24 22:35
4
+ * @author: FireGuo
5
+ * WindyPear-Team All right reserved
6
+ **/
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.Logger = void 0;
12
+ const chalk_1 = __importDefault(require("chalk")); // 引入 chalk 来实现控制台颜色输出
13
+ class Logger {
14
+ constructor(title) {
15
+ this.title = title;
16
+ this.titleColor = this.getRandomColor(); // 构造器中生成随机颜色
17
+ }
18
+ getRandomColor() {
19
+ const colors = [chalk_1.default.red, chalk_1.default.green, chalk_1.default.yellow, chalk_1.default.blue, chalk_1.default.magenta, chalk_1.default.cyan, chalk_1.default.white, chalk_1.default.gray];
20
+ const randomIndex = Math.floor(Math.random() * colors.length);
21
+ return colors[randomIndex];
22
+ }
23
+ log(level, content) {
24
+ const now = new Date();
25
+ const timestamp = `${now.getFullYear()}/${String(now.getMonth() + 1).padStart(2, '0')}/${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
26
+ console.log(`${timestamp} [${level}] ${this.titleColor(this.title)} ${content}`);
27
+ }
28
+ info(content) {
29
+ this.log('I', content);
30
+ }
31
+ warn(content) {
32
+ this.log('W', content);
33
+ }
34
+ error(content) {
35
+ this.log('E', content);
36
+ }
37
+ }
38
+ exports.Logger = Logger;
39
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA;;;;IAII;;;;;;AAEJ,kDAAqC,CAAC,sBAAsB;AAE5D,MAAa,MAAM;IAIjB,YAAa,KAAa;QACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,aAAa;IACxD,CAAC;IAEO,cAAc;QACpB,MAAM,MAAM,GAAG,CAAC,eAAK,CAAC,GAAG,EAAE,eAAK,CAAC,KAAK,EAAE,eAAK,CAAC,MAAM,EAAE,eAAK,CAAC,IAAI,EAAE,eAAK,CAAC,OAAO,EAAE,eAAK,CAAC,IAAI,EAAE,eAAK,CAAC,KAAK,EAAE,eAAK,CAAC,IAAI,CAAC,CAAC;QACtH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;IAEO,GAAG,CAAC,KAAa,EAAE,OAAe;QACxC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QAC1N,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,KAAK,KAAK,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzB,CAAC;CACF;AAhCD,wBAgCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yumerijs/core",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Core module for yumeri",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,6 +31,8 @@
31
31
  "typescript": "^5.8.2"
32
32
  },
33
33
  "dependencies": {
34
+ "@types/chalk": "^2.2.4",
35
+ "chalk": "^5.4.1",
34
36
  "chokidar": "^4.0.3",
35
37
  "js-sha256": "^0.11.0",
36
38
  "js-yaml": "^4.1.0"