create-better-t-stack 2.22.4 → 2.22.5

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
@@ -52,6 +52,7 @@ const dependencyVersionMap = {
52
52
  "drizzle-orm": "^0.44.2",
53
53
  "drizzle-kit": "^0.31.2",
54
54
  "@libsql/client": "^0.15.9",
55
+ "@neondatabase/serverless": "^1.0.1",
55
56
  pg: "^8.14.1",
56
57
  "@types/pg": "^8.11.11",
57
58
  mysql2: "^3.14.0",
@@ -3416,7 +3417,12 @@ async function setupDatabase(config) {
3416
3417
  devDependencies: ["drizzle-kit"],
3417
3418
  projectDir: serverDir
3418
3419
  });
3419
- else if (database === "postgres") await addPackageDependency({
3420
+ else if (database === "postgres") if (dbSetup === "neon") await addPackageDependency({
3421
+ dependencies: ["drizzle-orm", "@neondatabase/serverless"],
3422
+ devDependencies: ["drizzle-kit"],
3423
+ projectDir: serverDir
3424
+ });
3425
+ else await addPackageDependency({
3420
3426
  dependencies: ["drizzle-orm", "pg"],
3421
3427
  devDependencies: ["drizzle-kit", "@types/pg"],
3422
3428
  projectDir: serverDir
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "2.22.4",
3
+ "version": "2.22.5",
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",
@@ -1,12 +1,29 @@
1
1
  {{#if (or (eq runtime "bun") (eq runtime "node"))}}
2
+ {{#if (eq dbSetup "neon")}}
3
+ import { neon } from '@neondatabase/serverless';
4
+ import { drizzle } from 'drizzle-orm/neon-http';
5
+
6
+ const sql = neon(process.env.DATABASE_URL || "");
7
+ export const db = drizzle(sql);
8
+ {{else}}
2
9
  import { drizzle } from "drizzle-orm/node-postgres";
3
10
 
4
11
  export const db = drizzle(process.env.DATABASE_URL || "");
5
12
  {{/if}}
13
+ {{/if}}
6
14
 
7
15
  {{#if (eq runtime "workers")}}
16
+ {{#if (eq dbSetup "neon")}}
17
+ import { neon } from '@neondatabase/serverless';
18
+ import { drizzle } from 'drizzle-orm/neon-http';
19
+ import { env } from "cloudflare:workers";
20
+
21
+ const sql = neon(env.DATABASE_URL || "");
22
+ export const db = drizzle(sql);
23
+ {{else}}
8
24
  import { drizzle } from "drizzle-orm/node-postgres";
9
25
  import { env } from "cloudflare:workers";
10
26
 
11
27
  export const db = drizzle(env.DATABASE_URL || "");
12
28
  {{/if}}
29
+ {{/if}}