@srcroot/ui 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -574,20 +574,25 @@ async function init(options) {
|
|
|
574
574
|
missing.push(installCmd2);
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
+
if (missing.length === 0) {
|
|
578
|
+
spinner.succeed(chalk.green("All dependencies already installed"));
|
|
579
|
+
} else {
|
|
580
|
+
spinner.info(`Found ${chalk.cyan(missing.length)} missing ${missing.length === 1 ? "dependency" : "dependencies"}: ${chalk.dim(missing.map((d) => d.split("@")[0]).join(", "))}`);
|
|
581
|
+
}
|
|
577
582
|
async function installOneByOne(spinner2, packageManager2, installCmd2, missing2, cwd2, execSync) {
|
|
578
583
|
spinner2.warn("Batch installation failed. Attempting to install dependencies one by one...");
|
|
579
584
|
let allSucceeded = true;
|
|
580
585
|
for (const dep of missing2) {
|
|
581
|
-
spinner2.
|
|
586
|
+
spinner2.start(`Installing ${chalk.cyan(dep)} via ${packageManager2}...`);
|
|
582
587
|
try {
|
|
583
588
|
execSync(`${packageManager2} ${installCmd2} ${dep}`, {
|
|
584
589
|
stdio: "pipe",
|
|
585
590
|
cwd: cwd2
|
|
586
591
|
});
|
|
587
|
-
spinner2.succeed(`Installed ${dep}`);
|
|
592
|
+
spinner2.succeed(`Installed ${chalk.green(dep)}`);
|
|
588
593
|
} catch (depError) {
|
|
589
594
|
allSucceeded = false;
|
|
590
|
-
spinner2.fail(`Failed to install ${dep}`);
|
|
595
|
+
spinner2.fail(`Failed to install ${chalk.red(dep)}`);
|
|
591
596
|
if (depError.stdout) {
|
|
592
597
|
console.log(chalk.dim(`
|
|
593
598
|
=== stdout for ${dep} ===`));
|
|
@@ -601,9 +606,9 @@ async function init(options) {
|
|
|
601
606
|
}
|
|
602
607
|
}
|
|
603
608
|
if (allSucceeded) {
|
|
604
|
-
|
|
609
|
+
console.log(chalk.green("\n\u2705 All dependencies installed successfully!\n"));
|
|
605
610
|
} else {
|
|
606
|
-
|
|
611
|
+
console.log(chalk.yellow("\n\u26A0 Some dependencies failed to install."));
|
|
607
612
|
console.log(chalk.dim(`
|
|
608
613
|
Please manually run: ${packageManager2} ${installCmd2} ${missing2.join(" ")}
|
|
609
614
|
`));
|
|
@@ -635,8 +640,6 @@ Please manually run: ${packageManager2} ${installCmd2} ${missing2.join(" ")}
|
|
|
635
640
|
await installOneByOne(spinner, packageManager, installCmd, missing, cwd, execSync);
|
|
636
641
|
}
|
|
637
642
|
}
|
|
638
|
-
} else {
|
|
639
|
-
spinner.succeed("All dependencies already installed");
|
|
640
643
|
}
|
|
641
644
|
console.log(chalk.green("\n\u2705 Project initialized successfully!\n"));
|
|
642
645
|
console.log(`Theme: ${chalk.cyan(THEMES[selectedTheme].name)}`);
|