node-karin 0.0.3 → 0.1.0
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/LICENSE +674 -674
- package/README.md +57 -57
- package/config/defSet/App.yaml +37 -37
- package/config/defSet/config.yaml +43 -43
- package/config/defSet/group.yaml +18 -18
- package/config/defSet/pm2.yaml +21 -21
- package/config/defSet/server.yaml +42 -42
- package/config/view/App.yaml +74 -74
- package/config/view/config.yaml +100 -100
- package/config/view/group.yaml +62 -62
- package/config/view/pm2.yaml +41 -41
- package/config/view/redis.yaml +25 -25
- package/config/view/server.yaml +93 -93
- package/lib/adapter/onebot/onebot11.d.ts +430 -430
- package/lib/adapter/onebot/onebot11.js +1265 -1302
- package/lib/core/init.js +4 -4
- package/lib/core/karin.d.ts +72 -72
- package/lib/core/karin.js +51 -51
- package/lib/core/listener.d.ts +121 -121
- package/lib/core/listener.js +178 -178
- package/lib/core/plugin.app.d.ts +15 -15
- package/lib/core/plugin.app.js +18 -18
- package/lib/core/plugin.d.ts +182 -182
- package/lib/core/plugin.js +132 -132
- package/lib/core/plugin.loader.d.ts +149 -149
- package/lib/core/plugin.loader.js +451 -451
- package/lib/core/server.d.ts +26 -26
- package/lib/core/server.js +209 -209
- package/lib/db/level.d.ts +20 -20
- package/lib/db/level.js +36 -36
- package/lib/db/redis.d.ts +41 -41
- package/lib/db/redis.js +131 -131
- package/lib/db/redis_level.d.ts +113 -113
- package/lib/db/redis_level.js +274 -274
- package/lib/event/event.d.ts +138 -138
- package/lib/event/event.handler.d.ts +29 -29
- package/lib/event/event.handler.js +138 -138
- package/lib/event/event.js +120 -120
- package/lib/event/message.d.ts +102 -102
- package/lib/event/message.handler.d.ts +25 -25
- package/lib/event/message.handler.js +237 -237
- package/lib/event/message.js +69 -69
- package/lib/event/notice.d.ts +49 -49
- package/lib/event/notice.js +14 -14
- package/lib/event/request.d.ts +49 -49
- package/lib/event/request.js +14 -14
- package/lib/event/review.handler.d.ts +54 -54
- package/lib/event/review.handler.js +374 -374
- package/lib/index.d.ts +23 -23
- package/lib/index.js +39 -40
- package/lib/renderer/app.d.ts +53 -53
- package/lib/renderer/app.js +88 -88
- package/lib/renderer/base.d.ts +30 -30
- package/lib/renderer/base.js +68 -68
- package/lib/renderer/client.d.ts +30 -30
- package/lib/renderer/client.js +155 -155
- package/lib/renderer/http.d.ts +19 -19
- package/lib/renderer/http.js +50 -50
- package/lib/renderer/server.d.ts +42 -42
- package/lib/renderer/server.js +110 -110
- package/lib/renderer/wormhole.d.ts +1 -1
- package/lib/renderer/wormhole.js +154 -154
- package/lib/types/adapter.d.ts +575 -575
- package/lib/types/adapter.js +1 -1
- package/lib/types/config.d.ts +327 -327
- package/lib/types/config.js +1 -1
- package/lib/types/element.d.ts +576 -576
- package/lib/types/element.js +1 -1
- package/lib/types/index.d.ts +8 -8
- package/lib/types/index.js +8 -8
- package/lib/types/logger.d.ts +109 -109
- package/lib/types/logger.js +1 -1
- package/lib/types/onebots11.d.ts +1371 -1371
- package/lib/types/onebots11.js +1 -1
- package/lib/types/plugin.d.ts +282 -282
- package/lib/types/plugin.js +1 -1
- package/lib/types/render.d.ts +111 -111
- package/lib/types/render.js +1 -1
- package/lib/types/reply.d.ts +40 -40
- package/lib/types/reply.js +1 -1
- package/lib/types/types.d.ts +898 -898
- package/lib/types/types.js +1 -1
- package/lib/utils/YamlEditor.d.ts +62 -62
- package/lib/utils/YamlEditor.js +197 -197
- package/lib/utils/button.d.ts +49 -49
- package/lib/utils/button.js +75 -75
- package/lib/utils/common.d.ts +123 -123
- package/lib/utils/common.js +396 -396
- package/lib/utils/config.d.ts +72 -72
- package/lib/utils/config.js +254 -254
- package/lib/utils/exec.d.ts +22 -22
- package/lib/utils/exec.js +36 -36
- package/lib/utils/ffmpeg.d.ts +12 -12
- package/lib/utils/ffmpeg.js +25 -25
- package/lib/utils/handler.d.ts +76 -76
- package/lib/utils/handler.js +98 -98
- package/lib/utils/logger.d.ts +3 -3
- package/lib/utils/logger.js +104 -104
- package/lib/utils/segment.d.ts +276 -276
- package/lib/utils/segment.js +420 -420
- package/lib/utils/update.d.ts +69 -69
- package/lib/utils/update.js +145 -145
- package/lib/utils/updateVersion.d.ts +33 -33
- package/lib/utils/updateVersion.js +140 -140
- package/package.json +92 -91
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
import fs from 'fs'
|
|
2
|
-
import { exec } from 'child_process'
|
|
3
|
-
export default class Version {
|
|
4
|
-
path
|
|
5
|
-
packageDir
|
|
6
|
-
CHANGELOGDir
|
|
7
|
-
packageJson
|
|
8
|
-
version
|
|
9
|
-
commitsMap
|
|
10
|
-
HEAD
|
|
11
|
-
cmd
|
|
12
|
-
stdout
|
|
13
|
-
url
|
|
14
|
-
constructor (path) {
|
|
15
|
-
this.cmd = ''
|
|
16
|
-
this.stdout = ''
|
|
17
|
-
this.url = ''
|
|
18
|
-
this.HEAD = ''
|
|
19
|
-
this.path = path
|
|
20
|
-
this.packageDir = this.path + '/packageon'
|
|
21
|
-
this.CHANGELOGDir = this.path + '/CHANGELOG.md'
|
|
22
|
-
this.packageJson = JSON.parse(fs.readFileSync(this.packageDir, 'utf-8'))
|
|
23
|
-
this.version = this.packageJson.version
|
|
24
|
-
this.commitsMap = {
|
|
25
|
-
release: ['### Releases'],
|
|
26
|
-
feat: ['### 新增功能'],
|
|
27
|
-
fix: ['### Bug修复'],
|
|
28
|
-
docs: ['### 文档更新'],
|
|
29
|
-
style: ['### 代码样式修改'],
|
|
30
|
-
refactor: ['### 代码重构'],
|
|
31
|
-
perf: ['### 性能优化'],
|
|
32
|
-
chore: ['### 构建工具相关'],
|
|
33
|
-
revert: ['### 回滚'],
|
|
34
|
-
others: ['### 其他提交'],
|
|
35
|
-
}
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import { exec } from 'child_process'
|
|
3
|
+
export default class Version {
|
|
4
|
+
path
|
|
5
|
+
packageDir
|
|
6
|
+
CHANGELOGDir
|
|
7
|
+
packageJson
|
|
8
|
+
version
|
|
9
|
+
commitsMap
|
|
10
|
+
HEAD
|
|
11
|
+
cmd
|
|
12
|
+
stdout
|
|
13
|
+
url
|
|
14
|
+
constructor (path) {
|
|
15
|
+
this.cmd = ''
|
|
16
|
+
this.stdout = ''
|
|
17
|
+
this.url = ''
|
|
18
|
+
this.HEAD = ''
|
|
19
|
+
this.path = path
|
|
20
|
+
this.packageDir = this.path + '/packageon'
|
|
21
|
+
this.CHANGELOGDir = this.path + '/CHANGELOG.md'
|
|
22
|
+
this.packageJson = JSON.parse(fs.readFileSync(this.packageDir, 'utf-8'))
|
|
23
|
+
this.version = this.packageJson.version
|
|
24
|
+
this.commitsMap = {
|
|
25
|
+
release: ['### Releases'],
|
|
26
|
+
feat: ['### 新增功能'],
|
|
27
|
+
fix: ['### Bug修复'],
|
|
28
|
+
docs: ['### 文档更新'],
|
|
29
|
+
style: ['### 代码样式修改'],
|
|
30
|
+
refactor: ['### 代码重构'],
|
|
31
|
+
perf: ['### 性能优化'],
|
|
32
|
+
chore: ['### 构建工具相关'],
|
|
33
|
+
revert: ['### 回滚'],
|
|
34
|
+
others: ['### 其他提交'],
|
|
35
|
+
}
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
async init () {
|
|
39
|
-
/** 获取仓库地址 */
|
|
40
|
-
await this.gitUrl()
|
|
41
|
-
/** 取tag对应的head */
|
|
42
|
-
await this.gitTag()
|
|
43
|
-
const HEAD = this.HEAD ? `${this.HEAD}..HEAD ` : ''
|
|
44
|
-
this.cmd = `git log ${HEAD}--pretty=format:"HEAD: %H=分割=sha: %h=分割=log: %s"`
|
|
45
|
-
this.stdout = (await this.exce(this.cmd))
|
|
46
|
-
if (!this.stdout) { throw new Error('commit为空...') }
|
|
47
|
-
this.stdout = this.stdout.trim().split('\n')
|
|
48
|
-
const reg = /(fix|feat|docs|style|refactor|perf|release|chore|revert)(:|:)/i
|
|
49
|
-
for (const commit of this.stdout) {
|
|
50
|
-
/** 拆分 */
|
|
51
|
-
const [HEAD, sha, log] = commit.split('=分割=').map(item => item.trim().replace(/^(HEAD|sha|log): /, ''))
|
|
52
|
-
/** 排除此项 */
|
|
53
|
-
if (log.startsWith('Merge branch')) { continue }
|
|
54
|
-
const match = log.match(reg)
|
|
55
|
-
const type = match ? match[1].toLowerCase() : 'others'
|
|
56
|
-
/** 拼接commit */
|
|
57
|
-
const info = `- ${log} ([${sha}](${this.url}/commit/${HEAD}))`
|
|
58
|
-
this.commitsMap[type].push(info)
|
|
59
|
-
}
|
|
60
|
-
/** 更新版本号 */
|
|
61
|
-
await this.updateVersion()
|
|
62
|
-
/** YYYY-MM-DD */
|
|
63
|
-
const date = new Date().toLocaleDateString().replace(/\//g, '-')
|
|
64
|
-
const text = [`## ${this.version} (${date})`]
|
|
65
|
-
for (const key in this.commitsMap) {
|
|
66
|
-
/** 排除空 */
|
|
67
|
-
if (this.commitsMap[key].length === 1) {
|
|
68
|
-
delete this.commitsMap[key]
|
|
69
|
-
continue
|
|
70
|
-
}
|
|
71
|
-
text.push(this.commitsMap[key].join('\n'))
|
|
72
|
-
}
|
|
73
|
-
/** 判断是否有CHANGELOG.md文件 */
|
|
74
|
-
if (fs.existsSync(this.CHANGELOGDir)) {
|
|
75
|
-
const oldText = fs.readFileSync(this.CHANGELOGDir, 'utf-8')
|
|
76
|
-
text.push(oldText)
|
|
77
|
-
}
|
|
78
|
-
fs.writeFileSync(this.CHANGELOGDir, text.join('\n\n'))
|
|
79
|
-
console.log('更新成功~')
|
|
37
|
+
|
|
38
|
+
async init () {
|
|
39
|
+
/** 获取仓库地址 */
|
|
40
|
+
await this.gitUrl()
|
|
41
|
+
/** 取tag对应的head */
|
|
42
|
+
await this.gitTag()
|
|
43
|
+
const HEAD = this.HEAD ? `${this.HEAD}..HEAD ` : ''
|
|
44
|
+
this.cmd = `git log ${HEAD}--pretty=format:"HEAD: %H=分割=sha: %h=分割=log: %s"`
|
|
45
|
+
this.stdout = (await this.exce(this.cmd))
|
|
46
|
+
if (!this.stdout) { throw new Error('commit为空...') }
|
|
47
|
+
this.stdout = this.stdout.trim().split('\n')
|
|
48
|
+
const reg = /(fix|feat|docs|style|refactor|perf|release|chore|revert)(:|:)/i
|
|
49
|
+
for (const commit of this.stdout) {
|
|
50
|
+
/** 拆分 */
|
|
51
|
+
const [HEAD, sha, log] = commit.split('=分割=').map(item => item.trim().replace(/^(HEAD|sha|log): /, ''))
|
|
52
|
+
/** 排除此项 */
|
|
53
|
+
if (log.startsWith('Merge branch')) { continue }
|
|
54
|
+
const match = log.match(reg)
|
|
55
|
+
const type = match ? match[1].toLowerCase() : 'others'
|
|
56
|
+
/** 拼接commit */
|
|
57
|
+
const info = `- ${log} ([${sha}](${this.url}/commit/${HEAD}))`
|
|
58
|
+
this.commitsMap[type].push(info)
|
|
59
|
+
}
|
|
60
|
+
/** 更新版本号 */
|
|
61
|
+
await this.updateVersion()
|
|
62
|
+
/** YYYY-MM-DD */
|
|
63
|
+
const date = new Date().toLocaleDateString().replace(/\//g, '-')
|
|
64
|
+
const text = [`## ${this.version} (${date})`]
|
|
65
|
+
for (const key in this.commitsMap) {
|
|
66
|
+
/** 排除空 */
|
|
67
|
+
if (this.commitsMap[key].length === 1) {
|
|
68
|
+
delete this.commitsMap[key]
|
|
69
|
+
continue
|
|
70
|
+
}
|
|
71
|
+
text.push(this.commitsMap[key].join('\n'))
|
|
72
|
+
}
|
|
73
|
+
/** 判断是否有CHANGELOG.md文件 */
|
|
74
|
+
if (fs.existsSync(this.CHANGELOGDir)) {
|
|
75
|
+
const oldText = fs.readFileSync(this.CHANGELOGDir, 'utf-8')
|
|
76
|
+
text.push(oldText)
|
|
77
|
+
}
|
|
78
|
+
fs.writeFileSync(this.CHANGELOGDir, text.join('\n\n'))
|
|
79
|
+
console.log('更新成功~')
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* 获取当前仓库最新的一个标签的HEAD
|
|
84
|
-
*/
|
|
85
|
-
async gitTag () {
|
|
86
|
-
const cmd = 'git tag'
|
|
87
|
-
const stdout = await this.exce(cmd)
|
|
88
|
-
if (!stdout) { return false }
|
|
89
|
-
const tags = stdout.trim().split('\n')
|
|
90
|
-
const lastTag = tags[tags.length - 1]
|
|
91
|
-
const cmd2 = `git rev-list -n 1 ${lastTag}`
|
|
92
|
-
const HEAD = await this.exce(cmd2)
|
|
93
|
-
this.HEAD = HEAD.trim()
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 获取当前仓库最新的一个标签的HEAD
|
|
84
|
+
*/
|
|
85
|
+
async gitTag () {
|
|
86
|
+
const cmd = 'git tag'
|
|
87
|
+
const stdout = await this.exce(cmd)
|
|
88
|
+
if (!stdout) { return false }
|
|
89
|
+
const tags = stdout.trim().split('\n')
|
|
90
|
+
const lastTag = tags[tags.length - 1]
|
|
91
|
+
const cmd2 = `git rev-list -n 1 ${lastTag}`
|
|
92
|
+
const HEAD = await this.exce(cmd2)
|
|
93
|
+
this.HEAD = HEAD.trim()
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* 获取当前仓库的远程地址
|
|
98
|
-
*/
|
|
99
|
-
async gitUrl () {
|
|
100
|
-
const cmd = 'git remote -v'
|
|
101
|
-
const stdout = await this.exce(cmd)
|
|
102
|
-
let [url] = stdout.split('\n').map(item => item.split('\t')[1])
|
|
103
|
-
url = url.trim().split(' ')[0]
|
|
104
|
-
this.url = url
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 获取当前仓库的远程地址
|
|
98
|
+
*/
|
|
99
|
+
async gitUrl () {
|
|
100
|
+
const cmd = 'git remote -v'
|
|
101
|
+
const stdout = await this.exce(cmd)
|
|
102
|
+
let [url] = stdout.split('\n').map(item => item.split('\t')[1])
|
|
103
|
+
url = url.trim().split(' ')[0]
|
|
104
|
+
this.url = url
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* 更新版本号 tag
|
|
109
|
-
*/
|
|
110
|
-
async updateVersion () {
|
|
111
|
-
/** 10进1 */
|
|
112
|
-
const versionArr = this.version.split('.').map((item) => parseInt(item))
|
|
113
|
-
if (versionArr[2] === 9) {
|
|
114
|
-
versionArr[1]++
|
|
115
|
-
versionArr[2] = 0
|
|
116
|
-
} else {
|
|
117
|
-
versionArr[2]++
|
|
118
|
-
}
|
|
119
|
-
this.version = versionArr.join('.')
|
|
120
|
-
this.packageJson.version = this.version
|
|
121
|
-
fs.writeFileSync(this.packageDir, JSON.stringify(this.packageJson, null, 2))
|
|
122
|
-
/** tag */
|
|
123
|
-
try {
|
|
124
|
-
await this.exce(`git tag v${this.version}`)
|
|
125
|
-
} catch (e) {
|
|
126
|
-
console.log('tag已存在')
|
|
127
|
-
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 更新版本号 tag
|
|
109
|
+
*/
|
|
110
|
+
async updateVersion () {
|
|
111
|
+
/** 10进1 */
|
|
112
|
+
const versionArr = this.version.split('.').map((item) => parseInt(item))
|
|
113
|
+
if (versionArr[2] === 9) {
|
|
114
|
+
versionArr[1]++
|
|
115
|
+
versionArr[2] = 0
|
|
116
|
+
} else {
|
|
117
|
+
versionArr[2]++
|
|
118
|
+
}
|
|
119
|
+
this.version = versionArr.join('.')
|
|
120
|
+
this.packageJson.version = this.version
|
|
121
|
+
fs.writeFileSync(this.packageDir, JSON.stringify(this.packageJson, null, 2))
|
|
122
|
+
/** tag */
|
|
123
|
+
try {
|
|
124
|
+
await this.exce(`git tag v${this.version}`)
|
|
125
|
+
} catch (e) {
|
|
126
|
+
console.log('tag已存在')
|
|
127
|
+
}
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* 封装exce方法
|
|
132
|
-
* @param {string} cmd 执行的命令
|
|
133
|
-
*/
|
|
134
|
-
exce (cmd) {
|
|
135
|
-
return new Promise((resolve, reject) => {
|
|
136
|
-
exec(cmd, { cwd: this.path }, (error, stdout) => {
|
|
137
|
-
if (error) {
|
|
138
|
-
reject(error)
|
|
139
|
-
return
|
|
140
|
-
}
|
|
141
|
-
resolve(stdout)
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
}
|
|
145
|
-
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 封装exce方法
|
|
132
|
+
* @param {string} cmd 执行的命令
|
|
133
|
+
*/
|
|
134
|
+
exce (cmd) {
|
|
135
|
+
return new Promise((resolve, reject) => {
|
|
136
|
+
exec(cmd, { cwd: this.path }, (error, stdout) => {
|
|
137
|
+
if (error) {
|
|
138
|
+
reject(error)
|
|
139
|
+
return
|
|
140
|
+
}
|
|
141
|
+
resolve(stdout)
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
}
|
package/package.json
CHANGED
|
@@ -1,92 +1,93 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "node-karin",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"private": false,
|
|
5
|
-
"homepage": "https://github.com/KarinJS/Karin#readme",
|
|
6
|
-
"bugs": {
|
|
7
|
-
"url": "https://github.com/KarinJS/Karin/issues"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/KarinJS/Karin.git"
|
|
12
|
-
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"files": [
|
|
21
|
-
"/lib/**/*.js",
|
|
22
|
-
"/lib/**/*.d.ts",
|
|
23
|
-
"/config/defSet/*.yaml",
|
|
24
|
-
"/config/view/*.yaml",
|
|
25
|
-
"LICENSE",
|
|
26
|
-
"package.json",
|
|
27
|
-
"README.md"
|
|
28
|
-
],
|
|
29
|
-
"workspaces": [
|
|
30
|
-
"plugins/**"
|
|
31
|
-
],
|
|
32
|
-
"scripts": {
|
|
33
|
-
"app": "node .",
|
|
34
|
-
"build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json && npm run fix",
|
|
35
|
-
"delete": "pm2 delete ./config/config/pm2.yaml",
|
|
36
|
-
"fix": "
|
|
37
|
-
"
|
|
38
|
-
"init
|
|
39
|
-
"init:
|
|
40
|
-
"
|
|
41
|
-
"js
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"ts
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"@grpc/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"@types/
|
|
75
|
-
"@types/
|
|
76
|
-
"@types/node
|
|
77
|
-
"@types/
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "node-karin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"homepage": "https://github.com/KarinJS/Karin#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/KarinJS/Karin/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/KarinJS/Karin.git"
|
|
12
|
+
},
|
|
13
|
+
"license": "GPL-3.0-only",
|
|
14
|
+
"author": "Karin",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"imports": {
|
|
17
|
+
"#Karin": "./lib/index.js"
|
|
18
|
+
},
|
|
19
|
+
"main": "./lib/index.js",
|
|
20
|
+
"files": [
|
|
21
|
+
"/lib/**/*.js",
|
|
22
|
+
"/lib/**/*.d.ts",
|
|
23
|
+
"/config/defSet/*.yaml",
|
|
24
|
+
"/config/view/*.yaml",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"package.json",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"workspaces": [
|
|
30
|
+
"plugins/**"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"app": "node .",
|
|
34
|
+
"build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json && npm run fix",
|
|
35
|
+
"delete": "pm2 delete ./config/config/pm2.yaml",
|
|
36
|
+
"fix": "eslint lib/**/*.js --fix",
|
|
37
|
+
"fix:all": "eslint lib/**/*.js --fix && eslint src/**/*.ts --fix",
|
|
38
|
+
"init": "node lib/tools/install.js",
|
|
39
|
+
"init:dev": "node lib/tools/install.js",
|
|
40
|
+
"init:pack": "node lib/tools/install.js",
|
|
41
|
+
"js": "node .",
|
|
42
|
+
"js:dev": "node . --dev",
|
|
43
|
+
"log": "node lib/tools/pm2Log.js",
|
|
44
|
+
"monit": "pm2 monit",
|
|
45
|
+
"pub": "npm publish --access public",
|
|
46
|
+
"restart": "pm2 restart ./config/config/pm2.yaml",
|
|
47
|
+
"sort:pack": "npx sort-package-json",
|
|
48
|
+
"start": "pm2 start ./config/config/pm2.yaml && pm2 monit",
|
|
49
|
+
"stop": "pm2 delete ./config/config/pm2.yaml",
|
|
50
|
+
"ts": "tsx ./src/index.ts --dev",
|
|
51
|
+
"ts:dev": "tsx ./src/index.ts --dev",
|
|
52
|
+
"uninstall": "node lib/tools/uninstall.js",
|
|
53
|
+
"ver": "node lib/tools/updateVersion.js"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@grpc/grpc-js": "1.10.10",
|
|
57
|
+
"@grpc/proto-loader": "0.7.13",
|
|
58
|
+
"art-template": "4.13.2",
|
|
59
|
+
"axios": "1.7.2",
|
|
60
|
+
"chalk": "5.3.0",
|
|
61
|
+
"chokidar": "3.6.0",
|
|
62
|
+
"express": "4.19.2",
|
|
63
|
+
"kritor-proto": "^0.0.6",
|
|
64
|
+
"level": "8.0.1",
|
|
65
|
+
"lodash": "4.17.21",
|
|
66
|
+
"log4js": "6.9.1",
|
|
67
|
+
"moment": "2.30.1",
|
|
68
|
+
"node-schedule": "2.1.1",
|
|
69
|
+
"redis": "4.6.14",
|
|
70
|
+
"ws": "8.16.0",
|
|
71
|
+
"yaml": "2.4.1"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/express": "^4.17.21",
|
|
75
|
+
"@types/lodash": "^4.17.5",
|
|
76
|
+
"@types/node": "^20.14.8",
|
|
77
|
+
"@types/node-schedule": "^2.1.7",
|
|
78
|
+
"@types/ws": "8.5.10",
|
|
79
|
+
"eslint": "9.5.0",
|
|
80
|
+
"neostandard": "^0.7.2",
|
|
81
|
+
"sort-package-json": "^2.10.0",
|
|
82
|
+
"tsc-alias": "^1.8.10",
|
|
83
|
+
"tsx": "^4.15.7",
|
|
84
|
+
"typescript": "^4.9.5"
|
|
85
|
+
},
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": ">=18"
|
|
88
|
+
},
|
|
89
|
+
"publishConfig": {
|
|
90
|
+
"access": "public",
|
|
91
|
+
"registry": "https://registry.npmjs.org"
|
|
92
|
+
}
|
|
92
93
|
}
|