bunkit-cli 0.5.0 → 0.5.2

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 +106 -39
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10433,7 +10433,7 @@ var require_package = __commonJS((exports, module) => {
10433
10433
 
10434
10434
  // ../../node_modules/.bun/ejs@3.1.10/node_modules/ejs/lib/ejs.js
10435
10435
  var require_ejs = __commonJS((exports) => {
10436
- var fs4 = __require("fs");
10436
+ var fs5 = __require("fs");
10437
10437
  var path7 = __require("path");
10438
10438
  var utils = require_utils7();
10439
10439
  var scopeOptionWarned = false;
@@ -10461,7 +10461,7 @@ var require_ejs = __commonJS((exports) => {
10461
10461
  var _BOM = /^\uFEFF/;
10462
10462
  var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
10463
10463
  exports.cache = utils.cache;
10464
- exports.fileLoader = fs4.readFileSync;
10464
+ exports.fileLoader = fs5.readFileSync;
10465
10465
  exports.localsName = _DEFAULT_LOCALS_NAME;
10466
10466
  exports.promiseImpl = new Function("return this;")().Promise;
10467
10467
  exports.resolveInclude = function(name, filename, isDir) {
@@ -10479,7 +10479,7 @@ var require_ejs = __commonJS((exports) => {
10479
10479
  var filePath;
10480
10480
  if (paths.some(function(v2) {
10481
10481
  filePath = exports.resolveInclude(name, v2, true);
10482
- return fs4.existsSync(filePath);
10482
+ return fs5.existsSync(filePath);
10483
10483
  })) {
10484
10484
  return filePath;
10485
10485
  }
@@ -10499,7 +10499,7 @@ var require_ejs = __commonJS((exports) => {
10499
10499
  } else {
10500
10500
  if (options.filename) {
10501
10501
  filePath = exports.resolveInclude(path8, options.filename);
10502
- if (fs4.existsSync(filePath)) {
10502
+ if (fs5.existsSync(filePath)) {
10503
10503
  includePath = filePath;
10504
10504
  }
10505
10505
  }
@@ -24006,7 +24006,7 @@ async function createPackageJson(projectPath, config) {
24006
24006
  dependencies: {},
24007
24007
  devDependencies: {
24008
24008
  "@types/bun": "latest",
24009
- typescript: "^5.7.2"
24009
+ typescript: "^5.9.3"
24010
24010
  },
24011
24011
  ...gitUser.name && { author: gitUser.name }
24012
24012
  };
@@ -24118,10 +24118,14 @@ function createTemplateContext(config) {
24118
24118
  };
24119
24119
  }
24120
24120
  // ../core/src/install.ts
24121
+ var import_fs_extra3 = __toESM(require_lib(), 1);
24121
24122
  async function installDependencies(cwd, packages) {
24122
24123
  logger.step("Installing dependencies...");
24123
24124
  try {
24124
- if (packages && packages.length > 0) {
24125
+ if (packages && typeof packages === "object" && !Array.isArray(packages)) {
24126
+ await addDependenciesToPackageJson(cwd, packages);
24127
+ await execa("bun", ["install"], { cwd, stdio: "inherit" });
24128
+ } else if (packages && Array.isArray(packages) && packages.length > 0) {
24125
24129
  await execa("bun", ["add", ...packages], { cwd, stdio: "inherit" });
24126
24130
  } else {
24127
24131
  await execa("bun", ["install"], { cwd, stdio: "inherit" });
@@ -24132,6 +24136,15 @@ async function installDependencies(cwd, packages) {
24132
24136
  throw error;
24133
24137
  }
24134
24138
  }
24139
+ async function addDependenciesToPackageJson(cwd, dependencies) {
24140
+ const packageJsonPath = join(cwd, "package.json");
24141
+ const packageJson = await import_fs_extra3.default.readJson(packageJsonPath);
24142
+ packageJson.dependencies = {
24143
+ ...packageJson.dependencies,
24144
+ ...dependencies
24145
+ };
24146
+ await import_fs_extra3.default.writeJson(packageJsonPath, packageJson, { spaces: 2 });
24147
+ }
24135
24148
  // src/commands/init.enhanced.ts
24136
24149
  var import_picocolors4 = __toESM(require_picocolors(), 1);
24137
24150
 
@@ -24419,9 +24432,14 @@ async function setupBiome(projectPath, context) {
24419
24432
  }
24420
24433
  function getCodeQualityDependencies(codeQuality) {
24421
24434
  if (codeQuality === "ultracite") {
24422
- return ["ultracite", "@biomejs/biome"];
24435
+ return {
24436
+ ultracite: "^6.0.1",
24437
+ "@biomejs/biome": "^2.3.0"
24438
+ };
24423
24439
  }
24424
- return ["@biomejs/biome"];
24440
+ return {
24441
+ "@biomejs/biome": "^2.3.0"
24442
+ };
24425
24443
  }
24426
24444
 
24427
24445
  // ../templates/src/generators/docker.ts
@@ -25009,13 +25027,25 @@ DATABASE_URL=./local.db
25009
25027
  function getDatabaseDependencies(databaseType) {
25010
25028
  switch (databaseType) {
25011
25029
  case "postgres-drizzle":
25012
- return ["drizzle-orm", "drizzle-kit"];
25030
+ return {
25031
+ "drizzle-orm": "^0.38.0",
25032
+ "drizzle-kit": "^0.30.1",
25033
+ postgres: "^3.4.5"
25034
+ };
25013
25035
  case "supabase":
25014
- return ["@supabase/supabase-js", "drizzle-orm", "drizzle-kit", "postgres"];
25036
+ return {
25037
+ "@supabase/supabase-js": "^2.48.1",
25038
+ "drizzle-orm": "^0.38.0",
25039
+ "drizzle-kit": "^0.30.1",
25040
+ postgres: "^3.4.5"
25041
+ };
25015
25042
  case "sqlite-drizzle":
25016
- return ["drizzle-orm", "drizzle-kit"];
25043
+ return {
25044
+ "drizzle-orm": "^0.38.0",
25045
+ "drizzle-kit": "^0.30.1"
25046
+ };
25017
25047
  default:
25018
- return [];
25048
+ return {};
25019
25049
  }
25020
25050
  }
25021
25051
 
@@ -25229,15 +25259,36 @@ async function buildFullPreset(projectPath, context) {
25229
25259
  test: "bun test"
25230
25260
  },
25231
25261
  devDependencies: {
25232
- "@biomejs/biome": "^2.3.0",
25262
+ "@biomejs/biome": "catalog:",
25233
25263
  "@types/bun": "latest",
25234
- typescript: "^5.7.2"
25264
+ typescript: "catalog:"
25235
25265
  },
25236
25266
  catalog: {
25237
25267
  react: "^19.1.0",
25238
25268
  "react-dom": "^19.1.0",
25239
25269
  next: "^16.0.0",
25240
- hono: "^4.7.12"
25270
+ hono: "^4.7.12",
25271
+ "drizzle-orm": "^0.38.0",
25272
+ "drizzle-kit": "^0.30.1",
25273
+ postgres: "^3.4.5",
25274
+ "@supabase/supabase-js": "^2.48.1",
25275
+ tailwindcss: "^4.1.7",
25276
+ autoprefixer: "^10.4.20",
25277
+ postcss: "^8.5.1",
25278
+ "@tailwindcss/postcss": "^4.1.7",
25279
+ "@radix-ui/react-slot": "^1.2.3",
25280
+ "class-variance-authority": "^0.7.1",
25281
+ clsx: "^2.1.1",
25282
+ "tailwind-merge": "^3.3.1",
25283
+ "iconoir-react": "^7.11.0",
25284
+ "@biomejs/biome": "^2.3.0",
25285
+ ultracite: "^6.0.1",
25286
+ vitest: "^2.0.0",
25287
+ "@vitest/ui": "^2.0.0",
25288
+ "@types/react": "^19.1.0",
25289
+ "@types/react-dom": "^19.1.0",
25290
+ "@types/node": "^22.10.6",
25291
+ typescript: "^5.9.3"
25241
25292
  }
25242
25293
  };
25243
25294
  await writeFile(join(projectPath, "package.json"), JSON.stringify(rootPackageJson, null, 2));
@@ -25264,11 +25315,11 @@ coverage = true
25264
25315
  [`@${context.packageName}/types`]: "workspace:*"
25265
25316
  },
25266
25317
  devDependencies: {
25267
- "@types/react": "^19.1.0",
25268
- "@types/react-dom": "^19.1.0",
25269
- "@types/node": "^22.10.6",
25270
- typescript: "^5.7.2",
25271
- tailwindcss: "^4.1.5"
25318
+ "@types/react": "catalog:",
25319
+ "@types/react-dom": "catalog:",
25320
+ "@types/node": "catalog:",
25321
+ typescript: "catalog:",
25322
+ tailwindcss: "catalog:"
25272
25323
  }
25273
25324
  };
25274
25325
  await writeFile(join(projectPath, "apps/web/package.json"), JSON.stringify(webPackageJson, null, 2));
@@ -25288,11 +25339,11 @@ coverage = true
25288
25339
  [`@${context.packageName}/types`]: "workspace:*"
25289
25340
  },
25290
25341
  devDependencies: {
25291
- "@types/react": "^19.1.0",
25292
- "@types/react-dom": "^19.1.0",
25293
- "@types/node": "^22.10.6",
25294
- typescript: "^5.7.2",
25295
- tailwindcss: "^4.1.5"
25342
+ "@types/react": "catalog:",
25343
+ "@types/react-dom": "catalog:",
25344
+ "@types/node": "catalog:",
25345
+ typescript: "catalog:",
25346
+ tailwindcss: "catalog:"
25296
25347
  }
25297
25348
  };
25298
25349
  await writeFile(join(projectPath, "apps/platform/package.json"), JSON.stringify(platformPackageJson, null, 2));
@@ -25311,7 +25362,7 @@ coverage = true
25311
25362
  },
25312
25363
  devDependencies: {
25313
25364
  "@types/bun": "latest",
25314
- typescript: "^5.7.2"
25365
+ typescript: "catalog:"
25315
25366
  }
25316
25367
  };
25317
25368
  await writeFile(join(projectPath, "apps/api/package.json"), JSON.stringify(apiPackageJson, null, 2));
@@ -25749,16 +25800,16 @@ Built with \u2764\uFE0F using Bun monorepo features
25749
25800
  main: "./src/index.ts",
25750
25801
  types: "./src/index.ts",
25751
25802
  dependencies: context.database === "supabase" ? {
25752
- "@supabase/supabase-js": "^2.48.1",
25753
- "drizzle-orm": "^0.38.0",
25754
- postgres: "^3.4.5"
25803
+ "@supabase/supabase-js": "catalog:",
25804
+ "drizzle-orm": "catalog:",
25805
+ postgres: "catalog:"
25755
25806
  } : {
25756
- "drizzle-orm": "^0.38.0"
25807
+ "drizzle-orm": "catalog:"
25757
25808
  },
25758
25809
  devDependencies: {
25759
- "drizzle-kit": "^0.30.1",
25810
+ "drizzle-kit": "catalog:",
25760
25811
  "@types/bun": "latest",
25761
- typescript: "^5.7.2"
25812
+ typescript: "catalog:"
25762
25813
  }
25763
25814
  };
25764
25815
  await writeFile(join(dbPackagePath, "package.json"), JSON.stringify(dbPackageJson, null, 2));
@@ -25841,6 +25892,13 @@ ${context.database && context.database !== "none" && context.database !== "supab
25841
25892
  }
25842
25893
  }
25843
25894
  // src/commands/init.enhanced.ts
25895
+ var VERSIONS = {
25896
+ vitest: "^2.0.0",
25897
+ "@vitest/ui": "^2.0.0",
25898
+ "class-variance-authority": "^0.7.1",
25899
+ clsx: "^2.1.1",
25900
+ "tailwind-merge": "^3.3.1"
25901
+ };
25844
25902
  function getOptionValue(envVar, option, defaultValue) {
25845
25903
  const envValue = process.env[envVar];
25846
25904
  if (envValue !== undefined) {
@@ -26235,21 +26293,30 @@ async function enhancedInitCommand(options = {}) {
26235
26293
  s.message("\u2699\uFE0F Adding GitHub Actions...");
26236
26294
  }
26237
26295
  s.stop("\u2705 Project created!");
26238
- if (shouldInstall) {
26239
- const additionalDeps = [];
26296
+ if (shouldInstall && preset !== "full") {
26297
+ const additionalDeps = {};
26240
26298
  if (database && database !== "none") {
26241
- additionalDeps.push(...getDatabaseDependencies(database));
26299
+ Object.assign(additionalDeps, getDatabaseDependencies(database));
26242
26300
  }
26243
26301
  if (codeQuality) {
26244
- additionalDeps.push(...getCodeQualityDependencies(codeQuality));
26302
+ Object.assign(additionalDeps, getCodeQualityDependencies(codeQuality));
26245
26303
  }
26246
26304
  if (testing === "vitest") {
26247
- additionalDeps.push("vitest", "@vitest/ui");
26305
+ additionalDeps["vitest"] = VERSIONS.vitest;
26306
+ additionalDeps["@vitest/ui"] = VERSIONS["@vitest/ui"];
26248
26307
  }
26249
26308
  if (uiLibrary === "shadcn") {
26250
- additionalDeps.push("class-variance-authority", "clsx", "tailwind-merge");
26309
+ additionalDeps["class-variance-authority"] = VERSIONS["class-variance-authority"];
26310
+ additionalDeps["clsx"] = VERSIONS.clsx;
26311
+ additionalDeps["tailwind-merge"] = VERSIONS["tailwind-merge"];
26312
+ }
26313
+ if (Object.keys(additionalDeps).length > 0) {
26314
+ await installDependencies(projectPath, additionalDeps);
26315
+ } else {
26316
+ await installDependencies(projectPath);
26251
26317
  }
26252
- await installDependencies(projectPath, additionalDeps);
26318
+ } else if (shouldInstall && preset === "full") {
26319
+ await installDependencies(projectPath);
26253
26320
  }
26254
26321
  const getDevCommand = () => {
26255
26322
  if (preset === "full" || preset === "web")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunkit-cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Beautiful CLI for creating production-ready Bun projects",
5
5
  "type": "module",
6
6
  "bin": {