fix(cli): comment isolated linker in bunfig.toml when native-nativewind

is selected
This commit is contained in:
Aman Varshney
2025-08-05 14:12:48 +05:30
parent c8260d7517
commit ad1d28ff28
10 changed files with 203 additions and 271 deletions

View File

@@ -53,7 +53,6 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@better-t-stack/types": "workspace:*",
"@clack/prompts": "^0.11.0",
"consola": "^3.4.2",
"execa": "^9.6.0",
@@ -63,15 +62,15 @@
"handlebars": "^4.7.8",
"jsonc-parser": "^3.3.1",
"picocolors": "^1.1.1",
"posthog-node": "^5.6.0",
"trpc-cli": "^0.10.2",
"posthog-node": "^5.5.0",
"trpc-cli": "^0.10.0",
"ts-morph": "^26.0.0",
"zod": "^4.0.14"
"zod": "^4.0.5"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
"@types/node": "^24.2.0",
"tsdown": "^0.13.3",
"typescript": "^5.9.2"
"@types/node": "^24.0.13",
"tsdown": "^0.12.9",
"typescript": "^5.8.3"
}
}

View File

@@ -1 +1,180 @@
export * from "@better-t-stack/types";
import z from "zod";
export const DatabaseSchema = z
.enum(["none", "sqlite", "postgres", "mysql", "mongodb"])
.describe("Database type");
export type Database = z.infer<typeof DatabaseSchema>;
export const ORMSchema = z
.enum(["drizzle", "prisma", "mongoose", "none"])
.describe("ORM type");
export type ORM = z.infer<typeof ORMSchema>;
export const BackendSchema = z
.enum(["hono", "express", "fastify", "next", "elysia", "convex", "none"])
.describe("Backend framework");
export type Backend = z.infer<typeof BackendSchema>;
export const RuntimeSchema = z
.enum(["bun", "node", "workers", "none"])
.describe(
"Runtime environment (workers only available with hono backend and drizzle orm)",
);
export type Runtime = z.infer<typeof RuntimeSchema>;
export const FrontendSchema = z
.enum([
"tanstack-router",
"react-router",
"tanstack-start",
"next",
"nuxt",
"native-nativewind",
"native-unistyles",
"svelte",
"solid",
"none",
])
.describe("Frontend framework");
export type Frontend = z.infer<typeof FrontendSchema>;
export const AddonsSchema = z
.enum([
"pwa",
"tauri",
"starlight",
"biome",
"husky",
"turborepo",
"fumadocs",
"ultracite",
"oxlint",
"none",
])
.describe("Additional addons");
export type Addons = z.infer<typeof AddonsSchema>;
export const ExamplesSchema = z
.enum(["todo", "ai", "none"])
.describe("Example templates to include");
export type Examples = z.infer<typeof ExamplesSchema>;
export const PackageManagerSchema = z
.enum(["npm", "pnpm", "bun"])
.describe("Package manager");
export type PackageManager = z.infer<typeof PackageManagerSchema>;
export const DatabaseSetupSchema = z
.enum([
"turso",
"neon",
"prisma-postgres",
"mongodb-atlas",
"supabase",
"d1",
"docker",
"none",
])
.describe("Database hosting setup");
export type DatabaseSetup = z.infer<typeof DatabaseSetupSchema>;
export const APISchema = z.enum(["trpc", "orpc", "none"]).describe("API type");
export type API = z.infer<typeof APISchema>;
export const ProjectNameSchema = z
.string()
.min(1, "Project name cannot be empty")
.max(255, "Project name must be less than 255 characters")
.refine(
(name) => name === "." || !name.startsWith("."),
"Project name cannot start with a dot (except for '.')",
)
.refine(
(name) => name === "." || !name.startsWith("-"),
"Project name cannot start with a dash",
)
.refine((name) => {
const invalidChars = ["<", ">", ":", '"', "|", "?", "*"];
return !invalidChars.some((char) => name.includes(char));
}, "Project name contains invalid characters")
.refine(
(name) => name.toLowerCase() !== "node_modules",
"Project name is reserved",
)
.describe("Project name or path");
export type ProjectName = z.infer<typeof ProjectNameSchema>;
export const WebDeploySchema = z
.enum(["workers", "none"])
.describe("Web deployment");
export type WebDeploy = z.infer<typeof WebDeploySchema>;
export type CreateInput = {
projectName?: string;
yes?: boolean;
database?: Database;
orm?: ORM;
auth?: boolean;
frontend?: Frontend[];
addons?: Addons[];
examples?: Examples[];
git?: boolean;
packageManager?: PackageManager;
install?: boolean;
dbSetup?: DatabaseSetup;
backend?: Backend;
runtime?: Runtime;
api?: API;
webDeploy?: WebDeploy;
};
export type AddInput = {
addons?: Addons[];
webDeploy?: WebDeploy;
projectDir?: string;
install?: boolean;
packageManager?: PackageManager;
};
export type CLIInput = CreateInput & {
projectDirectory?: string;
};
export interface ProjectConfig {
projectName: string;
projectDir: string;
relativePath: string;
database: Database;
orm: ORM;
backend: Backend;
runtime: Runtime;
frontend: Frontend[];
addons: Addons[];
examples: Examples[];
auth: boolean;
git: boolean;
packageManager: PackageManager;
install: boolean;
dbSetup: DatabaseSetup;
api: API;
webDeploy: WebDeploy;
}
export interface BetterTStackConfig {
version: string;
createdAt: string;
database: Database;
orm: ORM;
backend: Backend;
runtime: Runtime;
frontend: Frontend[];
addons: Addons[];
examples: Examples[];
auth: boolean;
packageManager: PackageManager;
dbSetup: DatabaseSetup;
api: API;
webDeploy: WebDeploy;
}
export type AvailablePackageManagers = "npm" | "pnpm" | "bun";

View File

@@ -1,4 +1,4 @@
{{#if (includes frontend "nuxt")}}
{{#if (or (includes frontend "nuxt") (includes frontend "native-nativewind"))}}
# [install]
# linker = "isolated"
{{else}}