snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
4
templates/react-router-app/.dockerignore
Normal file
4
templates/react-router-app/.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
.react-router
|
||||
build
|
||||
node_modules
|
||||
README.md
|
||||
10
templates/react-router-app/.gitignore
vendored
Normal file
10
templates/react-router-app/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
.DS_Store
|
||||
.env*
|
||||
node_modules
|
||||
|
||||
# React Router
|
||||
.react-router
|
||||
build
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
7
templates/react-router-app/.prettierignore
Normal file
7
templates/react-router-app/.prettierignore
Normal file
@@ -0,0 +1,7 @@
|
||||
node_modules/
|
||||
coverage/
|
||||
.pnpm-store/
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
yarn.lock
|
||||
11
templates/react-router-app/.prettierrc
Normal file
11
templates/react-router-app/.prettierrc
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"endOfLine": "lf",
|
||||
"semi": false,
|
||||
"singleQuote": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "es5",
|
||||
"printWidth": 80,
|
||||
"plugins": ["prettier-plugin-tailwindcss"],
|
||||
"tailwindStylesheet": "app/app.css",
|
||||
"tailwindFunctions": ["cn", "cva"]
|
||||
}
|
||||
22
templates/react-router-app/Dockerfile
Normal file
22
templates/react-router-app/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM node:20-alpine AS development-dependencies-env
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
RUN npm ci
|
||||
|
||||
FROM node:20-alpine AS production-dependencies-env
|
||||
COPY ./package.json package-lock.json /app/
|
||||
WORKDIR /app
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
FROM node:20-alpine AS build-env
|
||||
COPY . /app/
|
||||
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
|
||||
WORKDIR /app
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine
|
||||
COPY ./package.json package-lock.json /app/
|
||||
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
|
||||
COPY --from=build-env /app/build /app/build
|
||||
WORKDIR /app
|
||||
CMD ["npm", "run", "start"]
|
||||
21
templates/react-router-app/README.md
Normal file
21
templates/react-router-app/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# React Router + shadcn/ui
|
||||
|
||||
This is a template for a new React Router project with React, TypeScript, and shadcn/ui.
|
||||
|
||||
## Adding components
|
||||
|
||||
To add components to your app, run the following command:
|
||||
|
||||
```bash
|
||||
npx shadcn@latest add button
|
||||
```
|
||||
|
||||
This will place the ui components in the `components` directory.
|
||||
|
||||
## Using components
|
||||
|
||||
To use the components in your app, import them as follows:
|
||||
|
||||
```tsx
|
||||
import { Button } from "@/components/ui/button";
|
||||
```
|
||||
1
templates/react-router-app/app/app.css
Normal file
1
templates/react-router-app/app/app.css
Normal file
@@ -0,0 +1 @@
|
||||
@import "tailwindcss";
|
||||
62
templates/react-router-app/app/root.tsx
Normal file
62
templates/react-router-app/app/root.tsx
Normal file
@@ -0,0 +1,62 @@
|
||||
import {
|
||||
Links,
|
||||
Meta,
|
||||
Outlet,
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
isRouteErrorResponse,
|
||||
} from "react-router"
|
||||
|
||||
import type { Route } from "./+types/root"
|
||||
import "./app.css"
|
||||
|
||||
export function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
<body>
|
||||
{children}
|
||||
<ScrollRestoration />
|
||||
<Scripts />
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return <Outlet />
|
||||
}
|
||||
|
||||
export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
|
||||
let message = "Oops!"
|
||||
let details = "An unexpected error occurred."
|
||||
let stack: string | undefined
|
||||
|
||||
if (isRouteErrorResponse(error)) {
|
||||
message = error.status === 404 ? "404" : "Error"
|
||||
details =
|
||||
error.status === 404
|
||||
? "The requested page could not be found."
|
||||
: error.statusText || details
|
||||
} else if (import.meta.env.DEV && error && error instanceof Error) {
|
||||
details = error.message
|
||||
stack = error.stack
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="container mx-auto p-4 pt-16">
|
||||
<h1>{message}</h1>
|
||||
<p>{details}</p>
|
||||
{stack && (
|
||||
<pre className="w-full overflow-x-auto p-4">
|
||||
<code>{stack}</code>
|
||||
</pre>
|
||||
)}
|
||||
</main>
|
||||
)
|
||||
}
|
||||
3
templates/react-router-app/app/routes.ts
Normal file
3
templates/react-router-app/app/routes.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { type RouteConfig, index } from "@react-router/dev/routes"
|
||||
|
||||
export default [index("routes/home.tsx")] satisfies RouteConfig
|
||||
16
templates/react-router-app/app/routes/home.tsx
Normal file
16
templates/react-router-app/app/routes/home.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Button } from "~/components/ui/button"
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div className="flex min-h-svh p-6">
|
||||
<div className="flex max-w-md min-w-0 flex-col gap-4 text-sm leading-loose">
|
||||
<div>
|
||||
<h1 className="font-medium">Project ready!</h1>
|
||||
<p>You may now add components and start building.</p>
|
||||
<p>We've already added the button component for you.</p>
|
||||
<Button className="mt-2">Button</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
32
templates/react-router-app/package.json
Normal file
32
templates/react-router-app/package.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "rr-app",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "react-router build",
|
||||
"dev": "react-router dev",
|
||||
"start": "react-router-serve ./build/server/index.js",
|
||||
"typecheck": "react-router typegen && tsc",
|
||||
"format": "prettier --write \"**/*.{ts,tsx}\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-router/node": "7.15.1",
|
||||
"@react-router/serve": "7.15.1",
|
||||
"isbot": "^5",
|
||||
"react": "^19.2.8",
|
||||
"react-dom": "^19.2.8",
|
||||
"react-router": "7.15.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-router/dev": "7.15.1",
|
||||
"@tailwindcss/vite": "^4",
|
||||
"@types/node": "^22",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"prettier": "^3.9.6",
|
||||
"prettier-plugin-tailwindcss": "^0.8.1",
|
||||
"tailwindcss": "^4",
|
||||
"typescript": "^6",
|
||||
"vite": "^8"
|
||||
}
|
||||
}
|
||||
2984
templates/react-router-app/pnpm-lock.yaml
generated
Normal file
2984
templates/react-router-app/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
5
templates/react-router-app/pnpm-workspace.yaml
Normal file
5
templates/react-router-app/pnpm-workspace.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
packages: []
|
||||
|
||||
allowBuilds:
|
||||
esbuild: true
|
||||
msw: false
|
||||
BIN
templates/react-router-app/public/favicon.ico
Normal file
BIN
templates/react-router-app/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
7
templates/react-router-app/react-router.config.ts
Normal file
7
templates/react-router-app/react-router.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Config } from "@react-router/dev/config"
|
||||
|
||||
export default {
|
||||
// Config options...
|
||||
// Server-side render by default, to enable SPA mode set this to `false`
|
||||
ssr: true,
|
||||
} satisfies Config
|
||||
26
templates/react-router-app/tsconfig.json
Normal file
26
templates/react-router-app/tsconfig.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"include": [
|
||||
"**/*",
|
||||
"**/.server/**/*",
|
||||
"**/.client/**/*",
|
||||
".react-router/types/**/*"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
||||
"types": ["node", "vite/client"],
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "bundler",
|
||||
"jsx": "react-jsx",
|
||||
"rootDirs": [".", "./.react-router/types"],
|
||||
"paths": {
|
||||
"~/*": ["./app/*"]
|
||||
},
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"noEmit": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
8
templates/react-router-app/vite.config.ts
Normal file
8
templates/react-router-app/vite.config.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { reactRouter } from "@react-router/dev/vite"
|
||||
import tailwindcss from "@tailwindcss/vite"
|
||||
import { defineConfig } from "vite"
|
||||
|
||||
export default defineConfig({
|
||||
resolve: { tsconfigPaths: true },
|
||||
plugins: [tailwindcss(), reactRouter()],
|
||||
})
|
||||
Reference in New Issue
Block a user