create-better-t-stack 2.50.0-canary.dd7000f2 → 2.50.1-canary.58bbe5f6
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.js +1 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.js +1 -1
- package/dist/{src-dv6H37db.js → src-CulfT5QB.js} +461 -358
- package/package.json +1 -1
- package/templates/addons/ruler/.ruler/bts.md.hbs +24 -14
- package/templates/api/orpc/fullstack/next/src/app/api/rpc/[[...rest]]/route.ts.hbs +50 -0
- package/templates/api/orpc/server/package.json.hbs +1 -3
- package/templates/api/orpc/server/tsconfig.json.hbs +8 -8
- package/templates/api/orpc/web/nuxt/app/plugins/orpc.ts.hbs +1 -1
- package/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs +4 -2
- package/templates/api/orpc/web/solid/src/utils/orpc.ts.hbs +1 -1
- package/templates/api/orpc/web/svelte/src/lib/orpc.ts.hbs +1 -1
- package/templates/api/trpc/fullstack/next/src/app/api/trpc/[trpc]/route.ts.hbs +14 -0
- package/templates/api/trpc/server/package.json.hbs +1 -3
- package/templates/api/trpc/server/tsconfig.json.hbs +8 -11
- package/templates/api/trpc/web/react/base/src/utils/trpc.ts.hbs +6 -4
- package/templates/auth/better-auth/fullstack/next/src/app/api/auth/[...all]/route.ts.hbs +4 -0
- package/templates/auth/better-auth/server/base/package.json.hbs +1 -4
- package/templates/auth/better-auth/server/base/src/index.ts.hbs +5 -5
- package/templates/auth/better-auth/server/base/tsconfig.json.hbs +8 -11
- package/templates/auth/better-auth/web/react/base/src/lib/auth-client.ts.hbs +2 -0
- package/templates/auth/better-auth/web/react/next/src/app/dashboard/page.tsx.hbs +31 -0
- package/templates/backend/server/base/package.json.hbs +1 -4
- package/templates/backend/server/base/tsconfig.json.hbs +1 -15
- package/templates/backend/server/base/tsdown.config.ts.hbs +1 -6
- package/templates/base/tsconfig.base.json.hbs +34 -0
- package/templates/base/tsconfig.json.hbs +3 -0
- package/templates/db/base/package.json.hbs +1 -3
- package/templates/db/base/tsconfig.json.hbs +8 -11
- package/templates/db/drizzle/mysql/drizzle.config.ts.hbs +5 -1
- package/templates/db/drizzle/postgres/drizzle.config.ts.hbs +5 -1
- package/templates/db/drizzle/sqlite/drizzle.config.ts.hbs +5 -1
- package/templates/db/prisma/mongodb/prisma.config.ts.hbs +5 -1
- package/templates/db/prisma/mysql/prisma.config.ts.hbs +5 -1
- package/templates/db/prisma/postgres/prisma.config.ts.hbs +5 -1
- package/templates/db/prisma/sqlite/prisma.config.ts.hbs +5 -1
- package/templates/deploy/alchemy/alchemy.run.ts.hbs +3 -3
- package/templates/examples/ai/fullstack/next/src/app/api/ai/route.ts.hbs +15 -0
- package/templates/examples/todo/server/drizzle/base/src/routers/todo.ts.hbs +2 -2
- package/templates/frontend/native/nativewind/tsconfig.json.hbs +1 -6
- package/templates/frontend/native/unistyles/tsconfig.json.hbs +1 -6
- package/templates/frontend/nuxt/tsconfig.json.hbs +0 -4
- package/templates/frontend/react/next/package.json.hbs +1 -1
- package/templates/frontend/react/next/tsconfig.json.hbs +0 -7
- package/templates/frontend/react/react-router/tsconfig.json.hbs +1 -6
- package/templates/frontend/react/tanstack-router/src/routes/__root.tsx.hbs +1 -1
- package/templates/frontend/react/tanstack-router/tsconfig.json.hbs +1 -6
- package/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs +1 -1
- package/templates/frontend/react/tanstack-start/tsconfig.json.hbs +1 -6
- package/templates/frontend/solid/tsconfig.json.hbs +1 -6
- package/templates/frontend/svelte/tsconfig.json.hbs +1 -6
- package/templates/base/tsconfig.base.json +0 -23
|
@@ -3,7 +3,11 @@ import type { PrismaConfig } from "prisma";
|
|
|
3
3
|
import dotenv from "dotenv";
|
|
4
4
|
|
|
5
5
|
dotenv.config({
|
|
6
|
-
|
|
6
|
+
{{#if (eq backend "self")}}
|
|
7
|
+
path: "../../apps/web/.env",
|
|
8
|
+
{{else}}
|
|
9
|
+
path: "../../apps/server/.env",
|
|
10
|
+
{{/if}}
|
|
7
11
|
});
|
|
8
12
|
|
|
9
13
|
export default {
|
|
@@ -4,7 +4,11 @@ import type { PrismaConfig } from "prisma";
|
|
|
4
4
|
import dotenv from "dotenv";
|
|
5
5
|
|
|
6
6
|
dotenv.config({
|
|
7
|
-
|
|
7
|
+
{{#if (eq backend "self")}}
|
|
8
|
+
path: "../../apps/web/.env",
|
|
9
|
+
{{else}}
|
|
10
|
+
path: "../../apps/server/.env",
|
|
11
|
+
{{/if}}
|
|
8
12
|
});
|
|
9
13
|
{{/unless}}
|
|
10
14
|
|
|
@@ -3,7 +3,11 @@ import type { PrismaConfig } from "prisma";
|
|
|
3
3
|
import dotenv from "dotenv";
|
|
4
4
|
|
|
5
5
|
dotenv.config({
|
|
6
|
-
|
|
6
|
+
{{#if (eq backend "self")}}
|
|
7
|
+
path: "../../apps/web/.env",
|
|
8
|
+
{{else}}
|
|
9
|
+
path: "../../apps/server/.env",
|
|
10
|
+
{{/if}}
|
|
7
11
|
});
|
|
8
12
|
|
|
9
13
|
export default {
|
|
@@ -39,15 +39,15 @@ const app = await alchemy("{{projectName}}");
|
|
|
39
39
|
|
|
40
40
|
{{#if (and (eq serverDeploy "alchemy") (eq dbSetup "d1"))}}
|
|
41
41
|
await Exec("db-generate", {
|
|
42
|
-
{{#if (and (eq webDeploy "alchemy") (eq serverDeploy "alchemy"))}}cwd: "
|
|
42
|
+
{{#if (and (eq webDeploy "alchemy") (eq serverDeploy "alchemy"))}}cwd: "packages/db",{{/if}}
|
|
43
43
|
command: "{{packageManager}} run db:generate",
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const db = await D1Database("database", {
|
|
47
47
|
{{#if (eq orm "prisma")}}
|
|
48
|
-
migrationsDir: "
|
|
48
|
+
migrationsDir: "packages/db/prisma/migrations",
|
|
49
49
|
{{else if (eq orm "drizzle")}}
|
|
50
|
-
migrationsDir: "
|
|
50
|
+
migrationsDir: "packages/db/src/migrations",
|
|
51
51
|
{{/if}}
|
|
52
52
|
});
|
|
53
53
|
{{/if}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { google } from "@ai-sdk/google";
|
|
2
|
+
import { streamText, type UIMessage, convertToModelMessages } from "ai";
|
|
3
|
+
|
|
4
|
+
export const maxDuration = 30;
|
|
5
|
+
|
|
6
|
+
export async function POST(req: Request) {
|
|
7
|
+
const { messages }: { messages: UIMessage[] } = await req.json();
|
|
8
|
+
|
|
9
|
+
const result = streamText({
|
|
10
|
+
model: google("gemini-2.5-flash"),
|
|
11
|
+
messages: convertToModelMessages(messages),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return result.toUIMessageStreamResponse();
|
|
15
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{{#if (eq api "orpc")}}
|
|
2
|
-
import { eq } from "
|
|
2
|
+
import { eq } from "drizzle-orm";
|
|
3
3
|
import z from "zod";
|
|
4
4
|
import { db } from "@{{projectName}}/db";
|
|
5
5
|
import { todo } from "@{{projectName}}/db/schema/todo";
|
|
@@ -40,7 +40,7 @@ export const todoRouter = {
|
|
|
40
40
|
{{#if (eq api "trpc")}}
|
|
41
41
|
import z from "zod";
|
|
42
42
|
import { router, publicProcedure } from "../index";
|
|
43
|
-
import { todo } from "
|
|
43
|
+
import { todo } from "@{{projectName}}/db/schema/todo";
|
|
44
44
|
import { eq } from "drizzle-orm";
|
|
45
45
|
import { db } from "@{{projectName}}/db";
|
|
46
46
|
|
|
@@ -8,10 +8,5 @@
|
|
|
8
8
|
"@/*": ["*"]
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"]
|
|
12
|
-
{{#unless (or (eq backend "convex") (eq backend "none"))}}
|
|
13
|
-
"references": [{
|
|
14
|
-
"path": "../server"
|
|
15
|
-
}]
|
|
16
|
-
{{/unless}}
|
|
11
|
+
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"]
|
|
17
12
|
}
|
|
@@ -8,7 +8,7 @@ import type { QueryClient } from "@tanstack/react-query";
|
|
|
8
8
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
9
9
|
import { useState } from "react";
|
|
10
10
|
import { createTanstackQueryUtils } from "@orpc/tanstack-query";
|
|
11
|
-
import type { AppRouterClient } from "@{{projectName}}/api/
|
|
11
|
+
import type { AppRouterClient } from "@{{projectName}}/api/routers/index";
|
|
12
12
|
import { createORPCClient } from "@orpc/client";
|
|
13
13
|
{{/if}}
|
|
14
14
|
{{#if (eq api "trpc")}}
|
|
@@ -66,7 +66,7 @@ export interface RouterAppContext {
|
|
|
66
66
|
{{else}}
|
|
67
67
|
{{#if (eq api "trpc")}}
|
|
68
68
|
import type { TRPCOptionsProxy } from "@trpc/tanstack-react-query";
|
|
69
|
-
import type { AppRouter } from "@{{projectName}}/api/
|
|
69
|
+
import type { AppRouter } from "@{{projectName}}/api/routers/index";
|
|
70
70
|
export interface RouterAppContext {
|
|
71
71
|
trpc: TRPCOptionsProxy<AppRouter>;
|
|
72
72
|
queryClient: QueryClient;
|
|
@@ -10,12 +10,7 @@
|
|
|
10
10
|
"sourceMap": true,
|
|
11
11
|
"strict": true,
|
|
12
12
|
"moduleResolution": "bundler"
|
|
13
|
-
}
|
|
14
|
-
{{#unless (or (eq backend "convex") (eq backend "none"))}}
|
|
15
|
-
"references": [{
|
|
16
|
-
"path": "../server"
|
|
17
|
-
}]
|
|
18
|
-
{{/unless}}
|
|
13
|
+
}
|
|
19
14
|
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
|
20
15
|
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
|
21
16
|
//
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"lib": [
|
|
8
|
-
"ESNext"
|
|
9
|
-
],
|
|
10
|
-
"verbatimModuleSyntax": true,
|
|
11
|
-
"strict": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"allowSyntheticDefaultImports": true,
|
|
15
|
-
"esModuleInterop": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"isolatedModules": true,
|
|
18
|
-
"noUncheckedIndexedAccess": true,
|
|
19
|
-
"noUnusedLocals": true,
|
|
20
|
-
"noUnusedParameters": true,
|
|
21
|
-
"noFallthroughCasesInSwitch": true
|
|
22
|
-
}
|
|
23
|
-
}
|