@the-grove/cli 0.1.7 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +15 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -43,7 +43,9 @@ 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");
@@ -51,13 +53,21 @@ async function add(components, options) {
51
53
  if (options.path) {
52
54
  args.push("--path", options.path);
53
55
  }
54
- await execa("npx", args, { stdio: "inherit" });
55
- spinner.succeed(`Added ${componentName}`);
56
+ try {
57
+ await execa("npx", args, { stdio: "inherit" });
58
+ console.log(chalk.green(`\u2713 Added ${componentName}`));
59
+ } catch (error) {
60
+ console.log(chalk.red(`\u2717 Failed to add ${componentName}`));
61
+ throw error;
62
+ }
56
63
  }
57
64
  console.log(chalk.green("\n\u2705 All components added successfully!"));
58
65
  } catch (error) {
59
- spinner.fail("Failed to add component");
60
- console.error(chalk.red(error instanceof Error ? error.message : "Unknown error"));
66
+ spinner.stop();
67
+ console.error(chalk.red("\n\u2717 Failed to add component"));
68
+ if (error instanceof Error && error.message) {
69
+ console.error(chalk.red(error.message));
70
+ }
61
71
  process.exit(1);
62
72
  }
63
73
  }
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.8",
4
4
  "type": "module",
5
5
  "description": "CLI for the-grove component library",
6
6
  "bin": {