@kotori-bot/loader 1.7.1 → 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 +2 -2
- package/lib/loader/constants.js +2 -2
- package/lib/loader/index.js +2 -2
- package/lib/loader/loader.js +5 -7
- package/lib/service/adapters.js +2 -2
- package/lib/service/database.js +2 -2
- package/lib/service/file.js +2 -2
- package/lib/service/server.d.ts +2 -0
- package/lib/service/server.js +2 -2
- package/lib/types/index.js +2 -2
- package/lib/types/server.d.ts +1 -0
- package/lib/types/server.js +2 -2
- package/lib/utils/log.js +2 -2
- package/lib/utils/logger.js +2 -2
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/loader/constants.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/loader/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/loader/loader.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
|
@@ -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
|
|
302
|
-
|
|
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,
|
|
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] ?? {}]);
|
package/lib/service/adapters.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/service/database.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/service/file.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/service/server.d.ts
CHANGED
|
@@ -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';
|
package/lib/service/server.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/types/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/types/server.d.ts
CHANGED
package/lib/types/server.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @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.
|
|
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
|
+
* @Date 2024/8/11 15:08:40
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
"use strict";
|
package/lib/utils/logger.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* @Package @kotori-bot/loader
|
|
4
|
-
* @Version 1.7.
|
|
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
|
+
* @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.
|
|
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/
|
|
33
|
-
"@kotori-bot/
|
|
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",
|