bunkit-cli 1.1.0 → 1.1.1
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 +30 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26457,13 +26457,27 @@ async function installShadcnComponents(projectPath, components, options = {}) {
|
|
|
26457
26457
|
const cwd2 = options.cwd || projectPath;
|
|
26458
26458
|
const stdio = options.silent ? "pipe" : "inherit";
|
|
26459
26459
|
const targetCwd = options.isMonorepo ? join(projectPath, "packages/ui") : cwd2;
|
|
26460
|
+
try {
|
|
26461
|
+
logger.debug("Installing dependencies with Bun before running shadcn CLI...");
|
|
26462
|
+
await execa("bun", ["install"], {
|
|
26463
|
+
cwd: options.isMonorepo ? projectPath : targetCwd,
|
|
26464
|
+
stdio: options.silent ? "pipe" : "inherit",
|
|
26465
|
+
env: {
|
|
26466
|
+
...process.env,
|
|
26467
|
+
BUN_INSTALL_LINKER: "isolated"
|
|
26468
|
+
}
|
|
26469
|
+
});
|
|
26470
|
+
} catch (installError) {
|
|
26471
|
+
logger.warn(`Failed to install dependencies with Bun: ${installError.message}`);
|
|
26472
|
+
}
|
|
26460
26473
|
try {
|
|
26461
26474
|
await execa("bunx", ["shadcn@latest", "add", ...components], {
|
|
26462
26475
|
cwd: targetCwd,
|
|
26463
26476
|
stdio,
|
|
26464
26477
|
env: {
|
|
26465
26478
|
...process.env,
|
|
26466
|
-
BUN_INSTALL_LINKER: "isolated"
|
|
26479
|
+
BUN_INSTALL_LINKER: "isolated",
|
|
26480
|
+
npm_config_force: "true"
|
|
26467
26481
|
}
|
|
26468
26482
|
});
|
|
26469
26483
|
if (options.isMonorepo) {
|
|
@@ -26479,7 +26493,7 @@ async function installShadcnComponents(projectPath, components, options = {}) {
|
|
|
26479
26493
|
await updateComponentsIndex(join(targetCwd, "src/components"));
|
|
26480
26494
|
}
|
|
26481
26495
|
} catch (fallbackError) {
|
|
26482
|
-
logger.warn(`Could not install shadcn components automatically. You can install them manually with: cd ${targetCwd} && bunx shadcn@latest add ${components.join(" ")}`);
|
|
26496
|
+
logger.warn(`Could not install shadcn components automatically. You can install them manually with: cd ${targetCwd} && bun install && bunx shadcn@latest add ${components.join(" ")}`);
|
|
26483
26497
|
throw fallbackError;
|
|
26484
26498
|
}
|
|
26485
26499
|
}
|
|
@@ -27096,14 +27110,14 @@ export * from './hooks';
|
|
|
27096
27110
|
rootPackageJson.catalog = {};
|
|
27097
27111
|
}
|
|
27098
27112
|
const shadcnDependencies = {
|
|
27099
|
-
"@radix-ui/react-slot": "^1.
|
|
27113
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
27100
27114
|
"class-variance-authority": "^0.7.1",
|
|
27101
27115
|
clsx: "^2.1.1",
|
|
27102
|
-
"tailwind-merge": "^
|
|
27116
|
+
"tailwind-merge": "^3.3.1",
|
|
27103
27117
|
"lucide-react": "^0.468.0",
|
|
27104
|
-
"@types/react": "^
|
|
27105
|
-
"@types/react-dom": "^
|
|
27106
|
-
typescript: "^5.
|
|
27118
|
+
"@types/react": "^19.2.2",
|
|
27119
|
+
"@types/react-dom": "^19.2.2",
|
|
27120
|
+
typescript: "^5.9.3"
|
|
27107
27121
|
};
|
|
27108
27122
|
Object.assign(rootPackageJson.catalog, shadcnDependencies);
|
|
27109
27123
|
await writeFile(rootPackageJsonPath, JSON.stringify(rootPackageJson, null, 2));
|
|
@@ -32976,8 +32990,15 @@ async function createCommand2(preset, name, options) {
|
|
|
32976
32990
|
break;
|
|
32977
32991
|
}
|
|
32978
32992
|
s.message(`${source_default.cyan("\u2728")} Finalizing setup...`);
|
|
32993
|
+
if (config.install !== false) {
|
|
32994
|
+
s.message(`${source_default.cyan("\uD83D\uDCE6")} Installing dependencies...`);
|
|
32995
|
+
try {
|
|
32996
|
+
await installDependencies(projectPath);
|
|
32997
|
+
} catch (error) {
|
|
32998
|
+
s.message(`${source_default.yellow("\u26A0\uFE0F")} Dependency installation had issues, but continuing...`);
|
|
32999
|
+
}
|
|
33000
|
+
}
|
|
32979
33001
|
if (isEnterprise && config.uiLibrary === "shadcn" && config.install !== false) {
|
|
32980
|
-
await new Promise((resolve2) => setTimeout(resolve2, 1000));
|
|
32981
33002
|
s.message(`${source_default.cyan("\uD83E\uDDE9")} Installing default shadcn/ui components...`);
|
|
32982
33003
|
try {
|
|
32983
33004
|
await installDefaultShadcnComponents(projectPath, {
|
|
@@ -32986,7 +33007,7 @@ async function createCommand2(preset, name, options) {
|
|
|
32986
33007
|
});
|
|
32987
33008
|
} catch (error) {
|
|
32988
33009
|
s.message(`${source_default.yellow("\u26A0\uFE0F")} Could not install default components automatically`);
|
|
32989
|
-
s.message(`${source_default.dim(" You can install them manually:")} ${source_default.cyan("cd packages/ui && bunx shadcn@latest add button card")}`);
|
|
33010
|
+
s.message(`${source_default.dim(" You can install them manually:")} ${source_default.cyan("cd packages/ui && bun install && bunx shadcn@latest add button card")}`);
|
|
32990
33011
|
}
|
|
32991
33012
|
}
|
|
32992
33013
|
s.stop(`${source_default.green("\u2705")} Project ${source_default.bold(name)} created successfully!`);
|