create-better-t-stack 3.8.3-pr730.1784e47 → 3.8.3
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-GZpht_dQ.mjs → src-BCBL3cO2.mjs} +19 -10
- package/package.json +7 -8
- package/templates/auth/better-auth/convex/backend/convex/auth.config.ts.hbs +7 -5
- package/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs +5 -11
- package/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs +10 -6
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-BCBL3cO2.mjs";
|
|
3
3
|
|
|
4
4
|
export { builder, createBtsCli, docs, init, router, sponsors };
|
|
@@ -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.9.7",
|
|
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 = "1";
|
|
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,7 +1241,16 @@ function isTelemetryEnabled() {
|
|
|
1241
1241
|
|
|
1242
1242
|
//#endregion
|
|
1243
1243
|
//#region src/utils/analytics.ts
|
|
1244
|
-
|
|
1244
|
+
const CONVEX_INGEST_URL = "https://striped-seahorse-863.convex.site/api/analytics/ingest";
|
|
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
|
+
}
|
|
1245
1254
|
async function trackProjectCreation(config, disableAnalytics = false) {
|
|
1246
1255
|
if (!isTelemetryEnabled() || disableAnalytics) return;
|
|
1247
1256
|
const { projectName: _projectName, projectDir: _projectDir, relativePath: _relativePath, ...safeConfig } = config;
|
|
@@ -4231,12 +4240,12 @@ async function setupAuth(config) {
|
|
|
4231
4240
|
if (convexBackendDirExists) {
|
|
4232
4241
|
await addPackageDependency({
|
|
4233
4242
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4234
|
-
customDependencies: { "better-auth": "1.
|
|
4243
|
+
customDependencies: { "better-auth": "1.3.34" },
|
|
4235
4244
|
projectDir: convexBackendDir
|
|
4236
4245
|
});
|
|
4237
4246
|
if (hasNativeForBA) await addPackageDependency({
|
|
4238
4247
|
dependencies: ["@better-auth/expo"],
|
|
4239
|
-
customDependencies: { "@better-auth/expo": "1.
|
|
4248
|
+
customDependencies: { "@better-auth/expo": "1.3.34" },
|
|
4240
4249
|
projectDir: convexBackendDir
|
|
4241
4250
|
});
|
|
4242
4251
|
}
|
|
@@ -4246,17 +4255,17 @@ async function setupAuth(config) {
|
|
|
4246
4255
|
const hasViteReactOther = frontend.some((f) => ["tanstack-router", "react-router"].includes(f));
|
|
4247
4256
|
if (hasNextJs) await addPackageDependency({
|
|
4248
4257
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4249
|
-
customDependencies: { "better-auth": "1.
|
|
4258
|
+
customDependencies: { "better-auth": "1.3.34" },
|
|
4250
4259
|
projectDir: clientDir
|
|
4251
4260
|
});
|
|
4252
4261
|
else if (hasTanStackStart) await addPackageDependency({
|
|
4253
4262
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4254
|
-
customDependencies: { "better-auth": "1.
|
|
4263
|
+
customDependencies: { "better-auth": "1.3.34" },
|
|
4255
4264
|
projectDir: clientDir
|
|
4256
4265
|
});
|
|
4257
4266
|
else if (hasViteReactOther) await addPackageDependency({
|
|
4258
4267
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4259
|
-
customDependencies: { "better-auth": "1.
|
|
4268
|
+
customDependencies: { "better-auth": "1.3.34" },
|
|
4260
4269
|
projectDir: clientDir
|
|
4261
4270
|
});
|
|
4262
4271
|
}
|
|
@@ -4270,8 +4279,8 @@ async function setupAuth(config) {
|
|
|
4270
4279
|
"@convex-dev/better-auth"
|
|
4271
4280
|
],
|
|
4272
4281
|
customDependencies: {
|
|
4273
|
-
"better-auth": "1.
|
|
4274
|
-
"@better-auth/expo": "1.
|
|
4282
|
+
"better-auth": "1.3.34",
|
|
4283
|
+
"@better-auth/expo": "1.3.34"
|
|
4275
4284
|
},
|
|
4276
4285
|
projectDir: nativeDir
|
|
4277
4286
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.8.3
|
|
3
|
+
"version": "3.8.3",
|
|
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,10 +51,8 @@
|
|
|
51
51
|
"build": "tsdown --publint",
|
|
52
52
|
"dev": "tsdown --watch",
|
|
53
53
|
"check-types": "tsc --noEmit",
|
|
54
|
-
"test": "bun run build &&
|
|
55
|
-
"test:
|
|
56
|
-
"test:coverage": "bun run build && bun test --coverage",
|
|
57
|
-
"test:ci": "bun run build && AGENT=1 bun test --bail=5",
|
|
54
|
+
"test": "bun run build && vitest run; rm -rf .smoke || true",
|
|
55
|
+
"test:ui": "bun run build && vitest --ui",
|
|
58
56
|
"prepublishOnly": "npm run build"
|
|
59
57
|
},
|
|
60
58
|
"exports": {
|
|
@@ -67,7 +65,7 @@
|
|
|
67
65
|
}
|
|
68
66
|
},
|
|
69
67
|
"dependencies": {
|
|
70
|
-
"@better-t-stack/types": "3.8.3
|
|
68
|
+
"@better-t-stack/types": "^3.8.3",
|
|
71
69
|
"@biomejs/js-api": "^4.0.0",
|
|
72
70
|
"@biomejs/wasm-nodejs": "^2.3.8",
|
|
73
71
|
"@clack/prompts": "^1.0.0-alpha.8",
|
|
@@ -86,11 +84,12 @@
|
|
|
86
84
|
"zod": "^4.1.13"
|
|
87
85
|
},
|
|
88
86
|
"devDependencies": {
|
|
89
|
-
"@types/bun": "^1.2.17",
|
|
90
87
|
"@types/fs-extra": "^11.0.4",
|
|
91
88
|
"@types/node": "^24.10.2",
|
|
89
|
+
"@vitest/ui": "^4.0.15",
|
|
92
90
|
"publint": "^0.3.16",
|
|
93
91
|
"tsdown": "^0.17.2",
|
|
94
|
-
"typescript": "^5.9.3"
|
|
92
|
+
"typescript": "^5.9.3",
|
|
93
|
+
"vitest": "^4.0.15"
|
|
95
94
|
}
|
|
96
95
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { getAuthConfigProvider } from "@convex-dev/better-auth/auth-config";
|
|
2
|
-
import type { AuthConfig } from "convex/server";
|
|
3
|
-
|
|
4
1
|
export default {
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
providers: [
|
|
3
|
+
{
|
|
4
|
+
domain: process.env.CONVEX_SITE_URL,
|
|
5
|
+
applicationID: "convex",
|
|
6
|
+
},
|
|
7
|
+
],
|
|
8
|
+
};
|
package/templates/auth/better-auth/convex/web/react/tanstack-start/src/lib/auth-server.ts.hbs
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAuth } from "@{{projectName}}/backend/convex/auth";
|
|
2
|
+
import { setupFetchClient } from "@convex-dev/better-auth/react-start";
|
|
3
|
+
import { getCookie } from "@tanstack/react-start/server";
|
|
2
4
|
|
|
3
|
-
export const {
|
|
4
|
-
|
|
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
|
-
});
|
|
5
|
+
export const { fetchQuery, fetchMutation, fetchAction } =
|
|
6
|
+
await setupFetchClient(createAuth, getCookie);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { auth } from '@{{projectName}}/auth'
|
|
2
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
3
3
|
|
|
4
|
-
export const Route = createFileRoute(
|
|
4
|
+
export const Route = createFileRoute('/api/auth/$')({
|
|
5
5
|
server: {
|
|
6
6
|
handlers: {
|
|
7
|
-
GET: ({ request }) =>
|
|
8
|
-
|
|
7
|
+
GET: ({ request }) => {
|
|
8
|
+
return auth.handler(request)
|
|
9
|
+
},
|
|
10
|
+
POST: ({ request }) => {
|
|
11
|
+
return auth.handler(request)
|
|
12
|
+
},
|
|
9
13
|
},
|
|
10
14
|
},
|
|
11
|
-
})
|
|
15
|
+
})
|