create-better-t-stack 2.50.0-canary.dd7000f2 → 2.50.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/cli.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{src-dv6H37db.js → src-B8TD9m4n.js} +228 -518
- package/package.json +1 -2
- package/templates/api/orpc/server/{src → base/src/lib}/context.ts.hbs +6 -6
- package/templates/api/orpc/server/next/src/app/rpc/[...all]/route.ts.hbs +52 -0
- 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 +1 -1
- 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/server/{src → base/src/lib}/context.ts.hbs +6 -6
- package/templates/api/trpc/server/next/src/app/trpc/[trpc]/route.ts +14 -0
- package/templates/api/trpc/web/react/base/src/utils/trpc.ts.hbs +2 -2
- package/templates/auth/better-auth/server/base/src/{index.ts.hbs → lib/auth.ts.hbs} +7 -7
- package/templates/auth/better-auth/server/next/src/app/api/auth/[...all]/route.ts +4 -0
- package/templates/backend/server/elysia/src/index.ts.hbs +6 -6
- package/templates/backend/server/express/src/index.ts.hbs +6 -6
- package/templates/backend/server/fastify/src/index.ts.hbs +6 -6
- package/templates/backend/server/hono/src/index.ts.hbs +7 -7
- package/templates/backend/server/next/next-env.d.ts +5 -0
- package/templates/backend/server/next/next.config.ts +7 -0
- package/templates/backend/server/next/package.json.hbs +27 -0
- package/templates/backend/server/next/src/app/route.ts +5 -0
- package/templates/backend/server/next/src/middleware.ts +19 -0
- package/templates/backend/server/next/tsconfig.json.hbs +33 -0
- package/templates/backend/server/{base → server-base}/package.json.hbs +1 -0
- package/templates/{api/trpc/server → backend/server/server-base}/src/routers/index.ts.hbs +2 -2
- package/templates/backend/server/{base → server-base}/tsconfig.json.hbs +10 -5
- package/templates/base/_gitignore +1 -47
- package/templates/base/package.json.hbs +3 -1
- package/templates/db/drizzle/mysql/drizzle.config.ts.hbs +2 -7
- package/templates/db/drizzle/mysql/src/{index.ts.hbs → db/index.ts.hbs} +1 -1
- package/templates/db/drizzle/postgres/drizzle.config.ts.hbs +2 -7
- package/templates/db/drizzle/postgres/src/{index.ts.hbs → db/index.ts.hbs} +1 -1
- package/templates/db/drizzle/sqlite/drizzle.config.ts.hbs +2 -7
- package/templates/db/drizzle/sqlite/src/{index.ts.hbs → db/index.ts.hbs} +1 -1
- package/templates/db/prisma/mongodb/prisma.config.ts.hbs +1 -5
- package/templates/db/prisma/mongodb/src/db/index.ts.hbs +5 -0
- package/templates/db/prisma/mysql/prisma.config.ts.hbs +1 -5
- package/templates/db/prisma/mysql/src/{index.ts.hbs → db/index.ts.hbs} +1 -1
- package/templates/db/prisma/postgres/prisma.config.ts.hbs +3 -7
- package/templates/db/prisma/postgres/src/{index.ts.hbs → db/index.ts.hbs} +1 -1
- package/templates/db/prisma/sqlite/prisma.config.ts.hbs +1 -5
- package/templates/db/prisma/sqlite/src/{index.ts.hbs → db/index.ts.hbs} +3 -3
- package/templates/examples/ai/server/next/src/app/ai/route.ts.hbs +15 -0
- package/templates/examples/todo/server/drizzle/base/src/routers/todo.ts.hbs +6 -6
- package/templates/examples/todo/server/mongoose/base/src/routers/todo.ts.hbs +4 -4
- package/templates/examples/todo/server/prisma/base/src/routers/todo.ts.hbs +4 -4
- package/templates/frontend/react/tanstack-router/src/routes/__root.tsx.hbs +1 -1
- package/templates/frontend/react/tanstack-start/src/routes/__root.tsx.hbs +1 -1
- package/templates/api/orpc/server/_gitignore +0 -34
- package/templates/api/orpc/server/package.json.hbs +0 -24
- package/templates/api/orpc/server/src/routers/index.ts.hbs +0 -55
- package/templates/api/orpc/server/tsconfig.json.hbs +0 -10
- package/templates/api/orpc/server/tsdown.config.ts.hbs +0 -7
- package/templates/api/trpc/server/_gitignore +0 -34
- package/templates/api/trpc/server/package.json.hbs +0 -23
- package/templates/api/trpc/server/tsconfig.json.hbs +0 -13
- package/templates/api/trpc/server/tsdown.config.ts.hbs +0 -7
- package/templates/auth/better-auth/server/base/_gitignore +0 -34
- package/templates/auth/better-auth/server/base/package.json.hbs +0 -24
- package/templates/auth/better-auth/server/base/tsconfig.json.hbs +0 -13
- package/templates/auth/better-auth/server/base/tsdown.config.ts.hbs +0 -7
- package/templates/backend/server/base/tsdown.config.ts.hbs +0 -14
- package/templates/base/tsconfig.base.json +0 -23
- package/templates/db/base/_gitignore +0 -34
- package/templates/db/base/package.json.hbs +0 -23
- package/templates/db/base/tsconfig.json.hbs +0 -13
- package/templates/db/base/tsdown.config.ts.hbs +0 -7
- package/templates/db/prisma/mongodb/src/index.ts.hbs +0 -5
- /package/templates/api/orpc/server/{src/index.ts.hbs → base/src/lib/orpc.ts.hbs} +0 -0
- /package/templates/api/trpc/server/{src/index.ts.hbs → base/src/lib/trpc.ts.hbs} +0 -0
- /package/templates/auth/better-auth/server/db/drizzle/mysql/src/{schema/auth.ts.hbs → db/schema/auth.ts} +0 -0
- /package/templates/auth/better-auth/server/db/drizzle/postgres/src/{schema/auth.ts.hbs → db/schema/auth.ts} +0 -0
- /package/templates/auth/better-auth/server/db/drizzle/sqlite/src/{schema/auth.ts.hbs → db/schema/auth.ts} +0 -0
- /package/templates/auth/better-auth/server/db/mongoose/mongodb/src/{models/auth.model.ts.hbs → db/models/auth.model.ts} +0 -0
- /package/templates/auth/better-auth/server/db/prisma/mongodb/prisma/schema/{auth.prisma.hbs → auth.prisma} +0 -0
- /package/templates/auth/better-auth/server/db/prisma/mysql/prisma/schema/{auth.prisma.hbs → auth.prisma} +0 -0
- /package/templates/auth/better-auth/server/db/prisma/postgres/prisma/schema/{auth.prisma.hbs → auth.prisma} +0 -0
- /package/templates/auth/better-auth/server/db/prisma/sqlite/prisma/schema/{auth.prisma.hbs → auth.prisma} +0 -0
- /package/templates/auth/better-auth/web/nuxt/app/middleware/{auth.ts.hbs → auth.ts} +0 -0
- /package/templates/backend/server/{base → server-base}/_gitignore +0 -0
- /package/templates/db/mongoose/mongodb/src/{index.ts.hbs → db/index.ts.hbs} +0 -0
- /package/templates/examples/todo/server/drizzle/mysql/src/{schema → db/schema}/todo.ts +0 -0
- /package/templates/examples/todo/server/drizzle/postgres/src/{schema → db/schema}/todo.ts +0 -0
- /package/templates/examples/todo/server/drizzle/sqlite/src/{schema → db/schema}/todo.ts +0 -0
- /package/templates/examples/todo/server/mongoose/mongodb/src/{models/todo.model.ts.hbs → db/models/todo.model.ts} +0 -0
- /package/templates/examples/todo/server/prisma/mongodb/prisma/schema/{todo.prisma.hbs → todo.prisma} +0 -0
- /package/templates/examples/todo/server/prisma/mysql/prisma/schema/{todo.prisma.hbs → todo.prisma} +0 -0
- /package/templates/examples/todo/server/prisma/postgres/prisma/schema/{todo.prisma.hbs → todo.prisma} +0 -0
- /package/templates/examples/todo/server/prisma/sqlite/prisma/schema/{todo.prisma.hbs → todo.prisma} +0 -0
|
@@ -1,50 +1,4 @@
|
|
|
1
|
-
# Dependencies
|
|
2
1
|
node_modules
|
|
3
|
-
.pnp
|
|
4
|
-
.pnp.js
|
|
5
|
-
|
|
6
|
-
# Build outputs
|
|
7
|
-
dist
|
|
8
|
-
build
|
|
9
|
-
*.tsbuildinfo
|
|
10
|
-
|
|
11
|
-
# Environment variables
|
|
12
|
-
.env
|
|
13
|
-
.env*.local
|
|
14
|
-
|
|
15
|
-
# IDEs and editors
|
|
16
|
-
.vscode/*
|
|
17
|
-
!.vscode/settings.json
|
|
18
|
-
!.vscode/tasks.json
|
|
19
|
-
!.vscode/launch.json
|
|
20
|
-
!.vscode/extensions.json
|
|
21
|
-
.idea
|
|
22
|
-
*.swp
|
|
23
|
-
*.swo
|
|
24
|
-
*~
|
|
25
|
-
.DS_Store
|
|
26
|
-
|
|
27
|
-
# Logs
|
|
28
|
-
logs
|
|
29
|
-
*.log
|
|
30
|
-
npm-debug.log*
|
|
31
|
-
yarn-debug.log*
|
|
32
|
-
yarn-error.log*
|
|
33
|
-
lerna-debug.log*
|
|
34
|
-
.pnpm-debug.log*
|
|
35
|
-
|
|
36
|
-
# Turbo
|
|
37
2
|
.turbo
|
|
38
|
-
|
|
39
|
-
# Better-T-Stack
|
|
40
3
|
.alchemy
|
|
41
|
-
|
|
42
|
-
# Testing
|
|
43
|
-
coverage
|
|
44
|
-
.nyc_output
|
|
45
|
-
|
|
46
|
-
# Misc
|
|
47
|
-
*.tgz
|
|
48
|
-
.cache
|
|
49
|
-
tmp
|
|
50
|
-
temp
|
|
4
|
+
.env
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from "drizzle-kit";
|
|
2
|
-
import dotenv from "dotenv";
|
|
3
|
-
|
|
4
|
-
dotenv.config({
|
|
5
|
-
path: "../../apps/server/.env",
|
|
6
|
-
});
|
|
7
2
|
|
|
8
3
|
export default defineConfig({
|
|
9
|
-
schema: "./src/schema",
|
|
10
|
-
out: "./src/migrations",
|
|
4
|
+
schema: "./src/db/schema",
|
|
5
|
+
out: "./src/db/migrations",
|
|
11
6
|
dialect: "mysql",
|
|
12
7
|
dbCredentials: {
|
|
13
8
|
url: process.env.DATABASE_URL || "",
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from "drizzle-kit";
|
|
2
|
-
import dotenv from "dotenv";
|
|
3
|
-
|
|
4
|
-
dotenv.config({
|
|
5
|
-
path: "../../apps/server/.env",
|
|
6
|
-
});
|
|
7
2
|
|
|
8
3
|
export default defineConfig({
|
|
9
|
-
schema: "./src/schema",
|
|
10
|
-
out: "./src/migrations",
|
|
4
|
+
schema: "./src/db/schema",
|
|
5
|
+
out: "./src/db/migrations",
|
|
11
6
|
dialect: "postgresql",
|
|
12
7
|
dbCredentials: {
|
|
13
8
|
url: process.env.DATABASE_URL || "",
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from "drizzle-kit";
|
|
2
|
-
import dotenv from "dotenv";
|
|
3
|
-
|
|
4
|
-
dotenv.config({
|
|
5
|
-
path: "../../apps/server/.env",
|
|
6
|
-
});
|
|
7
2
|
|
|
8
3
|
export default defineConfig({
|
|
9
|
-
schema: "./src/schema",
|
|
10
|
-
out: "./src/migrations",
|
|
4
|
+
schema: "./src/db/schema",
|
|
5
|
+
out: "./src/db/migrations",
|
|
11
6
|
{{#if (eq dbSetup "d1")}}
|
|
12
7
|
// DOCS: https://orm.drizzle.team/docs/guides/d1-http-with-drizzle-kit
|
|
13
8
|
dialect: "sqlite",
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import type { PrismaConfig } from "prisma";
|
|
3
1
|
{{#unless (eq dbSetup "prisma-postgres")}}
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
dotenv.config({
|
|
7
|
-
path: "../../apps/server/.env",
|
|
8
|
-
});
|
|
2
|
+
import "dotenv/config";
|
|
9
3
|
{{/unless}}
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import type { PrismaConfig } from "prisma";
|
|
10
6
|
|
|
11
7
|
export default {
|
|
12
8
|
schema: path.join("prisma", "schema"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{{#if (eq dbSetup "d1")}}
|
|
2
2
|
import { env } from "cloudflare:workers";
|
|
3
3
|
import { PrismaD1 } from "@prisma/adapter-d1";
|
|
4
|
-
import { PrismaClient } from "
|
|
4
|
+
import { PrismaClient } from "../../prisma/generated/client";
|
|
5
5
|
|
|
6
6
|
const adapter = new PrismaD1(env.DB);
|
|
7
7
|
const prisma = new PrismaClient({ adapter });
|
|
@@ -9,7 +9,7 @@ const prisma = new PrismaClient({ adapter });
|
|
|
9
9
|
export default prisma;
|
|
10
10
|
{{else if (eq dbSetup "turso")}}
|
|
11
11
|
import { PrismaLibSQL } from "@prisma/adapter-libsql";
|
|
12
|
-
import { PrismaClient } from "
|
|
12
|
+
import { PrismaClient } from "../../prisma/generated/client";
|
|
13
13
|
|
|
14
14
|
const adapter = new PrismaLibSQL({
|
|
15
15
|
url: process.env.DATABASE_URL || "",
|
|
@@ -20,7 +20,7 @@ const prisma = new PrismaClient({ adapter });
|
|
|
20
20
|
|
|
21
21
|
export default prisma;
|
|
22
22
|
{{else}}
|
|
23
|
-
import { PrismaClient } from "
|
|
23
|
+
import { PrismaClient } from "../../prisma/generated/client";
|
|
24
24
|
|
|
25
25
|
const prisma = new PrismaClient();
|
|
26
26
|
|
|
@@ -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.0-flash'),
|
|
11
|
+
messages: convertToModelMessages(messages),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return result.toUIMessageStreamResponse();
|
|
15
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{{#if (eq api "orpc")}}
|
|
2
|
-
import { eq } from "
|
|
2
|
+
import { eq } from "drizzle-orm";
|
|
3
3
|
import z from "zod";
|
|
4
|
-
import { db } from "
|
|
5
|
-
import { todo } from "
|
|
6
|
-
import { publicProcedure } from "../
|
|
4
|
+
import { db } from "../db";
|
|
5
|
+
import { todo } from "../db/schema/todo";
|
|
6
|
+
import { publicProcedure } from "../lib/orpc";
|
|
7
7
|
|
|
8
8
|
export const todoRouter = {
|
|
9
9
|
getAll: publicProcedure.handler(async () => {
|
|
@@ -39,10 +39,10 @@ export const todoRouter = {
|
|
|
39
39
|
|
|
40
40
|
{{#if (eq api "trpc")}}
|
|
41
41
|
import z from "zod";
|
|
42
|
-
import { router, publicProcedure } from "../
|
|
42
|
+
import { router, publicProcedure } from "../lib/trpc";
|
|
43
43
|
import { todo } from "../db/schema/todo";
|
|
44
44
|
import { eq } from "drizzle-orm";
|
|
45
|
-
import { db } from "
|
|
45
|
+
import { db } from "../db";
|
|
46
46
|
|
|
47
47
|
export const todoRouter = router({
|
|
48
48
|
getAll: publicProcedure.query(async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{{#if (eq api "orpc")}}
|
|
2
2
|
import z from "zod";
|
|
3
|
-
import { publicProcedure } from "../
|
|
4
|
-
import { Todo } from "
|
|
3
|
+
import { publicProcedure } from "../lib/orpc";
|
|
4
|
+
import { Todo } from "../db/models/todo.model";
|
|
5
5
|
|
|
6
6
|
export const todoRouter = {
|
|
7
7
|
getAll: publicProcedure.handler(async () => {
|
|
@@ -34,8 +34,8 @@ export const todoRouter = {
|
|
|
34
34
|
|
|
35
35
|
{{#if (eq api "trpc")}}
|
|
36
36
|
import z from "zod";
|
|
37
|
-
import { router, publicProcedure } from "../
|
|
38
|
-
import { Todo } from "
|
|
37
|
+
import { router, publicProcedure } from "../lib/trpc";
|
|
38
|
+
import { Todo } from "../db/models/todo.model";
|
|
39
39
|
|
|
40
40
|
export const todoRouter = router({
|
|
41
41
|
getAll: publicProcedure.query(async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{{#if (eq api "orpc")}}
|
|
2
2
|
import z from "zod";
|
|
3
|
-
import prisma from "
|
|
4
|
-
import { publicProcedure } from "../
|
|
3
|
+
import prisma from "../db";
|
|
4
|
+
import { publicProcedure } from "../lib/orpc";
|
|
5
5
|
|
|
6
6
|
export const todoRouter = {
|
|
7
7
|
getAll: publicProcedure.handler(async () => {
|
|
@@ -52,8 +52,8 @@ export const todoRouter = {
|
|
|
52
52
|
{{#if (eq api "trpc")}}
|
|
53
53
|
import { TRPCError } from "@trpc/server";
|
|
54
54
|
import z from "zod";
|
|
55
|
-
import prisma from "
|
|
56
|
-
import { publicProcedure, router } from "../
|
|
55
|
+
import prisma from "../db";
|
|
56
|
+
import { publicProcedure, router } from "../lib/trpc";
|
|
57
57
|
|
|
58
58
|
export const todoRouter = router({
|
|
59
59
|
getAll: publicProcedure.query(async () => {
|
|
@@ -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 "
|
|
11
|
+
import type { AppRouterClient } from "../../../server/src/routers";
|
|
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 "
|
|
69
|
+
import type { AppRouter } from "../../../server/src/routers";
|
|
70
70
|
export interface RouterAppContext {
|
|
71
71
|
trpc: TRPCOptionsProxy<AppRouter>;
|
|
72
72
|
queryClient: QueryClient;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# dependencies (bun install)
|
|
2
|
-
node_modules
|
|
3
|
-
|
|
4
|
-
# output
|
|
5
|
-
out
|
|
6
|
-
dist
|
|
7
|
-
*.tgz
|
|
8
|
-
|
|
9
|
-
# code coverage
|
|
10
|
-
coverage
|
|
11
|
-
*.lcov
|
|
12
|
-
|
|
13
|
-
# logs
|
|
14
|
-
logs
|
|
15
|
-
_.log
|
|
16
|
-
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|
17
|
-
|
|
18
|
-
# dotenv environment variable files
|
|
19
|
-
.env
|
|
20
|
-
.env.development.local
|
|
21
|
-
.env.test.local
|
|
22
|
-
.env.production.local
|
|
23
|
-
.env.local
|
|
24
|
-
|
|
25
|
-
# caches
|
|
26
|
-
.eslintcache
|
|
27
|
-
.cache
|
|
28
|
-
*.tsbuildinfo
|
|
29
|
-
|
|
30
|
-
# IntelliJ based IDEs
|
|
31
|
-
.idea
|
|
32
|
-
|
|
33
|
-
# Finder (MacOS) folder config
|
|
34
|
-
.DS_Store
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@{{projectName}}/api",
|
|
3
|
-
"exports": {
|
|
4
|
-
".": {
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
6
|
-
"default": "./src/index.ts"
|
|
7
|
-
},
|
|
8
|
-
"./*": {
|
|
9
|
-
"types": "./dist/*.d.ts",
|
|
10
|
-
"default": "./src/*.ts"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsdown"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@types/bun": "latest"
|
|
19
|
-
},
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"typescript": "^5"
|
|
22
|
-
},
|
|
23
|
-
"dependencies": {}
|
|
24
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{{#if (eq api "orpc")}}
|
|
2
|
-
import { {{#if (eq auth "better-auth")}}protectedProcedure, {{/if}}publicProcedure } from "../index";
|
|
3
|
-
import type { RouterClient } from "@orpc/server";
|
|
4
|
-
{{#if (includes examples "todo")}}
|
|
5
|
-
import { todoRouter } from "./todo";
|
|
6
|
-
{{/if}}
|
|
7
|
-
|
|
8
|
-
export const appRouter = {
|
|
9
|
-
healthCheck: publicProcedure.handler(() => {
|
|
10
|
-
return "OK";
|
|
11
|
-
}),
|
|
12
|
-
{{#if (eq auth "better-auth")}}
|
|
13
|
-
privateData: protectedProcedure.handler(({ context }) => {
|
|
14
|
-
return {
|
|
15
|
-
message: "This is private",
|
|
16
|
-
user: context.session?.user,
|
|
17
|
-
};
|
|
18
|
-
}),
|
|
19
|
-
{{/if}}
|
|
20
|
-
{{#if (includes examples "todo")}}
|
|
21
|
-
todo: todoRouter,
|
|
22
|
-
{{/if}}
|
|
23
|
-
};
|
|
24
|
-
export type AppRouter = typeof appRouter;
|
|
25
|
-
export type AppRouterClient = RouterClient<typeof appRouter>;
|
|
26
|
-
{{else if (eq api "trpc")}}
|
|
27
|
-
import {
|
|
28
|
-
{{#if (eq auth "better-auth")}}protectedProcedure, {{/if}}publicProcedure,
|
|
29
|
-
router,
|
|
30
|
-
} from "../index";
|
|
31
|
-
{{#if (includes examples "todo")}}
|
|
32
|
-
import { todoRouter } from "./todo";
|
|
33
|
-
{{/if}}
|
|
34
|
-
|
|
35
|
-
export const appRouter = router({
|
|
36
|
-
healthCheck: publicProcedure.query(() => {
|
|
37
|
-
return "OK";
|
|
38
|
-
}),
|
|
39
|
-
{{#if (eq auth "better-auth")}}
|
|
40
|
-
privateData: protectedProcedure.query(({ ctx }) => {
|
|
41
|
-
return {
|
|
42
|
-
message: "This is private",
|
|
43
|
-
user: ctx.session.user,
|
|
44
|
-
};
|
|
45
|
-
}),
|
|
46
|
-
{{/if}}
|
|
47
|
-
{{#if (includes examples "todo")}}
|
|
48
|
-
todo: todoRouter,
|
|
49
|
-
{{/if}}
|
|
50
|
-
});
|
|
51
|
-
export type AppRouter = typeof appRouter;
|
|
52
|
-
{{else}}
|
|
53
|
-
export const appRouter = {};
|
|
54
|
-
export type AppRouter = typeof appRouter;
|
|
55
|
-
{{/if}}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# dependencies (bun install)
|
|
2
|
-
node_modules
|
|
3
|
-
|
|
4
|
-
# output
|
|
5
|
-
out
|
|
6
|
-
dist
|
|
7
|
-
*.tgz
|
|
8
|
-
|
|
9
|
-
# code coverage
|
|
10
|
-
coverage
|
|
11
|
-
*.lcov
|
|
12
|
-
|
|
13
|
-
# logs
|
|
14
|
-
logs
|
|
15
|
-
_.log
|
|
16
|
-
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|
17
|
-
|
|
18
|
-
# dotenv environment variable files
|
|
19
|
-
.env
|
|
20
|
-
.env.development.local
|
|
21
|
-
.env.test.local
|
|
22
|
-
.env.production.local
|
|
23
|
-
.env.local
|
|
24
|
-
|
|
25
|
-
# caches
|
|
26
|
-
.eslintcache
|
|
27
|
-
.cache
|
|
28
|
-
*.tsbuildinfo
|
|
29
|
-
|
|
30
|
-
# IntelliJ based IDEs
|
|
31
|
-
.idea
|
|
32
|
-
|
|
33
|
-
# Finder (MacOS) folder config
|
|
34
|
-
.DS_Store
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@{{projectName}}/api",
|
|
3
|
-
"exports": {
|
|
4
|
-
".": {
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
6
|
-
"default": "./src/index.ts"
|
|
7
|
-
},
|
|
8
|
-
"./*": {
|
|
9
|
-
"types": "./dist/*.d.ts",
|
|
10
|
-
"default": "./src/*.ts"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsdown"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@types/bun": "latest"
|
|
19
|
-
},
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"typescript": "^5"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# dependencies (bun install)
|
|
2
|
-
node_modules
|
|
3
|
-
|
|
4
|
-
# output
|
|
5
|
-
out
|
|
6
|
-
dist
|
|
7
|
-
*.tgz
|
|
8
|
-
|
|
9
|
-
# code coverage
|
|
10
|
-
coverage
|
|
11
|
-
*.lcov
|
|
12
|
-
|
|
13
|
-
# logs
|
|
14
|
-
logs
|
|
15
|
-
_.log
|
|
16
|
-
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|
17
|
-
|
|
18
|
-
# dotenv environment variable files
|
|
19
|
-
.env
|
|
20
|
-
.env.development.local
|
|
21
|
-
.env.test.local
|
|
22
|
-
.env.production.local
|
|
23
|
-
.env.local
|
|
24
|
-
|
|
25
|
-
# caches
|
|
26
|
-
.eslintcache
|
|
27
|
-
.cache
|
|
28
|
-
*.tsbuildinfo
|
|
29
|
-
|
|
30
|
-
# IntelliJ based IDEs
|
|
31
|
-
.idea
|
|
32
|
-
|
|
33
|
-
# Finder (MacOS) folder config
|
|
34
|
-
.DS_Store
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@{{projectName}}/auth",
|
|
3
|
-
"exports": {
|
|
4
|
-
".": {
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
6
|
-
"default": "./src/index.ts"
|
|
7
|
-
},
|
|
8
|
-
"./*": {
|
|
9
|
-
"types": "./dist/*.d.ts",
|
|
10
|
-
"default": "./src/*.ts"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsdown"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@types/bun": "latest",
|
|
19
|
-
"@types/node": "^24.5.2"
|
|
20
|
-
},
|
|
21
|
-
"peerDependencies": {
|
|
22
|
-
"typescript": "^5"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsdown';
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: './src/index.ts',
|
|
5
|
-
format: 'esm',
|
|
6
|
-
outDir: './dist',
|
|
7
|
-
clean: true,
|
|
8
|
-
noExternal: [/@{{projectName}}\/.*/],
|
|
9
|
-
{{#if (and (eq orm "drizzle") (eq database "sqlite") (or (eq dbSetup "turso") (eq dbSetup "none")))}}
|
|
10
|
-
external: [
|
|
11
|
-
/^@libsql\/(linux|darwin|win32).*/
|
|
12
|
-
]
|
|
13
|
-
{{/if}}
|
|
14
|
-
});
|