@kotori-bot/core 1.5.0 → 1.5.1

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.
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/core
4
- * @Version 1.4.2-beta.1
4
+ * @Version 1.5.0
5
5
  * @Author Hotaru <biyuehuya@gmail.com>
6
6
  * @Copyright 2024 Hotaru. All rights reserved.
7
7
  * @License GPL-3.0
8
8
  * @Link https://github.com/kotorijs/kotori
9
- * @Date 2024/6/6 21:03:53
9
+ * @Date 2024/6/7 11:22:22
10
10
  */
11
11
 
12
12
  "use strict";
@@ -37,8 +37,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
37
37
  mod
38
38
  ));
39
39
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
-
41
- // src/components/config.ts
42
40
  var config_exports = {};
43
41
  __export(config_exports, {
44
42
  Config: () => Config,
@@ -46,39 +44,10 @@ __export(config_exports, {
46
44
  });
47
45
  module.exports = __toCommonJS(config_exports);
48
46
  var import_tsukiko = __toESM(require("tsukiko"));
49
- var import_node_path = require("path");
47
+ var import_node_path = require("node:path");
50
48
  var import_tools = require("@kotori-bot/tools");
51
-
52
- // src/global/constants.ts
53
- var import_i18n = require("@kotori-bot/i18n");
54
- var PLUGIN_PREFIX = "kotori-plugin-";
55
- var DATABASE_PREFIX = `${PLUGIN_PREFIX}database-`;
56
- var ADAPTER_PREFIX = `${PLUGIN_PREFIX}adapter-`;
57
- var CUSTOM_PREFIX = `${PLUGIN_PREFIX}custom-`;
58
- var DEFAULT_PORT = 720;
59
- var DEFAULT_CORE_CONFIG = {
60
- global: {
61
- lang: import_i18n.DEFAULT_LANG,
62
- "command-prefix": "/",
63
- port: DEFAULT_PORT
64
- },
65
- adapter: {},
66
- plugin: {}
67
- };
68
-
69
- // src/global/symbols.ts
70
- var Symbols = class {
71
- static adapter = Symbol.for("kotori.core.adapter");
72
- static bot = Symbol.for("kotori.core.bot");
73
- static midware = Symbol.for("kotori.core.midware");
74
- static command = Symbol.for("kotori.core.command");
75
- static regexp = Symbol.for("kotori.core.regexp");
76
- static modules = Symbol.for("kotori.loader.module");
77
- static job = Symbol.for("kotori.loader.job");
78
- };
79
-
80
- // src/components/config.ts
81
- var packageInfoSchema = import_tsukiko.default.Object({
49
+ var import_global = require("../global");
50
+ const packageInfoSchema = import_tsukiko.default.Object({
82
51
  name: import_tsukiko.default.String(),
83
52
  version: import_tsukiko.default.String(),
84
53
  description: import_tsukiko.default.String(),
@@ -86,10 +55,10 @@ var packageInfoSchema = import_tsukiko.default.Object({
86
55
  license: import_tsukiko.default.Literal("GPL-3.0"),
87
56
  author: import_tsukiko.default.String()
88
57
  });
89
- var Config = class {
58
+ class Config {
90
59
  config;
91
60
  pkg;
92
- constructor(config = DEFAULT_CORE_CONFIG) {
61
+ constructor(config = import_global.DEFAULT_CORE_CONFIG) {
93
62
  this.config = config;
94
63
  const info = (0, import_tools.loadConfig)((0, import_node_path.resolve)(__dirname, "../../package.json"));
95
64
  if (!info || Object.values(info).length === 0) {
@@ -105,7 +74,7 @@ var Config = class {
105
74
  }
106
75
  this.pkg = result.data;
107
76
  }
108
- };
77
+ }
109
78
  var config_default = Config;
110
79
  // Annotate the CommonJS export names for ESM import in node:
111
80
  0 && (module.exports = {