@beaket/ui 0.1.1 → 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 +2 -2
- package/src/commands/add.ts +9 -2
- package/src/index.ts +1 -1
- /package/bin/{cli.mjs → cli.js} +0 -0
package/package.json
CHANGED
package/src/commands/add.ts
CHANGED
|
@@ -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(
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ const program = new Command();
|
|
|
8
8
|
program
|
|
9
9
|
.name("@beaket/ui")
|
|
10
10
|
.description("CLI for adding Beaket UI components to your project")
|
|
11
|
-
.version("0.1.
|
|
11
|
+
.version("0.1.2");
|
|
12
12
|
|
|
13
13
|
program.command("init").description("Initialize Beaket UI in your project").action(init);
|
|
14
14
|
|
/package/bin/{cli.mjs → cli.js}
RENAMED
|
File without changes
|