create-better-t-stack 3.4.1 → 3.4.2-canary.281ca96d
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/README.md +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.js +1 -1
- package/dist/{src-_EdtPnBT.js → src-CFkY2F0Q.js} +97 -462
- package/package.json +1 -1
- package/templates/api/orpc/server/package.json.hbs +1 -5
- package/templates/api/orpc/server/tsconfig.json.hbs +1 -4
- package/templates/api/trpc/server/package.json.hbs +1 -5
- package/templates/api/trpc/server/tsconfig.json.hbs +1 -4
- package/templates/auth/better-auth/server/base/package.json.hbs +1 -5
- package/templates/auth/better-auth/server/base/tsconfig.json.hbs +1 -4
- package/templates/db/base/package.json.hbs +1 -5
- package/templates/db/base/tsconfig.json.hbs +1 -4
- package/templates/db/drizzle/sqlite/drizzle.config.ts.hbs +0 -7
- package/templates/db/prisma/mongodb/prisma/schema/schema.prisma.hbs +1 -1
- package/templates/db/prisma/mysql/prisma/schema/schema.prisma.hbs +8 -12
- package/templates/db/prisma/mysql/prisma.config.ts.hbs +17 -14
- package/templates/db/prisma/mysql/src/index.ts.hbs +20 -6
- package/templates/db/prisma/postgres/prisma/schema/schema.prisma.hbs +1 -5
- package/templates/db/prisma/postgres/prisma.config.ts.hbs +12 -9
- package/templates/db/prisma/postgres/src/index.ts.hbs +26 -4
- package/templates/db/prisma/sqlite/prisma/schema/schema.prisma.hbs +1 -12
- package/templates/db/prisma/sqlite/prisma.config.ts.hbs +12 -9
- package/templates/db/prisma/sqlite/src/index.ts.hbs +10 -14
- package/templates/deploy/alchemy/alchemy.run.ts.hbs +67 -5
- package/templates/examples/ai/web/react/next/src/app/ai/page.tsx.hbs +2 -2
- package/templates/extras/_npmrc.hbs +2 -2
- package/templates/frontend/native/uniwind/app/(drawer)/_layout.tsx.hbs +21 -13
- package/templates/frontend/react/next/next.config.ts.hbs +5 -2
- package/templates/frontend/react/next/tsconfig.json.hbs +0 -3
- package/templates/frontend/react/tanstack-start/package.json.hbs +4 -4
- package/templates/packages/config/tsconfig.base.json.hbs +1 -1
- package/templates/api/orpc/server/tsdown.config.ts.hbs +0 -7
- package/templates/api/trpc/server/tsdown.config.ts.hbs +0 -7
- package/templates/auth/better-auth/server/base/tsdown.config.ts.hbs +0 -7
- package/templates/db/base/tsdown.config.ts.hbs +0 -7
- package/templates/deploy/wrangler/server/wrangler.jsonc.hbs +0 -39
- package/templates/deploy/wrangler/web/nuxt/wrangler.jsonc.hbs +0 -51
- package/templates/deploy/wrangler/web/react/next/open-next.config.ts +0 -6
- package/templates/deploy/wrangler/web/react/next/wrangler.jsonc.hbs +0 -22
- package/templates/deploy/wrangler/web/react/react-router/wrangler.jsonc.hbs +0 -8
- package/templates/deploy/wrangler/web/react/tanstack-router/wrangler.jsonc.hbs +0 -8
- package/templates/deploy/wrangler/web/react/tanstack-start/wrangler.jsonc.hbs +0 -20
- package/templates/deploy/wrangler/web/solid/wrangler.jsonc.hbs +0 -8
- package/templates/deploy/wrangler/web/svelte/wrangler.jsonc.hbs +0 -51
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2-canary.281ca96d",
|
|
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",
|
|
@@ -2,18 +2,14 @@
|
|
|
2
2
|
"name": "@{{projectName}}/api",
|
|
3
3
|
"exports": {
|
|
4
4
|
".": {
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
6
5
|
"default": "./src/index.ts"
|
|
7
6
|
},
|
|
8
7
|
"./*": {
|
|
9
|
-
"types": "./dist/*.d.ts",
|
|
10
8
|
"default": "./src/*.ts"
|
|
11
9
|
}
|
|
12
10
|
},
|
|
13
11
|
"type": "module",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsdown"
|
|
16
|
-
},
|
|
12
|
+
"scripts": {},
|
|
17
13
|
"devDependencies": {},
|
|
18
14
|
"peerDependencies": {
|
|
19
15
|
"typescript": "^5"
|
|
@@ -2,18 +2,14 @@
|
|
|
2
2
|
"name": "@{{projectName}}/api",
|
|
3
3
|
"exports": {
|
|
4
4
|
".": {
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
6
5
|
"default": "./src/index.ts"
|
|
7
6
|
},
|
|
8
7
|
"./*": {
|
|
9
|
-
"types": "./dist/*.d.ts",
|
|
10
8
|
"default": "./src/*.ts"
|
|
11
9
|
}
|
|
12
10
|
},
|
|
13
11
|
"type": "module",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsdown"
|
|
16
|
-
},
|
|
12
|
+
"scripts": {},
|
|
17
13
|
"devDependencies": {},
|
|
18
14
|
"peerDependencies": {
|
|
19
15
|
"typescript": "^5"
|
|
@@ -2,18 +2,14 @@
|
|
|
2
2
|
"name": "@{{projectName}}/auth",
|
|
3
3
|
"exports": {
|
|
4
4
|
".": {
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
6
5
|
"default": "./src/index.ts"
|
|
7
6
|
},
|
|
8
7
|
"./*": {
|
|
9
|
-
"types": "./dist/*.d.ts",
|
|
10
8
|
"default": "./src/*.ts"
|
|
11
9
|
}
|
|
12
10
|
},
|
|
13
11
|
"type": "module",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsdown"
|
|
16
|
-
},
|
|
12
|
+
"scripts": {},
|
|
17
13
|
"devDependencies": {},
|
|
18
14
|
"peerDependencies": {
|
|
19
15
|
"typescript": "^5"
|
|
@@ -3,17 +3,13 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
|
-
"types": "./dist/index.d.ts",
|
|
7
6
|
"default": "./src/index.ts"
|
|
8
7
|
},
|
|
9
8
|
"./*": {
|
|
10
|
-
"types": "./dist/*.d.ts",
|
|
11
9
|
"default": "./src/*.ts"
|
|
12
10
|
}
|
|
13
11
|
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsdown"
|
|
16
|
-
},
|
|
12
|
+
"scripts": {},
|
|
17
13
|
"devDependencies": {},
|
|
18
14
|
"peerDependencies": {
|
|
19
15
|
"typescript": "^5"
|
|
@@ -16,13 +16,6 @@ export default defineConfig({
|
|
|
16
16
|
// DOCS: https://orm.drizzle.team/docs/guides/d1-http-with-drizzle-kit
|
|
17
17
|
dialect: "sqlite",
|
|
18
18
|
driver: "d1-http",
|
|
19
|
-
{{#if (eq serverDeploy "wrangler")}}
|
|
20
|
-
dbCredentials: {
|
|
21
|
-
accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,
|
|
22
|
-
databaseId: process.env.CLOUDFLARE_DATABASE_ID!,
|
|
23
|
-
token: process.env.CLOUDFLARE_D1_TOKEN!,
|
|
24
|
-
},
|
|
25
|
-
{{/if}}
|
|
26
19
|
{{else}}
|
|
27
20
|
dialect: "turso",
|
|
28
21
|
dbCredentials: {
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
generator client {
|
|
2
|
-
provider
|
|
3
|
-
output
|
|
4
|
-
moduleFormat
|
|
2
|
+
provider = "prisma-client"
|
|
3
|
+
output = "../generated"
|
|
4
|
+
moduleFormat = "esm"
|
|
5
5
|
{{#if (eq runtime "bun")}}
|
|
6
|
-
runtime
|
|
6
|
+
runtime = "bun"
|
|
7
7
|
{{/if}}
|
|
8
8
|
{{#if (eq runtime "node")}}
|
|
9
|
-
runtime
|
|
9
|
+
runtime = "nodejs"
|
|
10
10
|
{{/if}}
|
|
11
|
-
{{#if (eq runtime "workers")}}
|
|
12
|
-
runtime
|
|
13
|
-
{{/if}}
|
|
14
|
-
{{#if (eq dbSetup "planetscale")}}
|
|
15
|
-
previewFeatures = ["driverAdapters"]
|
|
11
|
+
{{#if (or (eq runtime "workers") (and (eq backend "self") (eq webDeploy "alchemy")))}}
|
|
12
|
+
runtime = "workerd"
|
|
16
13
|
{{/if}}
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
datasource db {
|
|
20
17
|
provider = "mysql"
|
|
21
|
-
url = env("DATABASE_URL")
|
|
22
18
|
{{#if (eq dbSetup "planetscale")}}
|
|
23
19
|
relationMode = "prisma"
|
|
24
20
|
{{/if}}
|
|
25
|
-
}
|
|
21
|
+
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import
|
|
3
|
-
import dotenv from
|
|
2
|
+
import { defineConfig, env } from 'prisma/config'
|
|
3
|
+
import dotenv from 'dotenv'
|
|
4
4
|
|
|
5
5
|
dotenv.config({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
6
|
+
{{#if (eq backend "self")}}
|
|
7
|
+
path: "../../apps/web/.env",
|
|
8
|
+
{{else}}
|
|
9
|
+
path: "../../apps/server/.env",
|
|
10
|
+
{{/if}}
|
|
11
|
+
})
|
|
12
12
|
|
|
13
|
-
export default {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
schema: path.join("prisma", "schema"),
|
|
15
|
+
migrations: {
|
|
16
|
+
path: path.join("prisma", "migrations"),
|
|
17
|
+
},
|
|
18
|
+
datasource: {
|
|
19
|
+
url: env('DATABASE_URL'),
|
|
20
|
+
},
|
|
21
|
+
})
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import { PrismaClient } from "../prisma/generated/client";
|
|
2
|
-
{{#if (eq dbSetup "planetscale")}}
|
|
3
|
-
import { PrismaPlanetScale } from '@prisma/adapter-planetscale'
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
{{#if (eq dbSetup "planetscale")}}
|
|
4
|
+
import { PrismaPlanetScale } from "@prisma/adapter-planetscale";
|
|
6
5
|
|
|
7
|
-
const
|
|
6
|
+
const adapter = new PrismaPlanetScale({ url: process.env.DATABASE_URL || "" });
|
|
7
|
+
const prisma = new PrismaClient({ adapter });
|
|
8
8
|
{{else}}
|
|
9
|
-
|
|
9
|
+
import { PrismaMariaDb } from "@prisma/adapter-mariadb";
|
|
10
|
+
|
|
11
|
+
const databaseUrl: string = process.env.DATABASE_URL!;
|
|
12
|
+
|
|
13
|
+
const url: URL = new URL(databaseUrl);
|
|
14
|
+
const connectionConfig = {
|
|
15
|
+
host: url.hostname,
|
|
16
|
+
port: parseInt(url.port || "3306"),
|
|
17
|
+
user: url.username,
|
|
18
|
+
password: url.password,
|
|
19
|
+
database: url.pathname.slice(1),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const adapter = new PrismaMariaDb(connectionConfig);
|
|
23
|
+
const prisma = new PrismaClient({ adapter });
|
|
10
24
|
{{/if}}
|
|
11
25
|
|
|
12
|
-
export default prisma;
|
|
26
|
+
export default prisma;
|
|
@@ -8,17 +8,13 @@ generator client {
|
|
|
8
8
|
{{#if (eq runtime "node")}}
|
|
9
9
|
runtime = "nodejs"
|
|
10
10
|
{{/if}}
|
|
11
|
-
{{#if (eq runtime "workers")}}
|
|
11
|
+
{{#if (or (eq runtime "workers") (and (eq backend "self") (eq webDeploy "alchemy")))}}
|
|
12
12
|
runtime = "workerd"
|
|
13
13
|
{{/if}}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
datasource db {
|
|
17
17
|
provider = "postgresql"
|
|
18
|
-
url = env("DATABASE_URL")
|
|
19
|
-
{{#if (eq dbSetup "supabase")}}
|
|
20
|
-
directUrl = env("DIRECT_URL")
|
|
21
|
-
{{/if}}
|
|
22
18
|
{{#if (eq dbSetup "planetscale")}}
|
|
23
19
|
relationMode = "prisma"
|
|
24
20
|
{{/if}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import
|
|
2
|
+
import { defineConfig, env } from 'prisma/config'
|
|
3
3
|
{{#unless (eq dbSetup "prisma-postgres")}}
|
|
4
|
-
import dotenv from
|
|
4
|
+
import dotenv from 'dotenv'
|
|
5
5
|
|
|
6
6
|
dotenv.config({
|
|
7
7
|
{{#if (eq backend "self")}}
|
|
@@ -9,12 +9,15 @@ dotenv.config({
|
|
|
9
9
|
{{else}}
|
|
10
10
|
path: "../../apps/server/.env",
|
|
11
11
|
{{/if}}
|
|
12
|
-
})
|
|
12
|
+
})
|
|
13
13
|
{{/unless}}
|
|
14
14
|
|
|
15
|
-
export default {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
schema: path.join("prisma", "schema"),
|
|
17
|
+
migrations: {
|
|
18
|
+
path: path.join("prisma", "migrations"),
|
|
19
|
+
},
|
|
20
|
+
datasource: {
|
|
21
|
+
url: env('DATABASE_URL'),
|
|
22
|
+
},
|
|
23
|
+
})
|
|
@@ -1,10 +1,32 @@
|
|
|
1
|
+
{{#if (eq runtime "workers")}}
|
|
1
2
|
import { PrismaClient } from "../prisma/generated/client";
|
|
2
|
-
{
|
|
3
|
-
|
|
3
|
+
import { env } from "cloudflare:workers";
|
|
4
|
+
{{#if (eq dbSetup "neon")}}
|
|
5
|
+
import { PrismaNeon } from "@prisma/adapter-neon";
|
|
4
6
|
|
|
5
|
-
const
|
|
7
|
+
const adapter = new PrismaNeon({ connectionString: env.DATABASE_URL || "" });
|
|
6
8
|
{{else}}
|
|
7
|
-
|
|
9
|
+
import { PrismaPg } from "@prisma/adapter-pg";
|
|
10
|
+
|
|
11
|
+
const adapter = new PrismaPg({ connectionString: env.DATABASE_URL || "" });
|
|
12
|
+
{{/if}}
|
|
13
|
+
const prisma = new PrismaClient({ adapter });
|
|
14
|
+
|
|
15
|
+
export default prisma;
|
|
16
|
+
{{else}}
|
|
17
|
+
import { PrismaClient } from "../prisma/generated/client";
|
|
18
|
+
{{#if (eq dbSetup "neon")}}
|
|
19
|
+
import { PrismaNeon } from "@prisma/adapter-neon";
|
|
20
|
+
import dotenv from "dotenv";
|
|
21
|
+
|
|
22
|
+
dotenv.config();
|
|
23
|
+
const adapter = new PrismaNeon({ connectionString: process.env.DATABASE_URL || "" });
|
|
24
|
+
{{else}}
|
|
25
|
+
import { PrismaPg } from "@prisma/adapter-pg";
|
|
26
|
+
|
|
27
|
+
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL || "" });
|
|
8
28
|
{{/if}}
|
|
29
|
+
const prisma = new PrismaClient({ adapter });
|
|
9
30
|
|
|
10
31
|
export default prisma;
|
|
32
|
+
{{/if}}
|
|
@@ -8,22 +8,11 @@ generator client {
|
|
|
8
8
|
{{#if (eq runtime "node")}}
|
|
9
9
|
runtime = "nodejs"
|
|
10
10
|
{{/if}}
|
|
11
|
-
{{#if (eq runtime "workers")}}
|
|
11
|
+
{{#if (or (eq runtime "workers") (and (eq backend "self") (eq webDeploy "alchemy")))}}
|
|
12
12
|
runtime = "workerd"
|
|
13
|
-
{{#if (eq dbSetup "d1")}}
|
|
14
|
-
previewFeatures = ["driverAdapters"]
|
|
15
|
-
{{/if}}
|
|
16
|
-
{{/if}}
|
|
17
|
-
{{#if (eq dbSetup "turso")}}
|
|
18
|
-
previewFeatures = ["driverAdapters"]
|
|
19
13
|
{{/if}}
|
|
20
14
|
}
|
|
21
15
|
|
|
22
16
|
datasource db {
|
|
23
17
|
provider = "sqlite"
|
|
24
|
-
{{#if (eq dbSetup "turso")}}
|
|
25
|
-
url = "file:./local.db"
|
|
26
|
-
{{else}}
|
|
27
|
-
url = env("DATABASE_URL")
|
|
28
|
-
{{/if}}
|
|
29
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import
|
|
3
|
-
import dotenv from
|
|
2
|
+
import { defineConfig, env } from 'prisma/config'
|
|
3
|
+
import dotenv from 'dotenv'
|
|
4
4
|
|
|
5
5
|
dotenv.config({
|
|
6
6
|
{{#if (eq backend "self")}}
|
|
@@ -8,11 +8,14 @@ dotenv.config({
|
|
|
8
8
|
{{else}}
|
|
9
9
|
path: "../../apps/server/.env",
|
|
10
10
|
{{/if}}
|
|
11
|
-
})
|
|
11
|
+
})
|
|
12
12
|
|
|
13
|
-
export default {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
schema: path.join("prisma", "schema"),
|
|
15
|
+
migrations: {
|
|
16
|
+
path: path.join("prisma", "migrations"),
|
|
17
|
+
},
|
|
18
|
+
datasource: {
|
|
19
|
+
url: env('DATABASE_URL'),
|
|
20
|
+
},
|
|
21
|
+
})
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
{{#if (eq dbSetup "d1")}}
|
|
2
|
-
import { env } from "cloudflare:workers";
|
|
3
|
-
import { PrismaD1 } from "@prisma/adapter-d1";
|
|
4
2
|
import { PrismaClient } from "../prisma/generated/client";
|
|
3
|
+
import { PrismaD1 } from "@prisma/adapter-d1";
|
|
4
|
+
import { env } from "cloudflare:workers";
|
|
5
5
|
|
|
6
6
|
const adapter = new PrismaD1(env.DB);
|
|
7
7
|
const prisma = new PrismaClient({ adapter });
|
|
8
8
|
|
|
9
9
|
export default prisma;
|
|
10
|
-
{{else
|
|
11
|
-
import { PrismaLibSQL } from "@prisma/adapter-libsql";
|
|
10
|
+
{{else}}
|
|
12
11
|
import { PrismaClient } from "../prisma/generated/client";
|
|
12
|
+
import { PrismaLibSql } from "@prisma/adapter-libsql";
|
|
13
13
|
|
|
14
|
-
const adapter = new
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const adapter = new PrismaLibSql({
|
|
15
|
+
url: process.env.DATABASE_URL || "",
|
|
16
|
+
{{#if (eq dbSetup "turso")}}
|
|
17
|
+
authToken: process.env.DATABASE_AUTH_TOKEN,
|
|
18
|
+
{{/if}}
|
|
17
19
|
});
|
|
18
20
|
|
|
19
21
|
const prisma = new PrismaClient({ adapter });
|
|
20
22
|
|
|
21
23
|
export default prisma;
|
|
22
|
-
{{
|
|
23
|
-
import { PrismaClient } from "../prisma/generated/client";
|
|
24
|
-
|
|
25
|
-
const prisma = new PrismaClient();
|
|
26
|
-
|
|
27
|
-
export default prisma;
|
|
28
|
-
{{/if}}
|
|
24
|
+
{{/if}}
|
|
@@ -18,11 +18,9 @@ import { Vite } from "alchemy/cloudflare";
|
|
|
18
18
|
{{/if}}
|
|
19
19
|
{{#if (eq serverDeploy "alchemy")}}
|
|
20
20
|
import { Worker } from "alchemy/cloudflare";
|
|
21
|
-
{{#if (eq dbSetup "d1")}}
|
|
22
|
-
import { D1Database } from "alchemy/cloudflare";
|
|
23
|
-
{{/if}}
|
|
24
21
|
{{/if}}
|
|
25
|
-
{{#if (and (eq serverDeploy "alchemy") (eq dbSetup "d1"))}}
|
|
22
|
+
{{#if (and (or (eq serverDeploy "alchemy") (and (eq webDeploy "alchemy") (eq backend "self"))) (eq dbSetup "d1"))}}
|
|
23
|
+
import { D1Database } from "alchemy/cloudflare";
|
|
26
24
|
import { Exec } from "alchemy/os";
|
|
27
25
|
{{/if}}
|
|
28
26
|
import { config } from "dotenv";
|
|
@@ -37,7 +35,7 @@ config({ path: "./.env" });
|
|
|
37
35
|
|
|
38
36
|
const app = await alchemy("{{projectName}}");
|
|
39
37
|
|
|
40
|
-
{{#if (and (eq serverDeploy "alchemy") (eq dbSetup "d1"))}}
|
|
38
|
+
{{#if (and (or (eq serverDeploy "alchemy") (and (eq webDeploy "alchemy") (eq backend "self"))) (eq dbSetup "d1"))}}
|
|
41
39
|
await Exec("db-generate", {
|
|
42
40
|
{{#if (and (eq webDeploy "alchemy") (eq serverDeploy "alchemy"))}}cwd: "packages/db",{{/if}}
|
|
43
41
|
command: "{{packageManager}} run db:generate",
|
|
@@ -62,6 +60,38 @@ export const web = await Nextjs("web", {
|
|
|
62
60
|
{{else if (ne backend "self")}}
|
|
63
61
|
NEXT_PUBLIC_SERVER_URL: process.env.NEXT_PUBLIC_SERVER_URL || "",
|
|
64
62
|
{{/if}}
|
|
63
|
+
{{#if (eq backend "self")}}
|
|
64
|
+
{{#if (eq dbSetup "d1")}}
|
|
65
|
+
DB: db,
|
|
66
|
+
{{else if (and (ne database "none") (ne dbSetup "none"))}}
|
|
67
|
+
DATABASE_URL: alchemy.secret(process.env.DATABASE_URL),
|
|
68
|
+
{{/if}}
|
|
69
|
+
CORS_ORIGIN: process.env.CORS_ORIGIN || "",
|
|
70
|
+
{{#if (eq auth "better-auth")}}
|
|
71
|
+
BETTER_AUTH_SECRET: alchemy.secret(process.env.BETTER_AUTH_SECRET),
|
|
72
|
+
BETTER_AUTH_URL: process.env.BETTER_AUTH_URL || "",
|
|
73
|
+
{{/if}}
|
|
74
|
+
{{#if (eq auth "clerk")}}
|
|
75
|
+
CLERK_SECRET_KEY: alchemy.secret(process.env.CLERK_SECRET_KEY),
|
|
76
|
+
{{/if}}
|
|
77
|
+
{{#if (includes examples "ai")}}
|
|
78
|
+
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret(process.env.GOOGLE_GENERATIVE_AI_API_KEY),
|
|
79
|
+
{{/if}}
|
|
80
|
+
{{#if (eq payments "polar")}}
|
|
81
|
+
POLAR_ACCESS_TOKEN: alchemy.secret(process.env.POLAR_ACCESS_TOKEN),
|
|
82
|
+
POLAR_SUCCESS_URL: process.env.POLAR_SUCCESS_URL || "",
|
|
83
|
+
{{/if}}
|
|
84
|
+
{{#if (eq dbSetup "turso")}}
|
|
85
|
+
DATABASE_AUTH_TOKEN: alchemy.secret(process.env.DATABASE_AUTH_TOKEN),
|
|
86
|
+
{{/if}}
|
|
87
|
+
{{#if (eq database "mysql")}}
|
|
88
|
+
{{#if (eq orm "drizzle")}}
|
|
89
|
+
DATABASE_HOST: process.env.DATABASE_HOST || "",
|
|
90
|
+
DATABASE_USERNAME: process.env.DATABASE_USERNAME || "",
|
|
91
|
+
DATABASE_PASSWORD: process.env.DATABASE_PASSWORD || "",
|
|
92
|
+
{{/if}}
|
|
93
|
+
{{/if}}
|
|
94
|
+
{{/if}}
|
|
65
95
|
},
|
|
66
96
|
dev: {
|
|
67
97
|
command: "{{packageManager}} run dev"
|
|
@@ -104,6 +134,38 @@ export const web = await TanStackStart("web", {
|
|
|
104
134
|
{{else if (ne backend "self")}}
|
|
105
135
|
VITE_SERVER_URL: process.env.VITE_SERVER_URL || "",
|
|
106
136
|
{{/if}}
|
|
137
|
+
{{#if (eq backend "self")}}
|
|
138
|
+
{{#if (eq dbSetup "d1")}}
|
|
139
|
+
DB: db,
|
|
140
|
+
{{else if (and (ne database "none") (ne dbSetup "none"))}}
|
|
141
|
+
DATABASE_URL: alchemy.secret(process.env.DATABASE_URL),
|
|
142
|
+
{{/if}}
|
|
143
|
+
CORS_ORIGIN: process.env.CORS_ORIGIN || "",
|
|
144
|
+
{{#if (eq auth "better-auth")}}
|
|
145
|
+
BETTER_AUTH_SECRET: alchemy.secret(process.env.BETTER_AUTH_SECRET),
|
|
146
|
+
BETTER_AUTH_URL: process.env.BETTER_AUTH_URL || "",
|
|
147
|
+
{{/if}}
|
|
148
|
+
{{#if (eq auth "clerk")}}
|
|
149
|
+
CLERK_SECRET_KEY: alchemy.secret(process.env.CLERK_SECRET_KEY),
|
|
150
|
+
{{/if}}
|
|
151
|
+
{{#if (includes examples "ai")}}
|
|
152
|
+
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret(process.env.GOOGLE_GENERATIVE_AI_API_KEY),
|
|
153
|
+
{{/if}}
|
|
154
|
+
{{#if (eq payments "polar")}}
|
|
155
|
+
POLAR_ACCESS_TOKEN: alchemy.secret(process.env.POLAR_ACCESS_TOKEN),
|
|
156
|
+
POLAR_SUCCESS_URL: process.env.POLAR_SUCCESS_URL || "",
|
|
157
|
+
{{/if}}
|
|
158
|
+
{{#if (eq dbSetup "turso")}}
|
|
159
|
+
DATABASE_AUTH_TOKEN: alchemy.secret(process.env.DATABASE_AUTH_TOKEN),
|
|
160
|
+
{{/if}}
|
|
161
|
+
{{#if (eq database "mysql")}}
|
|
162
|
+
{{#if (eq orm "drizzle")}}
|
|
163
|
+
DATABASE_HOST: process.env.DATABASE_HOST || "",
|
|
164
|
+
DATABASE_USERNAME: process.env.DATABASE_USERNAME || "",
|
|
165
|
+
DATABASE_PASSWORD: process.env.DATABASE_PASSWORD || "",
|
|
166
|
+
{{/if}}
|
|
167
|
+
{{/if}}
|
|
168
|
+
{{/if}}
|
|
107
169
|
},
|
|
108
170
|
dev: {
|
|
109
171
|
command: "{{packageManager}} run dev"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useChat } from "@ai-sdk/react";
|
|
4
4
|
import { DefaultChatTransport } from "ai";
|
|
5
5
|
import { Send } from "lucide-react";
|
|
6
|
-
{{#if (
|
|
6
|
+
{{#if (eq webDeploy "alchemy")}}
|
|
7
7
|
import dynamic from "next/dynamic";
|
|
8
8
|
{{else}}
|
|
9
9
|
import { Response } from "@/components/response";
|
|
@@ -12,7 +12,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
12
12
|
import { Button } from "@/components/ui/button";
|
|
13
13
|
import { Input } from "@/components/ui/input";
|
|
14
14
|
|
|
15
|
-
{{#if (
|
|
15
|
+
{{#if (eq webDeploy "alchemy")}}
|
|
16
16
|
const Response = dynamic(
|
|
17
17
|
() =>
|
|
18
18
|
import("@/components/response").then((mod) => ({ default: mod.Response })),
|
|
@@ -3,7 +3,7 @@ import { Ionicons, MaterialIcons } from "@expo/vector-icons";
|
|
|
3
3
|
import { Link } from "expo-router";
|
|
4
4
|
import { Drawer } from "expo-router/drawer";
|
|
5
5
|
import { useThemeColor } from "heroui-native";
|
|
6
|
-
import { Pressable } from "react-native";
|
|
6
|
+
import { Pressable, Text } from "react-native";
|
|
7
7
|
import { ThemeToggle } from "@/components/theme-toggle";
|
|
8
8
|
|
|
9
9
|
function DrawerLayout() {
|
|
@@ -29,9 +29,11 @@ function DrawerLayout() {
|
|
|
29
29
|
name="index"
|
|
30
30
|
options=\{{
|
|
31
31
|
headerTitle: "Home",
|
|
32
|
-
drawerLabel:
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
drawerLabel: ({ color, focused }) => (
|
|
33
|
+
<Text style=\{{ color: focused ? color : themeColorForeground }}>Home</Text>
|
|
34
|
+
),
|
|
35
|
+
drawerIcon: ({ size, color, focused }) => (
|
|
36
|
+
<Ionicons name="home-outline" size={size} color={focused ? color : themeColorForeground} />
|
|
35
37
|
),
|
|
36
38
|
}}
|
|
37
39
|
/>
|
|
@@ -39,9 +41,11 @@ function DrawerLayout() {
|
|
|
39
41
|
name="(tabs)"
|
|
40
42
|
options=\{{
|
|
41
43
|
headerTitle: "Tabs",
|
|
42
|
-
drawerLabel:
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
drawerLabel: ({ color, focused }) => (
|
|
45
|
+
<Text style=\{{ color: focused ? color : themeColorForeground }}>Tabs</Text>
|
|
46
|
+
),
|
|
47
|
+
drawerIcon: ({ size, color, focused }) => (
|
|
48
|
+
<MaterialIcons name="border-bottom" size={size} color={focused ? color : themeColorForeground} />
|
|
45
49
|
),
|
|
46
50
|
headerRight: () => (
|
|
47
51
|
<Link href="/modal" asChild>
|
|
@@ -57,9 +61,11 @@ function DrawerLayout() {
|
|
|
57
61
|
name="todos"
|
|
58
62
|
options=\{{
|
|
59
63
|
headerTitle: "Todos",
|
|
60
|
-
drawerLabel:
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
drawerLabel: ({ color, focused }) => (
|
|
65
|
+
<Text style=\{{ color: focused ? color : themeColorForeground }}>Todos</Text>
|
|
66
|
+
),
|
|
67
|
+
drawerIcon: ({ size, color, focused }) => (
|
|
68
|
+
<Ionicons name="checkbox-outline" size={size} color={focused ? color : themeColorForeground} />
|
|
63
69
|
),
|
|
64
70
|
}}
|
|
65
71
|
/>
|
|
@@ -69,9 +75,11 @@ function DrawerLayout() {
|
|
|
69
75
|
name="ai"
|
|
70
76
|
options=\{{
|
|
71
77
|
headerTitle: "AI",
|
|
72
|
-
drawerLabel:
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
drawerLabel: ({ color, focused }) => (
|
|
79
|
+
<Text style=\{{ color: focused ? color : themeColorForeground }}>AI</Text>
|
|
80
|
+
),
|
|
81
|
+
drawerIcon: ({ size, color, focused }) => (
|
|
82
|
+
<Ionicons name="chatbubble-ellipses-outline" size={size} color={focused ? color : themeColorForeground} />
|
|
75
83
|
),
|
|
76
84
|
}}
|
|
77
85
|
/>
|