MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / installRegistryBlock

Function installRegistryBlock

packages/cli/src/server/studioServer.ts:504–531  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

502 },
503
504 async installRegistryBlock(opts) {
505 const { resolveItemWithDependencies } = await import("../registry/resolver.js");
506 const { installItem } = await import("../registry/installer.js");
507 const { gateRegistryItemsCompatibility } = await import("../registry/compatibility.js");
508 // Resolve transitive registryDependencies and install them first so a
509 // block that depends on other registry items installs completely.
510 const items = await resolveItemWithDependencies(opts.blockName);
511 // Compatibility-gate the whole set before writing anything (same gate as
512 // `hyperframes add`), so an incompatible block or dep aborts cleanly.
513 const warnings = gateRegistryItemsCompatibility(items);
514 for (const warning of warnings) {
515 process.stderr.write(`hyperframes:registry ${warning}\n`);
516 }
517 const written: string[] = [];
518 for (const dep of items) {
519 const result = await installItem(dep, { destDir: opts.project.dir });
520 written.push(...result.written);
521 }
522 const item = items[items.length - 1]!;
523
524 rewriteWrittenToHostViewport(opts.project.dir, written);
525
526 const relativePaths = written.map((abs) => {
527 const rel = abs.startsWith(opts.project.dir) ? abs.slice(opts.project.dir.length + 1) : abs;
528 return rel;
529 });
530 return { written: relativePaths, block: item };
531 },
532 };
533
534 // ── Build the Hono app ─────────────────────────────────────────────────

Callers

nothing calls this directly

Calls 5

installItemFunction · 0.85
writeMethod · 0.65

Tested by

no test coverage detected