@kotori-bot/loader 1.7.1 → 1.7.3

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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
10
10
  */
11
11
 
12
12
  "use strict";
@@ -143,7 +143,7 @@ const adapterConfigSchemaFactory = (lang, commandPrefix) => import_core.Tsu.Obje
143
143
  const modulePackageSchema = import_core.Tsu.Object({
144
144
  name: import_core.Tsu.Custom((input) => {
145
145
  if (typeof input !== "string") return false;
146
- if (!input.startsWith("@") && /kotori-plugin-[a-z]([a-z,0-9]{2,13})\b/.exec(input) === null) return false;
146
+ if (!input.startsWith("@") && /kotori-plugin-[a-z]([a-z,0-9]{2,33})\b/.exec(input) === null) return false;
147
147
  return true;
148
148
  }),
149
149
  version: import_core.Tsu.String(),
@@ -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] ?? {}]);
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import { type Context, Service } from '@kotori-bot/core';
2
4
  import { type IncomingMessage, type ServerResponse } from 'node:http';
3
5
  import type { HttpRouteHandler, HttpRoutes, WsRouteHandler } from '../types/server';
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
10
10
  */
11
11
 
12
12
  "use strict";
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import type { NextFunction, Request, Response } from 'express';
2
3
  import type { IncomingMessage } from 'node:http';
3
4
  import type Ws from 'ws';
@@ -1,12 +1,12 @@
1
1
 
2
2
  /**
3
3
  * @Package @kotori-bot/loader
4
- * @Version 1.7.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1
4
+ * @Version 1.7.3
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 18:47:18
9
+ * @Date 2024/8/11 15:27:41
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.1",
3
+ "version": "1.7.3",
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.1",
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",