Lines 1-29javascript
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
5Object.defineProperty(exports, "__esModule", { value: true });
7const path_1 = __importDefault(require("path"));
8const fs_extra_1 = __importDefault(require("fs-extra"));
9const picocolors_1 = __importDefault(require("picocolors"));
10const child_process_1 = require("child_process");
11const registry_1 = require("../registry");
HighChild Process
Package source references child process execution.
dist/commands/add.jsView on unpkg · L9 12const PACKAGE_ROOT = path_1.default.join(__dirname, "..", "..");
13async function installComponent(name, installed, overwrite) {
14 if (installed.has(name))
16 const item = registry_1.registry[name];
18 console.error(picocolors_1.default.red(`✗ Unknown component: "${name}"`));
19 console.log(` Available: ${Object.keys(registry_1.registry).join(", ")}`);
22 // Install registry dependencies first (depth-first)
23 for (const dep of item.registryDependencies) {
24 await installComponent(dep, installed, overwrite);
26 // Copy component files into the user's project
27 for (const file of item.files) {
28 const src = path_1.default.join(PACKAGE_ROOT, file.src);
29 const dest = path_1.default.join(process.cwd(), file.dest);