create-better-t-stack 2.24.0 → 2.24.2
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/index.js +26 -7
- package/package.json +1 -1
- package/templates/auth/server/base/src/lib/auth.ts.hbs +1 -1
- package/templates/frontend/native/unistyles/_gitignore +1 -1
- package/templates/frontend/native/unistyles/babel.config.js +2 -2
- package/templates/frontend/native/unistyles/package.json.hbs +19 -19
package/dist/index.js
CHANGED
|
@@ -130,6 +130,15 @@ const ADDON_COMPATIBILITY = {
|
|
|
130
130
|
starlight: [],
|
|
131
131
|
none: []
|
|
132
132
|
};
|
|
133
|
+
const WEB_FRAMEWORKS = [
|
|
134
|
+
"tanstack-router",
|
|
135
|
+
"react-router",
|
|
136
|
+
"tanstack-start",
|
|
137
|
+
"next",
|
|
138
|
+
"nuxt",
|
|
139
|
+
"svelte",
|
|
140
|
+
"solid"
|
|
141
|
+
];
|
|
133
142
|
|
|
134
143
|
//#endregion
|
|
135
144
|
//#region src/types.ts
|
|
@@ -834,6 +843,9 @@ async function getRuntimeChoice(runtime, backend) {
|
|
|
834
843
|
|
|
835
844
|
//#endregion
|
|
836
845
|
//#region src/prompts/web-deploy.ts
|
|
846
|
+
function hasWebFrontend(frontends) {
|
|
847
|
+
return frontends.some((f) => WEB_FRAMEWORKS.includes(f));
|
|
848
|
+
}
|
|
837
849
|
function getDeploymentDisplay(deployment) {
|
|
838
850
|
if (deployment === "workers") return {
|
|
839
851
|
label: "Cloudflare Workers",
|
|
@@ -844,8 +856,9 @@ function getDeploymentDisplay(deployment) {
|
|
|
844
856
|
hint: `Add ${deployment} deployment`
|
|
845
857
|
};
|
|
846
858
|
}
|
|
847
|
-
async function getDeploymentChoice(deployment, _runtime, _backend,
|
|
859
|
+
async function getDeploymentChoice(deployment, _runtime, _backend, frontend = []) {
|
|
848
860
|
if (deployment !== void 0) return deployment;
|
|
861
|
+
if (!hasWebFrontend(frontend)) return "none";
|
|
849
862
|
const options = [{
|
|
850
863
|
value: "workers",
|
|
851
864
|
label: "Cloudflare Workers",
|
|
@@ -866,7 +879,8 @@ async function getDeploymentChoice(deployment, _runtime, _backend, _frontend = [
|
|
|
866
879
|
}
|
|
867
880
|
return response;
|
|
868
881
|
}
|
|
869
|
-
async function getDeploymentToAdd(
|
|
882
|
+
async function getDeploymentToAdd(frontend, existingDeployment) {
|
|
883
|
+
if (!hasWebFrontend(frontend)) return "none";
|
|
870
884
|
const options = [];
|
|
871
885
|
if (existingDeployment !== "workers") {
|
|
872
886
|
const { label, hint } = getDeploymentDisplay("workers");
|
|
@@ -1312,7 +1326,7 @@ function processAndValidateFlags(options, providedFlags, projectName) {
|
|
|
1312
1326
|
config.frontend = [];
|
|
1313
1327
|
} else {
|
|
1314
1328
|
const validOptions = options.frontend.filter((f) => f !== "none");
|
|
1315
|
-
const webFrontends = validOptions.filter((f) => f
|
|
1329
|
+
const webFrontends = validOptions.filter((f) => WEB_FRAMEWORKS.includes(f));
|
|
1316
1330
|
const nativeFrontends = validOptions.filter((f) => f === "native-nativewind" || f === "native-unistyles");
|
|
1317
1331
|
if (webFrontends.length > 1) {
|
|
1318
1332
|
consola$1.fatal("Cannot select multiple web frameworks. Choose only one of: tanstack-router, tanstack-start, react-router, next, nuxt, svelte, solid");
|
|
@@ -1473,6 +1487,11 @@ function processAndValidateFlags(options, providedFlags, projectName) {
|
|
|
1473
1487
|
consola$1.fatal("MongoDB database is not compatible with Cloudflare Workers runtime. MongoDB requires Prisma or Mongoose ORM, but Workers runtime only supports Drizzle ORM. Please use a different database or runtime.");
|
|
1474
1488
|
process.exit(1);
|
|
1475
1489
|
}
|
|
1490
|
+
const hasWebFrontendFlag = (config.frontend ?? []).some((f) => WEB_FRAMEWORKS.includes(f));
|
|
1491
|
+
if (config.webDeploy && config.webDeploy !== "none" && !hasWebFrontendFlag) {
|
|
1492
|
+
consola$1.fatal("'--web-deploy' requires a web frontend. Please select a web frontend or set '--web-deploy none'.");
|
|
1493
|
+
process.exit(1);
|
|
1494
|
+
}
|
|
1476
1495
|
return config;
|
|
1477
1496
|
}
|
|
1478
1497
|
function getProvidedFlags(options) {
|
|
@@ -2827,7 +2846,7 @@ async function setupAuth(config) {
|
|
|
2827
2846
|
dependencies: ["better-auth"],
|
|
2828
2847
|
projectDir: serverDir
|
|
2829
2848
|
});
|
|
2830
|
-
const hasWebFrontend = frontend.some((f) => [
|
|
2849
|
+
const hasWebFrontend$1 = frontend.some((f) => [
|
|
2831
2850
|
"react-router",
|
|
2832
2851
|
"tanstack-router",
|
|
2833
2852
|
"tanstack-start",
|
|
@@ -2836,7 +2855,7 @@ async function setupAuth(config) {
|
|
|
2836
2855
|
"svelte",
|
|
2837
2856
|
"solid"
|
|
2838
2857
|
].includes(f));
|
|
2839
|
-
if (hasWebFrontend && clientDirExists) await addPackageDependency({
|
|
2858
|
+
if (hasWebFrontend$1 && clientDirExists) await addPackageDependency({
|
|
2840
2859
|
dependencies: ["better-auth"],
|
|
2841
2860
|
projectDir: clientDir
|
|
2842
2861
|
});
|
|
@@ -2959,8 +2978,8 @@ async function setupEnvironmentVariables(config) {
|
|
|
2959
2978
|
const hasNuxt = frontend.includes("nuxt");
|
|
2960
2979
|
const hasSvelte = frontend.includes("svelte");
|
|
2961
2980
|
const hasSolid = frontend.includes("solid");
|
|
2962
|
-
const hasWebFrontend = hasReactRouter || hasTanStackRouter || hasTanStackStart || hasNextJs || hasNuxt || hasSolid || hasSvelte;
|
|
2963
|
-
if (hasWebFrontend) {
|
|
2981
|
+
const hasWebFrontend$1 = hasReactRouter || hasTanStackRouter || hasTanStackStart || hasNextJs || hasNuxt || hasSolid || hasSvelte;
|
|
2982
|
+
if (hasWebFrontend$1) {
|
|
2964
2983
|
const clientDir = path.join(projectDir, "apps/web");
|
|
2965
2984
|
if (await fs.pathExists(clientDir)) {
|
|
2966
2985
|
let envVarName = "VITE_SERVER_URL";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.2",
|
|
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",
|
|
@@ -68,7 +68,7 @@ import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
|
68
68
|
{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
|
|
69
69
|
import { expo } from "@better-auth/expo";
|
|
70
70
|
{{/if}}
|
|
71
|
-
import { db } from "
|
|
71
|
+
import { db } from "../db";
|
|
72
72
|
import * as schema from "../db/schema/auth";
|
|
73
73
|
import { env } from "cloudflare:workers";
|
|
74
74
|
|
|
@@ -9,40 +9,40 @@
|
|
|
9
9
|
"web": "expo start --web"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@expo/vector-icons": "^14.
|
|
13
|
-
"@react-navigation/bottom-tabs": "^7.
|
|
14
|
-
"@react-navigation/drawer": "^7.
|
|
15
|
-
"@react-navigation/native": "^7.
|
|
12
|
+
"@expo/vector-icons": "^14.1.0",
|
|
13
|
+
"@react-navigation/bottom-tabs": "^7.3.10",
|
|
14
|
+
"@react-navigation/drawer": "^7.3.9",
|
|
15
|
+
"@react-navigation/native": "^7.1.6",
|
|
16
16
|
{{#if (includes examples "ai")}}
|
|
17
17
|
"@stardazed/streams-text-encoding": "^1.0.2",
|
|
18
18
|
"@ungap/structured-clone": "^1.3.0",
|
|
19
19
|
{{/if}}
|
|
20
|
-
"@tanstack/react-form": "^1.0
|
|
21
|
-
"babel-plugin-react-compiler": "^19.
|
|
22
|
-
"expo": "^53.0.
|
|
23
|
-
"expo-constants": "~17.1.
|
|
24
|
-
"expo-linking": "~7.1.
|
|
25
|
-
"expo-router": "~5.
|
|
20
|
+
"@tanstack/react-form": "^1.14.0",
|
|
21
|
+
"babel-plugin-react-compiler": "^19.1.0-rc.2",
|
|
22
|
+
"expo": "^53.0.17",
|
|
23
|
+
"expo-constants": "~17.1.7",
|
|
24
|
+
"expo-linking": "~7.1.7",
|
|
25
|
+
"expo-router": "~5.1.3",
|
|
26
26
|
"expo-secure-store": "~14.2.3",
|
|
27
27
|
"expo-status-bar": "~2.2.3",
|
|
28
|
-
"expo-system-ui": "~5.0.
|
|
29
|
-
"expo-dev-client": "~5.
|
|
30
|
-
"expo-web-browser": "~14.
|
|
28
|
+
"expo-system-ui": "~5.0.10",
|
|
29
|
+
"expo-dev-client": "~5.2.4",
|
|
30
|
+
"expo-web-browser": "~14.2.0",
|
|
31
31
|
"react": "19.0.0",
|
|
32
32
|
"react-dom": "19.0.0",
|
|
33
|
-
"react-native": "0.79.
|
|
33
|
+
"react-native": "0.79.5",
|
|
34
34
|
"react-native-edge-to-edge": "1.6.0",
|
|
35
35
|
"react-native-gesture-handler": "~2.24.0",
|
|
36
|
-
"react-native-nitro-modules": "0.
|
|
36
|
+
"react-native-nitro-modules": "0.26.3",
|
|
37
37
|
"react-native-reanimated": "~3.17.4",
|
|
38
38
|
"react-native-safe-area-context": "5.4.0",
|
|
39
|
-
"react-native-screens": "~4.
|
|
40
|
-
"react-native-unistyles": "^3.0.0
|
|
39
|
+
"react-native-screens": "~4.11.1",
|
|
40
|
+
"react-native-unistyles": "^3.0.0",
|
|
41
41
|
"react-native-web": "^0.20.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"ajv": "^8.
|
|
45
|
-
"@babel/core": "^7.
|
|
44
|
+
"ajv": "^8.17.1",
|
|
45
|
+
"@babel/core": "^7.28.0",
|
|
46
46
|
"@types/react": "~19.0.10",
|
|
47
47
|
"typescript": "~5.8.3"
|
|
48
48
|
},
|