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:
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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,
|
||||
"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",
|
||||
|
||||
@@ -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 "./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: () => <Loader />,
|
||||
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({})],
|
||||
});
|
||||
Reference in New Issue
Block a user