@kotori-bot/loader 1.7.0 → 1.7.2

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/lib/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -212,7 +212,7 @@ class Loader extends import_core.Core {
212
212
  this.i18n.use(import_node_path.default.resolve(__dirname, "../../locales"));
213
213
  }
214
214
  run(onlyStart = false) {
215
- if (onlyStart) return this.emit("ready");
215
+ if (onlyStart) return this.start();
216
216
  this.logger.trace("baseDir:", this.baseDir);
217
217
  this.logger.trace("options:", this.options);
218
218
  this.logger.trace("config:", this.config);
@@ -298,10 +298,8 @@ class Loader extends import_core.Core {
298
298
  if (e instanceof import_core.TsuError) throw new import_core.DevError(`package.json format error ${pkgPath}: ${e.message}`);
299
299
  throw new import_core.DevError(`illegal package.json ${pkgPath}`);
300
300
  }
301
- const main = import_node_path.default.resolve(
302
- dir,
303
- this.isDev && import_node_fs.default.existsSync(import_node_path.default.join(dir, "src/index.ts")) ? "src/index.ts" : pkg.main
304
- );
301
+ const loadTs = this.isDev && import_node_fs.default.existsSync(import_node_path.default.join(dir, "src/index.ts"));
302
+ const main = import_node_path.default.resolve(dir, loadTs ? "src/index.ts" : pkg.main);
305
303
  if (!import_node_fs.default.existsSync(main)) throw new import_core.DevError(`cannot find main file ${main}`);
306
304
  const getDirFiles = (rootDir2) => {
307
305
  const files2 = import_node_fs.default.readdirSync(rootDir2);
@@ -316,7 +314,7 @@ class Loader extends import_core.Core {
316
314
  }
317
315
  return list;
318
316
  };
319
- const files = getDirFiles(import_node_path.default.join(dir, this.isDev ? "src" : import_node_path.default.parse(pkg.main).dir));
317
+ const files = getDirFiles(import_node_path.default.join(dir, loadTs ? "src" : import_node_path.default.parse(pkg.main).dir));
320
318
  const [pkgScope, pkgName] = pkg.name.split("/");
321
319
  const pluginName = `${pkgScope.startsWith("@") && pkgScope !== "@kotori-bot" ? `${pkgScope.slice(1)}/` : ""}${(pkgName ?? pkgScope).replace(import_constants.PLUGIN_PREFIX, "")}`;
322
320
  this[import_core.Symbols.modules].set(pkg.name, [{ pkg, files, main }, this.config.plugin[pluginName] ?? {}]);
@@ -399,7 +397,7 @@ class Loader extends import_core.Core {
399
397
  this.format(`loader.modules.all${failLoadCount > 0 ? ".failed" : ""}`, [this.loadRecord.size, failLoadCount])
400
398
  );
401
399
  this.loadAllAdapter();
402
- this.emit("ready");
400
+ this.start();
403
401
  }
404
402
  loadAllAdapter() {
405
403
  const adapters = this[import_core.Symbols.adapter];
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
package/lib/utils/log.js CHANGED
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.0-rc.1
4
+ * @Version 1.7.2
5
5
  * @Author Arimura Sena <me@hotaru.icu>
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/8/9 17:33:08
9
+ * @Date 2024/8/11 15:08:40
10
10
  */
11
11
 
12
12
  "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kotori-bot/loader",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Loader For KotoriBot",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -29,8 +29,8 @@
29
29
  "level": "^8.0.1",
30
30
  "path-to-regexp": "^6.2.2",
31
31
  "ws": "^8.14.2",
32
- "@kotori-bot/core": "^1.6.0",
33
- "@kotori-bot/logger": "^1.3.2"
32
+ "@kotori-bot/logger": "^1.3.2",
33
+ "@kotori-bot/core": "^1.6.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/express": "^4.17.21",