MCPcopy
hub / github.com/intentui/intentui / findInternalDepsForFile

Function findInternalDepsForFile

src/scripts/generate-registry.ts:247–265  ·  view source on GitHub ↗
(file: string, specs: string[])

Source from the content-addressed store, hash-verified

245]
246
247async function findInternalDepsForFile(file: string, specs: string[]) {
248 const urls: string[] = []
249 for (const s of specs) {
250 if (s.startsWith('./') || s.startsWith('../')) {
251 const p = await resolveLocalPath(file, s)
252 if (p) {
253 const u = await fsToNs(p)
254 if (u) urls.push(u)
255 }
256 } else if (s.startsWith('@/')) {
257 const p = await aliasToFs(s)
258 if (p) {
259 const u = await fsToNs(p)
260 if (u) urls.push(u)
261 }
262 }
263 }
264 return [...new Set(urls)]
265}
266
267const blockSlugFromPage = (pagePath: string) => {
268 const rel = toPosix(path.relative(BLOCKS_DIR, path.dirname(pagePath)))

Callers 5

buildComponentItemFunction · 0.85
buildLibItemFunction · 0.85
buildHookItemFunction · 0.85
buildExampleItemFunction · 0.85
registryDepsForBlockFunction · 0.85

Calls 3

resolveLocalPathFunction · 0.85
fsToNsFunction · 0.85
aliasToFsFunction · 0.85

Tested by

no test coverage detected