create-better-t-stack 3.8.2 → 3.8.3-pr730.1784e47
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.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-CVJS4SKc.mjs → src-GZpht_dQ.mjs} +12 -21
- package/package.json +8 -7
- package/templates/api/orpc/web/react/base/src/utils/orpc.ts.hbs +2 -4
- package/templates/api/trpc/web/react/base/src/utils/trpc.ts.hbs +4 -8
- package/templates/auth/better-auth/convex/backend/convex/auth.config.ts.hbs +5 -7
- package/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs +11 -5
- package/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs +6 -10
- package/templates/frontend/react/tanstack-start/src/router.tsx.hbs +2 -4
package/dist/cli.mjs
CHANGED
package/dist/index.mjs
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-
|
|
2
|
+
import { a as router, i as init, n as createBtsCli, o as sponsors, r as docs, t as builder } from "./src-GZpht_dQ.mjs";
|
|
3
3
|
|
|
4
4
|
export { builder, createBtsCli, docs, init, router, sponsors };
|
|
@@ -64,8 +64,8 @@ function getDefaultConfig() {
|
|
|
64
64
|
const DEFAULT_CONFIG = getDefaultConfig();
|
|
65
65
|
const dependencyVersionMap = {
|
|
66
66
|
typescript: "^5",
|
|
67
|
-
"better-auth": "1.4.
|
|
68
|
-
"@better-auth/expo": "1.4.
|
|
67
|
+
"better-auth": "^1.4.7",
|
|
68
|
+
"@better-auth/expo": "^1.4.7",
|
|
69
69
|
"@clerk/nextjs": "^6.31.5",
|
|
70
70
|
"@clerk/clerk-react": "^5.45.0",
|
|
71
71
|
"@clerk/tanstack-react-start": "^0.26.3",
|
|
@@ -136,7 +136,7 @@ const dependencyVersionMap = {
|
|
|
136
136
|
"convex-svelte": "^0.0.12",
|
|
137
137
|
"convex-nuxt": "0.1.5",
|
|
138
138
|
"convex-vue": "^0.1.5",
|
|
139
|
-
"@convex-dev/better-auth": "^0.
|
|
139
|
+
"@convex-dev/better-auth": "^0.10.4",
|
|
140
140
|
"@tanstack/svelte-query": "^5.85.3",
|
|
141
141
|
"@tanstack/svelte-query-devtools": "^5.85.3",
|
|
142
142
|
"@tanstack/vue-query-devtools": "^5.90.2",
|
|
@@ -1233,7 +1233,7 @@ const getLatestCLIVersion = () => {
|
|
|
1233
1233
|
*/
|
|
1234
1234
|
function isTelemetryEnabled() {
|
|
1235
1235
|
const BTS_TELEMETRY_DISABLED = process.env.BTS_TELEMETRY_DISABLED;
|
|
1236
|
-
const BTS_TELEMETRY = "
|
|
1236
|
+
const BTS_TELEMETRY = "0";
|
|
1237
1237
|
if (BTS_TELEMETRY_DISABLED !== void 0) return BTS_TELEMETRY_DISABLED !== "1";
|
|
1238
1238
|
if (BTS_TELEMETRY !== void 0) return BTS_TELEMETRY === "1";
|
|
1239
1239
|
return true;
|
|
@@ -1241,16 +1241,7 @@ function isTelemetryEnabled() {
|
|
|
1241
1241
|
|
|
1242
1242
|
//#endregion
|
|
1243
1243
|
//#region src/utils/analytics.ts
|
|
1244
|
-
|
|
1245
|
-
async function sendConvexEvent(payload) {
|
|
1246
|
-
try {
|
|
1247
|
-
await fetch(CONVEX_INGEST_URL, {
|
|
1248
|
-
method: "POST",
|
|
1249
|
-
headers: { "Content-Type": "application/json" },
|
|
1250
|
-
body: JSON.stringify(payload)
|
|
1251
|
-
});
|
|
1252
|
-
} catch {}
|
|
1253
|
-
}
|
|
1244
|
+
async function sendConvexEvent(payload) {}
|
|
1254
1245
|
async function trackProjectCreation(config, disableAnalytics = false) {
|
|
1255
1246
|
if (!isTelemetryEnabled() || disableAnalytics) return;
|
|
1256
1247
|
const { projectName: _projectName, projectDir: _projectDir, relativePath: _relativePath, ...safeConfig } = config;
|
|
@@ -4240,12 +4231,12 @@ async function setupAuth(config) {
|
|
|
4240
4231
|
if (convexBackendDirExists) {
|
|
4241
4232
|
await addPackageDependency({
|
|
4242
4233
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4243
|
-
customDependencies: { "better-auth": "1.
|
|
4234
|
+
customDependencies: { "better-auth": "1.4.7" },
|
|
4244
4235
|
projectDir: convexBackendDir
|
|
4245
4236
|
});
|
|
4246
4237
|
if (hasNativeForBA) await addPackageDependency({
|
|
4247
4238
|
dependencies: ["@better-auth/expo"],
|
|
4248
|
-
customDependencies: { "@better-auth/expo": "1.
|
|
4239
|
+
customDependencies: { "@better-auth/expo": "1.4.7" },
|
|
4249
4240
|
projectDir: convexBackendDir
|
|
4250
4241
|
});
|
|
4251
4242
|
}
|
|
@@ -4255,17 +4246,17 @@ async function setupAuth(config) {
|
|
|
4255
4246
|
const hasViteReactOther = frontend.some((f) => ["tanstack-router", "react-router"].includes(f));
|
|
4256
4247
|
if (hasNextJs) await addPackageDependency({
|
|
4257
4248
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4258
|
-
customDependencies: { "better-auth": "1.
|
|
4249
|
+
customDependencies: { "better-auth": "1.4.7" },
|
|
4259
4250
|
projectDir: clientDir
|
|
4260
4251
|
});
|
|
4261
4252
|
else if (hasTanStackStart) await addPackageDependency({
|
|
4262
4253
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4263
|
-
customDependencies: { "better-auth": "1.
|
|
4254
|
+
customDependencies: { "better-auth": "1.4.7" },
|
|
4264
4255
|
projectDir: clientDir
|
|
4265
4256
|
});
|
|
4266
4257
|
else if (hasViteReactOther) await addPackageDependency({
|
|
4267
4258
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4268
|
-
customDependencies: { "better-auth": "1.
|
|
4259
|
+
customDependencies: { "better-auth": "1.4.7" },
|
|
4269
4260
|
projectDir: clientDir
|
|
4270
4261
|
});
|
|
4271
4262
|
}
|
|
@@ -4279,8 +4270,8 @@ async function setupAuth(config) {
|
|
|
4279
4270
|
"@convex-dev/better-auth"
|
|
4280
4271
|
],
|
|
4281
4272
|
customDependencies: {
|
|
4282
|
-
"better-auth": "1.
|
|
4283
|
-
"@better-auth/expo": "1.
|
|
4273
|
+
"better-auth": "1.4.7",
|
|
4274
|
+
"@better-auth/expo": "1.4.7"
|
|
4284
4275
|
},
|
|
4285
4276
|
projectDir: nativeDir
|
|
4286
4277
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.3-pr730.1784e47",
|
|
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",
|
|
@@ -51,8 +51,10 @@
|
|
|
51
51
|
"build": "tsdown --publint",
|
|
52
52
|
"dev": "tsdown --watch",
|
|
53
53
|
"check-types": "tsc --noEmit",
|
|
54
|
-
"test": "bun run build &&
|
|
55
|
-
"test:
|
|
54
|
+
"test": "bun run build && bun test",
|
|
55
|
+
"test:watch": "bun run build && bun test --watch",
|
|
56
|
+
"test:coverage": "bun run build && bun test --coverage",
|
|
57
|
+
"test:ci": "bun run build && AGENT=1 bun test --bail=5",
|
|
56
58
|
"prepublishOnly": "npm run build"
|
|
57
59
|
},
|
|
58
60
|
"exports": {
|
|
@@ -65,7 +67,7 @@
|
|
|
65
67
|
}
|
|
66
68
|
},
|
|
67
69
|
"dependencies": {
|
|
68
|
-
"@better-t-stack/types": "
|
|
70
|
+
"@better-t-stack/types": "3.8.3-pr730.1784e47",
|
|
69
71
|
"@biomejs/js-api": "^4.0.0",
|
|
70
72
|
"@biomejs/wasm-nodejs": "^2.3.8",
|
|
71
73
|
"@clack/prompts": "^1.0.0-alpha.8",
|
|
@@ -84,12 +86,11 @@
|
|
|
84
86
|
"zod": "^4.1.13"
|
|
85
87
|
},
|
|
86
88
|
"devDependencies": {
|
|
89
|
+
"@types/bun": "^1.2.17",
|
|
87
90
|
"@types/fs-extra": "^11.0.4",
|
|
88
91
|
"@types/node": "^24.10.2",
|
|
89
|
-
"@vitest/ui": "^4.0.15",
|
|
90
92
|
"publint": "^0.3.16",
|
|
91
93
|
"tsdown": "^0.17.2",
|
|
92
|
-
"typescript": "^5.9.3"
|
|
93
|
-
"vitest": "^4.0.15"
|
|
94
|
+
"typescript": "^5.9.3"
|
|
94
95
|
}
|
|
95
96
|
}
|
|
@@ -15,13 +15,11 @@ import type { AppRouterClient } from "@{{projectName}}/api/routers/index";
|
|
|
15
15
|
|
|
16
16
|
export const queryClient = new QueryClient({
|
|
17
17
|
queryCache: new QueryCache({
|
|
18
|
-
onError: (error) => {
|
|
18
|
+
onError: (error, query) => {
|
|
19
19
|
toast.error(`Error: ${error.message}`, {
|
|
20
20
|
action: {
|
|
21
21
|
label: "retry",
|
|
22
|
-
onClick:
|
|
23
|
-
queryClient.invalidateQueries();
|
|
24
|
-
},
|
|
22
|
+
onClick: query.invalidate,
|
|
25
23
|
},
|
|
26
24
|
});
|
|
27
25
|
},
|
|
@@ -7,13 +7,11 @@ import { toast } from 'sonner';
|
|
|
7
7
|
|
|
8
8
|
export const queryClient = new QueryClient({
|
|
9
9
|
queryCache: new QueryCache({
|
|
10
|
-
onError: (error) => {
|
|
10
|
+
onError: (error, query) => {
|
|
11
11
|
toast.error(error.message, {
|
|
12
12
|
action: {
|
|
13
13
|
label: "retry",
|
|
14
|
-
onClick:
|
|
15
|
-
queryClient.invalidateQueries();
|
|
16
|
-
},
|
|
14
|
+
onClick: query.invalidate,
|
|
17
15
|
},
|
|
18
16
|
});
|
|
19
17
|
},
|
|
@@ -63,13 +61,11 @@ import { toast } from "sonner";
|
|
|
63
61
|
|
|
64
62
|
export const queryClient = new QueryClient({
|
|
65
63
|
queryCache: new QueryCache({
|
|
66
|
-
onError: (error) => {
|
|
64
|
+
onError: (error, query) => {
|
|
67
65
|
toast.error(error.message, {
|
|
68
66
|
action: {
|
|
69
67
|
label: "retry",
|
|
70
|
-
onClick:
|
|
71
|
-
queryClient.invalidateQueries();
|
|
72
|
-
},
|
|
68
|
+
onClick: query.invalidate,
|
|
73
69
|
},
|
|
74
70
|
});
|
|
75
71
|
},
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
import { getAuthConfigProvider } from "@convex-dev/better-auth/auth-config";
|
|
2
|
+
import type { AuthConfig } from "convex/server";
|
|
3
|
+
|
|
1
4
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
domain: process.env.CONVEX_SITE_URL,
|
|
5
|
-
applicationID: "convex",
|
|
6
|
-
},
|
|
7
|
-
],
|
|
8
|
-
};
|
|
5
|
+
providers: [getAuthConfigProvider()],
|
|
6
|
+
} satisfies AuthConfig;
|
package/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { setupFetchClient } from "@convex-dev/better-auth/react-start";
|
|
3
|
-
import { getCookie } from "@tanstack/react-start/server";
|
|
1
|
+
import { convexBetterAuthReactStart } from "@convex-dev/better-auth/react-start";
|
|
4
2
|
|
|
5
|
-
export const {
|
|
6
|
-
|
|
3
|
+
export const {
|
|
4
|
+
handler,
|
|
5
|
+
getToken,
|
|
6
|
+
fetchAuthQuery,
|
|
7
|
+
fetchAuthMutation,
|
|
8
|
+
fetchAuthAction,
|
|
9
|
+
} = convexBetterAuthReactStart({
|
|
10
|
+
convexUrl: process.env.VITE_CONVEX_URL!,
|
|
11
|
+
convexSiteUrl: process.env.VITE_CONVEX_SITE_URL!,
|
|
12
|
+
});
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { handler } from "@/lib/auth-server";
|
|
3
3
|
|
|
4
|
-
export const Route = createFileRoute(
|
|
4
|
+
export const Route = createFileRoute("/api/auth/$")({
|
|
5
5
|
server: {
|
|
6
6
|
handlers: {
|
|
7
|
-
GET: ({ request }) =>
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
POST: ({ request }) => {
|
|
11
|
-
return auth.handler(request)
|
|
12
|
-
},
|
|
7
|
+
GET: ({ request }) => handler(request),
|
|
8
|
+
POST: ({ request }) => handler(request),
|
|
13
9
|
},
|
|
14
10
|
},
|
|
15
|
-
})
|
|
11
|
+
});
|
|
@@ -68,13 +68,11 @@ export function getRouter() {
|
|
|
68
68
|
{{#if (eq api "trpc")}}
|
|
69
69
|
export const queryClient = new QueryClient({
|
|
70
70
|
queryCache: new QueryCache({
|
|
71
|
-
onError: (error) => {
|
|
71
|
+
onError: (error, query) => {
|
|
72
72
|
toast.error(error.message, {
|
|
73
73
|
action: {
|
|
74
74
|
label: "retry",
|
|
75
|
-
onClick:
|
|
76
|
-
queryClient.invalidateQueries();
|
|
77
|
-
},
|
|
75
|
+
onClick: query.invalidate,
|
|
78
76
|
},
|
|
79
77
|
});
|
|
80
78
|
},
|