@srcroot/ui 0.0.7 → 0.0.8
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 +11 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -443,37 +443,25 @@ async function init(options) {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
if (missing.length > 0) {
|
|
446
|
-
spinner.
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
if (install) {
|
|
454
|
-
spinner.start(`Installing dependencies...`);
|
|
455
|
-
import("child_process").then(({ execSync }) => {
|
|
456
|
-
execSync(`npm install ${missing.join(" ")}`, { stdio: "ignore", cwd });
|
|
457
|
-
spinner.succeed("Dependencies installed");
|
|
458
|
-
}).catch(() => {
|
|
459
|
-
spinner.fail("Failed to install dependencies automatically.");
|
|
460
|
-
console.log(chalk.dim(`
|
|
461
|
-
Please manually run: npm install ${missing.join(" ")}
|
|
462
|
-
`));
|
|
463
|
-
});
|
|
464
|
-
} else {
|
|
446
|
+
spinner.text = `Installing dependencies: ${missing.join(", ")}...`;
|
|
447
|
+
try {
|
|
448
|
+
const { execSync } = await import("child_process");
|
|
449
|
+
execSync(`npm install ${missing.join(" ")}`, { stdio: "ignore", cwd });
|
|
450
|
+
spinner.succeed("Dependencies installed");
|
|
451
|
+
} catch {
|
|
452
|
+
spinner.fail("Failed to install dependencies automatically");
|
|
465
453
|
console.log(chalk.dim(`
|
|
466
454
|
Please manually run: npm install ${missing.join(" ")}
|
|
467
455
|
`));
|
|
468
456
|
}
|
|
469
457
|
} else {
|
|
470
|
-
spinner.succeed("All dependencies installed");
|
|
458
|
+
spinner.succeed("All dependencies already installed");
|
|
471
459
|
}
|
|
472
460
|
console.log(chalk.green("\n\u2705 Project initialized successfully!\n"));
|
|
473
461
|
console.log(`Theme: ${chalk.cyan(THEMES[selectedTheme].name)}`);
|
|
474
462
|
console.log("\nNext steps:");
|
|
475
|
-
console.log(chalk.dim("
|
|
476
|
-
console.log(chalk.dim("
|
|
463
|
+
console.log(chalk.dim(" npx @srcroot/ui add button"));
|
|
464
|
+
console.log(chalk.dim(" npx @srcroot/ui add --all"));
|
|
477
465
|
console.log();
|
|
478
466
|
} catch (error) {
|
|
479
467
|
spinner.fail("Failed to initialize project");
|
|
@@ -963,7 +951,7 @@ async function list() {
|
|
|
963
951
|
|
|
964
952
|
// src/cli/index.ts
|
|
965
953
|
var program = new Command();
|
|
966
|
-
program.name("@srcroot/ui").description("Add polymorphic, accessible UI components to your project").version("0.0.
|
|
954
|
+
program.name("@srcroot/ui").description("Add polymorphic, accessible UI components to your project").version("0.0.8");
|
|
967
955
|
program.command("init").description("Initialize your project with srcroot-ui").option("-y, --yes", "Skip confirmation prompts", false).option("-t, --theme <theme>", "Color theme (slate, neutral, stone, zinc, gray)").option("--cwd <path>", "Working directory", process.cwd()).action(init);
|
|
968
956
|
program.command("add").description("Add components to your project").argument("[components...]", "Components to add").option("-y, --yes", "Skip confirmation prompts", false).option("-o, --overwrite", "Overwrite existing files", false).option("-a, --all", "Add all available components", false).option("--cwd <path>", "Working directory", process.cwd()).action(add);
|
|
969
957
|
program.command("list").description("List all available components").action(list);
|