MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readJsoncPlugins

Function readJsoncPlugins

packages/core/vite-plugin/src/index.ts:46–57  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

44const DEFAULT_JSONC_CANDIDATES = ["executor.jsonc", "executor.json"];
45
46const 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
59const tryResolveClient = (packageName: string, fromDir: string): string | null => {
60 const require = createRequire(resolvePath(fromDir, "_anchor.js"));

Callers 1

loadVirtualSourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected