|
1
|
import type { Codemod } from "./types" |
|
2
|
import replaceZodImports from "./replace-zod-imports" |
|
3
|
|
|
4
|
/** |
|
5
|
* Registry of available codemods |
|
6
|
*/ |
|
7
|
const CODEMODS: Record<string, Codemod> = { |
|
8
|
"replace-zod-imports": replaceZodImports, |
|
9
|
} |
|
10
|
|
|
11
|
/** |
|
12
|
* Get a codemod by name |
|
13
|
* @param name - The name of the codemod to retrieve |
|
14
|
* @returns The codemod if found, null otherwise |
|
15
|
*/ |
|
16
|
export function getCodemod(name: string): Codemod | null { |
|
17
|
return CODEMODS[name] || null |
|
18
|
} |
|
19
|
|
|
20
|
/** |
|
21
|
* List all available codemod names |
|
22
|
* @returns Array of codemod names |
|
23
|
*/ |
|
24
|
export function listCodemods(): string[] { |
|
25
|
return Object.keys(CODEMODS) |
|
26
|
} |