-
Notifications
You must be signed in to change notification settings - Fork 3
/
package.json
365 lines (365 loc) · 15.2 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
{
"name": "hamibot-assistant",
"displayName": "Hamibot 开发助手",
"description": "辅助开发 Hamibot 脚本的 VSCode 插件",
"keywords": [
"hamibot"
],
"version": "0.7.5",
"publisher": "BATU1579",
"license": "MPL-2.0",
"homepage": "https://github.com/batu1579/hamibot-assistant#readme",
"repository": {
"type": "git",
"url": "https://github.com/batu1579/hamibot-assistant.git"
},
"bugs": {
"url": "https://github.com/batu1579/hamibot-assistant/issues"
},
"engines": {
"vscode": "^1.70.0"
},
"categories": [
"Other"
],
"icon": "images/logo.png",
"activationEvents": [
"onStartupFinished"
],
"main": "./dist/extension.js",
"contributes": {
"configuration": {
"type": "object",
"title": "Hamibot 开发助手",
"properties": {
"hamibot-assistant.apiToken": {
"type": "string",
"scope": "window",
"pattern": "^hmp_[0-9a-f]{64}$",
"patternErrorMessage": "需要是一个以 'hmp_' 开头加 64 位 16 进制字符串。",
"editPresentation": "multilineText",
"markdownDescription": "用于访问 Hamibot API 的开发者令牌,可以从 [控制台](https://hamibot.com/account/tokens) 申请。",
"order": 0
},
"hamibot-assistant.showOfflineRobot": {
"type": "boolean",
"scope": "window",
"default": true,
"markdownDescription": "选择调试机器人时显示离线机器人。",
"order": 1
},
"hamibot-assistant.defaultExecuteRobot.enable": {
"type": "boolean",
"scope": "application",
"default": false,
"markdownDescription": "使用默认调试机器人。启用后在创建项目时会使用此机器人,当项目设置中没有配置机器人时也会使用默认调试机器人代替。",
"order": 2
},
"hamibot-assistant.defaultExecuteRobot.robotInfo": {
"type": "object",
"scope": "application",
"required": [
"name",
"id"
],
"properties": {
"name": {
"type": "string",
"markdownDescription": "默认调试机器人名称"
},
"id": {
"type": "string",
"pattern": "^[0-9a-f]{24}|(?:)$",
"patternErrorMessage": "需要是一个 24 位 16 进制字符串",
"markdownDescription": "默认调试机器人 ID"
}
},
"markdownDescription": "默认调试机器人信息,只有在 `#hamibot-assistant.defaultExecuteRobot.enable#` 设置为 `true` 时才会启用\n\n建议使用指令设置",
"order": 3
},
"hamibot-assistant.defaultExecuteRobot.robotInfo.name": {
"type": "string",
"scope": "application",
"default": "",
"markdownDescription": "默认调试机器人名称",
"order": 4
},
"hamibot-assistant.defaultExecuteRobot.robotInfo.id": {
"type": "string",
"scope": "application",
"default": "",
"pattern": "^[0-9a-f]{24}|(?:)$",
"patternErrorMessage": "需要是一个 24 位 16 进制字符串",
"markdownDescription": "默认调试机器人 ID",
"order": 5
},
"hamibot-assistant.projectTemplate": {
"type": "object",
"scope": "application",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"scope": "application",
"enum": [
"disabled",
"local",
"remote",
"askWhenCreate"
],
"markdownDescription": "描述模板路径的类型,需要注意的是此项设置需要和 `#hamibot-assistant.projectTemplate.path#` 对应\n\n- `loacl` 需要在路径中填入本地的绝对路径地址\n- `remote` 需要在路径中填入有效的 Github 远程仓库地址( SSH 或 HTTPS ),同时还必须安装过 Git\n"
},
"path": {
"type": "string",
"scope": "application",
"pattern": "^(((([A-Za-z]:)|\\.)(.*))|(((git@)|(https?:\\/\\/))github.com[:\\/][\\w-_]*?\\/[\\w-_]*?(\\.git)?))|(?:)$",
"patternErrorMessage": "只能是一个本地绝对路径或 Github 远程仓库地址",
"markdownDescription": "项目模板存放的路径。\n\n请勿手动设置相对路径!"
}
},
"markdownDescription": "设置项目模板\n\n建议使用指令设置",
"order": 6
},
"hamibot-assistant.projectTemplate.type": {
"type": "string",
"scope": "application",
"default": "askWhenCreate",
"enum": [
"disabled",
"local",
"remote",
"askWhenCreate"
],
"enumItemLabels": [
"禁用通过模板创建项目",
"使用本地模板(本地文件夹)",
"使用远程模板( Github 仓库)",
"在每次创建项目时询问"
],
"markdownDescription": "描述模板路径的类型,需要注意的是此项设置需要和 `#hamibot-assistant.projectTemplate.path#` 对应\n\n- `loacl` 需要在路径中填入本地的绝对路径地址\n- `remote` 需要在路径中填入有效的 Github 远程仓库地址( SSH 或 HTTPS ),同时还必须安装过 Git\n",
"order": 7
},
"hamibot-assistant.projectTemplate.path": {
"type": "string",
"scope": "application",
"default": "",
"pattern": "^(((([A-Za-z]:)|\\.)(.*))|(((git@)|(https?:\\/\\/))github.com[:\\/][\\w-_]*?\\/[\\w-_]*?(\\.git)?))|(?:)$",
"patternErrorMessage": "只能是一个本地绝对路径或 Github 远程仓库地址",
"markdownDescription": "项目模板存放的路径。\n\n请勿手动设置相对路径!",
"order": 8
}
}
},
"commands": [
{
"command": "hamibot-assistant.setApiToken",
"title": "设置 Hamibot API 令牌",
"category": "Hamibot Config"
},
{
"command": "hamibot-assistant.setShowOfflineRobot",
"title": "设置是否显示离线机器人",
"category": "Hamibot Config"
},
{
"command": "hamibot-assistant.setDefaultExecuteRobot",
"title": "设置默认调试机器人",
"category": "Hamibot Config"
},
{
"command": "hamibot-assistant.resetDialogs",
"title": "重置提示信息",
"category": "Hamibot Config"
},
{
"command": "hamibot-assistant.setProjectTemplate",
"title": "设置创建项目时使用的模板",
"category": "Hamibot Config"
},
{
"command": "hamibot-assistant.setProjectName",
"title": "设置项目名称",
"category": "Hamibot Project"
},
{
"command": "hamibot-assistant.markScriptFile",
"title": "标记脚本文件",
"category": "Hamibot Project"
},
{
"command": "hamibot-assistant.markConfigFile",
"title": "标记脚本配置文件",
"category": "Hamibot Project"
},
{
"command": "hamibot-assistant.setExecuteRobot",
"title": "设置用于调试的机器人",
"category": "Hamibot Project"
},
{
"command": "hamibot-assistant.initProject",
"title": "新建 Hamibot 项目",
"category": "Hamibot Operation"
},
{
"command": "hamibot-assistant.uploadScript",
"title": "上传标记的脚本文件",
"category": "Hamibot Operation"
},
{
"command": "hamibot-assistant.uploadAndRunScript",
"title": "上传并运行标记的脚本文件",
"category": "Hamibot Operation"
},
{
"command": "hamibot-assistant.stopScript",
"title": "强制停止脚本运行",
"category": "Hamibot Operation"
}
],
"menus": {
"explorer/context": [
{
"command": "hamibot-assistant.markScriptFile",
"group": "workspace",
"when": "hamibot-assistant.isEnabled && resourceExtname == .js && hamibot-assistant.isProjectFolder"
},
{
"command": "hamibot-assistant.markConfigFile",
"group": "workspace",
"when": "hamibot-assistant.isEnabled && resourceExtname == .json && resourceFilename != hamibot.config.json && hamibot-assistant.isProjectFolder"
}
],
"commandPalette": [
{
"command": "hamibot-assistant.setApiToken",
"when": "hamibot-assistant.isEnabled"
},
{
"command": "hamibot-assistant.setShowOfflineRobot",
"when": "hamibot-assistant.isEnabled"
},
{
"command": "hamibot-assistant.setDefaultExecuteRobot",
"when": "hamibot-assistant.isEnabled"
},
{
"command": "hamibot-assistant.resetDialogs",
"when": "hamibot-assistant.isEnabled"
},
{
"command": "hamibot-assistant.setProjectTemplate",
"when": "hamibot-assistant.isEnabled"
},
{
"command": "hamibot-assistant.markScriptFile",
"when": "false"
},
{
"command": "hamibot-assistant.markConfigFile",
"when": "false"
},
{
"command": "hamibot-assistant.setProjectName",
"when": "hamibot-assistant.isEnabled && hamibot-assistant.isProjectFolder"
},
{
"command": "hamibot-assistant.setExecuteRobot",
"when": "hamibot-assistant.isEnabled && hamibot-assistant.isProjectFolder"
},
{
"command": "hamibot-assistant.initProject",
"when": "hamibot-assistant.isEnabled"
},
{
"command": "hamibot-assistant.uploadScript",
"when": "hamibot-assistant.isEnabled && hamibot-assistant.isProjectFolder"
},
{
"command": "hamibot-assistant.uploadAndRunScript",
"when": "hamibot-assistant.isEnabled && hamibot-assistant.isProjectFolder"
},
{
"command": "hamibot-assistant.stopScript",
"when": "hamibot-assistant.isEnabled && hamibot-assistant.isProjectFolder"
}
]
},
"jsonValidation": [
{
"fileMatch": "hamibot.config.json",
"url": "./schemas/ConfigSchema.json"
}
],
"taskDefinitions": [
{
"type": "clone-template",
"required": [
"repoUrl",
"targetPath"
],
"properties": {
"repoUrl": {
"type": "string",
"description": "模板仓库 URL"
},
"targetPath": {
"type": "string",
"description": "目标目录"
}
}
},
{
"type": "execute-batch",
"required": [
"batchFilePath",
"targetPath"
],
"properties": {
"batchFilePath": {
"type": "string",
"description": "模板初始化批处理文件路径",
"pattern": "\\.bat"
},
"targetPath": {
"type": "string",
"description": "目标目录"
}
}
}
]
},
"scripts": {
"vscode:prepublish": "npm run package",
"compile": "webpack",
"watch": "webpack --watch",
"package": "webpack --mode production --devtool hidden-source-map",
"compile-tests": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "npm run compile-tests && npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/glob": "^7.2.0",
"@types/mocha": "^9.1.1",
"@types/node": "16.x",
"@types/vscode": "^1.70.0",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"@vscode/test-electron": "^2.1.5",
"eslint": "^8.20.0",
"glob": "^8.0.3",
"mocha": "^10.0.0",
"ts-loader": "^9.3.1",
"typescript": "^4.7.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
},
"dependencies": {
"axios": "^1.6.5",
"form-data": "^4.0.0"
}
}