@beaket/ui 0.1.2 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beaket/ui",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "CLI for adding Beaket UI components to your project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,8 +1,7 @@
1
- import fs from "fs-extra";
2
1
  import path from "path";
3
2
  import pc from "picocolors";
4
3
  import { getConfig } from "../utils/config.ts";
5
- import { writeComponentFiles } from "../utils/files.ts";
4
+ import { installDependencies, writeComponentFiles } from "../utils/files.ts";
6
5
  import { fetchComponent, fetchRegistry } from "../utils/registry.ts";
7
6
 
8
7
  export async function add(componentName: string) {
@@ -40,6 +39,14 @@ export async function add(componentName: string) {
40
39
  await writeComponentFiles(componentsDir, componentName, files, config);
41
40
 
42
41
  console.log(pc.green("✓"), `Added ${componentName}`);
42
+
43
+ // Install dependencies
44
+ if (componentDef.dependencies.length > 0) {
45
+ console.log();
46
+ console.log("Installing dependencies...");
47
+ await installDependencies(componentDef.dependencies);
48
+ console.log(pc.green("✓"), `Installed ${componentDef.dependencies.join(", ")}`);
49
+ }
43
50
  console.log();
44
51
  console.log("Import it in your code:");
45
52
  console.log(