Skip to content

Commit ad1d28f

Browse files
fix(cli): comment isolated linker in bunfig.toml when native-nativewind
is selected
1 parent c8260d7 commit ad1d28f

File tree

10 files changed

+203
-271
lines changed

10 files changed

+203
-271
lines changed

.changeset/sour-ducks-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-better-t-stack": patch
3+
---
4+
5+
Comment isolated linker in bunfig.toml when native-nativewind is selected

apps/cli/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"prepublishOnly": "npm run build"
5454
},
5555
"dependencies": {
56-
"@better-t-stack/types": "workspace:*",
5756
"@clack/prompts": "^0.11.0",
5857
"consola": "^3.4.2",
5958
"execa": "^9.6.0",
@@ -63,15 +62,15 @@
6362
"handlebars": "^4.7.8",
6463
"jsonc-parser": "^3.3.1",
6564
"picocolors": "^1.1.1",
66-
"posthog-node": "^5.6.0",
67-
"trpc-cli": "^0.10.2",
65+
"posthog-node": "^5.5.0",
66+
"trpc-cli": "^0.10.0",
6867
"ts-morph": "^26.0.0",
69-
"zod": "^4.0.14"
68+
"zod": "^4.0.5"
7069
},
7170
"devDependencies": {
7271
"@types/fs-extra": "^11.0.4",
73-
"@types/node": "^24.2.0",
74-
"tsdown": "^0.13.3",
75-
"typescript": "^5.9.2"
72+
"@types/node": "^24.0.13",
73+
"tsdown": "^0.12.9",
74+
"typescript": "^5.8.3"
7675
}
7776
}

apps/cli/src/types.ts

Lines changed: 180 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,180 @@
1-
export * from "@better-t-stack/types";
1+
import z from "zod";
2+
3+
export const DatabaseSchema = z
4+
.enum(["none", "sqlite", "postgres", "mysql", "mongodb"])
5+
.describe("Database type");
6+
export type Database = z.infer<typeof DatabaseSchema>;
7+
8+
export const ORMSchema = z
9+
.enum(["drizzle", "prisma", "mongoose", "none"])
10+
.describe("ORM type");
11+
export type ORM = z.infer<typeof ORMSchema>;
12+
13+
export const BackendSchema = z
14+
.enum(["hono", "express", "fastify", "next", "elysia", "convex", "none"])
15+
.describe("Backend framework");
16+
export type Backend = z.infer<typeof BackendSchema>;
17+
18+
export const RuntimeSchema = z
19+
.enum(["bun", "node", "workers", "none"])
20+
.describe(
21+
"Runtime environment (workers only available with hono backend and drizzle orm)",
22+
);
23+
export type Runtime = z.infer<typeof RuntimeSchema>;
24+
25+
export const FrontendSchema = z
26+
.enum([
27+
"tanstack-router",
28+
"react-router",
29+
"tanstack-start",
30+
"next",
31+
"nuxt",
32+
"native-nativewind",
33+
"native-unistyles",
34+
"svelte",
35+
"solid",
36+
"none",
37+
])
38+
.describe("Frontend framework");
39+
export type Frontend = z.infer<typeof FrontendSchema>;
40+
41+
export const AddonsSchema = z
42+
.enum([
43+
"pwa",
44+
"tauri",
45+
"starlight",
46+
"biome",
47+
"husky",
48+
"turborepo",
49+
"fumadocs",
50+
"ultracite",
51+
"oxlint",
52+
"none",
53+
])
54+
.describe("Additional addons");
55+
export type Addons = z.infer<typeof AddonsSchema>;
56+
57+
export const ExamplesSchema = z
58+
.enum(["todo", "ai", "none"])
59+
.describe("Example templates to include");
60+
export type Examples = z.infer<typeof ExamplesSchema>;
61+
62+
export const PackageManagerSchema = z
63+
.enum(["npm", "pnpm", "bun"])
64+
.describe("Package manager");
65+
export type PackageManager = z.infer<typeof PackageManagerSchema>;
66+
67+
export const DatabaseSetupSchema = z
68+
.enum([
69+
"turso",
70+
"neon",
71+
"prisma-postgres",
72+
"mongodb-atlas",
73+
"supabase",
74+
"d1",
75+
"docker",
76+
"none",
77+
])
78+
.describe("Database hosting setup");
79+
export type DatabaseSetup = z.infer<typeof DatabaseSetupSchema>;
80+
81+
export const APISchema = z.enum(["trpc", "orpc", "none"]).describe("API type");
82+
export type API = z.infer<typeof APISchema>;
83+
84+
export const ProjectNameSchema = z
85+
.string()
86+
.min(1, "Project name cannot be empty")
87+
.max(255, "Project name must be less than 255 characters")
88+
.refine(
89+
(name) => name === "." || !name.startsWith("."),
90+
"Project name cannot start with a dot (except for '.')",
91+
)
92+
.refine(
93+
(name) => name === "." || !name.startsWith("-"),
94+
"Project name cannot start with a dash",
95+
)
96+
.refine((name) => {
97+
const invalidChars = ["<", ">", ":", '"', "|", "?", "*"];
98+
return !invalidChars.some((char) => name.includes(char));
99+
}, "Project name contains invalid characters")
100+
.refine(
101+
(name) => name.toLowerCase() !== "node_modules",
102+
"Project name is reserved",
103+
)
104+
.describe("Project name or path");
105+
export type ProjectName = z.infer<typeof ProjectNameSchema>;
106+
107+
export const WebDeploySchema = z
108+
.enum(["workers", "none"])
109+
.describe("Web deployment");
110+
export type WebDeploy = z.infer<typeof WebDeploySchema>;
111+
112+
export type CreateInput = {
113+
projectName?: string;
114+
yes?: boolean;
115+
database?: Database;
116+
orm?: ORM;
117+
auth?: boolean;
118+
frontend?: Frontend[];
119+
addons?: Addons[];
120+
examples?: Examples[];
121+
git?: boolean;
122+
packageManager?: PackageManager;
123+
install?: boolean;
124+
dbSetup?: DatabaseSetup;
125+
backend?: Backend;
126+
runtime?: Runtime;
127+
api?: API;
128+
webDeploy?: WebDeploy;
129+
};
130+
131+
export type AddInput = {
132+
addons?: Addons[];
133+
webDeploy?: WebDeploy;
134+
projectDir?: string;
135+
install?: boolean;
136+
packageManager?: PackageManager;
137+
};
138+
139+
export type CLIInput = CreateInput & {
140+
projectDirectory?: string;
141+
};
142+
143+
export interface ProjectConfig {
144+
projectName: string;
145+
projectDir: string;
146+
relativePath: string;
147+
database: Database;
148+
orm: ORM;
149+
backend: Backend;
150+
runtime: Runtime;
151+
frontend: Frontend[];
152+
addons: Addons[];
153+
examples: Examples[];
154+
auth: boolean;
155+
git: boolean;
156+
packageManager: PackageManager;
157+
install: boolean;
158+
dbSetup: DatabaseSetup;
159+
api: API;
160+
webDeploy: WebDeploy;
161+
}
162+
163+
export interface BetterTStackConfig {
164+
version: string;
165+
createdAt: string;
166+
database: Database;
167+
orm: ORM;
168+
backend: Backend;
169+
runtime: Runtime;
170+
frontend: Frontend[];
171+
addons: Addons[];
172+
examples: Examples[];
173+
auth: boolean;
174+
packageManager: PackageManager;
175+
dbSetup: DatabaseSetup;
176+
api: API;
177+
webDeploy: WebDeploy;
178+
}
179+
180+
export type AvailablePackageManagers = "npm" | "pnpm" | "bun";

apps/cli/templates/extras/bunfig.toml.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{#if (includes frontend "nuxt")}}
1+
{{#if (or (includes frontend "nuxt") (includes frontend "native-nativewind"))}}
22
# [install]
33
# linker = "isolated"
44
{{else}}

apps/web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
},
1717
"dependencies": {
1818
"@better-t-stack/backend": "workspace:*",
19-
"@better-t-stack/types": "workspace:*",
2019
"@erquhart/convex-oss-stats": "^0.8.1",
2120
"@number-flow/react": "^0.5.10",
2221
"@opennextjs/cloudflare": "^1.6.3",

apps/web/scripts/generate-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
PackageManagerSchema,
1515
RuntimeSchema,
1616
WebDeploySchema,
17-
} from "@better-t-stack/types";
17+
} from "../../cli/src/types";
1818

1919
const DATABASE_VALUES = DatabaseSchema.options;
2020
const ORM_VALUES = ORMSchema.options;

0 commit comments

Comments
 (0)