-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpackage.json
More file actions
492 lines (492 loc) · 19.4 KB
/
package.json
File metadata and controls
492 lines (492 loc) · 19.4 KB
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
{
"name": "js-codeformer",
"displayName": "JS CodeFormer: Javascript Refactoring & Code Automation",
"description": "A JavaScript/TypeScript refactoring and code automation tool for building better source",
"version": "2.6.2-pre.0",
"publisher": "cmstead",
"repository": {
"type": "git",
"url": "https://github.com/cmstead/js-codeformer.git"
},
"engines": {
"vscode": "^1.56.0"
},
"categories": [
"Keymaps",
"Snippets",
"Other"
],
"keywords": [
"refactor",
"refactoring",
"javascript",
"react",
"vue",
"typescript",
"automation"
],
"scripts": {
"lint": "eslint .",
"test-only": "mocha ./test/**/*.test.js",
"test-and-cover": "nyc --reporter=lcov mocha ./test/**/*.test.js",
"test-and-report": "nyc mocha ./test/**/*.test.js",
"test": "npm run test-and-cover && gittey push",
"build": "rm *.vsix & vsce package",
"push-patch": "npm run test-only && gittey push-patch",
"push-minor": "npm run test-only && gittey push-minor",
"publish": "npm run test-only && vsce publish"
},
"devDependencies": {
"@types/glob": "^7.1.3",
"@types/mocha": "^8.2.2",
"@types/node": "14.x",
"@types/vscode": "^1.56.0",
"approvals": "^3.0.5",
"chai": "^4.3.4",
"eslint": "^7.27.0",
"glob": "^7.1.7",
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"rimrafx": "^1.0.0",
"vsce": "^1.99.0",
"vscode-test": "^1.5.2"
},
"dependencies": {
"@typescript-eslint/typescript-estree": "^4.31.1",
"estraverse": "^5.2.0",
"jsonc-parser": "^3.0.0",
"typescript": "^4.4.3"
},
"main": "./extension.js",
"icon": "icon/jscf-icon-vscode.png",
"galleryBanner": {
"color": "#ffe518"
},
"public": true,
"activationEvents": [
"onCommand:cmstead.jscodeformer.extractMethod",
"onCommand:cmstead.jscodeformer.extractToParameter",
"onCommand:cmstead.jscodeformer.extractVariable",
"onCommand:cmstead.jscodeformer.inlineVariable",
"onCommand:cmstead.jscodeformer.rename",
"onCommand:cmstead.jscodeformer.invertIf",
"onCommand:cmstead.jscodeformer.invertTernary",
"onCommand:cmstead.jscodeformer.surroundWith",
"onCommand:cmstead.jscodeformer.convertToArrowFunction",
"onCommand:cmstead.jscodeformer.convertToFunctionExpression",
"onCommand:cmstead.jscodeformer.convertToFunctionDeclaration",
"onCommand:cmstead.jscodeformer.convertToMethod",
"onCommand:cmstead.jscodeformer.convertTernaryToIfElse",
"onCommand:cmstead.jscodeformer.convertFunctionsToClass",
"onCommand:cmstead.jscodeformer.convertImportToCommonjs",
"onCommand:cmstead.jscodeformer.convertToMultipleDeclarations",
"onCommand:cmstead.jscodeformer.togglePropertyDeclaration",
"onCommand:cmstead.jscodeformer.toggleParametersType",
"onCommand:cmstead.jscodeformer.toggleArgumentsType",
"onCommand:cmstead.jscodeformer.toggleArrowFunctionBraces",
"onCommand:cmstead.jscodeformer.convertToTemplateLiteral",
"onCommand:cmstead.jscodeformer.changeVariableType",
"onCommand:cmstead.jscodeformer.introduceVariable",
"onCommand:cmstead.jscodeformer.introduceFunction",
"onCommand:cmstead.jscodeformer.toggleAsync",
"onCommand:cmstead.jscodeformer.moveFunctionIntoClass",
"onCommand:cmstead.jscodeformer.moveMethodOutOfClass",
"onCommand:cmstead.jscodeformer.liftAndNameFunctionExpression",
"onCommand:cmstead.jscodeformer.suggestAction"
],
"contributes": {
"configuration": {
"title": "JS CodeFormer",
"properties": {
"js-codeformer.useSemicolons": {
"type": "boolean",
"default": true,
"description": "Enable or disable semicolons"
}
}
},
"languages": [
{
"id": "html"
},
{
"id": "javascript"
},
{
"id": "javascriptreact"
},
{
"id": "typescript"
},
{
"id": "typescriptreact"
},
{
"id": "vue"
}
],
"snippets": [
{
"language": "javascript",
"path": "./js-snippets.code-snippets"
},
{
"language": "javascriptreact",
"path": "./js-snippets.code-snippets"
},
{
"language": "vue",
"path": "./js-snippets.code-snippets"
},
{
"language": "html",
"path": "./js-snippets.code-snippets"
},
{
"language": "typescript",
"path": "./ts-snippets.code-snippets"
},
{
"language": "typescriptreact",
"path": "./ts-snippets.code-snippets"
}
],
"commands": [
{
"command": "cmstead.jscodeformer.extractMethod",
"title": "Extract Method",
"description": "Extract selected source as a function/method to selected scope"
},
{
"command": "cmstead.jscodeformer.extractToParameter",
"title": "Extract Variable To Parameter",
"description": "Extract selected variable to a function parameter"
},
{
"command": "cmstead.jscodeformer.extractVariable",
"title": "Extract Variable",
"description": "Extract selected source as a variable to selected scope"
},
{
"command": "cmstead.jscodeformer.inlineVariable",
"title": "Inline Variable",
"description": "Inline value of selected variable, and delete variable declaration"
},
{
"command": "cmstead.jscodeformer.rename",
"title": "Rename",
"description": "Rename"
},
{
"command": "cmstead.jscodeformer.invertIf",
"title": "Invert If Statement",
"description": "Invert if/else statement"
},
{
"command": "cmstead.jscodeformer.invertTernary",
"title": "Invert Ternary Expression",
"description": "Invert Ternary Expression"
},
{
"command": "cmstead.jscodeformer.surroundWith",
"title": "Surround With",
"description": "Surround selection with snippet text"
},
{
"command": "cmstead.jscodeformer.changeVariableType",
"title": "Change Variable Type",
"description": "Change variable type from current type to const, let, or var"
},
{
"command": "cmstead.jscodeformer.introduceVariable",
"title": "Introduce Variable",
"description": "Introduce variable from existing variable use"
},
{
"command": "cmstead.jscodeformer.introduceFunction",
"title": "Introduce Function",
"description": "Introduce function from existing function name or use"
},
{
"command": "cmstead.jscodeformer.introduceFunction",
"title": "Introduce Function",
"description": "Introduce function from existing function name or use"
},
{
"command": "cmstead.jscodeformer.convertToArrowFunction",
"title": "Convert to Arrow Function",
"description": "Convert Function to Arrow Function"
},
{
"command": "cmstead.jscodeformer.convertToFunctionExpression",
"title": "Convert to Function Expression",
"description": "Convert Function to Function Expression"
},
{
"command": "cmstead.jscodeformer.convertToFunctionDeclaration",
"title": "Convert to Function Declaration",
"description": "Convert function expression to a function declaration"
},
{
"command": "cmstead.jscodeformer.convertToMethod",
"title": "Convert to Method",
"description": "Convert class function property to a method"
},
{
"command": "cmstead.jscodeformer.convertToTemplateLiteral",
"title": "Convert to Template Literal",
"description": "Convert string, or concatenated string to a template literal"
},
{
"command": "cmstead.jscodeformer.convertTernaryToIfElse",
"title": "Convert Ternary to If/Else",
"description": "Convert Ternary to if/else statement"
},
{
"command": "cmstead.jscodeformer.convertFunctionsToClass",
"title": "Convert Functions To Class",
"description": "Convert selected functions to a class"
},
{
"command": "cmstead.jscodeformer.convertImportToCommonjs",
"title": "Convert Import Declaration to CommonJS Require",
"description": "Convert import declaration to Common JS require"
},
{
"command": "cmstead.jscodeformer.convertToMultipleDeclarations",
"title": "Convert to Multiple Declarations",
"description": "Convert declaration to multiple declarations"
},
{
"command": "cmstead.jscodeformer.togglePropertyDeclaration",
"title": "Toggle Property Declaration Type",
"description": "Toggle Between Shorthand and Standard Property Declaration"
},
{
"command": "cmstead.jscodeformer.toggleParametersType",
"title": "Toggle Function Parameters Declaration Type",
"description": "Toggle Between Positional and Destructured Parameters"
},
{
"command": "cmstead.jscodeformer.toggleArgumentsType",
"title": "Toggle Function Call Argument Passing Type",
"description": "Toggle Between Positional and Object Arguments"
},
{
"command": "cmstead.jscodeformer.toggleArrowFunctionBraces",
"title": "Toggle Arrow Function Braces",
"description": "Toggle braces on a single-line arrow function"
},
{
"command": "cmstead.jscodeformer.liftAndNameFunctionExpression",
"title": "Lift and Name Anonymous Function",
"description": "Lift a function expression from its current location and convert it to a declaration"
},
{
"command": "cmstead.jscodeformer.moveFunctionIntoClass",
"title": "Move Independent Function Into Class",
"description": "Move a function declaration into a class as a method"
},
{
"command": "cmstead.jscodeformer.moveMethodOutOfClass",
"title": "Move Method Out Of Class",
"description": "Move selected method out of class and convert to function"
},
{
"command": "cmstead.jscodeformer.toggleAsync",
"title": "Toggle Function Async Property",
"description": "Toggle async property on current function"
},
{
"command": "cmstead.jscodeformer.suggestAction",
"title": "JS CodeFormer: Suggest an Action",
"description": "Analyze document and list suggested actions"
}
],
"keybindings": [
{
"command": "cmstead.jscodeformer.extractMethod",
"key": "ctrl+shift+j m",
"mac": "cmd+shift+j m",
"when": "editorHasSelection"
},
{
"command": "cmstead.jscodeformer.extractVariable",
"key": "ctrl+shift+j v",
"mac": "cmd+shift+j v",
"when": "editorHasSelection"
},
{
"command": "cmstead.jscodeformer.extractToParameter",
"key": "ctrl+shift+j p",
"mac": "cmd+shift+j p"
},
{
"command": "cmstead.jscodeformer.inlineVariable",
"key": "ctrl+shift+j i",
"mac": "cmd+shift+j i"
},
{
"command": "cmstead.jscodeformer.rename",
"key": "ctrl+shift+j r",
"mac": "cmd+shift+j r"
},
{
"command": "cmstead.jscodeformer.invertIf",
"key": "ctrl+shift+j n",
"mac": "cmd+shift+j n"
},
{
"command": "cmstead.jscodeformer.invertTernary",
"key": "ctrl+shift+j t",
"mac": "cmd+shift+j t"
},
{
"command": "cmstead.jscodeformer.surroundWith",
"key": "ctrl+shift+j w",
"mac": "cmd+shift+j w"
},
{
"command": "cmstead.jscodeformer.suggestAction",
"key": "ctrl+alt+.",
"mac": "cmd+shift+alt+."
}
],
"menus": {
"editor/context": [
{
"submenu": "cmstead.js-codeformer.refactor",
"group": "js-codeformer@1",
"when": "editorLangId == javascript || editorLangId == typescript || editorLangId == html || editorLangId == javascriptreact || editorLangId == typescriptreact || editorLangId == jsx || editorLangId == vue || editorLangId == vue-html || editorLangId == svelte"
},
{
"submenu": "cmstead.js-codeformer.conversions",
"group": "js-codeformer@2",
"when": "editorLangId == javascript || editorLangId == typescript || editorLangId == html || editorLangId == javascriptreact || editorLangId == typescriptreact || editorLangId == jsx || editorLangId == vue || editorLangId == vue-html || editorLangId == svelte"
},
{
"submenu": "cmstead.js-codeformer.actions",
"group": "js-codeformer@3",
"when": "editorLangId == javascript || editorLangId == typescript || editorLangId == html || editorLangId == javascriptreact || editorLangId == typescriptreact || editorLangId == jsx || editorLangId == vue || editorLangId == vue-html || editorLangId == svelte"
},
{
"command": "cmstead.jscodeformer.suggestAction",
"group": "js-codeformer@4",
"when": "editorLangId == javascript || editorLangId == typescript || editorLangId == html || editorLangId == javascriptreact || editorLangId == typescriptreact || editorLangId == jsx || editorLangId == vue || editorLangId == vue-html || editorLangId == svelte"
}
],
"cmstead.js-codeformer.refactor": [
{
"command": "cmstead.jscodeformer.extractMethod"
},
{
"command": "cmstead.jscodeformer.extractToParameter"
},
{
"command": "cmstead.jscodeformer.extractVariable"
},
{
"command": "cmstead.jscodeformer.inlineVariable"
},
{
"command": "cmstead.jscodeformer.rename"
},
{
"command": "cmstead.jscodeformer.invertIf"
},
{
"command": "cmstead.jscodeformer.invertTernary"
}
],
"cmstead.js-codeformer.conversions": [
{
"command": "cmstead.jscodeformer.convertToArrowFunction"
},
{
"command": "cmstead.jscodeformer.changeVariableType"
},
{
"command": "cmstead.jscodeformer.convertToFunctionDeclaration"
},
{
"command": "cmstead.jscodeformer.convertToFunctionExpression"
},
{
"command": "cmstead.jscodeformer.convertToMethod"
},
{
"command": "cmstead.jscodeformer.convertToTemplateLiteral"
},
{
"command": "cmstead.jscodeformer.convertTernaryToIfElse"
},
{
"command": "cmstead.jscodeformer.convertFunctionsToClass"
},
{
"command": "cmstead.jscodeformer.convertImportToCommonjs"
},
{
"command": "cmstead.jscodeformer.convertToMultipleDeclarations"
}
],
"cmstead.js-codeformer.actions": [
{
"command": "cmstead.jscodeformer.introduceVariable"
},
{
"command": "cmstead.jscodeformer.introduceFunction"
},
{
"command": "cmstead.jscodeformer.liftAndNameFunctionExpression"
},
{
"command": "cmstead.jscodeformer.toggleAsync"
},
{
"command": "cmstead.jscodeformer.togglePropertyDeclaration"
},
{
"command": "cmstead.jscodeformer.toggleParametersType"
},
{
"command": "cmstead.jscodeformer.toggleArgumentsType"
},
{
"command": "cmstead.jscodeformer.toggleArrowFunctionBraces"
},
{
"command": "cmstead.jscodeformer.moveFunctionIntoClass"
},
{
"command": "cmstead.jscodeformer.moveMethodOutOfClass"
},
{
"command": "cmstead.jscodeformer.surroundWith"
}
]
},
"submenus": [
{
"id": "cmstead.js-codeformer.refactor",
"label": "JS CodeFormer: Refactor"
},
{
"id": "cmstead.js-codeformer.conversions",
"label": "JS CodeFormer: Conversions"
},
{
"id": "cmstead.js-codeformer.actions",
"label": "JS CodeFormer: Actions"
}
]
},
"links": {
"getstarted": {
"uri": "https://github.com/cmstead/js-codeformer#readme"
},
"support": {
"uri": "https://github.com/cmstead/js-codeformer/issues"
}
}
}