This is a Next.js project bootstrapped with pnpm dlx create-next-app@latest --use-pnpm
.
Clone the repository and run pnpm install
to install the dependencies.
Run pnpm dev
to start the development server.
Install and config each package and create the necessary files for his configuration.
See the commitlint guide and local setup
pnpm add --save-dev @commitlint/{cli,config-conventional}
Create the commitlint configuration file
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.ts
pnpm add --save-dev husky
pnpm husky init
echo "pnpm dlx commitlint --edit \$1" > .husky/commit-msg
See the commitizen cz-cli guide
pnpm add -D commitizen
pnpm dlx commitizen init cz-conventional-changelog --pnpm --save-dev --save-exact
Create prepare-commit-msg hook to run commitizen
echo "exec < /dev/tty && node_modules/.bin/cz --hook || true" > .husky/prepare-commit-msg
pnpm add -D prettier eslint-config-prettier eslint-config-prettier eslint-plugin-prettier
Create the prettier configuration file
echo "export default {plugins: ['prettier-plugin-organize-imports','prettier-plugin-tailwindcss'],
tailwindFunctions: ['clsx'],};" > prettier.config.mjs
pnpm add -D lint-staged
And in the pre commit husky hook copy the following:
npx lint-staged
And the package.json copy the following:
"devDependencies": {
....
},
"lint-staged": {
"*.{js,ts}": [
"eslint --fix",
"prettier --write"
],
"*.{md,html,json}": "prettier --write"
},