chore: fix shadcn imports again

This commit is contained in:
afiqzudinhadi 2025-06-20 23:12:56 +08:00
parent 614ace11b0
commit 0039016707
23 changed files with 425 additions and 112 deletions

View file

@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "../../packages/ui/src/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"hooks": "@/hooks",
"lib": "@/lib",
"utils": "@repo/ui/lib/utils",
"ui": "@repo/ui/components"
}
}

View file

@ -1,12 +1,13 @@
import { NextConfig } from "next";
const nextConfig: NextConfig = {
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
transpilePackages: ["@repo/ui"],
};
export default nextConfig;

View file

@ -1,5 +1,5 @@
import "@repo/ui/styles/styles.css";
import "@repo/ui/globals.css";
import "@repo/ui/styles/global.css";
export default function RootLayout({
children,

View file

@ -1,10 +1,10 @@
import { Button } from "@repo/ui/components/button.js";
import { Button } from "@repo/ui/components/button";
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@repo/ui/components/card.js";
} from "@repo/ui/components/card";
export default function HomePage() {
return (

View file

@ -1,13 +1,17 @@
{
"exclude": ["node_modules"],
"extends": "@repo/typescript-config/nextjs.json",
"compilerOptions": {
"outDir": "dist",
"plugins": [
{
"name": "next"
}
]
},
"include": ["src", "next.config.ts", "next-env.d.ts", ".next/types/**/*.ts"]
"exclude": ["node_modules"],
"extends": "@repo/typescript-config/nextjs.json",
"compilerOptions": {
"outDir": "dist",
"plugins": [
{
"name": "next"
}
],
"paths": {
"~/*": ["./src/*"],
"@repo/ui/*": ["../../packages/ui/src/*"]
}
},
"include": ["src", "next.config.ts", "next-env.d.ts", ".next/types/**/*.ts"]
}

View file

@ -7,7 +7,7 @@ import {
} from "@remix-run/react";
import { Analytics } from "@vercel/analytics/react";
import "@repo/ui/styles/styles.css";
import "@repo/ui/globals.css";
import "@repo/ui/styles/global.css";
export function Layout({ children }: { children: React.ReactNode }) {
return (

View file

@ -1,5 +1,5 @@
import { CounterButton } from "@repo/ui/counter-button/index.mjs";
import { Link } from "@repo/ui/link/index.mjs";
import { CounterButton } from "@repo/ui/counter-button";
import { Link } from "@repo/ui/link";
export default function Index() {
return (

View file

@ -1,11 +1,11 @@
import { Button } from "@repo/ui/components/button.mjs";
import { Button } from "@repo/ui/components/button";
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@repo/ui/components/card.mjs";
import { Link } from "@repo/ui/link/index.mjs";
} from "@repo/ui/components/card";
import { Link } from "@repo/ui/link";
export default function Index() {
return (

View file

@ -11,6 +11,7 @@
"lint": "eslint app/ --max-warnings 0"
},
"dependencies": {
"@radix-ui/react-slot": "^1.2.3",
"@remix-run/node": "^2.15.2",
"@remix-run/react": "^2.15.2",
"@remix-run/server-runtime": "^2.15.2",

View file

@ -6,7 +6,8 @@
"module": "ESNext",
"skipLibCheck": true,
"paths": {
"~/*": ["./app/*"]
"~/*": ["./app/*"],
"@repo/ui/*": ["../../packages/ui/src/*"]
},
// Vite takes care of building everything, not tsc.

View file

@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "../../packages/ui/src/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"hooks": "@/hooks",
"lib": "@/lib",
"utils": "@repo/ui/lib/utils",
"ui": "@repo/ui/components"
}
}

View file

@ -22,6 +22,7 @@
"@vitejs/plugin-react": "^4.5.1",
"eslint": "^9.29.0",
"typescript": "5.8.2",
"vite": "^5.4.14"
"vite": "^5.4.14",
"vite-tsconfig-paths": "^4.2.1"
}
}

View file

@ -0,0 +1 @@
export { default } from "@repo/ui/postcss.config";

View file

@ -1,27 +1,44 @@
import "./styles.css";
import "@repo/ui/styles/styles.css";
import "@repo/ui/styles/global.css";
import { CounterButton } from "@repo/ui/counter-button";
import { Link } from "@repo/ui/link";
import { Button } from "@repo/ui/components/button";
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@repo/ui/components/card";
function App() {
return (
<div className="container">
<h1 className="title">
Admin <br />
<span>Kitchen Sink</span>
</h1>
<CounterButton />
<p className="description">
Built With{" "}
<Link href="https://turborepo.com" newTab>
Turborepo
</Link>
{" & "}
<Link href="https://vitejs.dev/" newTab>
Vite
</Link>
</p>
</div>
);
return (
<div className="container">
<h1 className="title">
Admin <br />
<span>Kitchen Sink</span>
</h1>
<CounterButton />
<Card className="my-6">
<CardHeader>
<CardTitle>shadcn/ui Card Example</CardTitle>
</CardHeader>
<CardContent>
<Button>shadcn/ui Button</Button>
</CardContent>
</Card>
<p className="description">
Built With{" "}
<Link href="https://turborepo.com" newTab>
Turborepo
</Link>
{" & "}
<Link href="https://vitejs.dev/" newTab>
Vite
</Link>
</p>
</div>
);
}
export default App;

View file

@ -1,40 +0,0 @@
.container {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1.5rem;
max-width: 100%;
margin: 0 auto;
padding: 0 16px;
text-align: center;
}
.title {
font-size: 3rem;
font-weight: 700;
margin: 0;
}
.title span {
display: inline-block;
background-image: linear-gradient(to right, #3b82f6, #ef4444);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.description {
color: #9ca3af;
font-weight: 500;
}
.description a {
color: #3b82f6;
text-decoration: none;
}
.description a:hover {
text-decoration: underline;
}

View file

@ -0,0 +1 @@
export { default } from "@repo/ui/tailwind.config";

View file

@ -1,25 +1,29 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"paths": {
"~/*": ["./src/*"],
"@repo/ui/*": ["../../packages/ui/src/*"]
},
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}

View file

@ -1,6 +1,7 @@
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
plugins: [react()],
plugins: [react(), tsconfigPaths()],
});