create-better-t-stack 3.2.7 → 3.2.9

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as createBtsCli } from "./src-c3LG0aVB.js";
2
+ import { n as createBtsCli } from "./src-CUyDENe-.js";
3
3
 
4
4
  //#region src/cli.ts
5
5
  createBtsCli().run();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { a as router, i as init, n as createBtsCli, o as sponsors, r as docs, t as builder } from "./src-c3LG0aVB.js";
2
+ import { a as router, i as init, n as createBtsCli, o as sponsors, r as docs, t as builder } from "./src-CUyDENe-.js";
3
3
 
4
4
  export { builder, createBtsCli, docs, init, router, sponsors };
@@ -150,6 +150,7 @@ const dependencyVersionMap = {
150
150
  dotenv: "^17.2.2",
151
151
  tsdown: "^0.15.5",
152
152
  zod: "^4.1.11",
153
+ srvx: "0.8.15",
153
154
  "@polar-sh/better-auth": "^1.1.3",
154
155
  "@polar-sh/sdk": "^0.34.16"
155
156
  };
@@ -4309,6 +4310,10 @@ async function setupApi(config) {
4309
4310
  dependencies: ["better-auth"],
4310
4311
  projectDir: apiPackageDir
4311
4312
  });
4313
+ if (backend === "express") await addPackageDependency({
4314
+ devDependencies: ["@types/express"],
4315
+ projectDir: apiPackageDir
4316
+ });
4312
4317
  if (webDirExists && apiDeps.web) await addPackageDependency({
4313
4318
  dependencies: apiDeps.web.dependencies,
4314
4319
  devDependencies: apiDeps.web.devDependencies,
@@ -4445,7 +4450,7 @@ async function setupAuth(config) {
4445
4450
  projectDir: clientDir
4446
4451
  });
4447
4452
  else if (hasTanStackStart) await addPackageDependency({
4448
- dependencies: ["@clerk/tanstack-react-start"],
4453
+ dependencies: ["@clerk/tanstack-react-start", "srvx"],
4449
4454
  projectDir: clientDir
4450
4455
  });
4451
4456
  else if (hasViteReactOther) await addPackageDependency({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "3.2.7",
3
+ "version": "3.2.9",
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,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
2
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
3
  "vcs": {
4
4
  "enabled": false,
5
5
  "clientKind": "git",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
2
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
3
  "files": {
4
4
  "ignoreUnknown": false,
5
5
  "includes": [
@@ -88,12 +88,17 @@ export async function createContext({ context }: CreateContextOptions) {
88
88
  }
89
89
 
90
90
  {{else if (eq backend 'express')}}
91
+ import type { Request } from "express";
91
92
  {{#if (eq auth "better-auth")}}
92
93
  import { fromNodeHeaders } from "better-auth/node";
93
94
  import { auth } from "@{{projectName}}/auth";
94
95
  {{/if}}
95
96
 
96
- export async function createContext(opts: any) {
97
+ interface CreateContextOptions {
98
+ req: Request;
99
+ }
100
+
101
+ export async function createContext(opts: CreateContextOptions) {
97
102
  {{#if (eq auth "better-auth")}}
98
103
  const session = await auth.api.getSession({
99
104
  headers: fromNodeHeaders(opts.req.headers),
@@ -33,7 +33,19 @@ const getORPCClient = createIsomorphicFn()
33
33
  .server(() =>
34
34
  createRouterClient(appRouter, {
35
35
  context: async ({ req }) => {
36
+ {{#if (eq backend "self")}}
36
37
  return createContext({ req });
38
+ {{else if (eq backend "hono")}}
39
+ return createContext({ context: req });
40
+ {{else if (eq backend "elysia")}}
41
+ return createContext({ context: req });
42
+ {{else if (eq backend "express")}}
43
+ return createContext({ req });
44
+ {{else if (eq backend "fastify")}}
45
+ return createContext(req.headers);
46
+ {{else}}
47
+ return createContext();
48
+ {{/if}}
37
49
  },
38
50
  }),
39
51
  )
@@ -5,6 +5,7 @@ node_modules
5
5
  out
6
6
  dist
7
7
  *.tgz
8
+ /prisma/generated
8
9
 
9
10
  # code coverage
10
11
  coverage