diff --git a/apps/cli/package.json b/apps/cli/package.json index debb49022..fb7bf06e5 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,90 +1,90 @@ { - "name": "create-better-t-stack", - "version": "2.44.0", - "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations", - "type": "module", - "license": "MIT", - "author": "Aman Varshney", - "bin": { - "create-better-t-stack": "dist/cli.js" - }, - "files": [ - "templates", - "dist" - ], - "keywords": [ - "better-t-stack", - "typescript", - "boilerplate", - "starter", - "cli", - "turborepo", - "trpc", - "better-auth", - "monorepo", - "fullstack", - "type-safety", - "react", - "react-native", - "expo", - "hono", - "elysia", - "drizzle", - "prisma", - "tanstack", - "tailwind", - "shadcn", - "pwa", - "tauri", - "biome" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/AmanVarshney01/create-better-t-stack.git", - "directory": "apps/cli" - }, - "publishConfig": { - "access": "public" - }, - "homepage": "https://better-t-stack.dev/", - "scripts": { - "build": "tsdown", - "dev": "tsdown --watch", - "check-types": "tsc --noEmit", - "check": "biome check --write .", - "test": "bun run build && vitest run", - "test:ui": "bun run build && vitest --ui", - "test:with-build": "bun run build && WITH_BUILD=1 vitest --ui", - "prepublishOnly": "npm run build" - }, - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js" - } - }, - "dependencies": { - "@biomejs/js-api": "^3.0.0", - "@biomejs/wasm-nodejs": "^2.2.4", - "@clack/prompts": "^1.0.0-alpha.4", - "consola": "^3.4.2", - "execa": "^9.6.0", - "fs-extra": "^11.3.1", - "gradient-string": "^3.0.0", - "handlebars": "^4.7.8", - "jsonc-parser": "^3.3.1", - "picocolors": "^1.1.1", - "tinyglobby": "^0.2.15", - "trpc-cli": "^0.10.2", - "ts-morph": "^27.0.0", - "zod": "^4.1.5" - }, - "devDependencies": { - "@types/fs-extra": "^11.0.4", - "@types/node": "^24.3.1", - "@vitest/ui": "^3.2.4", - "tsdown": "^0.14.2", - "typescript": "^5.9.2", - "vitest": "^3.2.4" - } + "name": "create-better-t-stack", + "version": "2.44.0", + "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations", + "type": "module", + "license": "MIT", + "author": "Aman Varshney", + "bin": { + "create-better-t-stack": "dist/cli.js" + }, + "files": [ + "templates", + "dist" + ], + "keywords": [ + "better-t-stack", + "typescript", + "boilerplate", + "starter", + "cli", + "turborepo", + "trpc", + "better-auth", + "monorepo", + "fullstack", + "type-safety", + "react", + "react-native", + "expo", + "hono", + "elysia", + "drizzle", + "prisma", + "tanstack", + "tailwind", + "shadcn", + "pwa", + "tauri", + "biome" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/AmanVarshney01/create-better-t-stack.git", + "directory": "apps/cli" + }, + "publishConfig": { + "access": "public" + }, + "homepage": "https://better-t-stack.dev/", + "scripts": { + "build": "tsdown", + "dev": "tsdown --watch", + "check-types": "tsc --noEmit", + "check": "biome check --write .", + "test": "bun run build && vitest run", + "test:ui": "bun run build && vitest --ui", + "test:with-build": "bun run build && WITH_BUILD=1 vitest --ui", + "prepublishOnly": "npm run build" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + }, + "dependencies": { + "@biomejs/js-api": "^3.0.0", + "@biomejs/wasm-nodejs": "^2.2.4", + "@clack/prompts": "^1.0.0-alpha.4", + "consola": "^3.4.2", + "execa": "^9.6.0", + "fs-extra": "^11.3.1", + "gradient-string": "^3.0.0", + "handlebars": "^4.7.8", + "jsonc-parser": "^3.3.1", + "picocolors": "^1.1.1", + "tinyglobby": "^0.2.15", + "trpc-cli": "^0.10.2", + "ts-morph": "^27.0.0", + "zod": "^4.1.5" + }, + "devDependencies": { + "@types/fs-extra": "^11.0.4", + "@types/node": "^24.3.1", + "@vitest/ui": "^3.2.4", + "tsdown": "^0.14.2", + "typescript": "^5.9.2", + "vitest": "^3.2.4" + } } diff --git a/apps/cli/src/helpers/core/template-manager.ts b/apps/cli/src/helpers/core/template-manager.ts index b93075f43..c90e0eb3d 100644 --- a/apps/cli/src/helpers/core/template-manager.ts +++ b/apps/cli/src/helpers/core/template-manager.ts @@ -851,7 +851,7 @@ export async function handleExtras(projectDir: string, context: ProjectConfig) { const pnpmWorkspaceSrc = path.join(extrasDir, "pnpm-workspace.yaml"); const pnpmWorkspaceDest = path.join(projectDir, "pnpm-workspace.yaml"); if (await fs.pathExists(pnpmWorkspaceSrc)) { - await fs.copy(pnpmWorkspaceSrc, pnpmWorkspaceDest); + await processTemplate(pnpmWorkspaceSrc, pnpmWorkspaceDest, context); } } diff --git a/apps/cli/src/utils/template-processor.ts b/apps/cli/src/utils/template-processor.ts index 8505e9fe5..85df96aa2 100644 --- a/apps/cli/src/utils/template-processor.ts +++ b/apps/cli/src/utils/template-processor.ts @@ -5,6 +5,15 @@ import handlebars from "handlebars"; import type { ProjectConfig } from "../types"; import { formatFileWithBiome } from "./biome-formatter"; +const BINARY_EXTENSIONS = new Set([ + ".png", ".ico", ".svg", +]); + +function isBinaryFile(filePath: string): boolean { + const ext = path.extname(filePath).toLowerCase(); + return BINARY_EXTENSIONS.has(ext); +} + export async function processTemplate( srcPath: string, destPath: string, @@ -13,6 +22,11 @@ export async function processTemplate( try { await fs.ensureDir(path.dirname(destPath)); + if (isBinaryFile(srcPath) && !srcPath.endsWith(".hbs")) { + await fs.copy(srcPath, destPath); + return; + } + let content: string; if (srcPath.endsWith(".hbs")) { diff --git a/apps/cli/templates/auth/better-auth/native/native-base/lib/auth-client.ts.hbs b/apps/cli/templates/auth/better-auth/native/native-base/lib/auth-client.ts.hbs index 8d1b7bd82..8b5584f8e 100644 --- a/apps/cli/templates/auth/better-auth/native/native-base/lib/auth-client.ts.hbs +++ b/apps/cli/templates/auth/better-auth/native/native-base/lib/auth-client.ts.hbs @@ -1,12 +1,13 @@ -import { createAuthClient } from "better-auth/react"; import { expoClient } from "@better-auth/expo/client"; +import { createAuthClient } from "better-auth/react"; import * as SecureStore from "expo-secure-store"; export const authClient = createAuthClient({ baseURL: process.env.EXPO_PUBLIC_SERVER_URL, plugins: [ expoClient({ - storagePrefix: "my-better-t-app", + scheme: "mybettertapp", + storagePrefix: "{{projectName}}", storage: SecureStore, }), ], diff --git a/apps/cli/templates/auth/better-auth/server/base/src/lib/auth.ts.hbs b/apps/cli/templates/auth/better-auth/server/base/src/lib/auth.ts.hbs index 2d876f560..c4399812d 100644 --- a/apps/cli/templates/auth/better-auth/server/base/src/lib/auth.ts.hbs +++ b/apps/cli/templates/auth/better-auth/server/base/src/lib/auth.ts.hbs @@ -16,7 +16,7 @@ export const auth = betterAuth({ trustedOrigins: [ process.env.CORS_ORIGIN || "", {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} - "my-better-t-app://", + "mybettertapp://", "exp://" {{/if}} ], emailAndPassword: { @@ -55,7 +55,7 @@ export const auth = betterAuth({ trustedOrigins: [ process.env.CORS_ORIGIN || "", {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} - "my-better-t-app://", + "mybettertapp://", "exp://" {{/if}} ], emailAndPassword: { @@ -124,7 +124,7 @@ export const auth = betterAuth({ trustedOrigins: [ process.env.CORS_ORIGIN || "", {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} - "my-better-t-app://", + "mybettertapp://", "exp://" {{/if}} ], emailAndPassword: { @@ -154,7 +154,7 @@ export const auth = betterAuth({ trustedOrigins: [ process.env.CORS_ORIGIN || "", {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} - "my-better-t-app://", + "mybettertapp://", "exp://" {{/if}} ], emailAndPassword: { @@ -171,4 +171,4 @@ export const auth = betterAuth({ , plugins: [expo()] {{/if}} }); -{{/if}} \ No newline at end of file +{{/if}} diff --git a/apps/cli/templates/backend/server/next/package.json.hbs b/apps/cli/templates/backend/server/next/package.json.hbs index 885cb31da..7c9860590 100644 --- a/apps/cli/templates/backend/server/next/package.json.hbs +++ b/apps/cli/templates/backend/server/next/package.json.hbs @@ -9,8 +9,8 @@ }, "dependencies": { "next": "15.5.0", - "react": "^19.0.0", - "react-dom": "^19.0.0", + "react": "19.1.0", + "react-dom": "19.1.0", "dotenv": "^17.2.1" }, {{#if (eq dbSetup 'supabase')}} @@ -20,7 +20,7 @@ {{/if}} "devDependencies": { "@types/node": "^20", - "@types/react": "^19", + "@types/react": "~19.1.10", "zod": "^4.0.13", "typescript": "^5" } diff --git a/apps/cli/templates/frontend/native/native-base/assets/favicon.png b/apps/cli/templates/frontend/native/native-base/assets/favicon.png deleted file mode 100644 index 9dbf6dd6c..000000000 Binary files a/apps/cli/templates/frontend/native/native-base/assets/favicon.png and /dev/null differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/icon.png b/apps/cli/templates/frontend/native/native-base/assets/icon.png deleted file mode 100644 index a0b1526fc..000000000 Binary files a/apps/cli/templates/frontend/native/native-base/assets/icon.png and /dev/null differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-background.png b/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-background.png new file mode 100644 index 000000000..5ffefc5bb Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-background.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-foreground.png b/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-foreground.png new file mode 100644 index 000000000..3a9e5016d Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-foreground.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-monochrome.png b/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-monochrome.png new file mode 100644 index 000000000..77484ebdb Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/android-icon-monochrome.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/favicon.png b/apps/cli/templates/frontend/native/native-base/assets/images/favicon.png new file mode 100644 index 000000000..408bd7466 Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/favicon.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/icon.png b/apps/cli/templates/frontend/native/native-base/assets/images/icon.png new file mode 100644 index 000000000..7165a53c7 Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/icon.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/partial-react-logo.png b/apps/cli/templates/frontend/native/native-base/assets/images/partial-react-logo.png new file mode 100644 index 000000000..66fd9570e Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/partial-react-logo.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/react-logo.png b/apps/cli/templates/frontend/native/native-base/assets/images/react-logo.png new file mode 100644 index 000000000..9d72a9ffc Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/react-logo.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/react-logo@2x.png b/apps/cli/templates/frontend/native/native-base/assets/images/react-logo@2x.png new file mode 100644 index 000000000..2229b130a Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/react-logo@2x.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/images/react-logo@3x.png b/apps/cli/templates/frontend/native/native-base/assets/images/react-logo@3x.png new file mode 100644 index 000000000..a99b20322 Binary files /dev/null and b/apps/cli/templates/frontend/native/native-base/assets/images/react-logo@3x.png differ diff --git a/apps/cli/templates/frontend/native/native-base/assets/adaptive-icon.png b/apps/cli/templates/frontend/native/native-base/assets/images/splash-icon.png similarity index 100% rename from apps/cli/templates/frontend/native/native-base/assets/adaptive-icon.png rename to apps/cli/templates/frontend/native/native-base/assets/images/splash-icon.png diff --git a/apps/cli/templates/frontend/native/native-base/assets/splash.png b/apps/cli/templates/frontend/native/native-base/assets/splash.png deleted file mode 100644 index 0e89705a9..000000000 Binary files a/apps/cli/templates/frontend/native/native-base/assets/splash.png and /dev/null differ diff --git a/apps/cli/templates/frontend/native/nativewind/app-env.d.ts b/apps/cli/templates/frontend/native/nativewind/app-env.d.ts deleted file mode 100644 index 88dc403ea..000000000 --- a/apps/cli/templates/frontend/native/nativewind/app-env.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @ts-ignore -/// diff --git a/apps/cli/templates/frontend/native/nativewind/app.json b/apps/cli/templates/frontend/native/nativewind/app.json deleted file mode 100644 index 3d89aa638..000000000 --- a/apps/cli/templates/frontend/native/nativewind/app.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "expo": { - "name": "my-better-t-app", - "slug": "my-better-t-app", - "version": "1.0.0", - "scheme": "my-better-t-app", - "web": { - "bundler": "metro", - "output": "static", - "favicon": "./assets/favicon.png" - }, - "plugins": [ - "expo-router", - "expo-secure-store", - "expo-web-browser" - ], - "experiments": { - "typedRoutes": true, - "tsconfigPaths": true - }, - "newArchEnabled": true, - "orientation": "portrait", - "icon": "./assets/icon.png", - "userInterfaceStyle": "light", - "splash": { - "image": "./assets/splash.png", - "resizeMode": "contain", - "backgroundColor": "#ffffff" - }, - "assetBundlePatterns": [ - "**/*" - ], - "ios": { - "supportsTablet": true, - "bundleIdentifier": "com.amanvarshney01.mybettertapp" - }, - "android": { - "adaptiveIcon": { - "foregroundImage": "./assets/adaptive-icon.png", - "backgroundColor": "#ffffff" - }, - "package": "com.amanvarshney01.mybettertapp", - "edgeToEdgeEnabled": true - } - } -} diff --git a/apps/cli/templates/frontend/native/nativewind/app.json.hbs b/apps/cli/templates/frontend/native/nativewind/app.json.hbs new file mode 100644 index 000000000..86a6b10ab --- /dev/null +++ b/apps/cli/templates/frontend/native/nativewind/app.json.hbs @@ -0,0 +1,49 @@ +{ + "expo": { + "name": "{{projectName}}", + "slug": "{{projectName}}", + "version": "1.0.0", + "orientation": "portrait", + "icon": "./assets/images/icon.png", + "scheme": "mybettertapp", + "userInterfaceStyle": "automatic", + "newArchEnabled": true, + "ios": { + "supportsTablet": true + }, + "android": { + "adaptiveIcon": { + "backgroundColor": "#E6F4FE", + "foregroundImage": "./assets/images/android-icon-foreground.png", + "backgroundImage": "./assets/images/android-icon-background.png", + "monochromeImage": "./assets/images/android-icon-monochrome.png" + }, + "edgeToEdgeEnabled": true, + "predictiveBackGestureEnabled": false, + "package": "com.anonymous.mybettertapp" + }, + "web": { + "output": "static", + "favicon": "./assets/images/favicon.png" + }, + "plugins": [ + "expo-router", + [ + "expo-splash-screen", + { + "image": "./assets/images/splash-icon.png", + "imageWidth": 200, + "resizeMode": "contain", + "backgroundColor": "#ffffff", + "dark": { + "backgroundColor": "#000000" + } + } + ] + ], + "experiments": { + "typedRoutes": true, + "reactCompiler": true + } + } +} diff --git a/apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/_layout.tsx b/apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/_layout.tsx.hbs similarity index 94% rename from apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/_layout.tsx rename to apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/_layout.tsx.hbs index 617283cef..a1a1f04ad 100644 --- a/apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/_layout.tsx +++ b/apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/_layout.tsx.hbs @@ -7,7 +7,7 @@ export default function TabLayout() { return ( , }} /> ( diff --git a/apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/index.tsx b/apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/index.tsx.hbs similarity index 100% rename from apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/index.tsx rename to apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/index.tsx.hbs diff --git a/apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/two.tsx b/apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/two.tsx.hbs similarity index 100% rename from apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/two.tsx rename to apps/cli/templates/frontend/native/nativewind/app/(drawer)/(tabs)/two.tsx.hbs diff --git a/apps/cli/templates/frontend/native/nativewind/app/+html.tsx b/apps/cli/templates/frontend/native/nativewind/app/+html.tsx deleted file mode 100644 index 7dfb9333c..000000000 --- a/apps/cli/templates/frontend/native/nativewind/app/+html.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { ScrollViewStyleReset } from 'expo-router/html'; -import { ReactNode } from 'react'; - -// This file is web-only and used to configure the root HTML for every -// web page during static rendering. -// The contents of this function only run in Node.js environments and -// do not have access to the DOM or browser APIs. -export default function Root({ children }: { children: ReactNode }) { - return ( - - - - - - {/* - This viewport disables scaling which makes the mobile website act more like a native app. - However this does reduce built-in accessibility. If you want to enable scaling, use this instead: - - */} - - {/* - Disable body scrolling on web. This makes ScrollView components work closer to how they do on native. - However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line. - */} - - - {/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */} -