-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathpackage.json
298 lines (298 loc) · 9.28 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
{
"name": "var-translation",
"displayName": "驼峰翻译助手",
"description": "快速将中文变量翻译名转换为多种常用驼峰命名格式(如 camelCase、PascalCase、snake_case 等)。同时,支持 腾讯 百度 OpenAI API 自定义翻译模型提升开发效率。",
"publisher": "svenzhao",
"icon": "images/logo.png",
"version": "0.13.55",
"engines": {
"vscode": "^1.50.0"
},
"categories": [
"Other"
],
"keywords": [
"translate",
"variable",
"camel",
"var",
"翻译",
"变量",
"驼峰",
"var-translation"
],
"activationEvents": [
"onStartupFinished"
],
"main": "./dist/extension.js",
"contributes": {
"keybindings": [
{
"command": "extension.varTranslation",
"key": "Alt+shift+t",
"mac": "cmd+shift+t"
}
],
"commands": [
{
"command": "extension.varTranslation",
"title": "驼峰命名转换",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.camelCase",
"title": "camelCase 驼峰(小) camelCase",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.pascalCase",
"title": "pascalCase 驼峰(大) PascalCase",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.paramCase",
"title": "paramCase 中划线(小) param-case",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.snakeCase",
"title": "snakeCase 下划线 snake_case",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.constantCase",
"title": "constantCase 常量 CONSTANT_CASE",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.capitalCase",
"title": "capitalCase 分词(大) Capital Case",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.dotCase",
"title": "dotCase 对象属性 dot case",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.headerCase",
"title": "headerCase 中划线(大) Header-Case",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.noCase",
"title": "noCase 分词(小) no case",
"when": "editorTextFocus",
"category": "var-translation"
},
{
"command": "extension.varTranslation.pathCase",
"title": "pathCase 文件路径 path/case",
"when": "editorTextFocus",
"category": "var-translation"
}
],
"submenus": [
{
"id": "var-translation.menulist",
"label": "驼峰翻译"
}
],
"menus": {
"editor/context": [
{
"submenu": "var-translation.menulist",
"when": "editorTextFocus"
}
],
"var-translation.menulist": [
{
"command": "extension.varTranslation",
"group": "1",
"title": "选择翻译"
},
{
"command": "extension.varTranslation.camelCase",
"group": "2",
"title": "camelCase 驼峰(小) camelCase"
},
{
"command": "extension.varTranslation.pascalCase",
"group": "3",
"title": "pascalCase 驼峰(大) PascalCase"
},
{
"command": "extension.varTranslation.paramCase",
"group": "4",
"title": "paramCase 中划线(小) param-case"
},
{
"command": "extension.varTranslation.snakeCase",
"group": "5",
"title": "snakeCase 下划线 snake_case"
},
{
"command": "extension.varTranslation.constantCase",
"group": "6",
"title": "constantCase 常量 CONSTANT_CASE"
},
{
"command": "extension.varTranslation.capitalCase",
"group": "7",
"title": "capitalCase 分词(大) Capital Case"
},
{
"command": "extension.varTranslation.dotCase",
"group": "8",
"title": "dotCase 对象属性 dot case"
},
{
"command": "extension.varTranslation.headerCase",
"group": "9",
"title": "headerCase 中划线(大) Header-Case"
},
{
"command": "extension.varTranslation.noCase",
"group": "10",
"title": "noCase 分词(小) no case"
},
{
"command": "extension.varTranslation.pathCase",
"group": "11",
"title": "pathCase 文件路径 path/case"
}
]
},
"configuration": {
"type": "object",
"title": "驼峰翻译配置",
"properties": {
"varTranslation.baiduSecret": {
"type": "string",
"default": "",
"description": "百度翻译密钥 使用逗号隔开例如 appid,scretkey 申请地址看文档"
},
"varTranslation.tencentSecret": {
"type": "string",
"default": "",
"description": "腾讯翻译君密钥 使用逗号隔开例如 secretId,secretKey 申请地址看文档"
},
"varTranslation.googleTld": {
"type": "string",
"default": "",
"description": "用于在调用API时使用的谷歌翻译的顶级域名:https://translate.google.{Tld} 默认为com"
},
"varTranslation.openai.apiKey": {
"type": "string",
"default": "",
"description": "官方ApiKey是sk-开头的字符串"
},
"varTranslation.openai.apiBaseUrl": {
"type": "string",
"default": "",
"description": "OpenAI API基础URL的可选覆盖。如果您自定义了它,请确保具有相同的格式,例如以https://开头且没有尾随斜杠。补全端点的后缀将在内部添加,例如:${apiBaseUrl}/chat/completions,参考官方路线:https://api.openai.com/v1。"
},
"varTranslation.openai.model": {
"type": "string",
"default": "gpt-3.5-turbo",
"description": "自定义模型"
},
"varTranslation.libretranslate.apiBaseUrl": {
"type": "string",
"default": "http://localhost:5000/translate",
"description": "libretranslate api, libretranslate 仓库地址: https://github.com/LibreTranslate/LibreTranslate"
},
"varTranslation.libretranslate.apiKey": {
"type": "string",
"default": "",
"description": "libretranslate api_key,如果开启了key"
},
"varTranslation.deeplx.apiBaseUrl": {
"type": "string",
"default": "http://localhost:5000/translate",
"description": "deeplx API"
},
"varTranslation.translationEngine": {
"type": "string",
"enum": [
"google",
"baidu",
"tencent",
"ChatGpt",
"libretranslate",
"deeplx"
],
"enumDescriptions": [
"谷歌中国",
"百度",
"腾讯翻译君",
"ChatGpt",
"自建翻译",
"deeplx"
],
"default": "google",
"description": "翻译引擎"
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run package",
"compile": "webpack --devtool nosources-source-map --config ./build/node-extension.webpack.config.js",
"watch": "webpack --watch --devtool nosources-source-map --config ./build/node-extension.webpack.config.js",
"package": "webpack --mode production --config ./build/node-extension.webpack.config.js",
"test-compile": "tsc -p ./",
"test-watch": "tsc -watch -p ./",
"pretest": "npm run test-compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js",
"release": "standard-version",
"publish": "npm run release && vsce publish",
"f2elint-scan": "f2elint scan",
"f2elint-fix": "f2elint fix"
},
"devDependencies": {
"@types/glob": "^7.1.3",
"@types/google-translate-api": "^2.3.1",
"@types/mocha": "^8.0.4",
"@types/node": "^12.11.7",
"@types/vscode": "^1.50.0",
"f2elint": "^4.9.0",
"glob": "^7.1.6",
"mocha": "^8.1.3",
"standard-version": "^9.1.0",
"ts-loader": "^8.0.11",
"typescript": "^4.1.2",
"vscode-test": "^1.4.1",
"webpack": "^5.10.0",
"webpack-cli": "^4.2.0"
},
"dependencies": {
"@asmagin/google-translate-api": "^8.0.2",
"axios": "^1.6.5",
"change-case": "^4.1.2",
"node-baidu-translate": "^0.1.0",
"openai": "^3.3.0",
"tencentcloud-sdk-nodejs": "^4.0.331"
},
"repository": {
"type": "git",
"url": "https://github.com/SvenZhao/var-translation"
},
"homepage": "https://github.com/SvenZhao/var-translation/blob/master/README.md",
"husky": {
"hooks": {
"pre-commit": "f2elint commit-file-scan",
"commit-msg": "f2elint commit-msg-scan"
}
}
}