https://github.com/hugocruzlfc/nextjs-perfect-base-template
Nextjs with Shadcn(Tailwind v4), husky, commitlint, lint-satged, prettier and eslint integration. Base project template.
https://github.com/hugocruzlfc/nextjs-perfect-base-template
clsx commit-and-tag-version commitizen commitlint cz-conventional-changelog eslint husky lint-staged nextjs15 prettier shadcn-ui tailwindv4 typescript
Last synced: 3 months ago
JSON representation
Nextjs with Shadcn(Tailwind v4), husky, commitlint, lint-satged, prettier and eslint integration. Base project template.
- Host: GitHub
- URL: https://github.com/hugocruzlfc/nextjs-perfect-base-template
- Owner: hugocruzlfc
- Created: 2025-01-14T17:12:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-22T13:25:16.000Z (over 1 year ago)
- Last Synced: 2025-04-22T14:32:18.680Z (over 1 year ago)
- Topics: clsx, commit-and-tag-version, commitizen, commitlint, cz-conventional-changelog, eslint, husky, lint-staged, nextjs15, prettier, shadcn-ui, tailwindv4, typescript
- Language: CSS
- Homepage:
- Size: 475 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
This is a [Next.js](https://nextjs.org) project bootstrapped with `pnpm dlx create-next-app@latest --use-pnpm`.
## Getting Started
Clone the repository and run `pnpm install` to install the dependencies.
## Development
Run `pnpm dev` to start the development server.
## Configuration step by step
Install and config each package and create the necessary files for his configuration.
### Commitlint
[See the commitlint guide](https://commitlint.js.org/guides/getting-started.html) and [local setup](https://commitlint.js.org/guides/local-setup.html)
```bash
pnpm add --save-dev @commitlint/{cli,config-conventional}
```
Create the commitlint configuration file
```bash
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.ts
```
### Husky
```bash
pnpm add --save-dev husky
pnpm husky init
echo "pnpm dlx commitlint --edit \$1" > .husky/commit-msg
```
### Commitizen and cz-conventional-changelog
[See the commitizen cz-cli guide](https://github.com/commitizen/cz-cli)
```bash
pnpm add -D commitizen
pnpm dlx commitizen init cz-conventional-changelog --pnpm --save-dev --save-exact
```
Create prepare-commit-msg hook to run commitizen
```bash
echo "exec < /dev/tty && node_modules/.bin/cz --hook || true" > .husky/prepare-commit-msg
```
### Prettier and plugins
```bash
pnpm add -D prettier eslint-config-prettier eslint-config-prettier eslint-plugin-prettier
```
Create the prettier configuration file
```bash
echo "export default {plugins: ['prettier-plugin-organize-imports','prettier-plugin-tailwindcss'],
tailwindFunctions: ['clsx'],};" > prettier.config.mjs
```
### Lint-staged
```bash
pnpm add -D lint-staged
```
And in the pre commit husky hook copy the following:
```bash
npx lint-staged
```
And the package.json copy the following:
```json
"devDependencies": {
....
},
"lint-staged": {
"*.{js,ts}": [
"eslint --fix",
"prettier --write"
],
"*.{md,html,json}": "prettier --write"
},
```