| 44 | const DEFAULT_JSONC_CANDIDATES = ["executor.jsonc", "executor.json"]; |
| 45 | |
| 46 | const readJsoncPlugins = (path: string): readonly string[] => { |
| 47 | try { |
| 48 | const raw = readFileSync(path, "utf8"); |
| 49 | const parsed = jsonc.parse(raw) as |
| 50 | | { plugins?: ReadonlyArray<{ package?: string }> } |
| 51 | | undefined; |
| 52 | const entries = parsed?.plugins ?? []; |
| 53 | return entries.map((e) => e.package).filter((p): p is string => !!p); |
| 54 | } catch { |
| 55 | return []; |
| 56 | } |
| 57 | }; |
| 58 | |
| 59 | const tryResolveClient = (packageName: string, fromDir: string): string | null => { |
| 60 | const require = createRequire(resolvePath(fromDir, "_anchor.js")); |