( manifest: PackageManifest | undefined )
| 145 | ] |
| 146 | |
| 147 | export const detectMigrationSource = ( |
| 148 | manifest: PackageManifest | undefined |
| 149 | ): MigrationSource | undefined => { |
| 150 | const deps = { ...manifest?.dependencies, ...manifest?.devDependencies } |
| 151 | if ("zod" in deps) return "zod" |
| 152 | if ("valibot" in deps) return "valibot" |
| 153 | if ("yup" in deps) return "yup" |
| 154 | if ("joi" in deps) return "joi" |
| 155 | if ("@sinclair/typebox" in deps || "typebox" in deps) return "typebox" |
| 156 | const arkVer = deps.arktype |
| 157 | if (arkVer) { |
| 158 | const normalized = arkVer.replace(/([<>]=?|=|\^|~)\s+/g, "$1") |
| 159 | if ( |
| 160 | /(?:^|[\s|]|workspace:)(?:[<>]=|=|\^|~)?v?2(?=$|[\s.|-])/.test(normalized) |
| 161 | ) |
| 162 | return "v2" |
| 163 | } |
| 164 | return undefined |
| 165 | } |
| 166 | |
| 167 | const defaultSkillTarget = (projectRoot: string): string => { |
| 168 | if ( |
no test coverage detected