-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.json
92 lines (92 loc) · 4.63 KB
/
config.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
{
"modelConfig": {
"rolePrompt": "You are a senior frontend developer. Answer only with a complete file content and code. DO NOT explain, DO NOT add details, DO NOT apologize. DO NOT add the file type at the beginning of the answer. DO NOT wrap the answer with \"```\" or \"```jsx\" or \"```html\". Reply with the same file content you get as input, including the required changes.\n\n",
"model_type": "ChatGPT",
"model_name": "gpt-4o"
},
"ValidatorsConfig": {
"babelCompile": {
"maxRetries": 3
},
"jestRunner": {
"maxRetries": 3
}
},
"RefactorsActions": {
"HOW_TO_CONFIG": {
"description": "description of the refactoring task for readability",
"prompt": "string|file path - Prompt string to give insturctions for refactoring OR file path to a .txt file with long prompt.",
"targetDir": "the full path of the directory where the refactoring should be done recursively",
"targetFilesExtensionRegex": "regex - which files to work on, like '.*.test.js'",
"contentConditionRegex": "regex - which content should be in the file in order to refactor, like '.*'. Another example: 'extends\\s+(React\\.)?(Pure)?Component\\s*{'",
"model_type": "ChatGPT/Vertex/ClaudeAi which model to use from the list",
"model_name": "gpt-4o/gemini-1.5-pro-preview-0409/claude-3-5-sonnet-20240620 which model name to use from the list",
"advanceOptions": {
"outputFileExtension": "optional - when given, the result of the refactoring will be saved to the same file name and given file extention, like test.js",
"useFilePath": "true/false - if true, will search for {\"file_path\":\"/Path/of/file.js\"}",
"codeValidators": [
"babelCompile - optional - validate the refactor is compiled by JS babel",
"JestRunner - optional - validate the refactor is tested by Jest and the unit test is green"
]
}
},
"Accessify-Html": {
"description": "Make this html file accessible",
"prompt": "Make the following code to be fully accessible.\n Make sure to add the proper aria attributes and roles.\n Follow the WAI-ARIA best practices and WCAG 2 A and AA Checklist.",
"targetDir": "/Volumes/mhdev/working-copies/web/trunk/htdocs/FP/Assets/Templates/FamilyHome/AddPeopleQuickly/",
"targetFilesExtensionRegex": "FormAddPeopleQuicklyTemplate.html",
"contentConditionRegex": ".*"
},
"Knobs": {
"description": "Migrate from knobs to controls",
"prompt": "./prompts/Knobs/NewKnobsPrompt.txt",
"targetDir": "path/to/your/working/directory",
"targetFilesExtensionRegex": ".*.mdx",
"contentConditionRegex": "storybook/addon-knobs"
},
"KnobsMagic": {
"description": "Migrate to nobs",
"prompt": "./MagicNobsPrompt.txt",
"targetDir": "/Path/to/your/working/directory",
"targetFilesExtensionRegex": ".*.mdx",
"contentConditionRegex": "",
"advanceOptions": {
"useFilePath": true
}
},
"ReactClassToFunc": {
"description": "React Class to functional React Component",
"prompt": "Refactor the following code to a React functional component according to React best practices. Delete the `defaultProps` property and move all props from propTypes and default values to be passed as default arguments to the function. Be compliant with the `react` and `react-hooks` ESLint rules. Preserve `@name` and `@module` in the comments.",
"targetDir": "/Path/to/your/working/directory",
"targetFilesExtensionRegex": ".*.react.js",
"contentConditionRegex": "extends\\s+(React\\.)?(Pure)?Component\\s*{",
"advanceOptions": {
"codeValidators": [
"babelCompile"
]
}
},
"RemovejQuery": {
"description": "Get rid of jQuery",
"prompt": "Refactor the following code, get rid of the use of the jQuery library. Use native browser API. Aswume the code is running in a modern browser.",
"targetDir": "/Path/to/your/working/directory",
"targetFilesExtensionRegex": "signupPopupDeprecated.js",
"contentConditionRegex": "jQuery",
"advanceOptions": {
"codeValidators": [
"babelCompile"
]
}
},
"RemoveUnderscore": {
"description": "Get rid of underscore",
"prompt": "Refactor the following code, get rid of the use of the underscore library in the most concise way possible. When refactoring, use simple loops whenever possible.",
"targetDir": "/Path/to/your/working/directory",
"targetFilesExtensionRegex": ".*.js",
"contentConditionRegex": "import _ from 'underscore';",
"codeValidators": [
"babelCompile"
]
}
}
}