create-better-t-stack 3.8.1 → 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-BDXa8gsB.mjs → src-GZpht_dQ.mjs} +33 -29
- package/package.json +8 -7
- package/templates/addons/biome/biome.json.hbs +2 -1
- package/templates/addons/ultracite/biome.json.hbs +2 -1
- 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 -4
- package/templates/auth/better-auth/fullstack/tanstack-start/src/routes/api/auth/$.ts.hbs +6 -10
- package/templates/deploy/alchemy/alchemy.run.ts.hbs +75 -71
- package/templates/examples/todo/web/react/tanstack-start/src/routes/todos.tsx.hbs +4 -0
- package/templates/frontend/react/next/package.json.hbs +1 -1
- package/templates/frontend/react/tanstack-router/package.json.hbs +1 -1
- package/templates/frontend/react/tanstack-router/vite.config.ts.hbs +3 -0
- package/templates/frontend/react/tanstack-start/package.json.hbs +1 -1
- package/templates/frontend/react/tanstack-start/src/router.tsx.hbs +2 -4
- package/templates/frontend/react/tanstack-start/vite.config.ts.hbs +3 -0
- package/templates/frontend/solid/package.json.hbs +1 -1
- package/templates/frontend/solid/vite.config.ts.hbs +3 -0
- /package/templates/frontend/svelte/{vite.config.ts → vite.config.ts.hbs} +0 -0
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",
|
|
@@ -114,7 +114,7 @@ const dependencyVersionMap = {
|
|
|
114
114
|
"@types/cors": "^2.8.17",
|
|
115
115
|
fastify: "^5.3.3",
|
|
116
116
|
"@fastify/cors": "^11.0.1",
|
|
117
|
-
turbo: "^2.
|
|
117
|
+
turbo: "^2.6.3",
|
|
118
118
|
ai: "^5.0.49",
|
|
119
119
|
"@ai-sdk/google": "^2.0.13",
|
|
120
120
|
"@ai-sdk/vue": "^2.0.49",
|
|
@@ -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",
|
|
@@ -146,13 +146,13 @@ const dependencyVersionMap = {
|
|
|
146
146
|
"@tanstack/solid-query": "^5.87.4",
|
|
147
147
|
"@tanstack/solid-query-devtools": "^5.87.4",
|
|
148
148
|
"@tanstack/solid-router-devtools": "^1.131.44",
|
|
149
|
-
wrangler: "^4.
|
|
150
|
-
"@cloudflare/vite-plugin": "^1.
|
|
151
|
-
"@opennextjs/cloudflare": "^1.6
|
|
149
|
+
wrangler: "^4.54.0",
|
|
150
|
+
"@cloudflare/vite-plugin": "^1.17.1",
|
|
151
|
+
"@opennextjs/cloudflare": "^1.14.6",
|
|
152
152
|
"nitro-cloudflare-dev": "^0.2.2",
|
|
153
|
-
"@sveltejs/adapter-cloudflare": "^7.2.
|
|
154
|
-
"@cloudflare/workers-types": "^4.
|
|
155
|
-
alchemy: "^0.81.
|
|
153
|
+
"@sveltejs/adapter-cloudflare": "^7.2.4",
|
|
154
|
+
"@cloudflare/workers-types": "^4.20251213.0",
|
|
155
|
+
alchemy: "^0.81.2",
|
|
156
156
|
dotenv: "^17.2.2",
|
|
157
157
|
tsdown: "^0.16.5",
|
|
158
158
|
zod: "^4.1.13",
|
|
@@ -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;
|
|
@@ -3363,6 +3354,7 @@ async function setupNextAlchemyDeploy(projectDir, _packageManager, options) {
|
|
|
3363
3354
|
const pkg = await fs.readJson(pkgPath);
|
|
3364
3355
|
if (!options?.skipAppScripts) pkg.scripts = {
|
|
3365
3356
|
...pkg.scripts,
|
|
3357
|
+
dev: "alchemy dev",
|
|
3366
3358
|
deploy: "alchemy deploy",
|
|
3367
3359
|
destroy: "alchemy destroy"
|
|
3368
3360
|
};
|
|
@@ -3397,6 +3389,7 @@ async function setupNuxtAlchemyDeploy(projectDir, _packageManager, options) {
|
|
|
3397
3389
|
const pkg = await fs.readJson(pkgPath);
|
|
3398
3390
|
if (!options?.skipAppScripts) pkg.scripts = {
|
|
3399
3391
|
...pkg.scripts,
|
|
3392
|
+
dev: "alchemy dev",
|
|
3400
3393
|
deploy: "alchemy deploy",
|
|
3401
3394
|
destroy: "alchemy destroy"
|
|
3402
3395
|
};
|
|
@@ -3458,6 +3451,7 @@ async function setupReactRouterAlchemyDeploy(projectDir, _packageManager, option
|
|
|
3458
3451
|
const pkg = await fs.readJson(pkgPath);
|
|
3459
3452
|
if (!options?.skipAppScripts) pkg.scripts = {
|
|
3460
3453
|
...pkg.scripts,
|
|
3454
|
+
dev: "alchemy dev",
|
|
3461
3455
|
deploy: "alchemy deploy",
|
|
3462
3456
|
destroy: "alchemy destroy"
|
|
3463
3457
|
};
|
|
@@ -3479,6 +3473,7 @@ async function setupSolidAlchemyDeploy(projectDir, _packageManager, options) {
|
|
|
3479
3473
|
const pkg = await fs.readJson(pkgPath);
|
|
3480
3474
|
if (!options?.skipAppScripts) pkg.scripts = {
|
|
3481
3475
|
...pkg.scripts,
|
|
3476
|
+
dev: "alchemy dev",
|
|
3482
3477
|
deploy: "alchemy deploy",
|
|
3483
3478
|
destroy: "alchemy destroy"
|
|
3484
3479
|
};
|
|
@@ -3500,6 +3495,7 @@ async function setupSvelteAlchemyDeploy(projectDir, _packageManager, options) {
|
|
|
3500
3495
|
const pkg = await fs.readJson(pkgPath);
|
|
3501
3496
|
if (!options?.skipAppScripts) pkg.scripts = {
|
|
3502
3497
|
...pkg.scripts,
|
|
3498
|
+
dev: "alchemy dev",
|
|
3503
3499
|
deploy: "alchemy deploy",
|
|
3504
3500
|
destroy: "alchemy destroy"
|
|
3505
3501
|
};
|
|
@@ -3565,6 +3561,7 @@ async function setupTanStackRouterAlchemyDeploy(projectDir, _packageManager, opt
|
|
|
3565
3561
|
const pkg = await fs.readJson(pkgPath);
|
|
3566
3562
|
if (!options?.skipAppScripts) pkg.scripts = {
|
|
3567
3563
|
...pkg.scripts,
|
|
3564
|
+
dev: "alchemy dev",
|
|
3568
3565
|
deploy: "alchemy deploy",
|
|
3569
3566
|
destroy: "alchemy destroy"
|
|
3570
3567
|
};
|
|
@@ -3586,6 +3583,7 @@ async function setupTanStackStartAlchemyDeploy(projectDir, _packageManager, opti
|
|
|
3586
3583
|
const pkg = await fs.readJson(pkgPath);
|
|
3587
3584
|
if (!options?.skipAppScripts) pkg.scripts = {
|
|
3588
3585
|
...pkg.scripts,
|
|
3586
|
+
dev: "alchemy dev",
|
|
3589
3587
|
deploy: "alchemy deploy",
|
|
3590
3588
|
destroy: "alchemy destroy"
|
|
3591
3589
|
};
|
|
@@ -4233,12 +4231,12 @@ async function setupAuth(config) {
|
|
|
4233
4231
|
if (convexBackendDirExists) {
|
|
4234
4232
|
await addPackageDependency({
|
|
4235
4233
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4236
|
-
customDependencies: { "better-auth": "1.
|
|
4234
|
+
customDependencies: { "better-auth": "1.4.7" },
|
|
4237
4235
|
projectDir: convexBackendDir
|
|
4238
4236
|
});
|
|
4239
4237
|
if (hasNativeForBA) await addPackageDependency({
|
|
4240
4238
|
dependencies: ["@better-auth/expo"],
|
|
4241
|
-
customDependencies: { "@better-auth/expo": "1.
|
|
4239
|
+
customDependencies: { "@better-auth/expo": "1.4.7" },
|
|
4242
4240
|
projectDir: convexBackendDir
|
|
4243
4241
|
});
|
|
4244
4242
|
}
|
|
@@ -4248,17 +4246,17 @@ async function setupAuth(config) {
|
|
|
4248
4246
|
const hasViteReactOther = frontend.some((f) => ["tanstack-router", "react-router"].includes(f));
|
|
4249
4247
|
if (hasNextJs) await addPackageDependency({
|
|
4250
4248
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4251
|
-
customDependencies: { "better-auth": "1.
|
|
4249
|
+
customDependencies: { "better-auth": "1.4.7" },
|
|
4252
4250
|
projectDir: clientDir
|
|
4253
4251
|
});
|
|
4254
4252
|
else if (hasTanStackStart) await addPackageDependency({
|
|
4255
4253
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4256
|
-
customDependencies: { "better-auth": "1.
|
|
4254
|
+
customDependencies: { "better-auth": "1.4.7" },
|
|
4257
4255
|
projectDir: clientDir
|
|
4258
4256
|
});
|
|
4259
4257
|
else if (hasViteReactOther) await addPackageDependency({
|
|
4260
4258
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4261
|
-
customDependencies: { "better-auth": "1.
|
|
4259
|
+
customDependencies: { "better-auth": "1.4.7" },
|
|
4262
4260
|
projectDir: clientDir
|
|
4263
4261
|
});
|
|
4264
4262
|
}
|
|
@@ -4272,8 +4270,8 @@ async function setupAuth(config) {
|
|
|
4272
4270
|
"@convex-dev/better-auth"
|
|
4273
4271
|
],
|
|
4274
4272
|
customDependencies: {
|
|
4275
|
-
"better-auth": "1.
|
|
4276
|
-
"@better-auth/expo": "1.
|
|
4273
|
+
"better-auth": "1.4.7",
|
|
4274
|
+
"@better-auth/expo": "1.4.7"
|
|
4277
4275
|
},
|
|
4278
4276
|
projectDir: nativeDir
|
|
4279
4277
|
});
|
|
@@ -4432,6 +4430,11 @@ async function setupEnvironmentVariables(config) {
|
|
|
4432
4430
|
value: backend === "convex" ? "https://<YOUR_CONVEX_URL>" : baseVar.value,
|
|
4433
4431
|
condition: backend === "convex" ? true : baseVar.write
|
|
4434
4432
|
}];
|
|
4433
|
+
if (hasNextJs) clientVars.push({
|
|
4434
|
+
key: "PORT",
|
|
4435
|
+
value: "3001",
|
|
4436
|
+
condition: true
|
|
4437
|
+
});
|
|
4435
4438
|
if (backend === "convex" && auth === "clerk") {
|
|
4436
4439
|
if (hasNextJs) clientVars.push({
|
|
4437
4440
|
key: "NEXT_PUBLIC_CLERK_FRONTEND_API_URL",
|
|
@@ -6473,6 +6476,7 @@ async function updateRootPackageJson(projectDir, options) {
|
|
|
6473
6476
|
if (!isD1Alchemy) scripts["db:migrate"] = pmConfig.filter(dbPackageName, "db:migrate");
|
|
6474
6477
|
}
|
|
6475
6478
|
}
|
|
6479
|
+
if (database === "sqlite" && dbSetup !== "d1" && orm !== "none") scripts["db:local"] = pmConfig.filter(dbPackageName, "db:local");
|
|
6476
6480
|
if (dbSetup === "docker") {
|
|
6477
6481
|
scripts["db:start"] = pmConfig.filter(dbPackageName, "db:start");
|
|
6478
6482
|
scripts["db:watch"] = pmConfig.filter(dbPackageName, "db:watch");
|
|
@@ -6539,7 +6543,7 @@ async function updateDbPackageJson(projectDir, options) {
|
|
|
6539
6543
|
const { database, orm, dbSetup, serverDeploy } = options;
|
|
6540
6544
|
const isD1Alchemy = dbSetup === "d1" && serverDeploy === "alchemy";
|
|
6541
6545
|
if (database !== "none") {
|
|
6542
|
-
if (database === "sqlite" &&
|
|
6546
|
+
if (database === "sqlite" && dbSetup !== "d1") scripts["db:local"] = "turso dev --db-file local.db";
|
|
6543
6547
|
if (orm === "prisma") {
|
|
6544
6548
|
scripts["db:push"] = "prisma db push";
|
|
6545
6549
|
scripts["db:generate"] = "prisma generate";
|
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,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { setupFetchClient } from "@convex-dev/better-auth/react-start";
|
|
1
|
+
import { convexBetterAuthReactStart } from "@convex-dev/better-auth/react-start";
|
|
3
2
|
|
|
4
|
-
export const {
|
|
5
|
-
|
|
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
|
+
});
|
|
@@ -50,43 +50,45 @@ export const web = await Nextjs("web", {
|
|
|
50
50
|
{{#if (eq serverDeploy "alchemy")}}cwd: "apps/web",{{/if}}
|
|
51
51
|
bindings: {
|
|
52
52
|
{{#if (eq backend "convex")}}
|
|
53
|
-
NEXT_PUBLIC_CONVEX_URL:
|
|
53
|
+
NEXT_PUBLIC_CONVEX_URL: alchemy.env.NEXT_PUBLIC_CONVEX_URL,
|
|
54
|
+
{{#if (eq auth "better-auth")}}
|
|
55
|
+
NEXT_PUBLIC_CONVEX_SITE_URL: alchemy.env.NEXT_PUBLIC_CONVEX_SITE_URL,
|
|
56
|
+
{{/if}}
|
|
54
57
|
{{else if (ne backend "self")}}
|
|
55
|
-
NEXT_PUBLIC_SERVER_URL:
|
|
58
|
+
NEXT_PUBLIC_SERVER_URL: alchemy.env.NEXT_PUBLIC_SERVER_URL,
|
|
56
59
|
{{/if}}
|
|
57
60
|
{{#if (eq dbSetup "d1")}}
|
|
58
61
|
DB: db,
|
|
59
62
|
{{else if (ne database "none")}}
|
|
60
|
-
DATABASE_URL: alchemy.secret
|
|
63
|
+
DATABASE_URL: alchemy.secret.env.DATABASE_URL,
|
|
61
64
|
{{/if}}
|
|
62
|
-
|
|
65
|
+
{{#if (ne backend "convex")}}
|
|
66
|
+
CORS_ORIGIN: alchemy.env.CORS_ORIGIN,
|
|
63
67
|
{{#if (eq auth "better-auth")}}
|
|
64
|
-
BETTER_AUTH_SECRET: alchemy.secret
|
|
65
|
-
BETTER_AUTH_URL:
|
|
68
|
+
BETTER_AUTH_SECRET: alchemy.secret.env.BETTER_AUTH_SECRET,
|
|
69
|
+
BETTER_AUTH_URL: alchemy.env.BETTER_AUTH_URL,
|
|
70
|
+
{{/if}}
|
|
66
71
|
{{/if}}
|
|
67
72
|
{{#if (eq auth "clerk")}}
|
|
68
|
-
CLERK_SECRET_KEY: alchemy.secret
|
|
73
|
+
CLERK_SECRET_KEY: alchemy.secret.env.CLERK_SECRET_KEY,
|
|
69
74
|
{{/if}}
|
|
70
75
|
{{#if (includes examples "ai")}}
|
|
71
|
-
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret
|
|
76
|
+
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret.env.GOOGLE_GENERATIVE_AI_API_KEY,
|
|
72
77
|
{{/if}}
|
|
73
78
|
{{#if (eq payments "polar")}}
|
|
74
|
-
POLAR_ACCESS_TOKEN: alchemy.secret
|
|
75
|
-
POLAR_SUCCESS_URL:
|
|
79
|
+
POLAR_ACCESS_TOKEN: alchemy.secret.env.POLAR_ACCESS_TOKEN,
|
|
80
|
+
POLAR_SUCCESS_URL: alchemy.env.POLAR_SUCCESS_URL,
|
|
76
81
|
{{/if}}
|
|
77
82
|
{{#if (eq dbSetup "turso")}}
|
|
78
|
-
DATABASE_AUTH_TOKEN: alchemy.secret
|
|
83
|
+
DATABASE_AUTH_TOKEN: alchemy.secret.env.DATABASE_AUTH_TOKEN,
|
|
79
84
|
{{/if}}
|
|
80
85
|
{{#if (eq database "mysql")}}
|
|
81
86
|
{{#if (eq orm "drizzle")}}
|
|
82
|
-
DATABASE_HOST:
|
|
83
|
-
DATABASE_USERNAME:
|
|
84
|
-
DATABASE_PASSWORD:
|
|
87
|
+
DATABASE_HOST: alchemy.env.DATABASE_HOST,
|
|
88
|
+
DATABASE_USERNAME: alchemy.env.DATABASE_USERNAME,
|
|
89
|
+
DATABASE_PASSWORD: alchemy.secret.env.DATABASE_PASSWORD,
|
|
85
90
|
{{/if}}
|
|
86
91
|
{{/if}}
|
|
87
|
-
},
|
|
88
|
-
dev: {
|
|
89
|
-
command: "{{packageManager}} run dev"
|
|
90
92
|
}
|
|
91
93
|
});
|
|
92
94
|
{{else if (includes frontend "nuxt")}}
|
|
@@ -94,13 +96,13 @@ export const web = await Nuxt("web", {
|
|
|
94
96
|
{{#if (eq serverDeploy "alchemy")}}cwd: "apps/web",{{/if}}
|
|
95
97
|
bindings: {
|
|
96
98
|
{{#if (eq backend "convex")}}
|
|
97
|
-
NUXT_PUBLIC_CONVEX_URL:
|
|
99
|
+
NUXT_PUBLIC_CONVEX_URL: alchemy.env.NUXT_PUBLIC_CONVEX_URL,
|
|
100
|
+
{{#if (eq auth "better-auth")}}
|
|
101
|
+
NUXT_PUBLIC_CONVEX_SITE_URL: alchemy.env.NUXT_PUBLIC_CONVEX_SITE_URL,
|
|
102
|
+
{{/if}}
|
|
98
103
|
{{else if (ne backend "self")}}
|
|
99
|
-
NUXT_PUBLIC_SERVER_URL:
|
|
104
|
+
NUXT_PUBLIC_SERVER_URL: alchemy.env.NUXT_PUBLIC_SERVER_URL,
|
|
100
105
|
{{/if}}
|
|
101
|
-
},
|
|
102
|
-
dev: {
|
|
103
|
-
command: "{{packageManager}} run dev"
|
|
104
106
|
}
|
|
105
107
|
});
|
|
106
108
|
{{else if (includes frontend "svelte")}}
|
|
@@ -108,13 +110,13 @@ export const web = await SvelteKit("web", {
|
|
|
108
110
|
{{#if (eq serverDeploy "alchemy")}}cwd: "apps/web",{{/if}}
|
|
109
111
|
bindings: {
|
|
110
112
|
{{#if (eq backend "convex")}}
|
|
111
|
-
PUBLIC_CONVEX_URL:
|
|
113
|
+
PUBLIC_CONVEX_URL: alchemy.env.PUBLIC_CONVEX_URL,
|
|
114
|
+
{{#if (eq auth "better-auth")}}
|
|
115
|
+
PUBLIC_CONVEX_SITE_URL: alchemy.env.PUBLIC_CONVEX_SITE_URL,
|
|
116
|
+
{{/if}}
|
|
112
117
|
{{else if (ne backend "self")}}
|
|
113
|
-
PUBLIC_SERVER_URL:
|
|
118
|
+
PUBLIC_SERVER_URL: alchemy.env.PUBLIC_SERVER_URL,
|
|
114
119
|
{{/if}}
|
|
115
|
-
},
|
|
116
|
-
dev: {
|
|
117
|
-
command: "{{packageManager}} run dev"
|
|
118
120
|
}
|
|
119
121
|
});
|
|
120
122
|
{{else if (includes frontend "tanstack-start")}}
|
|
@@ -122,43 +124,45 @@ export const web = await TanStackStart("web", {
|
|
|
122
124
|
{{#if (eq serverDeploy "alchemy")}}cwd: "apps/web",{{/if}}
|
|
123
125
|
bindings: {
|
|
124
126
|
{{#if (eq backend "convex")}}
|
|
125
|
-
VITE_CONVEX_URL:
|
|
127
|
+
VITE_CONVEX_URL: alchemy.env.VITE_CONVEX_URL,
|
|
128
|
+
{{#if (eq auth "better-auth")}}
|
|
129
|
+
VITE_CONVEX_SITE_URL: alchemy.env.VITE_CONVEX_SITE_URL,
|
|
130
|
+
{{/if}}
|
|
126
131
|
{{else if (ne backend "self")}}
|
|
127
|
-
VITE_SERVER_URL:
|
|
132
|
+
VITE_SERVER_URL: alchemy.env.VITE_SERVER_URL,
|
|
128
133
|
{{/if}}
|
|
129
134
|
{{#if (eq dbSetup "d1")}}
|
|
130
135
|
DB: db,
|
|
131
136
|
{{else if (ne database "none")}}
|
|
132
|
-
DATABASE_URL: alchemy.secret
|
|
137
|
+
DATABASE_URL: alchemy.secret.env.DATABASE_URL,
|
|
133
138
|
{{/if}}
|
|
134
|
-
|
|
139
|
+
{{#if (ne backend "convex")}}
|
|
140
|
+
CORS_ORIGIN: alchemy.env.CORS_ORIGIN,
|
|
135
141
|
{{#if (eq auth "better-auth")}}
|
|
136
|
-
BETTER_AUTH_SECRET: alchemy.secret
|
|
137
|
-
BETTER_AUTH_URL:
|
|
142
|
+
BETTER_AUTH_SECRET: alchemy.secret.env.BETTER_AUTH_SECRET,
|
|
143
|
+
BETTER_AUTH_URL: alchemy.env.BETTER_AUTH_URL,
|
|
144
|
+
{{/if}}
|
|
138
145
|
{{/if}}
|
|
139
146
|
{{#if (eq auth "clerk")}}
|
|
140
|
-
CLERK_SECRET_KEY: alchemy.secret
|
|
147
|
+
CLERK_SECRET_KEY: alchemy.secret.env.CLERK_SECRET_KEY,
|
|
141
148
|
{{/if}}
|
|
142
149
|
{{#if (includes examples "ai")}}
|
|
143
|
-
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret
|
|
150
|
+
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret.env.GOOGLE_GENERATIVE_AI_API_KEY,
|
|
144
151
|
{{/if}}
|
|
145
152
|
{{#if (eq payments "polar")}}
|
|
146
|
-
POLAR_ACCESS_TOKEN: alchemy.secret
|
|
147
|
-
POLAR_SUCCESS_URL:
|
|
153
|
+
POLAR_ACCESS_TOKEN: alchemy.secret.env.POLAR_ACCESS_TOKEN,
|
|
154
|
+
POLAR_SUCCESS_URL: alchemy.env.POLAR_SUCCESS_URL,
|
|
148
155
|
{{/if}}
|
|
149
156
|
{{#if (eq dbSetup "turso")}}
|
|
150
|
-
DATABASE_AUTH_TOKEN: alchemy.secret
|
|
157
|
+
DATABASE_AUTH_TOKEN: alchemy.secret.env.DATABASE_AUTH_TOKEN,
|
|
151
158
|
{{/if}}
|
|
152
159
|
{{#if (eq database "mysql")}}
|
|
153
160
|
{{#if (eq orm "drizzle")}}
|
|
154
|
-
DATABASE_HOST:
|
|
155
|
-
DATABASE_USERNAME:
|
|
156
|
-
DATABASE_PASSWORD:
|
|
161
|
+
DATABASE_HOST: alchemy.env.DATABASE_HOST,
|
|
162
|
+
DATABASE_USERNAME: alchemy.env.DATABASE_USERNAME,
|
|
163
|
+
DATABASE_PASSWORD: alchemy.secret.env.DATABASE_PASSWORD,
|
|
157
164
|
{{/if}}
|
|
158
165
|
{{/if}}
|
|
159
|
-
},
|
|
160
|
-
dev: {
|
|
161
|
-
command: "{{packageManager}} run dev"
|
|
162
166
|
}
|
|
163
167
|
});
|
|
164
168
|
{{else if (includes frontend "tanstack-router")}}
|
|
@@ -167,13 +171,13 @@ export const web = await Vite("web", {
|
|
|
167
171
|
assets: "dist",
|
|
168
172
|
bindings: {
|
|
169
173
|
{{#if (eq backend "convex")}}
|
|
170
|
-
VITE_CONVEX_URL:
|
|
174
|
+
VITE_CONVEX_URL: alchemy.env.VITE_CONVEX_URL,
|
|
175
|
+
{{#if (eq auth "better-auth")}}
|
|
176
|
+
VITE_CONVEX_SITE_URL: alchemy.env.VITE_CONVEX_SITE_URL,
|
|
177
|
+
{{/if}}
|
|
171
178
|
{{else if (ne backend "self")}}
|
|
172
|
-
VITE_SERVER_URL:
|
|
179
|
+
VITE_SERVER_URL: alchemy.env.VITE_SERVER_URL,
|
|
173
180
|
{{/if}}
|
|
174
|
-
},
|
|
175
|
-
dev: {
|
|
176
|
-
command: "{{packageManager}} run dev"
|
|
177
181
|
}
|
|
178
182
|
});
|
|
179
183
|
{{else if (includes frontend "react-router")}}
|
|
@@ -181,13 +185,13 @@ export const web = await ReactRouter("web", {
|
|
|
181
185
|
{{#if (eq serverDeploy "alchemy")}}cwd: "apps/web",{{/if}}
|
|
182
186
|
bindings: {
|
|
183
187
|
{{#if (eq backend "convex")}}
|
|
184
|
-
VITE_CONVEX_URL:
|
|
188
|
+
VITE_CONVEX_URL: alchemy.env.VITE_CONVEX_URL,
|
|
189
|
+
{{#if (eq auth "better-auth")}}
|
|
190
|
+
VITE_CONVEX_SITE_URL: alchemy.env.VITE_CONVEX_SITE_URL,
|
|
191
|
+
{{/if}}
|
|
185
192
|
{{else if (ne backend "self")}}
|
|
186
|
-
VITE_SERVER_URL:
|
|
193
|
+
VITE_SERVER_URL: alchemy.env.VITE_SERVER_URL,
|
|
187
194
|
{{/if}}
|
|
188
|
-
},
|
|
189
|
-
dev: {
|
|
190
|
-
command: "{{packageManager}} run dev"
|
|
191
195
|
}
|
|
192
196
|
});
|
|
193
197
|
{{else if (includes frontend "solid")}}
|
|
@@ -196,13 +200,13 @@ export const web = await Vite("web", {
|
|
|
196
200
|
assets: "dist",
|
|
197
201
|
bindings: {
|
|
198
202
|
{{#if (eq backend "convex")}}
|
|
199
|
-
VITE_CONVEX_URL:
|
|
203
|
+
VITE_CONVEX_URL: alchemy.env.VITE_CONVEX_URL,
|
|
204
|
+
{{#if (eq auth "better-auth")}}
|
|
205
|
+
VITE_CONVEX_SITE_URL: alchemy.env.VITE_CONVEX_SITE_URL,
|
|
206
|
+
{{/if}}
|
|
200
207
|
{{else if (ne backend "self")}}
|
|
201
|
-
VITE_SERVER_URL:
|
|
208
|
+
VITE_SERVER_URL: alchemy.env.VITE_SERVER_URL,
|
|
202
209
|
{{/if}}
|
|
203
|
-
},
|
|
204
|
-
dev: {
|
|
205
|
-
command: "{{packageManager}} run dev"
|
|
206
210
|
}
|
|
207
211
|
});
|
|
208
212
|
{{/if}}
|
|
@@ -217,31 +221,31 @@ export const server = await Worker("server", {
|
|
|
217
221
|
{{#if (eq dbSetup "d1")}}
|
|
218
222
|
DB: db,
|
|
219
223
|
{{else if (ne database "none")}}
|
|
220
|
-
DATABASE_URL: alchemy.secret
|
|
224
|
+
DATABASE_URL: alchemy.secret.env.DATABASE_URL,
|
|
221
225
|
{{/if}}
|
|
222
|
-
CORS_ORIGIN:
|
|
226
|
+
CORS_ORIGIN: alchemy.env.CORS_ORIGIN,
|
|
223
227
|
{{#if (eq auth "better-auth")}}
|
|
224
|
-
BETTER_AUTH_SECRET: alchemy.secret
|
|
225
|
-
BETTER_AUTH_URL:
|
|
228
|
+
BETTER_AUTH_SECRET: alchemy.secret.env.BETTER_AUTH_SECRET,
|
|
229
|
+
BETTER_AUTH_URL: alchemy.env.BETTER_AUTH_URL,
|
|
226
230
|
{{/if}}
|
|
227
231
|
{{#if (eq auth "clerk")}}
|
|
228
|
-
CLERK_SECRET_KEY: alchemy.secret
|
|
232
|
+
CLERK_SECRET_KEY: alchemy.secret.env.CLERK_SECRET_KEY,
|
|
229
233
|
{{/if}}
|
|
230
234
|
{{#if (includes examples "ai")}}
|
|
231
|
-
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret
|
|
235
|
+
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret.env.GOOGLE_GENERATIVE_AI_API_KEY,
|
|
232
236
|
{{/if}}
|
|
233
237
|
{{#if (eq payments "polar")}}
|
|
234
|
-
POLAR_ACCESS_TOKEN: alchemy.secret
|
|
235
|
-
POLAR_SUCCESS_URL:
|
|
238
|
+
POLAR_ACCESS_TOKEN: alchemy.secret.env.POLAR_ACCESS_TOKEN,
|
|
239
|
+
POLAR_SUCCESS_URL: alchemy.env.POLAR_SUCCESS_URL,
|
|
236
240
|
{{/if}}
|
|
237
241
|
{{#if (eq dbSetup "turso")}}
|
|
238
|
-
DATABASE_AUTH_TOKEN: alchemy.secret
|
|
242
|
+
DATABASE_AUTH_TOKEN: alchemy.secret.env.DATABASE_AUTH_TOKEN,
|
|
239
243
|
{{/if}}
|
|
240
244
|
{{#if (eq database "mysql")}}
|
|
241
245
|
{{#if (eq orm "drizzle")}}
|
|
242
|
-
DATABASE_HOST:
|
|
243
|
-
DATABASE_USERNAME:
|
|
244
|
-
DATABASE_PASSWORD:
|
|
246
|
+
DATABASE_HOST: alchemy.env.DATABASE_HOST,
|
|
247
|
+
DATABASE_USERNAME: alchemy.env.DATABASE_USERNAME,
|
|
248
|
+
DATABASE_PASSWORD: alchemy.secret.env.DATABASE_PASSWORD,
|
|
245
249
|
{{/if}}
|
|
246
250
|
{{/if}}
|
|
247
251
|
},
|
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
import { Checkbox } from "@/components/ui/checkbox";
|
|
10
10
|
import { Input } from "@/components/ui/input";
|
|
11
11
|
import { createFileRoute } from "@tanstack/react-router";
|
|
12
|
+
{{#if (eq backend "convex")}}
|
|
13
|
+
import { Trash2 } from "lucide-react";
|
|
14
|
+
{{else}}
|
|
12
15
|
import { Loader2, Trash2 } from "lucide-react";
|
|
16
|
+
{{/if}}
|
|
13
17
|
import { useState } from "react";
|
|
14
18
|
|
|
15
19
|
{{#if (eq backend "convex")}}
|
|
@@ -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
|
},
|
|
File without changes
|