create-better-t-stack 2.28.0 → 2.28.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 CHANGED
@@ -49,8 +49,8 @@ const DEFAULT_CONFIG = {
49
49
  webDeploy: "none"
50
50
  };
51
51
  const dependencyVersionMap = {
52
- "better-auth": "^1.3.0",
53
- "@better-auth/expo": "^1.3.0",
52
+ "better-auth": "^1.3.4",
53
+ "@better-auth/expo": "^1.3.4",
54
54
  "drizzle-orm": "^0.44.2",
55
55
  "drizzle-kit": "^0.31.2",
56
56
  "@libsql/client": "^0.15.9",
@@ -60,8 +60,8 @@ const dependencyVersionMap = {
60
60
  "@types/ws": "^8.18.1",
61
61
  ws: "^8.18.3",
62
62
  mysql2: "^3.14.0",
63
- "@prisma/client": "^6.12.0",
64
- prisma: "^6.12.0",
63
+ "@prisma/client": "^6.13.0",
64
+ prisma: "^6.13.0",
65
65
  "@prisma/extension-accelerate": "^2.0.2",
66
66
  mongoose: "^8.14.0",
67
67
  "vite-plugin-pwa": "^1.0.1",
@@ -275,7 +275,7 @@ function getAddonDisplay(addon) {
275
275
  hint = "High-performance build system";
276
276
  break;
277
277
  case "pwa":
278
- label = "PWA (Progressive Web App)";
278
+ label = "PWA";
279
279
  hint = "Make your app installable and work offline";
280
280
  break;
281
281
  case "tauri":
@@ -3739,7 +3739,7 @@ async function setupNeonPostgres(config) {
3739
3739
  //#region src/helpers/database-providers/prisma-postgres-setup.ts
3740
3740
  async function setupWithCreateDb(serverDir, packageManager, orm) {
3741
3741
  try {
3742
- log.info("Starting Prisma PostgreSQL setup. Please follow the instructions below:");
3742
+ log.info("Starting Prisma Postgres setup. Please follow the instructions below:");
3743
3743
  const createDbCommand = getPackageExecutionCommand(packageManager, "create-db@latest -i");
3744
3744
  await execa(createDbCommand, {
3745
3745
  cwd: serverDir,
@@ -3806,6 +3806,16 @@ async function writeEnvFile$1(projectDir, config) {
3806
3806
  consola$1.error("Failed to update environment configuration");
3807
3807
  }
3808
3808
  }
3809
+ async function addDotenvImportToPrismaConfig(projectDir) {
3810
+ try {
3811
+ const prismaConfigPath = path.join(projectDir, "apps/server/prisma.config.ts");
3812
+ let content = await fs.readFile(prismaConfigPath, "utf8");
3813
+ content = `import "dotenv/config";\n${content}`;
3814
+ await fs.writeFile(prismaConfigPath, content);
3815
+ } catch (_error) {
3816
+ consola$1.error("Failed to update prisma.config.ts");
3817
+ }
3818
+ }
3809
3819
  function displayManualSetupInstructions$1() {
3810
3820
  log.info(`Manual Prisma PostgreSQL Setup Instructions:
3811
3821
 
@@ -3863,7 +3873,7 @@ async function setupPrismaPostgres(config) {
3863
3873
  hint: "More control (requires auth)"
3864
3874
  });
3865
3875
  const setupMethod = await select({
3866
- message: "Choose your Prisma setup method:",
3876
+ message: "Choose your Prisma Postgres setup method:",
3867
3877
  options: setupOptions,
3868
3878
  initialValue: "create-db"
3869
3879
  });
@@ -3876,20 +3886,15 @@ async function setupPrismaPostgres(config) {
3876
3886
  else prismaConfig = await initPrismaDatabase(serverDir, packageManager);
3877
3887
  if (prismaConfig) {
3878
3888
  await writeEnvFile$1(projectDir, prismaConfig);
3879
- if (orm === "prisma") {
3880
- await addPrismaAccelerateExtension(serverDir);
3881
- log.info(pc.cyan("NOTE: Make sure to uncomment `import \"dotenv/config\";` in `apps/server/src/prisma.config.ts` to load environment variables."));
3882
- }
3883
- log.success(pc.green("Prisma PostgreSQL database configured successfully!"));
3889
+ await addDotenvImportToPrismaConfig(projectDir);
3890
+ if (orm === "prisma") await addPrismaAccelerateExtension(serverDir);
3891
+ log.success(pc.green("Prisma Postgres database configured successfully!"));
3884
3892
  } else {
3885
- const fallbackSpinner = spinner();
3886
- fallbackSpinner.start("Setting up fallback configuration...");
3887
3893
  await writeEnvFile$1(projectDir);
3888
- fallbackSpinner.stop("Fallback configuration ready");
3889
3894
  displayManualSetupInstructions$1();
3890
3895
  }
3891
3896
  } catch (error) {
3892
- consola$1.error(pc.red(`Error during Prisma PostgreSQL setup: ${error instanceof Error ? error.message : String(error)}`));
3897
+ consola$1.error(pc.red(`Error during Prisma Postgres setup: ${error instanceof Error ? error.message : String(error)}`));
3893
3898
  try {
3894
3899
  await writeEnvFile$1(projectDir);
3895
3900
  displayManualSetupInstructions$1();
@@ -4867,8 +4872,7 @@ async function getDatabaseInstructions(database, orm, runCmd, runtime, dbSetup)
4867
4872
  instructions.push("");
4868
4873
  }
4869
4874
  if (orm === "prisma") {
4870
- if (database === "sqlite") instructions.push(`${pc.yellow("NOTE:")} Turso support with Prisma is in Early Access and requires additional setup.`, `Learn more at: https://www.prisma.io/docs/orm/overview/databases/turso`);
4871
- if (runtime === "bun") instructions.push(`${pc.yellow("NOTE:")} Prisma with Bun may require additional configuration. If you encounter errors,\nfollow the guidance provided in the error messages`);
4875
+ if (dbSetup === "turso") instructions.push(`${pc.yellow("NOTE:")} Turso support with Prisma is in Early Access and requires additional setup.`, `Learn more at: https://www.prisma.io/docs/orm/overview/databases/turso`);
4872
4876
  if (database === "mongodb" && dbSetup === "docker") instructions.push(`${pc.yellow("WARNING:")} Prisma + MongoDB + Docker combination may not work.`);
4873
4877
  if (dbSetup === "docker") instructions.push(`${pc.cyan("•")} Start docker container: ${`${runCmd} db:start`}`);
4874
4878
  instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
@@ -5055,9 +5059,9 @@ async function updateServerPackageJson(projectDir, options) {
5055
5059
  if (options.database !== "none") {
5056
5060
  if (options.database === "sqlite" && options.orm === "drizzle" && options.dbSetup !== "d1") scripts["db:local"] = "turso dev --db-file local.db";
5057
5061
  if (options.orm === "prisma") {
5058
- scripts["db:push"] = "prisma db push --schema ./prisma/schema";
5062
+ scripts["db:push"] = "prisma db push";
5059
5063
  scripts["db:studio"] = "prisma studio";
5060
- scripts["db:generate"] = "prisma generate --schema ./prisma/schema";
5064
+ scripts["db:generate"] = "prisma generate";
5061
5065
  scripts["db:migrate"] = "prisma migrate dev";
5062
5066
  } else if (options.orm === "drizzle") {
5063
5067
  scripts["db:push"] = "drizzle-kit push";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "2.28.0",
3
+ "version": "2.28.1",
4
4
  "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  "next": "15.3.0",
12
12
  "react": "^19.0.0",
13
13
  "react-dom": "^19.0.0",
14
- "dotenv": "^16.5.0"
14
+ "dotenv": "^17.2.1"
15
15
  },
16
16
  {{#if (eq dbSetup 'supabase')}}
17
17
  "trustedDependencies": [
@@ -21,6 +21,7 @@
21
21
  "devDependencies": {
22
22
  "@types/node": "^20",
23
23
  "@types/react": "^19",
24
+ "zod": "^4.0.13",
24
25
  "typescript": "^5"
25
26
  }
26
27
  }
@@ -7,13 +7,8 @@
7
7
  "check-types": "tsc -b",
8
8
  "compile": "bun build --compile --minify --sourcemap --bytecode ./src/index.ts --outfile server"
9
9
  },
10
- {{#if (eq orm 'prisma')}}
11
- "prisma": {
12
- "schema": "./schema"
13
- },
14
- {{/if}}
15
10
  "dependencies": {
16
- "dotenv": "^16.4.7",
11
+ "dotenv": "^17.2.1",
17
12
  "zod": "^4.0.2"
18
13
  },
19
14
  {{#if (eq dbSetup 'supabase')}}
@@ -3,6 +3,8 @@ import path from "node:path";
3
3
  import type { PrismaConfig } from "prisma";
4
4
 
5
5
  export default {
6
- earlyAccess: true,
7
6
  schema: path.join("prisma", "schema"),
7
+ migrations: {
8
+ path: path.join("prisma", "migrations"),
9
+ }
8
10
  } satisfies PrismaConfig;
@@ -3,6 +3,8 @@ import path from "node:path";
3
3
  import type { PrismaConfig } from "prisma";
4
4
 
5
5
  export default {
6
- earlyAccess: true,
7
6
  schema: path.join("prisma", "schema"),
7
+ migrations: {
8
+ path: path.join("prisma", "migrations"),
9
+ }
8
10
  } satisfies PrismaConfig;
@@ -1,12 +1,12 @@
1
- {{#if (eq dbSetup "prisma-postgres")}}
2
- // import "dotenv/config"; uncomment this to load .env
3
- {{else}}
1
+ {{#unless (eq dbSetup "prisma-postgres")}}
4
2
  import "dotenv/config";
5
- {{/if}}
3
+ {{/unless}}
6
4
  import path from "node:path";
7
5
  import type { PrismaConfig } from "prisma";
8
6
 
9
7
  export default {
10
- earlyAccess: true,
11
8
  schema: path.join("prisma", "schema"),
9
+ migrations: {
10
+ path: path.join("prisma", "migrations"),
11
+ }
12
12
  } satisfies PrismaConfig;
@@ -3,6 +3,8 @@ import path from "node:path";
3
3
  import type { PrismaConfig } from "prisma";
4
4
 
5
5
  export default {
6
- earlyAccess: true,
7
6
  schema: path.join("prisma", "schema"),
7
+ migrations: {
8
+ path: path.join("prisma", "migrations"),
9
+ }
8
10
  } satisfies PrismaConfig;