init shadcn turborepo
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
"components": "@/components",
|
||||
"hooks": "@/hooks",
|
||||
"lib": "@/lib",
|
||||
"utils": "@workspace/ui/lib/utils",
|
||||
"ui": "@workspace/ui/components"
|
||||
"utils": "@repo/ui/lib/utils",
|
||||
"ui": "@repo/ui/components"
|
||||
},
|
||||
"rtl": false,
|
||||
"menuColor": "default-translucent",
|
||||
|
||||
+10
-10
@@ -1,21 +1,21 @@
|
||||
// @ts-check
|
||||
|
||||
import { tanstackConfig } from "@tanstack/eslint-config"
|
||||
import { tanstackConfig } from '@tanstack/eslint-config';
|
||||
|
||||
export default [
|
||||
...tanstackConfig,
|
||||
{
|
||||
rules: {
|
||||
"import/no-cycle": "off",
|
||||
"import/order": "off",
|
||||
"import/consistent-type-specifier-style": "off",
|
||||
"sort-imports": "off",
|
||||
"@typescript-eslint/array-type": "off",
|
||||
"@typescript-eslint/require-await": "off",
|
||||
"pnpm/json-enforce-catalog": "off",
|
||||
'import/no-cycle': 'off',
|
||||
'import/order': 'off',
|
||||
'import/consistent-type-specifier-style': 'off',
|
||||
'sort-imports': 'off',
|
||||
'@typescript-eslint/array-type': 'off',
|
||||
'@typescript-eslint/require-await': 'off',
|
||||
'pnpm/json-enforce-catalog': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ["eslint.config.js", ".prettierrc"],
|
||||
ignores: ['eslint.config.js', '.prettierrc'],
|
||||
},
|
||||
]
|
||||
];
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"@tanstack/react-router": "latest",
|
||||
"@tanstack/react-router-devtools": "latest",
|
||||
"@tanstack/react-start": "latest",
|
||||
"@workspace/ui": "workspace:*",
|
||||
"@repo/ui": "workspace:*",
|
||||
"lucide-react": "^1.84.0",
|
||||
"react": "^19.3.1",
|
||||
"react-dom": "^19.3.1",
|
||||
|
||||
@@ -8,43 +8,43 @@
|
||||
// You should NOT make any changes in this file as it will be overwritten.
|
||||
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
||||
|
||||
import { Route as rootRouteImport } from "./routes/__root"
|
||||
import { Route as IndexRouteImport } from "./routes/index"
|
||||
import { Route as rootRouteImport } from './routes/__root'
|
||||
import { Route as IndexRouteImport } from './routes/index'
|
||||
|
||||
const IndexRoute = IndexRouteImport.update({
|
||||
id: "/",
|
||||
path: "/",
|
||||
id: '/',
|
||||
path: '/',
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
|
||||
export interface FileRoutesByFullPath {
|
||||
"/": typeof IndexRoute
|
||||
'/': typeof IndexRoute
|
||||
}
|
||||
export interface FileRoutesByTo {
|
||||
"/": typeof IndexRoute
|
||||
'/': typeof IndexRoute
|
||||
}
|
||||
export interface FileRoutesById {
|
||||
__root__: typeof rootRouteImport
|
||||
"/": typeof IndexRoute
|
||||
'/': typeof IndexRoute
|
||||
}
|
||||
export interface FileRouteTypes {
|
||||
fileRoutesByFullPath: FileRoutesByFullPath
|
||||
fullPaths: "/"
|
||||
fullPaths: '/'
|
||||
fileRoutesByTo: FileRoutesByTo
|
||||
to: "/"
|
||||
id: "__root__" | "/"
|
||||
to: '/'
|
||||
id: '__root__' | '/'
|
||||
fileRoutesById: FileRoutesById
|
||||
}
|
||||
export interface RootRouteChildren {
|
||||
IndexRoute: typeof IndexRoute
|
||||
}
|
||||
|
||||
declare module "@tanstack/react-router" {
|
||||
declare module '@tanstack/react-router' {
|
||||
interface FileRoutesByPath {
|
||||
"/": {
|
||||
id: "/"
|
||||
path: "/"
|
||||
fullPath: "/"
|
||||
'/': {
|
||||
id: '/'
|
||||
path: '/'
|
||||
fullPath: '/'
|
||||
preLoaderRoute: typeof IndexRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
@@ -58,9 +58,9 @@ export const routeTree = rootRouteImport
|
||||
._addFileChildren(rootRouteChildren)
|
||||
._addFileTypes<FileRouteTypes>()
|
||||
|
||||
import type { getRouter } from "./router.tsx"
|
||||
import type { createStart } from "@tanstack/react-start"
|
||||
declare module "@tanstack/react-start" {
|
||||
import type { getRouter } from './router.tsx'
|
||||
import type { createStart } from '@tanstack/react-start'
|
||||
declare module '@tanstack/react-start' {
|
||||
interface Register {
|
||||
ssr: true
|
||||
router: Awaited<ReturnType<typeof getRouter>>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { createRouter as createTanStackRouter } from "@tanstack/react-router"
|
||||
import { routeTree } from "./routeTree.gen"
|
||||
import { createRouter as createTanStackRouter } from '@tanstack/react-router';
|
||||
import { routeTree } from './routeTree.gen';
|
||||
|
||||
export function getRouter() {
|
||||
const router = createTanStackRouter({
|
||||
routeTree,
|
||||
|
||||
scrollRestoration: true,
|
||||
defaultPreload: "intent",
|
||||
defaultPreload: 'intent',
|
||||
defaultPreloadStaleTime: 0,
|
||||
})
|
||||
});
|
||||
|
||||
return router
|
||||
return router;
|
||||
}
|
||||
|
||||
declare module "@tanstack/react-router" {
|
||||
declare module '@tanstack/react-router' {
|
||||
interface Register {
|
||||
router: ReturnType<typeof getRouter>
|
||||
router: ReturnType<typeof getRouter>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
import { HeadContent, Scripts, createRootRoute } from "@tanstack/react-router"
|
||||
import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router';
|
||||
|
||||
import appCss from "@workspace/ui/globals.css?url"
|
||||
import appCss from '@repo/ui/globals.css?url';
|
||||
import { TooltipProvider } from '@repo/ui/components/tooltip';
|
||||
|
||||
export const Route = createRootRoute({
|
||||
head: () => ({
|
||||
meta: [
|
||||
{
|
||||
charSet: "utf-8",
|
||||
charSet: 'utf-8',
|
||||
},
|
||||
{
|
||||
name: "viewport",
|
||||
content: "width=device-width, initial-scale=1",
|
||||
name: 'viewport',
|
||||
content: 'width=device-width, initial-scale=1',
|
||||
},
|
||||
{
|
||||
title: "TanStack Start Starter",
|
||||
title: 'TanStack Start Starter',
|
||||
},
|
||||
],
|
||||
links: [
|
||||
{
|
||||
rel: "stylesheet",
|
||||
rel: 'stylesheet',
|
||||
href: appCss,
|
||||
},
|
||||
],
|
||||
@@ -30,7 +31,7 @@ export const Route = createRootRoute({
|
||||
</main>
|
||||
),
|
||||
shellComponent: RootDocument,
|
||||
})
|
||||
});
|
||||
|
||||
function RootDocument({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
@@ -39,9 +40,9 @@ function RootDocument({ children }: { children: React.ReactNode }) {
|
||||
<HeadContent />
|
||||
</head>
|
||||
<body>
|
||||
{children}
|
||||
<TooltipProvider>{children}</TooltipProvider>
|
||||
<Scripts />
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createFileRoute } from "@tanstack/react-router"
|
||||
import { Button } from "@workspace/ui/components/button"
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
import { Button } from '@repo/ui/components/button';
|
||||
|
||||
export const Route = createFileRoute("/")({ component: App })
|
||||
export const Route = createFileRoute('/')({ component: App });
|
||||
|
||||
function App() {
|
||||
return (
|
||||
@@ -15,5 +15,5 @@ function App() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"types": ["vite/client"],
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@workspace/ui/*": ["../../packages/ui/src/*"]
|
||||
"@repo/ui/*": ["../../packages/ui/src/*"]
|
||||
},
|
||||
|
||||
/* Bundler mode */
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { defineConfig } from "vite"
|
||||
import { devtools } from "@tanstack/devtools-vite"
|
||||
import { tanstackStart } from "@tanstack/react-start/plugin/vite"
|
||||
import viteReact from "@vitejs/plugin-react"
|
||||
import tailwindcss from "@tailwindcss/vite"
|
||||
import { defineConfig } from 'vite';
|
||||
import { devtools } from '@tanstack/devtools-vite';
|
||||
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
|
||||
import viteReact from '@vitejs/plugin-react';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
|
||||
const config = defineConfig({
|
||||
resolve: { tsconfigPaths: true },
|
||||
plugins: [devtools(), tailwindcss(), tanstackStart(), viteReact()],
|
||||
})
|
||||
});
|
||||
|
||||
export default config
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user