diff --git a/.changeset/empty-clocks-cut.md b/.changeset/empty-clocks-cut.md new file mode 100644 index 0000000..bea067d --- /dev/null +++ b/.changeset/empty-clocks-cut.md @@ -0,0 +1,5 @@ +--- +"create-better-t-stack": minor +--- + +Upgrade to Tanstack start devinxi diff --git a/apps/cli/src/constants.ts b/apps/cli/src/constants.ts index 233c6e2..704d94b 100644 --- a/apps/cli/src/constants.ts +++ b/apps/cli/src/constants.ts @@ -27,8 +27,8 @@ export const DEFAULT_CONFIG: ProjectConfig = { }; export const dependencyVersionMap = { - "better-auth": "^1.2.8", - "@better-auth/expo": "^1.2.8", + "better-auth": "^1.2.9", + "@better-auth/expo": "^1.2.9", "drizzle-orm": "^0.38.4", "drizzle-kit": "^0.30.5", @@ -87,9 +87,9 @@ export const dependencyVersionMap = { "@prisma/extension-accelerate": "^1.3.0", - "@orpc/server": "^1.4.1", - "@orpc/client": "^1.4.1", - "@orpc/tanstack-query": "^1.4.1", + "@orpc/server": "^1.5.0", + "@orpc/client": "^1.5.0", + "@orpc/tanstack-query": "^1.5.0", "@trpc/tanstack-react-query": "^11.0.0", "@trpc/server": "^11.0.0", diff --git a/apps/cli/src/prompts/frontend.ts b/apps/cli/src/prompts/frontend.ts index c846a07..893ef4e 100644 --- a/apps/cli/src/prompts/frontend.ts +++ b/apps/cli/src/prompts/frontend.ts @@ -68,7 +68,7 @@ export async function getFrontendChoice( }, { value: "tanstack-start" as const, - label: "TanStack Start (beta)", + label: "TanStack Start (devinxi)", hint: "SSR, Server Functions, API Routes and more with TanStack Router", }, ]; diff --git a/apps/cli/templates/auth/server/base/src/lib/auth.ts.hbs b/apps/cli/templates/auth/server/base/src/lib/auth.ts.hbs index 21fb256..de189fe 100644 --- a/apps/cli/templates/auth/server/base/src/lib/auth.ts.hbs +++ b/apps/cli/templates/auth/server/base/src/lib/auth.ts.hbs @@ -1,7 +1,7 @@ {{#if (eq orm "prisma")}} import { betterAuth } from "better-auth"; import { prismaAdapter } from "better-auth/adapters/prisma"; -{{#if (includes frontend "native")}} +{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} import { expo } from "@better-auth/expo"; {{/if}} import prisma from "../../prisma"; @@ -14,14 +14,14 @@ export const auth = betterAuth({ {{#if (eq database "mongodb")}}provider: "mongodb"{{/if}} }), trustedOrigins: [ - process.env.CORS_ORIGIN || "",{{#if (includes frontend "native")}} + process.env.CORS_ORIGIN || "",{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} "my-better-t-app://",{{/if}} ], emailAndPassword: { enabled: true, } - {{#if (includes frontend "native")}} + {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} , plugins: [expo()] {{/if}} @@ -31,7 +31,7 @@ export const auth = betterAuth({ {{#if (eq orm "drizzle")}} import { betterAuth } from "better-auth"; import { drizzleAdapter } from "better-auth/adapters/drizzle"; -{{#if (includes frontend "native")}} +{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} import { expo } from "@better-auth/expo"; {{/if}} import { db } from "../db"; @@ -45,14 +45,14 @@ export const auth = betterAuth({ schema: schema, }), trustedOrigins: [ - process.env.CORS_ORIGIN || "",{{#if (includes frontend "native")}} + process.env.CORS_ORIGIN || "",{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} "my-better-t-app://",{{/if}} ], emailAndPassword: { enabled: true, } - {{#if (includes frontend "native")}} + {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} , plugins: [expo()] {{/if}} @@ -62,7 +62,7 @@ export const auth = betterAuth({ {{#if (eq orm "mongoose")}} import { betterAuth } from "better-auth"; import { mongodbAdapter } from "better-auth/adapters/mongodb"; -{{#if (includes frontend "native")}} +{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} import { expo } from "@better-auth/expo"; {{/if}} import { client } from "../db"; @@ -70,14 +70,14 @@ import { client } from "../db"; export const auth = betterAuth({ database: mongodbAdapter(client), trustedOrigins: [ - process.env.CORS_ORIGIN || "",{{#if (includes frontend "native")}} + process.env.CORS_ORIGIN || "",{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} "my-better-t-app://",{{/if}} ], emailAndPassword: { enabled: true, } - {{#if (includes frontend "native")}} + {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} , plugins: [expo()] {{/if}} @@ -86,21 +86,21 @@ export const auth = betterAuth({ {{#if (eq orm "none")}} import { betterAuth } from "better-auth"; -{{#if (includes frontend "native")}} +{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} import { expo } from "@better-auth/expo"; {{/if}} export const auth = betterAuth({ database: "", // Invalid configuration trustedOrigins: [ - process.env.CORS_ORIGIN || "",{{#if (includes frontend "native")}} + process.env.CORS_ORIGIN || "",{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} "my-better-t-app://",{{/if}} ], emailAndPassword: { enabled: true, } - {{#if (includes frontend "native")}} + {{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}} , plugins: [expo()] {{/if}} diff --git a/apps/cli/templates/frontend/react/tanstack-start/app.config.ts b/apps/cli/templates/frontend/react/tanstack-start/app.config.ts deleted file mode 100644 index e891c17..0000000 --- a/apps/cli/templates/frontend/react/tanstack-start/app.config.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { defineConfig } from "@tanstack/react-start/config"; -import viteTsConfigPaths from "vite-tsconfig-paths"; -import tailwindcss from "@tailwindcss/vite"; - -export default defineConfig({ - tsr: { - appDirectory: "src", - }, - vite: { - plugins: [ - viteTsConfigPaths({ - projects: ["./tsconfig.json"], - }), - tailwindcss(), - ], - }, -}); diff --git a/apps/cli/templates/frontend/react/tanstack-start/package.json b/apps/cli/templates/frontend/react/tanstack-start/package.json index 99a79af..abf34c7 100644 --- a/apps/cli/templates/frontend/react/tanstack-start/package.json +++ b/apps/cli/templates/frontend/react/tanstack-start/package.json @@ -3,10 +3,9 @@ "private": true, "type": "module", "scripts": { - "start": "vinxi start", - "build": "vinxi build", + "build": "vite build", "serve": "vite preview", - "dev": "vinxi dev --port=3001" + "dev": "vite dev --port=3001" }, "dependencies": { "@radix-ui/react-checkbox": "^1.1.4", @@ -15,11 +14,11 @@ "@radix-ui/react-slot": "^1.1.2", "@tanstack/react-form": "^1.0.5", "@tailwindcss/vite": "^4.1.8", - "@tanstack/react-query": "^5.80.5", - "@tanstack/react-router": "^1.120.15", - "@tanstack/react-router-with-query": "^1.120.15", - "@tanstack/react-start": "^1.120.15", - "@tanstack/router-plugin": "^1.120.15", + "@tanstack/react-query": "^5.80.6", + "@tanstack/react-router": "^1.121.0-alpha.27", + "@tanstack/react-router-with-query": "^1.121.0", + "@tanstack/react-start": "^1.121.0-alpha.27", + "@tanstack/router-plugin": "^1.121.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.473.0", @@ -30,17 +29,16 @@ "tailwindcss": "^4.1.3", "tailwind-merge": "^2.6.0", "tw-animate-css": "^1.2.5", - "vinxi": "^0.5.3", "vite-tsconfig-paths": "^5.1.4", "zod": "^3.25.16" }, "devDependencies": { - "@tanstack/react-router-devtools": "^1.120.15", + "@tanstack/react-router-devtools": "^1.121.0-alpha.27", "@testing-library/dom": "^10.4.0", "@testing-library/react": "^16.2.0", "@types/react": "^19.0.12", "@types/react-dom": "^19.0.4", - "@vitejs/plugin-react": "^4.3.4", + "@vitejs/plugin-react": "^4.5.2", "jsdom": "^26.0.0", "typescript": "^5.7.2", "vite": "^6.3.5", diff --git a/apps/cli/templates/frontend/react/tanstack-start/src/api.ts b/apps/cli/templates/frontend/react/tanstack-start/src/api.ts deleted file mode 100644 index ac23f7c..0000000 --- a/apps/cli/templates/frontend/react/tanstack-start/src/api.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { - createStartAPIHandler, - defaultAPIFileRouteHandler, -} from "@tanstack/react-start/api"; - -export default createStartAPIHandler(defaultAPIFileRouteHandler); diff --git a/apps/cli/templates/frontend/react/tanstack-start/src/client.tsx b/apps/cli/templates/frontend/react/tanstack-start/src/client.tsx deleted file mode 100644 index ca1d304..0000000 --- a/apps/cli/templates/frontend/react/tanstack-start/src/client.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { StartClient } from "@tanstack/react-start"; -import { hydrateRoot } from "react-dom/client"; - -import { createRouter } from "./router"; - -const router = createRouter(); - -hydrateRoot(document, ); diff --git a/apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs b/apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs index 983fc47..5fbfcc6 100644 --- a/apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs +++ b/apps/cli/templates/frontend/react/tanstack-start/src/router.tsx.hbs @@ -8,7 +8,7 @@ import { routeTree } from "./routeTree.gen"; import Loader from "./components/loader"; import "./index.css"; {{else}} -import { createRouter as createTanstackRouter } from "@tanstack/react-router"; +import { createRouter as createTanStackRouter } from "@tanstack/react-router"; import Loader from "./components/loader"; import "./index.css"; import { routeTree } from "./routeTree.gen"; @@ -102,7 +102,7 @@ const trpc = createTRPCOptionsProxy({ {{/if}} export const createRouter = () => { - const router = createTanstackRouter({ + const router = createTanStackRouter({ routeTree, scrollRestoration: true, defaultPreloadStaleTime: 0, @@ -111,7 +111,7 @@ export const createRouter = () => { {{else if (eq api "orpc")}} context: { orpc, queryClient }, {{else}} - context: { }, + context: {}, {{/if}} defaultPendingComponent: () => , defaultNotFoundComponent: () =>
Not Found
, diff --git a/apps/cli/templates/frontend/react/tanstack-start/src/ssr.tsx b/apps/cli/templates/frontend/react/tanstack-start/src/ssr.tsx deleted file mode 100644 index 8bea78d..0000000 --- a/apps/cli/templates/frontend/react/tanstack-start/src/ssr.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { getRouterManifest } from "@tanstack/react-start/router-manifest"; -import { - createStartHandler, - defaultStreamHandler, -} from "@tanstack/react-start/server"; - -import { createRouter } from "./router"; - -export default createStartHandler({ - createRouter, - getRouterManifest, -})(defaultStreamHandler); diff --git a/apps/cli/templates/frontend/react/tanstack-start/vite.config.ts b/apps/cli/templates/frontend/react/tanstack-start/vite.config.ts new file mode 100644 index 0000000..4996232 --- /dev/null +++ b/apps/cli/templates/frontend/react/tanstack-start/vite.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; +import tsconfigPaths from "vite-tsconfig-paths"; +import { tanstackStart } from "@tanstack/react-start/plugin/vite"; +import tailwindcss from "@tailwindcss/vite"; + +export default defineConfig({ + plugins: [tsconfigPaths(), tailwindcss(), tanstackStart({})], +}); diff --git a/apps/web/src/lib/constant.ts b/apps/web/src/lib/constant.ts index 10c80bd..9167c18 100644 --- a/apps/web/src/lib/constant.ts +++ b/apps/web/src/lib/constant.ts @@ -42,7 +42,7 @@ export const TECH_OPTIONS = { }, { id: "tanstack-start", - name: "TanStack Start (beta)", + name: "TanStack Start (devinxi)", description: "Full-stack React and Solid framework powered by TanStack Router", icon: "/icon/tanstack.svg",