@srcroot/ui 0.0.33 → 0.0.34
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 +25 -11
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import path2 from "path";
|
|
|
10
10
|
import ora from "ora";
|
|
11
11
|
import prompts from "prompts";
|
|
12
12
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
13
|
+
import { execa } from "execa";
|
|
13
14
|
|
|
14
15
|
// src/cli/services/theme-service.ts
|
|
15
16
|
import fs from "fs-extra";
|
|
@@ -193,6 +194,7 @@ var ProjectInitializer = class {
|
|
|
193
194
|
await this.detectConfiguration();
|
|
194
195
|
await this.promptUser();
|
|
195
196
|
await this.scaffold();
|
|
197
|
+
await this.installDependencies();
|
|
196
198
|
this.printSuccess();
|
|
197
199
|
}
|
|
198
200
|
async validateEnvironment() {
|
|
@@ -329,26 +331,38 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
329
331
|
process.exit(1);
|
|
330
332
|
}
|
|
331
333
|
}
|
|
332
|
-
|
|
334
|
+
async installDependencies() {
|
|
333
335
|
const cfg = this.config;
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
console.log(`Tailwind: ${cfg.isTailwind4 ? "v4" : "v3"}`);
|
|
337
|
-
const requiredDeps = [
|
|
336
|
+
const spinner = ora("Installing dependencies...").start();
|
|
337
|
+
const deps = [
|
|
338
338
|
"clsx",
|
|
339
339
|
"tailwind-merge",
|
|
340
340
|
"class-variance-authority",
|
|
341
341
|
"react-icons"
|
|
342
342
|
];
|
|
343
343
|
if (!cfg.isTailwind4) {
|
|
344
|
-
|
|
344
|
+
deps.push("tailwindcss-animate");
|
|
345
|
+
}
|
|
346
|
+
try {
|
|
347
|
+
await execa(cfg.packageManager, [cfg.installCmd, ...deps], {
|
|
348
|
+
cwd: cfg.cwd,
|
|
349
|
+
stdio: "pipe"
|
|
350
|
+
});
|
|
351
|
+
spinner.succeed(`Installed ${deps.length} dependencies`);
|
|
352
|
+
} catch (error) {
|
|
353
|
+
spinner.fail("Failed to install dependencies");
|
|
354
|
+
logger.warn(`
|
|
355
|
+
Manually run: ${cfg.packageManager} ${cfg.installCmd} ${deps.join(" ")}`);
|
|
345
356
|
}
|
|
346
|
-
|
|
347
|
-
|
|
357
|
+
}
|
|
358
|
+
printSuccess() {
|
|
359
|
+
const cfg = this.config;
|
|
360
|
+
logger.success("\n\u2705 Project initialized successfully!\n");
|
|
361
|
+
console.log(`Theme: ${cfg.selectedTheme}`);
|
|
362
|
+
console.log(`Tailwind: ${cfg.isTailwind4 ? "v4" : "v3"}`);
|
|
348
363
|
console.log("\n\u2728 Next steps:");
|
|
349
|
-
console.log(" 1.
|
|
350
|
-
console.log(" 2. npx @srcroot/ui add
|
|
351
|
-
console.log(" 3. npx @srcroot/ui add --all");
|
|
364
|
+
console.log(" 1. npx @srcroot/ui add button");
|
|
365
|
+
console.log(" 2. npx @srcroot/ui add --all");
|
|
352
366
|
console.log();
|
|
353
367
|
}
|
|
354
368
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@srcroot/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"description": "A UI library with polymorphic, accessible React components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"chalk": "^5.3.0",
|
|
27
27
|
"commander": "^12.1.0",
|
|
28
|
+
"execa": "^9.6.1",
|
|
28
29
|
"fs-extra": "^11.2.0",
|
|
29
30
|
"ora": "^8.1.1",
|
|
30
31
|
"prompts": "^2.4.2"
|