Skip to content

Commit

Permalink
core: editor config and gitattributes configured
Browse files Browse the repository at this point in the history
  • Loading branch information
vgseven committed Oct 6, 2024
1 parent fd546af commit 8038d83
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 49 deletions.
7 changes: 6 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"changelog": [
"@changesets/changelog-github",
{
"repo": "labelementary/turborepo-essential"
}
],
"commit": false,
"fixed": [],
"linked": [],
Expand Down
42 changes: 42 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

# Markdown files
[*.mdx]
trim_trailing_whitespace = false

# JSON files
[*.json]
insert_final_newline = false

# TypeScript and JavaScript files
[*.{ts,js,tsx,jsx}]
quote_type = single

# YAML files
[*.{yml,yaml}]
indent_size = 2

# Shell scripts
[*.sh]
indent_style = space
indent_size = 2

# Ignore built and vendor files
[{build,dist,node_modules,.turbo}/**]
indent_style = ignore
indent_size = ignore
end_of_line = ignore
trim_trailing_whitespace = ignore
charset = ignore
53 changes: 53 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Set default behavior to automatically normalize line endings
* text=auto eol=lf

# Source code
*.js text eol=lf
*.jsx text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.json text eol=lf
*.css text eol=lf
*.scss text eol=lf
*.html text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.xml text eol=lf
*.svg text eol=lf

# Scripts
*.sh text eol=lf
*.bash text eol=lf

# Config files
*.conf text eol=lf
*.config text eol=lf
*.lock text eol=lf
.env text eol=lf
.gitattributes text eol=lf
.gitignore text eol=lf
.editorconfig text eol=lf

# Documentation
*.txt text eol=lf
*.pdf binary

# Denote all files that are truly binary and should not be modified
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.eot binary
*.woff binary
*.woff2 binary
*.pyc binary
*.pdf binary
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pnpm run typecheck
pnpm run lint
pnpm run format
pnpm run build
pnpm run build
40 changes: 9 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Unified Turborepo Essential, An Essential Template to get started with Turborepo

## Features

- ✨ Library: [React](https://reactjs.org/) with [Vite](https://vitejs.dev/) - Fast and efficient development environment
- ✨ Famework: [Next.js](https://nextjs.org/) - The React Framework
- 📦 Bundler: [Turbopack](https://turbo.build/) - The universal bundler for web
- 🚀 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
Expand All @@ -13,16 +14,16 @@ Unified Turborepo Essential, An Essential Template to get started with Turborepo
- ⚙️ 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
- `apps/`: Source code directory
- `web/`: Web application
- `packages/`: Packages directory
- `ui/`: UI components
- `tailwind-config/`: Tailwind CSS configuration
- `lib/`: Helpers, utilities, and configs
- `ts-config/`: TypeScript configuration

## Getting Started

Expand All @@ -31,29 +32,6 @@ Unified Turborepo Essential, An Essential Template to get started with Turborepo
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:
Expand Down
11 changes: 8 additions & 3 deletions apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { Metadata } from "next";
import "@/styles/root-layout.css";
import { fonts } from "@/lib/fonts";
import { cn } from "@repo/lib";

export const metadata: Metadata = {
title: "Next Essential",
title: "Turborepo Essential",
description:
"Next.js Essential Starter Template to start your next next.js project",
"Turborepo Essential Starter Template to start your next Turborepo project.",
icons: {
icon: "favicon.png",
},
Expand All @@ -19,7 +20,11 @@ export default function RootLayout({
return (
<html
lang="en"
className={`${fonts.GeistSans.variable} ${fonts.GeistMono.variable} font-geistMono`}
className={cn(
fonts.GeistSans.variable,
fonts.GeistMono.variable,
"font-geistMono"
)}
>
<body>{children}</body>
</html>
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Label } from "@repo/ui";

export default function Home() {
return (
<main
className={"relative flex h-screen flex-col items-center justify-center"}
>
<h1 className={"font-semibold text-3xl tracking-tighter"}>
<Label className={"font-semibold text-3xl tracking-tighter"}>
Next Essential
</h1>
</Label>
<p className={"my-4 max-w-[44rem] text-center"}>
The Next.js Essential Starter Template is a Next.js project that
provides a basic structure for building ypur next.js project.
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/styles/root-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
}

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

body {
@apply bg-background text-foreground;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit"
},
"exports": {
".": {
"import": "./src/index.ts",
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/primitives/label.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import * as React from "react";
import * as LabelPrimitive from "@radix-ui/react-label";
import { cva, type VariantProps } from "class-variance-authority";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@repo/ts-config/react",
"include": ["./src/**/*.ts", "./src/**/*.tsx"],
"include": ["."],
"exclude": ["node_modules", "dist"]
}
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8038d83

Please sign in to comment.