create-better-fullstack 1.1.11 → 1.1.12

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/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { o as createBtsCli } from "./src-BkL9XJbn.mjs";
2
+ import { o as createBtsCli } from "./src-BVho5D9n.mjs";
3
3
 
4
4
  //#region src/cli.ts
5
5
  createBtsCli().run();
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { a as create, c as docs, d as sponsors, i as builder, l as generateVirtualProject, n as TEMPLATE_COUNT, o as createBtsCli, r as VirtualFileSystem, s as createVirtual, t as EMBEDDED_TEMPLATES, u as router } from "./src-BkL9XJbn.mjs";
2
+ import { a as create, c as docs, d as sponsors, i as builder, l as generateVirtualProject, n as TEMPLATE_COUNT, o as createBtsCli, r as VirtualFileSystem, s as createVirtual, t as EMBEDDED_TEMPLATES, u as router } from "./src-BVho5D9n.mjs";
3
3
 
4
4
  export { EMBEDDED_TEMPLATES, TEMPLATE_COUNT, VirtualFileSystem, builder, create, createBtsCli, createVirtual, docs, generateVirtualProject, router, sponsors };
@@ -13,9 +13,9 @@ import path$1 from "node:path";
13
13
  import { fileURLToPath } from "node:url";
14
14
  import { AsyncLocalStorage } from "node:async_hooks";
15
15
  import { ConfirmPrompt, GroupMultiSelectPrompt, MultiSelectPrompt, SelectPrompt, isCancel as isCancel$1 } from "@clack/core";
16
+ import { $, execa } from "execa";
16
17
  import gradient from "gradient-string";
17
18
  import { writeTreeToFilesystem } from "@better-fullstack/template-generator/fs-writer";
18
- import { $, execa } from "execa";
19
19
  import * as JSONC from "jsonc-parser";
20
20
  import { format } from "oxfmt";
21
21
  import os$1 from "node:os";
@@ -2384,10 +2384,33 @@ async function getGitChoice(git) {
2384
2384
  return response;
2385
2385
  }
2386
2386
 
2387
+ //#endregion
2388
+ //#region src/utils/command-exists.ts
2389
+ async function commandExists(command) {
2390
+ try {
2391
+ if (process.platform === "win32") return (await $({ reject: false })`where ${command}`).exitCode === 0;
2392
+ return (await $({ reject: false })`which ${command}`).exitCode === 0;
2393
+ } catch {
2394
+ return false;
2395
+ }
2396
+ }
2397
+
2387
2398
  //#endregion
2388
2399
  //#region src/prompts/install.ts
2389
- async function getinstallChoice(install) {
2400
+ async function getinstallChoice(install, ecosystem) {
2390
2401
  if (install !== void 0) return install;
2402
+ if (ecosystem === "rust") {
2403
+ if (!await commandExists("cargo")) {
2404
+ log.warn("Cargo is not installed. Please install Rust from https://rustup.rs");
2405
+ return false;
2406
+ }
2407
+ const response$1 = await navigableConfirm({
2408
+ message: "Run cargo build?",
2409
+ initialValue: DEFAULT_CONFIG.install
2410
+ });
2411
+ if (isCancel$1(response$1)) return exitCancelled("Operation cancelled");
2412
+ return response$1;
2413
+ }
2391
2414
  const response = await navigableConfirm({
2392
2415
  message: "Install dependencies?",
2393
2416
  initialValue: DEFAULT_CONFIG.install
@@ -3364,8 +3387,11 @@ async function gatherConfig(flags, projectName, projectDir, relativePath) {
3364
3387
  return getRustLibrariesChoice(flags.rustLibraries);
3365
3388
  },
3366
3389
  git: () => getGitChoice(flags.git),
3367
- packageManager: () => getPackageManagerChoice(flags.packageManager),
3368
- install: () => getinstallChoice(flags.install)
3390
+ packageManager: ({ results }) => {
3391
+ if (results.ecosystem === "rust") return Promise.resolve("npm");
3392
+ return getPackageManagerChoice(flags.packageManager);
3393
+ },
3394
+ install: ({ results }) => getinstallChoice(flags.install, results.ecosystem)
3369
3395
  }, { onCancel: () => exitCancelled("Operation cancelled") });
3370
3396
  return {
3371
3397
  projectName,
@@ -5288,17 +5314,6 @@ function getDatabaseUrl(database, projectName) {
5288
5314
  }
5289
5315
  }
5290
5316
 
5291
- //#endregion
5292
- //#region src/utils/command-exists.ts
5293
- async function commandExists(command) {
5294
- try {
5295
- if (process.platform === "win32") return (await $({ reject: false })`where ${command}`).exitCode === 0;
5296
- return (await $({ reject: false })`which ${command}`).exitCode === 0;
5297
- } catch {
5298
- return false;
5299
- }
5300
- }
5301
-
5302
5317
  //#endregion
5303
5318
  //#region src/helpers/database-providers/mongodb-atlas-setup.ts
5304
5319
  async function checkAtlasCLI() {
@@ -6229,6 +6244,20 @@ async function installDependencies({ projectDir, packageManager }) {
6229
6244
  if (error instanceof Error) consola.error(pc.red(`Installation error: ${error.message}`));
6230
6245
  }
6231
6246
  }
6247
+ async function runCargoBuild({ projectDir }) {
6248
+ const s = spinner();
6249
+ try {
6250
+ s.start("Running cargo build...");
6251
+ await $({
6252
+ cwd: projectDir,
6253
+ stderr: "inherit"
6254
+ })`cargo build`;
6255
+ s.stop("Cargo build completed");
6256
+ } catch (error) {
6257
+ s.stop(pc.red("Cargo build failed"));
6258
+ if (error instanceof Error) consola.error(pc.red(`Cargo build error: ${error.message}`));
6259
+ }
6260
+ }
6232
6261
 
6233
6262
  //#endregion
6234
6263
  //#region src/utils/docker-utils.ts
@@ -6521,6 +6550,7 @@ async function createProject(options, cliInput = {}) {
6521
6550
  projectDir,
6522
6551
  packageManager: options.packageManager
6523
6552
  });
6553
+ if (options.install && options.ecosystem === "rust") await runCargoBuild({ projectDir });
6524
6554
  await initializeGit(projectDir, options.git);
6525
6555
  if (!isSilent()) await displayPostInstallInstructions({
6526
6556
  ...options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-fullstack",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "A CLI-first toolkit for building Full Stack applications. Skip the configuration. Ship the code.",
5
5
  "keywords": [
6
6
  "better-auth",
@@ -76,8 +76,8 @@
76
76
  "prepublishOnly": "npm run build"
77
77
  },
78
78
  "dependencies": {
79
- "@better-fullstack/template-generator": "^1.1.11",
80
- "@better-fullstack/types": "^1.1.11",
79
+ "@better-fullstack/template-generator": "^1.1.12",
80
+ "@better-fullstack/types": "^1.1.12",
81
81
  "@clack/core": "^0.5.0",
82
82
  "@clack/prompts": "^1.0.0-alpha.8",
83
83
  "@orpc/server": "^1.13.0",