Skip to content

turborepo setup with lint-staged, commitizen, changelog

Notifications You must be signed in to change notification settings

5alidz/turborepo-with-commitizen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a test monorepo that uses commitizen

Try it out

clone the repo and run yarn to install the dependencies

gh repo clone 5alidz/turborepo-with-commitizen
cd turborepo-with-commitizen
yarn

do a change and commit it

echo "test" >> abc.txt && git add . && git commit

enojoy the interactive commit wizard 🎉

Steps taken to create the repo

installing husky and lint staged

yarn add -D -W husky lint-staged

ensure that husky in not installed in CI environments

in your package.json

{
  "scripts": {
    "prepare": "node -e \"try { !(process.env.CI !== undefined) && require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\""
  }
}

now run husky prepare

yarn prepare

add lint-staged config

{
  "lint-staged": {
    "apps/**/*.{js,ts,jsx,tsx}": ["./node_modules/eslint/bin/eslint.js --fix"],
    "packages/ui/**/*.{js,ts,jsx,tsx}": [
      "./node_modules/eslint/bin/eslint.js --fix"
    ],
    "*.json": ["prettier --write"]
  }
}

create the hooks

add lint-staged to pre-commit hook

npx husky add .husky/pre-commit "npm run test && npx lint-staged"

add commitizen to prepare-commit-msg

npx husky add .husky/prepare-commit-msg "exec < /dev/tty && git cz --hook || true"

How to use commitizen

after staging your files with git add run git commit to launch the interactive commit wizard

About

turborepo setup with lint-staged, commitizen, changelog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published