forked from zhixiaoqiang/yapi2code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.json
268 lines (268 loc) · 7.56 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
{
"name": "yapi-to-code",
"displayName": "Yapi to Code",
"version": "0.0.31",
"private": true,
"description": "基于 YApi 生成 ts/dart/...",
"categories": [
"Snippets",
"Other"
],
"keywords": [
"Yapi",
"Ts",
"dart"
],
"repository": {
"type": "git",
"url": "https://github.com/zhixiaoqiang/yapi2code.git"
},
"publisher": "zhixiaoqiang",
"main": "./dist/extension.js",
"workspaces": [
"src/server",
"src/webview"
],
"scripts": {
"build": "rspack build",
"build:all": "pnpm build && pnpm build:webview && pnpm build:server",
"build:server": "cd src/server && pnpm build",
"build:webview": "cd src/webview && pnpm build",
"commit": "git-cz",
"compile-tests": "tsc -p . --outDir out",
"preinstall": "npx only-allow pnpm",
"lint": "eslint src --ext ts",
"lint-fix": "eslint --fix './**/*.{js?(x),ts?(x),mjs}' --cache",
"markdownlint-fix": "markdownlint-cli2-fix",
"package": "vsce package --no-dependencies",
"prepare": "husky install",
"pub": "vsce publish --no-dependencies",
"sort-package-json": "sort-package-json '**/package.json'",
"start": "rspack build --watch true",
"pretest": "pnpm compile-tests && pnpm compile && pnpm lint",
"test": "node ./out/test/runTest.js",
"vscode:prepublish": "rimraf dist && pnpm build:all",
"watch": "cross-env DEBUG=* rspack build --watch true",
"watch-tests": "tsc -p . -w --outDir out"
},
"contributes": {
"commands": [
{
"command": "yapi.refresh",
"title": "Yapi: 刷新接口",
"icon": {
"dark": "dist/assets/refresh-light.svg",
"light": "dist/assets/refresh-dark.svg"
}
},
{
"command": "yapi.logout",
"title": "Yapi: 退出登录"
},
{
"command": "yapi.configuration",
"title": "Yapi: 设置"
},
{
"command": "yapi.configuration-preview",
"title": "Yapi: 设置-预览完整配置项"
},
{
"command": "yapi.github",
"title": "Yapi: github",
"icon": {
"dark": "dist/assets/github-light.svg",
"light": "dist/assets/github-dark.svg"
}
},
{
"command": "yapi.fixall",
"title": "Yapi: 补充所有yapi接口类型"
}
],
"configuration": {
"type": "object",
"title": "yapi to code",
"properties": {
"yapi.host": {
"order": 0,
"type": "string",
"default": "http://yapi.internal.weimob.com",
"markdownDescription": "域名:优先取工作区缓存的域名(登录成功的域名)",
"scope": "resource"
},
"yapi.banner": {
"order": 1,
"type": "string",
"markdownDescription": "头部内容,可以填写导入的请求实例等",
"scope": "resource"
},
"yapi.responseKey": {
"order": 2,
"type": "string",
"enum": [
"all",
"data",
"custom"
],
"enumDescriptions": [
"返回所有属性",
"仅返回 data 属性",
"自定义属性"
],
"default": "all",
"markdownDescription": "生成 res 包含的属性,默认 `all`, 可指定为 `data、custom`",
"scope": "resource"
},
"yapi.responseCustomKey": {
"order": 3,
"type": "string",
"default": "data",
"markdownDescription": "生成 res 指定的属性值,仅当 `responseKey` 选择 `custom` 是有效,默认 `data`, 可指定为任意 key(支持链式:data.result)",
"scope": "resource"
},
"yapi.responseTypePosition": {
"order": 4,
"type": "string",
"enum": [
"outerFunction",
"fetchMethodGeneric"
],
"enumDescriptions": [
"类型将会放置在外层函数:Promise<T>",
"类型将会放置在请求方法的泛型中:post<T>"
],
"default": "outerFunction",
"markdownDescription": "`resType` 放置的位置是外层的 `Promise<T>` 还是作为请求方法的泛型 `post<T>`",
"scope": "resource"
},
"yapi.format": {
"order": 5,
"type": "boolean",
"default": false,
"markdownDescription": "开启默认格式化"
},
"yapi.useTab": {
"order": 6,
"type": "boolean",
"default": false,
"markdownDescription": "缩进使用 `tab`,或者 双空格"
},
"yapi.responseType": {
"order": 7,
"type": "string",
"enum": [
"methodGeneric"
],
"default": "methodGeneric",
"markdownDescription": "补全返回类型",
"scope": "resource"
}
}
},
"menus": {
"view/title": [
{
"command": "yapi.refresh",
"when": "tree.view.show && view == yapi.view",
"group": "navigation"
},
{
"command": "yapi.github",
"when": "tree.view.show && view == yapi.view",
"group": "navigation"
},
{
"command": "yapi.logout",
"when": "tree.view.show && view == yapi.view"
},
{
"command": "yapi.configuration",
"when": "tree.view.show && view == yapi.view"
},
{
"command": "yapi.configuration-preview",
"when": "tree.view.show && view == yapi.view"
}
],
"editor/context": [
{
"when": "resourceLangId == typescript",
"command": "yapi.fixall",
"group": "yapi"
}
]
},
"views": {
"yapi-menu": [
{
"id": "yapi.view",
"name": "yapi-menu",
"type": "webview"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "yapi-menu",
"title": "yapi to code",
"icon": "dist/assets/icon.svg"
}
]
}
},
"activationEvents": [
"onLanguage:typescript",
"onLanguage:typescriptreact"
],
"dependencies": {
"axios": "^1.4.0",
"debug": "^4.3.4",
"fs-extra": "^11.1.1",
"ts-morph": "^19.0.0",
"vscode-languageclient": "^7.0.0"
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@commitlint/cli": "^17.6.7",
"@commitlint/config-conventional": "^17.6.7",
"@rspack/cli": "^0.2.11",
"@types/debug": "^4.1.8",
"@types/fs-extra": "^11.0.1",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.9",
"@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@vscode/test-electron": "^2.3.4",
"@vscode/vsce": "^2.20.1",
"commitizen": "4.3.0",
"conventional-changelog-cli": "3.0.0",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "3.3.0",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-define-config": "^1.20.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.1",
"fast-glob": "^3.3.1",
"husky": "8.0.3",
"lint-staged": "13.2.3",
"markdownlint-cli2": "^0.8.1",
"mocha": "^10.2.0",
"prettier": "^3.0.1",
"rimraf": "^5.0.1",
"sort-package-json": "2.5.1",
"tsx": "^3.12.7",
"typescript": "^5.1.6"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=16.17.0",
"npm": ">=8.15.0",
"vscode": "^1.81.0"
},
"icon": "dist/assets/logo.png"
}