This project uses npm workspaces to manage multiple packages.
- Node.js 20 or higher
- npm 10.x or higher
npm installnpm run lintnpm testThis project uses Lefthook v2.0.0 to manage Git hooks.
- pre-commit:
- Sorts all
package.jsonfiles (priority 1) - Runs ESLint on staged
.js,.ts,.tsxfiles in parallel (priority 2) - Validates branch names (priority 3)
- Sorts all
- commit-msg:
- Validates commit messages with commitlint
Hooks are automatically installed when you run npm install (via the prepare script).
To manually reinstall hooks:
npx lefthook install# Skip all hooks
LEFTHOOK=0 git commit -m "message"
# Skip specific command
LEFTHOOK_EXCLUDE=validate-branch git commit -m "message"npx lefthook run pre-commit --verboseTo ensure that every part of the monorepo infrastructure works as intended, every package must be located within the ./packages/<new-package-name> folder.
After creating a package, add a release script to the ./packages/<new-package-name>/package.json file, and another one to the main ./package.json file with:
"release:<new-package-name>": "npm run release --workspace=@untile/<new-package-name>",When creating new packages, keep in mind that the auto labeler must have the new package added in .github/labeler, so that it can label its pull requests accordingly and they are included in the correct CHANGELOG.md. To add new packages to auto labeler run:
sh bin/auto-labeler.shMake sure that you have configured GITHUB_TOKEN in your globals.
This will also publish your packages that have changes to NPM.
npm run release:[<package-name>] [<new version> | major | minor | patch]
git push origin master && git push --tags