MCPcopy
hub / github.com/intentui/intentui / registryDepsForBlock

Function registryDepsForBlock

src/scripts/generate-registry.ts:454–465  ·  view source on GitHub ↗
(pagePath: string, code: string)

Source from the content-addressed store, hash-verified

452}
453
454const registryDepsForBlock = async (pagePath: string, code: string) => {
455 const privates = await collectBlocks(pagePath, code)
456 const allFiles = new Set<string>([pagePath, ...privates])
457 const urls: string[] = []
458 for (const file of allFiles) {
459 const src = file === pagePath ? code : await read(file)
460 const specs = importSpecifiers(src)
461 const fileUrls = await findInternalDepsForFile(file, specs)
462 for (const u of fileUrls) urls.push(u)
463 }
464 return [...new Set(urls)]
465}
466
467const buildBlockItem = async (pagePath: string) => {
468 const code = await read(pagePath)

Callers 1

buildBlockItemFunction · 0.85

Calls 4

collectBlocksFunction · 0.85
readFunction · 0.85
importSpecifiersFunction · 0.85
findInternalDepsForFileFunction · 0.85

Tested by

no test coverage detected