Skip to content

Commit

Permalink
core: configured base structure
Browse files Browse the repository at this point in the history
  • Loading branch information
vgseven committed Oct 5, 2024
1 parent ab4ca35 commit fd546af
Show file tree
Hide file tree
Showing 50 changed files with 1,034 additions and 806 deletions.
7 changes: 0 additions & 7 deletions .vscode/extensions.json

This file was deleted.

8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
}
"[css]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
68 changes: 67 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,67 @@
# Turborepo Essential
# Unified Turborepo Essential

Unified Turborepo Essential, An Essential Template to get started with Turborepo application with all the essentials included...

## Features

- ✨ Library: [React](https://reactjs.org/) with [Vite](https://vitejs.dev/) - Fast and efficient development environment
- 🚀 Styling: [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
- 💻 Language: [TypeScript](https://www.typescriptlang.org/) - Typed superset of JavaScript
- 🧹 Linting and Formatting: [Biome.js](https://biomejs.dev/) - Fast and customizable linter and formatter
- 🎨 Themes: [next-themes](https://github.com/pacocoursey/next-themes) - Easy theming for React.js.
- 💄 Icons: [lucide-react](https://lucide.dev/) - A comprehensive set of icons for React.js
- ⚙️ Build: Github Actions - Automated workflows for CI/CD
- 🛠 Commit: [Husky](https://typicode.github.io/husky/) - Git hooks made easy
- 📦 Package: [pnpm](https://pnpm.io/) - Fast, disk space efficient package manager
- 🚀 Routing: [TanStack Router](https://tanstack.com/router/v1) - Type-safe routing for React

## Project Structure

- `src/`: Source code directory
- `routes/`: Contains all routes and pages
- `ui/`: Contains all reusable components and primitives
- `lib/`: Includes helpers, utilities, and configuration files
- `styles/`: Global styles and theme configuration
- `public/`: Static assets and images

## Getting Started

1. Clone the repository
2. Install dependencies: `pnpm install`
3. Run the development server: `pnpm run dev`
4. Open [http://localhost:5173](http://localhost:5173) in your browser

## Guidelines

- Keep components and primitives in the `src/ui/` folder
- Place all routes and pages in the `src/routes/` folder
- Store helpers, utilities, and configs in the `src/lib/` folder
- Follow the TypeScript and Biome.js linting rules
- Use Husky pre-commit hooks to ensure code quality

## Customization

- Modify the theme in `tailwind.config.ts`
- Adjust global styles in `src/styles/root-layout.css`
- Configure Vite settings in `vite.config.ts`

## Available Scripts

- `pnpm run dev`: Start the development server
- `pnpm run build`: Build the production-ready application
- `pnpm run typecheck`: Run TypeScript type checking
- `pnpm run lint`: Run Biome.js linter
- `pnpm run lint:fix`: Run Biome.js linter and fix issues
- `pnpm run format`: Format code using Biome.js

## Contributing

Contributions are welcome! Please follow these steps:

1. Fork the repository
2. Create a new branch: `git checkout -b feature/your-feature-name`
3. Make your changes and commit them: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin feature/your-feature-name`
5. Submit a pull request

For major changes, please open an issue first to discuss what you would like to change.
4 changes: 3 additions & 1 deletion apps/web/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Next.js Template
# Web

An Next.js Application started with [Next-Essential](https://github.com/labelementary/next-essential).
4 changes: 0 additions & 4 deletions apps/web/biome.json

This file was deleted.

25 changes: 13 additions & 12 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
{
"name": "web",
"version": "0.0.0",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"typecheck": "tsc --noEmit",
"lint": "biome lint --write .",
"format": "biome format --write ."
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@repo/ui": "workspace:*",
"@repo/lib": "workspace:*",
"geist": "^1.3.1",
"next": "14.2.5",
"next": "14.2.14",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^20.14.11",
"@types/react": "^18.3.3",
"@repo/tailwind-config": "workspace:*",
"@repo/ts-config": "workspace:*",
"@types/node": "^22.7.4",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.39",
"tailwindcss": "^3.4.6",
"typescript": "^5.5.3",
"@biomejs/biome": "^1.8.3"
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.13",
"typescript": "^5.6.2"
}
}
Binary file modified apps/web/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export default function Home() {
return (
<main
className={"h-screen relative flex flex-col justify-center items-center"}
className={"relative flex h-screen flex-col items-center justify-center"}
>
<h1 className={"text-3xl font-semibold tracking-tighter"}>
<h1 className={"font-semibold text-3xl tracking-tighter"}>
Next Essential
</h1>
<p className={"my-4 max-w-[44rem] text-center"}>
Expand Down
23 changes: 23 additions & 0 deletions apps/web/src/styles/root-layout.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 240 4.8% 95.9%;
--foreground: 240 10% 3.9%;
--primary: 240 5.9% 10%;
--primary-foreground: 0 0% 98%;
--secondary: 240 5.9% 90%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
}
}

@layer base {
* {
@apply border-border;
}

body {
@apply bg-background text-foreground;
}
}
30 changes: 22 additions & 8 deletions apps/web/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
import type { Config } from "tailwindcss";
import { default as twConfig } from "@repo/tailwind-config/tailwind";

const config = {
content: ["./src/app/**/*.{ts,tsx}"],
extend: {
fontFamily: {
geistSans: ["var(--font-geist-sans)"],
geistMono: ["var(--font-geist-mono)"],
const config: Pick<Config, "presets"> = {
presets: [
{
...twConfig,
content: [
"./src/app/**/*.{ts,tsx}",
"./src/ui/**/*.tsx",
"./src/content/**/*.mdx",
"../../packages/ui/src/**/*.{ts,tsx}",
],
theme: {
extend: {
...twConfig?.theme?.extend,
fontFamily: {
geistSans: ["var(--font-geist-sans)"],
geistMono: ["var(--font-geist-mono)"],
},
},
},
},
},
} satisfies Config;
],
};

export default config;
27 changes: 4 additions & 23 deletions apps/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": ["@repo/ts-config/next"],
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"target": "esnext",
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"],
"@/public/*": ["./public/*"]
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules", ".next", ".turbo"]
}
108 changes: 107 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,110 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"extends": ["./packages/config/biome/base.json"]
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf",
"attributePosition": "auto",
"ignore": [
".next",
".vercel",
".env",
".changeset",
".husky",
".turbo",
"node_modules",
"build",
"dist"
]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"nursery": {
"useSortedClasses": {
"fix": "unsafe",
"level": "warn",
"options": {
"attributes": ["className"],
"functions": ["cn", "cva"]
}
}
},
"correctness": {
"recommended": true,
"noUnusedVariables": "warn",
"noUnusedImports": "warn"
},
"style": {
"recommended": true
},
"complexity": {
"recommended": true
},
"performance": {
"recommended": true
},
"suspicious": {
"recommended": true
},
"a11y": {
"recommended": true
},
"security": {
"recommended": true
}
},
"ignore": [
".vscode",
".next",
".vercel",
".env",
".changeset",
".husky",
".turbo",
"node_modules",
"build",
"dist"
]
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "double",
"attributePosition": "auto"
}
},
"css": {
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf",
"quoteStyle": "double"
}
},
"json": {
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf",
"trailingCommas": "none"
}
}
}
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
"build": "turbo build",
"dev": "turbo dev",
"typecheck": "turbo typecheck",
"lint": "turbo lint",
"format": "turbo format",
"lint": "biome lint --write .",
"lint:fix": "biome lint --write --unsafe .",
"format": "biome format --write .",
"prepare": "husky"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@biomejs/biome": "^1.9.3",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.7",
"husky": "^9.1.4",
"turbo": "^2.0.12"
"@changesets/cli": "^2.27.9",
"husky": "^9.1.6",
"turbo": "^2.1.3"
},
"packageManager": "pnpm@9.7.0",
"packageManager": "pnpm@9.12.0",
"engines": {
"node": ">=20"
}
Expand Down
Loading

0 comments on commit fd546af

Please sign in to comment.