create-better-t-stack 3.6.3 → 3.6.5
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.js +1 -1
- package/dist/{src-BN3eh8p0.js → src-CZUWfiAN.js} +22 -18
- package/package.json +1 -1
- package/templates/backend/convex/packages/backend/package.json.hbs +1 -3
- package/templates/deploy/alchemy/alchemy.run.ts.hbs +0 -4
- package/templates/frontend/native/uniwind/app/(drawer)/index.tsx.hbs +40 -2
package/dist/cli.js
CHANGED
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-
|
|
2
|
+
import { a as router, i as init, n as createBtsCli, o as sponsors, r as docs, t as builder } from "./src-CZUWfiAN.js";
|
|
3
3
|
|
|
4
4
|
export { builder, createBtsCli, docs, init, router, sponsors };
|
|
@@ -130,12 +130,12 @@ const dependencyVersionMap = {
|
|
|
130
130
|
"@trpc/server": "^11.5.0",
|
|
131
131
|
"@trpc/client": "^11.5.0",
|
|
132
132
|
next: "15.5.4",
|
|
133
|
-
convex: "^1.
|
|
134
|
-
"@convex-dev/react-query": "^0.
|
|
135
|
-
"convex-svelte": "^0.0.
|
|
133
|
+
convex: "^1.29.3",
|
|
134
|
+
"@convex-dev/react-query": "^0.1.0",
|
|
135
|
+
"convex-svelte": "^0.0.12",
|
|
136
136
|
"convex-nuxt": "0.1.5",
|
|
137
137
|
"convex-vue": "^0.1.5",
|
|
138
|
-
"@convex-dev/better-auth": "^0.9.
|
|
138
|
+
"@convex-dev/better-auth": "^0.9.7",
|
|
139
139
|
"@tanstack/svelte-query": "^5.85.3",
|
|
140
140
|
"@tanstack/svelte-query-devtools": "^5.85.3",
|
|
141
141
|
"@tanstack/vue-query-devtools": "^5.90.2",
|
|
@@ -4243,7 +4243,13 @@ async function setupApi(config) {
|
|
|
4243
4243
|
//#region src/helpers/core/backend-setup.ts
|
|
4244
4244
|
async function setupBackendDependencies(config) {
|
|
4245
4245
|
const { backend, runtime, api, auth, examples, projectDir } = config;
|
|
4246
|
-
if (backend === "convex")
|
|
4246
|
+
if (backend === "convex") {
|
|
4247
|
+
await addPackageDependency({
|
|
4248
|
+
dependencies: ["convex"],
|
|
4249
|
+
projectDir: path.join(projectDir, "packages/backend")
|
|
4250
|
+
});
|
|
4251
|
+
return;
|
|
4252
|
+
}
|
|
4247
4253
|
const framework = backend;
|
|
4248
4254
|
const serverDir = path.join(projectDir, "apps/server");
|
|
4249
4255
|
const dependencies = [];
|
|
@@ -4283,8 +4289,8 @@ async function setupBetterAuthPlugins(projectDir, config) {
|
|
|
4283
4289
|
const pluginsToAdd = [];
|
|
4284
4290
|
const importsToAdd = [];
|
|
4285
4291
|
if (config.backend === "self" && config.frontend?.includes("tanstack-start")) {
|
|
4286
|
-
pluginsToAdd.push("
|
|
4287
|
-
importsToAdd.push("import {
|
|
4292
|
+
pluginsToAdd.push("tanstackStartCookies()");
|
|
4293
|
+
importsToAdd.push("import { tanstackStartCookies } from \"better-auth/tanstack-start\";");
|
|
4288
4294
|
}
|
|
4289
4295
|
if (config.backend === "self" && config.frontend?.includes("next")) {
|
|
4290
4296
|
pluginsToAdd.push("nextCookies()");
|
|
@@ -4351,12 +4357,12 @@ async function setupAuth(config) {
|
|
|
4351
4357
|
if (convexBackendDirExists) {
|
|
4352
4358
|
await addPackageDependency({
|
|
4353
4359
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4354
|
-
customDependencies: { "better-auth": "1.3.
|
|
4360
|
+
customDependencies: { "better-auth": "1.3.34" },
|
|
4355
4361
|
projectDir: convexBackendDir
|
|
4356
4362
|
});
|
|
4357
4363
|
if (hasNativeForBA) await addPackageDependency({
|
|
4358
4364
|
dependencies: ["@better-auth/expo"],
|
|
4359
|
-
customDependencies: { "@better-auth/expo": "1.3.
|
|
4365
|
+
customDependencies: { "@better-auth/expo": "1.3.34" },
|
|
4360
4366
|
projectDir: convexBackendDir
|
|
4361
4367
|
});
|
|
4362
4368
|
}
|
|
@@ -4366,17 +4372,17 @@ async function setupAuth(config) {
|
|
|
4366
4372
|
const hasViteReactOther = frontend.some((f) => ["tanstack-router", "react-router"].includes(f));
|
|
4367
4373
|
if (hasNextJs) await addPackageDependency({
|
|
4368
4374
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4369
|
-
customDependencies: { "better-auth": "1.3.
|
|
4375
|
+
customDependencies: { "better-auth": "1.3.34" },
|
|
4370
4376
|
projectDir: clientDir
|
|
4371
4377
|
});
|
|
4372
4378
|
else if (hasTanStackStart) await addPackageDependency({
|
|
4373
4379
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4374
|
-
customDependencies: { "better-auth": "1.3.
|
|
4380
|
+
customDependencies: { "better-auth": "1.3.34" },
|
|
4375
4381
|
projectDir: clientDir
|
|
4376
4382
|
});
|
|
4377
4383
|
else if (hasViteReactOther) await addPackageDependency({
|
|
4378
4384
|
dependencies: ["better-auth", "@convex-dev/better-auth"],
|
|
4379
|
-
customDependencies: { "better-auth": "1.3.
|
|
4385
|
+
customDependencies: { "better-auth": "1.3.34" },
|
|
4380
4386
|
projectDir: clientDir
|
|
4381
4387
|
});
|
|
4382
4388
|
}
|
|
@@ -4390,8 +4396,8 @@ async function setupAuth(config) {
|
|
|
4390
4396
|
"@convex-dev/better-auth"
|
|
4391
4397
|
],
|
|
4392
4398
|
customDependencies: {
|
|
4393
|
-
"better-auth": "1.3.
|
|
4394
|
-
"@better-auth/expo": "1.3.
|
|
4399
|
+
"better-auth": "1.3.34",
|
|
4400
|
+
"@better-auth/expo": "1.3.34"
|
|
4395
4401
|
},
|
|
4396
4402
|
projectDir: nativeDir
|
|
4397
4403
|
});
|
|
@@ -6763,11 +6769,9 @@ async function createProject(options, cliInput) {
|
|
|
6763
6769
|
await setupAddonsTemplate(projectDir, options);
|
|
6764
6770
|
await setupDeploymentTemplates(projectDir, options);
|
|
6765
6771
|
await setupApi(options);
|
|
6772
|
+
if (isConvex || needsServerSetup) await setupBackendDependencies(options);
|
|
6766
6773
|
if (!isConvex) {
|
|
6767
|
-
if (needsServerSetup)
|
|
6768
|
-
await setupBackendDependencies(options);
|
|
6769
|
-
await setupRuntime(options);
|
|
6770
|
-
}
|
|
6774
|
+
if (needsServerSetup) await setupRuntime(options);
|
|
6771
6775
|
await setupDatabase(options, cliInput);
|
|
6772
6776
|
if (options.examples.length > 0 && options.examples[0] !== "none") await setupExamples(options);
|
|
6773
6777
|
}
|
package/package.json
CHANGED
|
@@ -54,7 +54,6 @@ export const web = await Nextjs("web", {
|
|
|
54
54
|
{{else if (ne backend "self")}}
|
|
55
55
|
NEXT_PUBLIC_SERVER_URL: process.env.NEXT_PUBLIC_SERVER_URL || "",
|
|
56
56
|
{{/if}}
|
|
57
|
-
{{#if (eq backend "self")}}
|
|
58
57
|
{{#if (eq dbSetup "d1")}}
|
|
59
58
|
DB: db,
|
|
60
59
|
{{else if (ne database "none")}}
|
|
@@ -85,7 +84,6 @@ export const web = await Nextjs("web", {
|
|
|
85
84
|
DATABASE_PASSWORD: process.env.DATABASE_PASSWORD || "",
|
|
86
85
|
{{/if}}
|
|
87
86
|
{{/if}}
|
|
88
|
-
{{/if}}
|
|
89
87
|
},
|
|
90
88
|
dev: {
|
|
91
89
|
command: "{{packageManager}} run dev"
|
|
@@ -128,7 +126,6 @@ export const web = await TanStackStart("web", {
|
|
|
128
126
|
{{else if (ne backend "self")}}
|
|
129
127
|
VITE_SERVER_URL: process.env.VITE_SERVER_URL || "",
|
|
130
128
|
{{/if}}
|
|
131
|
-
{{#if (eq backend "self")}}
|
|
132
129
|
{{#if (eq dbSetup "d1")}}
|
|
133
130
|
DB: db,
|
|
134
131
|
{{else if (ne database "none")}}
|
|
@@ -159,7 +156,6 @@ export const web = await TanStackStart("web", {
|
|
|
159
156
|
DATABASE_PASSWORD: process.env.DATABASE_PASSWORD || "",
|
|
160
157
|
{{/if}}
|
|
161
158
|
{{/if}}
|
|
162
|
-
{{/if}}
|
|
163
159
|
},
|
|
164
160
|
dev: {
|
|
165
161
|
command: "{{packageManager}} run dev"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Text, View } from "react-native";
|
|
1
|
+
import { Text, View, TouchableOpacity } from "react-native";
|
|
2
2
|
import { Container } from "@/components/container";
|
|
3
3
|
{{#if (eq api "orpc")}}
|
|
4
4
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -24,7 +24,7 @@ import { SignUp } from "@/components/sign-up";
|
|
|
24
24
|
import { useQuery } from "convex/react";
|
|
25
25
|
import { api } from "@{{projectName}}/backend/convex/_generated/api";
|
|
26
26
|
{{/if}}
|
|
27
|
-
{{#unless (eq backend "none")}}
|
|
27
|
+
{{#unless (or (eq backend "none") (and (eq backend "convex") (eq auth "better-auth")))}}
|
|
28
28
|
import { Ionicons } from "@expo/vector-icons";
|
|
29
29
|
{{/unless}}
|
|
30
30
|
import { Card, Chip, useThemeColor } from "heroui-native";
|
|
@@ -142,6 +142,44 @@ return (
|
|
|
142
142
|
<Text className="text-muted">Loading...</Text>
|
|
143
143
|
</AuthLoading>
|
|
144
144
|
{{/if}}
|
|
145
|
+
|
|
146
|
+
{{#if (and (eq backend "convex") (eq auth "better-auth"))}}
|
|
147
|
+
{user ? (
|
|
148
|
+
<Card variant="secondary" className="p-4 mb-4">
|
|
149
|
+
<View className="mb-2">
|
|
150
|
+
<Text className="text-foreground text-base">
|
|
151
|
+
Welcome, <Text className="font-semibold">{user.name}</Text>
|
|
152
|
+
</Text>
|
|
153
|
+
</View>
|
|
154
|
+
<Text className="text-muted text-sm mb-4">{user.email}</Text>
|
|
155
|
+
<TouchableOpacity className="bg-danger px-4 py-2 rounded-md self-start" onPress={()=> {
|
|
156
|
+
authClient.signOut();
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
159
|
+
<Text className="text-danger-foreground font-medium">Sign Out</Text>
|
|
160
|
+
</TouchableOpacity>
|
|
161
|
+
</Card>
|
|
162
|
+
) : null}
|
|
163
|
+
<Card variant="secondary" className="p-4 mb-4">
|
|
164
|
+
<Text className="text-foreground font-medium mb-2">API Status</Text>
|
|
165
|
+
<View className="flex-row items-center gap-2">
|
|
166
|
+
<View className={`w-3 h-3 rounded-full ${healthCheck==="OK" ? "bg-success" : "bg-danger" }`} />
|
|
167
|
+
<Text className="text-muted">
|
|
168
|
+
{healthCheck === undefined
|
|
169
|
+
? "Checking..."
|
|
170
|
+
: healthCheck === "OK"
|
|
171
|
+
? "Connected to API"
|
|
172
|
+
: "API Disconnected"}
|
|
173
|
+
</Text>
|
|
174
|
+
</View>
|
|
175
|
+
</Card>
|
|
176
|
+
{!user && (
|
|
177
|
+
<>
|
|
178
|
+
<SignIn />
|
|
179
|
+
<SignUp />
|
|
180
|
+
</>
|
|
181
|
+
)}
|
|
182
|
+
{{/if}}
|
|
145
183
|
</Container>
|
|
146
184
|
);
|
|
147
185
|
}
|