|
1 | 1 | export interface Config { |
| 2 | + /** |
| 3 | + * Targets represent the packages that the hypermod package is providing transforms to. |
| 4 | + * This is useful for filtering and grouping codemods based on the target package. |
| 5 | + * |
| 6 | + * For example, a hypermod package that is targetting react and react-dom would have |
| 7 | + * the following targets: ['react', 'react-dom']. |
| 8 | + */ |
2 | 9 | targets?: string[]; |
| 10 | + |
| 11 | + /** |
| 12 | + * Github usernames of the maintainers |
| 13 | + */ |
3 | 14 | maintainers?: string[]; |
| 15 | + |
| 16 | + /** |
| 17 | + * Description of the hypermod package, please explain the intetion of the package. |
| 18 | + */ |
4 | 19 | description?: string; |
| 20 | + |
| 21 | + /** |
| 22 | + * Transforms are the main building blocks of a codemod. When a hypermod package |
| 23 | + * is targetting a specific package / focus area, transforms represent the |
| 24 | + * migrations between versions of the target package. |
| 25 | + * |
| 26 | + * Example react v16 -> v17, or react-dom v16 -> v17 |
| 27 | + */ |
5 | 28 | transforms?: Record<string, string>; |
| 29 | + |
| 30 | + /** |
| 31 | + * Presets represent transforms that have no association with a specific |
| 32 | + * version of a package / focus area. These should be generic and reusable. |
| 33 | + * |
| 34 | + * Example: Format imports, remove console logs, etc. |
| 35 | + */ |
6 | 36 | presets?: Record<string, string>; |
| 37 | + |
| 38 | + /** |
| 39 | + * A list of dependencies to be installed before running the transform. |
| 40 | + * These are useful when co-locating codemods with an existing package |
| 41 | + * and want to whitelist devDependencies to be installed. |
| 42 | + * |
| 43 | + * Note: the versions installed are based on the package.json |
| 44 | + * |
| 45 | + * Example: dependencies: ['@hypermod/utils', 'postcss', 'postcss-less'] |
| 46 | + */ |
| 47 | + dependencies?: string[]; |
7 | 48 | } |
8 | 49 |
|
9 | 50 | export type CodeshiftConfig = Config; |
0 commit comments