Skip to content

Commit

Permalink
feat: tailwindcss v4 (#918)
Browse files Browse the repository at this point in the history
* feat: use tailwindcss v4

* feat: update sorting list

* feat: update fitler list

* feat: update fiter list

* feat: add faceted filters
  • Loading branch information
sadmann7 authored Mar 8, 2025
1 parent 24794bb commit 5c7bdca
Show file tree
Hide file tree
Showing 35 changed files with 1,458 additions and 1,461 deletions.
54 changes: 54 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Expert Guidelines

You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind.

Code Style and Structure

- Write concise, technical TypeScript code with accurate examples.
- Use functional and declarative programming patterns; avoid classes.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Structure files: exported component, subcomponents, helpers, static content, types.
- Use console.log({value}) instead of console.log(value)
- Use onCallback instead of handleCallback

Naming Conventions

- Use lowercase with dashes for directories (e.g., components/auth-wizard).
- Favor named exports for components.

TypeScript Usage

- Use TypeScript for all code; prefer interfaces over types.
- Avoid enums; use maps instead.
- Use functional components with TypeScript interfaces.

Syntax and Formatting

- Use the "function" keyword for pure functions.
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
- Use declarative JSX.

UI and Styling

- Use Shadcn UI, Radix, and Tailwind for components and styling.
- Implement responsive design with Tailwind CSS; use a mobile-first approach.

Performance Optimization

- Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC).
- Wrap client components in Suspense with fallback.
- Use dynamic loading for non-critical components.
- Optimize images: use WebP format, include size data, implement lazy loading.

Key Conventions

- Optimize Web Vitals (LCP, CLS, FID).
- Limit 'use client':
- Favor server components and Next.js SSR.
- Use only for Web API access in small components.
- Avoid for data fetching or state management.

Follow Next.js docs for Data Fetching, Rendering, and Routing.

---
20 changes: 8 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
{
"tailwindCSS.includeLanguages": {
"plaintext": "html"
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["tw=\"([^\"]*)\""]
],
"json.schemas": [
{
"fileMatch": ["/package.json"],
"url": "https://json.schemastore.org/package",
"schema": true
}
["clsx\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cva\\(((?:[^()]|\\([^()]*\\))*)\\)", "[\"'`]?([^\"'`]+)[\"'`]?"],
["cn\\(((?:[^()]|\\([^()]*\\))*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
}
8 changes: 5 additions & 3 deletions next.config.js → next.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { NextConfig } from "next";

/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.js");
// Import environment validation synchronously
import "./src/env.js";

/** @type {import("next").NextConfig} */
const nextConfig = {
const nextConfig: NextConfig = {
// Already doing linting and typechecking as separate tasks in CI
eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true },
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@faker-js/faker": "^9.4.0",
"@tailwindcss/postcss": "^4.0.12",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^22.12.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"autoprefixer": "^10.4.20",
"dotenv-cli": "^8.0.0",
"drizzle-kit": "^0.30.4",
"pg": "^8.13.1",
"postcss": "^8.5.1",
"rimraf": "^6.0.1",
"tailwindcss": "^3.4.14",
"tailwindcss": "^4.0.12",
"tsx": "^4.19.2",
"typescript": "^5.7.3"
},
Expand Down
Loading

0 comments on commit 5c7bdca

Please sign in to comment.