MCPcopy
hub / github.com/intentui/intentui / resolveLocalPath

Function resolveLocalPath

src/scripts/generate-registry.ts:172–182  ·  view source on GitHub ↗
(fromFile: string, spec: string)

Source from the content-addressed store, hash-verified

170}
171
172const resolveLocalPath = async (fromFile: string, spec: string) => {
173 const base = path.dirname(fromFile)
174 const candidates = [
175 path.resolve(base, `${spec}.tsx`),
176 path.resolve(base, `${spec}.ts`),
177 path.resolve(base, `${spec}/index.tsx`),
178 path.resolve(base, `${spec}/index.ts`),
179 ]
180 for (const c of candidates) if (await exists(c)) return c
181 return null
182}
183
184const resolveWithin = async (baseDir: string, rel: string) => {
185 const clean = rel.replace(/^\/+/, '')

Callers 3

findInternalDepsForFileFunction · 0.85
collectBlocksFunction · 0.85

Calls 1

existsFunction · 0.85

Tested by

no test coverage detected