@the-grove/cli 0.1.7 → 0.1.9

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -43,21 +43,34 @@ async function add(components, options) {
43
43
  }
44
44
  spinner.start(`Adding ${componentName}...`);
45
45
  }
46
- spinner.text = `Installing ${componentName} via shadcn...`;
46
+ spinner.stop();
47
+ console.log(chalk.gray(`Installing ${componentName} via shadcn...
48
+ `));
47
49
  const args = ["shadcn@latest", "add", registryUrl];
48
50
  if (options.yes) {
49
51
  args.push("--yes");
50
52
  }
53
+ if (options.overwrite) {
54
+ args.push("--overwrite");
55
+ }
51
56
  if (options.path) {
52
57
  args.push("--path", options.path);
53
58
  }
54
- await execa("npx", args, { stdio: "inherit" });
55
- spinner.succeed(`Added ${componentName}`);
59
+ try {
60
+ await execa("npx", args, { stdio: "inherit" });
61
+ console.log(chalk.green(`\u2713 Added ${componentName}`));
62
+ } catch (error) {
63
+ console.log(chalk.red(`\u2717 Failed to add ${componentName}`));
64
+ throw error;
65
+ }
56
66
  }
57
67
  console.log(chalk.green("\n\u2705 All components added successfully!"));
58
68
  } catch (error) {
59
- spinner.fail("Failed to add component");
60
- console.error(chalk.red(error instanceof Error ? error.message : "Unknown error"));
69
+ spinner.stop();
70
+ console.error(chalk.red("\n\u2717 Failed to add component"));
71
+ if (error instanceof Error && error.message) {
72
+ console.error(chalk.red(error.message));
73
+ }
61
74
  process.exit(1);
62
75
  }
63
76
  }
@@ -291,7 +304,7 @@ async function fetchCategoryComponents(category) {
291
304
  // src/index.ts
292
305
  var program = new Command();
293
306
  program.name("the-grove").description("Component library CLI for managing UI components").version("0.1.0");
294
- program.command("add").description("Add component(s) to your project").argument("[components...]", "Component names to add").option("-p, --path <path>", "Custom installation path").option("-y, --yes", "Skip confirmation prompts").action(add);
307
+ program.command("add").description("Add component(s) to your project").argument("[components...]", "Component names to add").option("-p, --path <path>", "Custom installation path").option("-y, --yes", "Skip confirmation prompts").option("-o, --overwrite", "Overwrite existing files").action(add);
295
308
  program.command("contribute").description("Contribute component(s) back to the template repository").argument("<files...>", "Component file paths to contribute").action(contribute);
296
309
  program.command("list").description("List all available components").option("-c, --category <category>", "Filter by category (core, convex, clerk, convex-clerk)").option("-t, --tag <tag>", "Filter by tag").action(list);
297
310
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-grove/cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "description": "CLI for the-grove component library",
6
6
  "bin": {