node-karin 0.3.5 → 0.3.7
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/adapter/onebot/onebot11.d.ts +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +5 -0
- package/lib/render/client.d.ts +1 -0
- package/lib/render/server.d.ts +1 -0
- package/lib/types/adapter.d.ts +1 -0
- package/lib/types/render.d.ts +1 -1
- package/lib/utils/config.d.ts +1 -1
- package/lib/utils/config.js +4 -4
- package/lib/utils/kritor-proto.d.ts +1 -0
- package/package.json +3 -2
package/lib/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare const Cfg: {
|
|
|
35
35
|
change: Map<string, any>;
|
|
36
36
|
watcher: Map<string, any>;
|
|
37
37
|
review: boolean;
|
|
38
|
-
|
|
38
|
+
logger: import("log4js").Logger;
|
|
39
39
|
initCfg(): Promise<void>;
|
|
40
40
|
getPlugins(): string[];
|
|
41
41
|
dirPath(name: string, plugins: string[]): Promise<void>;
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/// <reference types="@types/express" />
|
|
2
|
+
/// <reference types="@types/lodash" />
|
|
3
|
+
/// <reference types="@types/node" />
|
|
4
|
+
/// <reference types="@types/node-schedule" />
|
|
5
|
+
/// <reference types="@types/ws" />
|
|
1
6
|
// 基本模块
|
|
2
7
|
export * from 'kritor-proto';
|
|
3
8
|
export * from './core/index.js';
|
package/lib/render/client.d.ts
CHANGED
package/lib/render/server.d.ts
CHANGED
package/lib/types/adapter.d.ts
CHANGED
package/lib/types/render.d.ts
CHANGED
package/lib/utils/config.d.ts
CHANGED
package/lib/utils/config.js
CHANGED
|
@@ -10,7 +10,7 @@ export const config = new (class Cfg {
|
|
|
10
10
|
change
|
|
11
11
|
watcher
|
|
12
12
|
review
|
|
13
|
-
|
|
13
|
+
logger
|
|
14
14
|
constructor () {
|
|
15
15
|
this.dir = karinDir
|
|
16
16
|
this._path = process.cwd() + '/config'
|
|
@@ -43,7 +43,7 @@ export const config = new (class Cfg {
|
|
|
43
43
|
this.dirPath('temp', plugins)
|
|
44
44
|
this.dirPath('resources', plugins)
|
|
45
45
|
this.dirPath('temp/html', plugins)
|
|
46
|
-
this.
|
|
46
|
+
this.logger = (await import('./logger.js')).default
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
getPlugins () {
|
|
@@ -212,7 +212,7 @@ export const config = new (class Cfg {
|
|
|
212
212
|
/** 监听文件变化 */
|
|
213
213
|
watcher.on('change', () => {
|
|
214
214
|
this.change.delete(key)
|
|
215
|
-
this.
|
|
215
|
+
this.logger.mark(`[修改配置文件][${type}][${name}]`)
|
|
216
216
|
/** 文件修改后调用对应的方法 */
|
|
217
217
|
switch (`change_${name}`) {
|
|
218
218
|
case 'change_App':
|
|
@@ -236,7 +236,7 @@ export const config = new (class Cfg {
|
|
|
236
236
|
|
|
237
237
|
async change_config () {
|
|
238
238
|
/** 修改日志等级 */
|
|
239
|
-
this.
|
|
239
|
+
this.logger.level = this.Config.log4jsCfg.level
|
|
240
240
|
await this.#review()
|
|
241
241
|
if (this.Server.HotUpdate) {
|
|
242
242
|
const { Bot } = await import('../index.js')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'kritor-proto'
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-karin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "基于 Kritor 进行开发的nodejs机器人框架",
|
|
6
6
|
"homepage": "https://github.com/KarinJS/Karin",
|
|
7
|
+
"types": "./lib/index.d.ts",
|
|
7
8
|
"bugs": {
|
|
8
9
|
"url": "https://github.com/KarinJS/Karin/issues"
|
|
9
10
|
},
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"scripts": {
|
|
39
40
|
"app": "node .",
|
|
40
41
|
"build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json && npm run fix && npm run cp",
|
|
41
|
-
"cp": "cp ./lib/modules.d.ts ./modules.d.ts && cp ./lib/modules.js ./modules.js",
|
|
42
|
+
"cp": "cp ./lib/modules.d.ts ./modules.d.ts && cp ./lib/modules.js ./modules.js && cp ./src/utils/kritor-proto.d.ts ./lib/utils/kritor-proto.d.ts",
|
|
42
43
|
"delete": "pm2 delete ./config/config/pm2.yaml",
|
|
43
44
|
"fix": "eslint lib/**/*.js --fix",
|
|
44
45
|
"fix:all": "eslint lib/**/*.js --fix && eslint src/**/*.ts --fix",
|