mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
upgrade to tanstack start alpha devinxi
This commit is contained in:
5
.changeset/empty-clocks-cut.md
Normal file
5
.changeset/empty-clocks-cut.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"create-better-t-stack": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Upgrade to Tanstack start devinxi
|
||||||
@@ -27,8 +27,8 @@ export const DEFAULT_CONFIG: ProjectConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const dependencyVersionMap = {
|
export const dependencyVersionMap = {
|
||||||
"better-auth": "^1.2.8",
|
"better-auth": "^1.2.9",
|
||||||
"@better-auth/expo": "^1.2.8",
|
"@better-auth/expo": "^1.2.9",
|
||||||
|
|
||||||
"drizzle-orm": "^0.38.4",
|
"drizzle-orm": "^0.38.4",
|
||||||
"drizzle-kit": "^0.30.5",
|
"drizzle-kit": "^0.30.5",
|
||||||
@@ -87,9 +87,9 @@ export const dependencyVersionMap = {
|
|||||||
|
|
||||||
"@prisma/extension-accelerate": "^1.3.0",
|
"@prisma/extension-accelerate": "^1.3.0",
|
||||||
|
|
||||||
"@orpc/server": "^1.4.1",
|
"@orpc/server": "^1.5.0",
|
||||||
"@orpc/client": "^1.4.1",
|
"@orpc/client": "^1.5.0",
|
||||||
"@orpc/tanstack-query": "^1.4.1",
|
"@orpc/tanstack-query": "^1.5.0",
|
||||||
|
|
||||||
"@trpc/tanstack-react-query": "^11.0.0",
|
"@trpc/tanstack-react-query": "^11.0.0",
|
||||||
"@trpc/server": "^11.0.0",
|
"@trpc/server": "^11.0.0",
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export async function getFrontendChoice(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "tanstack-start" as const,
|
value: "tanstack-start" as const,
|
||||||
label: "TanStack Start (beta)",
|
label: "TanStack Start (devinxi)",
|
||||||
hint: "SSR, Server Functions, API Routes and more with TanStack Router",
|
hint: "SSR, Server Functions, API Routes and more with TanStack Router",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{{#if (eq orm "prisma")}}
|
{{#if (eq orm "prisma")}}
|
||||||
import { betterAuth } from "better-auth";
|
import { betterAuth } from "better-auth";
|
||||||
import { prismaAdapter } from "better-auth/adapters/prisma";
|
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";
|
import { expo } from "@better-auth/expo";
|
||||||
{{/if}}
|
{{/if}}
|
||||||
import prisma from "../../prisma";
|
import prisma from "../../prisma";
|
||||||
@@ -14,14 +14,14 @@ export const auth = betterAuth({
|
|||||||
{{#if (eq database "mongodb")}}provider: "mongodb"{{/if}}
|
{{#if (eq database "mongodb")}}provider: "mongodb"{{/if}}
|
||||||
}),
|
}),
|
||||||
trustedOrigins: [
|
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}}
|
"my-better-t-app://",{{/if}}
|
||||||
],
|
],
|
||||||
emailAndPassword: {
|
emailAndPassword: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#if (includes frontend "native")}}
|
{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
|
||||||
,
|
,
|
||||||
plugins: [expo()]
|
plugins: [expo()]
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@@ -31,7 +31,7 @@ export const auth = betterAuth({
|
|||||||
{{#if (eq orm "drizzle")}}
|
{{#if (eq orm "drizzle")}}
|
||||||
import { betterAuth } from "better-auth";
|
import { betterAuth } from "better-auth";
|
||||||
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
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";
|
import { expo } from "@better-auth/expo";
|
||||||
{{/if}}
|
{{/if}}
|
||||||
import { db } from "../db";
|
import { db } from "../db";
|
||||||
@@ -45,14 +45,14 @@ export const auth = betterAuth({
|
|||||||
schema: schema,
|
schema: schema,
|
||||||
}),
|
}),
|
||||||
trustedOrigins: [
|
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}}
|
"my-better-t-app://",{{/if}}
|
||||||
],
|
],
|
||||||
emailAndPassword: {
|
emailAndPassword: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#if (includes frontend "native")}}
|
{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
|
||||||
,
|
,
|
||||||
plugins: [expo()]
|
plugins: [expo()]
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@@ -62,7 +62,7 @@ export const auth = betterAuth({
|
|||||||
{{#if (eq orm "mongoose")}}
|
{{#if (eq orm "mongoose")}}
|
||||||
import { betterAuth } from "better-auth";
|
import { betterAuth } from "better-auth";
|
||||||
import { mongodbAdapter } from "better-auth/adapters/mongodb";
|
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";
|
import { expo } from "@better-auth/expo";
|
||||||
{{/if}}
|
{{/if}}
|
||||||
import { client } from "../db";
|
import { client } from "../db";
|
||||||
@@ -70,14 +70,14 @@ import { client } from "../db";
|
|||||||
export const auth = betterAuth({
|
export const auth = betterAuth({
|
||||||
database: mongodbAdapter(client),
|
database: mongodbAdapter(client),
|
||||||
trustedOrigins: [
|
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}}
|
"my-better-t-app://",{{/if}}
|
||||||
],
|
],
|
||||||
emailAndPassword: {
|
emailAndPassword: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#if (includes frontend "native")}}
|
{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
|
||||||
,
|
,
|
||||||
plugins: [expo()]
|
plugins: [expo()]
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@@ -86,21 +86,21 @@ export const auth = betterAuth({
|
|||||||
|
|
||||||
{{#if (eq orm "none")}}
|
{{#if (eq orm "none")}}
|
||||||
import { betterAuth } from "better-auth";
|
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";
|
import { expo } from "@better-auth/expo";
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
export const auth = betterAuth({
|
export const auth = betterAuth({
|
||||||
database: "", // Invalid configuration
|
database: "", // Invalid configuration
|
||||||
trustedOrigins: [
|
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}}
|
"my-better-t-app://",{{/if}}
|
||||||
],
|
],
|
||||||
emailAndPassword: {
|
emailAndPassword: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#if (includes frontend "native")}}
|
{{#if (or (includes frontend "native-nativewind") (includes frontend "native-unistyles"))}}
|
||||||
,
|
,
|
||||||
plugins: [expo()]
|
plugins: [expo()]
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
@@ -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(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
@@ -3,10 +3,9 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vinxi start",
|
"build": "vite build",
|
||||||
"build": "vinxi build",
|
|
||||||
"serve": "vite preview",
|
"serve": "vite preview",
|
||||||
"dev": "vinxi dev --port=3001"
|
"dev": "vite dev --port=3001"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/react-checkbox": "^1.1.4",
|
"@radix-ui/react-checkbox": "^1.1.4",
|
||||||
@@ -15,11 +14,11 @@
|
|||||||
"@radix-ui/react-slot": "^1.1.2",
|
"@radix-ui/react-slot": "^1.1.2",
|
||||||
"@tanstack/react-form": "^1.0.5",
|
"@tanstack/react-form": "^1.0.5",
|
||||||
"@tailwindcss/vite": "^4.1.8",
|
"@tailwindcss/vite": "^4.1.8",
|
||||||
"@tanstack/react-query": "^5.80.5",
|
"@tanstack/react-query": "^5.80.6",
|
||||||
"@tanstack/react-router": "^1.120.15",
|
"@tanstack/react-router": "^1.121.0-alpha.27",
|
||||||
"@tanstack/react-router-with-query": "^1.120.15",
|
"@tanstack/react-router-with-query": "^1.121.0",
|
||||||
"@tanstack/react-start": "^1.120.15",
|
"@tanstack/react-start": "^1.121.0-alpha.27",
|
||||||
"@tanstack/router-plugin": "^1.120.15",
|
"@tanstack/router-plugin": "^1.121.0",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^0.473.0",
|
"lucide-react": "^0.473.0",
|
||||||
@@ -30,17 +29,16 @@
|
|||||||
"tailwindcss": "^4.1.3",
|
"tailwindcss": "^4.1.3",
|
||||||
"tailwind-merge": "^2.6.0",
|
"tailwind-merge": "^2.6.0",
|
||||||
"tw-animate-css": "^1.2.5",
|
"tw-animate-css": "^1.2.5",
|
||||||
"vinxi": "^0.5.3",
|
|
||||||
"vite-tsconfig-paths": "^5.1.4",
|
"vite-tsconfig-paths": "^5.1.4",
|
||||||
"zod": "^3.25.16"
|
"zod": "^3.25.16"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"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/dom": "^10.4.0",
|
||||||
"@testing-library/react": "^16.2.0",
|
"@testing-library/react": "^16.2.0",
|
||||||
"@types/react": "^19.0.12",
|
"@types/react": "^19.0.12",
|
||||||
"@types/react-dom": "^19.0.4",
|
"@types/react-dom": "^19.0.4",
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^4.5.2",
|
||||||
"jsdom": "^26.0.0",
|
"jsdom": "^26.0.0",
|
||||||
"typescript": "^5.7.2",
|
"typescript": "^5.7.2",
|
||||||
"vite": "^6.3.5",
|
"vite": "^6.3.5",
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
import {
|
|
||||||
createStartAPIHandler,
|
|
||||||
defaultAPIFileRouteHandler,
|
|
||||||
} from "@tanstack/react-start/api";
|
|
||||||
|
|
||||||
export default createStartAPIHandler(defaultAPIFileRouteHandler);
|
|
||||||
@@ -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, <StartClient router={router} />);
|
|
||||||
@@ -8,7 +8,7 @@ import { routeTree } from "./routeTree.gen";
|
|||||||
import Loader from "./components/loader";
|
import Loader from "./components/loader";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
{{else}}
|
{{else}}
|
||||||
import { createRouter as createTanstackRouter } from "@tanstack/react-router";
|
import { createRouter as createTanStackRouter } from "@tanstack/react-router";
|
||||||
import Loader from "./components/loader";
|
import Loader from "./components/loader";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { routeTree } from "./routeTree.gen";
|
import { routeTree } from "./routeTree.gen";
|
||||||
@@ -102,7 +102,7 @@ const trpc = createTRPCOptionsProxy({
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
export const createRouter = () => {
|
export const createRouter = () => {
|
||||||
const router = createTanstackRouter({
|
const router = createTanStackRouter({
|
||||||
routeTree,
|
routeTree,
|
||||||
scrollRestoration: true,
|
scrollRestoration: true,
|
||||||
defaultPreloadStaleTime: 0,
|
defaultPreloadStaleTime: 0,
|
||||||
@@ -111,7 +111,7 @@ export const createRouter = () => {
|
|||||||
{{else if (eq api "orpc")}}
|
{{else if (eq api "orpc")}}
|
||||||
context: { orpc, queryClient },
|
context: { orpc, queryClient },
|
||||||
{{else}}
|
{{else}}
|
||||||
context: { },
|
context: {},
|
||||||
{{/if}}
|
{{/if}}
|
||||||
defaultPendingComponent: () => <Loader />,
|
defaultPendingComponent: () => <Loader />,
|
||||||
defaultNotFoundComponent: () => <div>Not Found</div>,
|
defaultNotFoundComponent: () => <div>Not Found</div>,
|
||||||
|
|||||||
@@ -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);
|
|
||||||
@@ -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({})],
|
||||||
|
});
|
||||||
@@ -42,7 +42,7 @@ export const TECH_OPTIONS = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "tanstack-start",
|
id: "tanstack-start",
|
||||||
name: "TanStack Start (beta)",
|
name: "TanStack Start (devinxi)",
|
||||||
description:
|
description:
|
||||||
"Full-stack React and Solid framework powered by TanStack Router",
|
"Full-stack React and Solid framework powered by TanStack Router",
|
||||||
icon: "/icon/tanstack.svg",
|
icon: "/icon/tanstack.svg",
|
||||||
|
|||||||
Reference in New Issue
Block a user