Thank you for your interest in contributing to this monorepo! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Workflow
- Commit Message Conventions
- Pull Request Guidelines
- Coding Standards
- Testing
- Release Process
This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to daniel.sousa.tutods@gmail.com.
- Node.js: v20 or higher
- pnpm: Latest version (recommended) or npm/yarn
- Git: Latest version
- Fork and clone the repository
git clone https://github.com/your-username/lib.git
cd lib- Install dependencies
pnpm install- Build all packages
pnpm buildUse descriptive branch names:
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Adding or updating testschore/- Maintenance tasks
Examples:
feature/button-component
fix/input-validation
docs/update-readme
refactor/optimize-build- Create a new branch
git checkout -b feature/your-feature-name-
Make your changes
-
Lint and format your code
pnpm lint:fix- Commit your changes (using Commitizen)
pnpm commitFollow the Commit Message Conventions below.
- Push to your fork
git push origin feature/your-feature-name- Create a Pull Request
We use Conventional Commits to automate versioning and changelog generation.
<type>(<scope>): <description>
[optional body]
[optional footer]
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksci: CI/CD changesperf: Performance improvementsrevert: Revert a previous commit
Common scopes include:
components- React componentsbiome-config- Biome configurationtypescript-config- TypeScript configurationci- CI/CD workflowsdocs- Documentation
feat(components): add Button component with variants
Add a new Button component with primary, secondary, and outline variants.
Supports custom className and onClick handler.
Closes #123fix(biome-config): resolve Tailwind CSS sorting conflict
Update tailwind.json to properly handle Tailwind utility class sorting
when used with clsx and cva.docs: update contributing guide with new workflow
Add detailed instructions for the PR review process and
automated release workflow.We provide a CLI tool to help you write proper commit messages:
pnpm commitFollow the interactive prompts to create your commit message.
- Code follows the project's coding standards
- Code is properly linted (
pnpm lint:fix) - Commit messages follow conventional commits
- Tests pass (if applicable)
- Documentation is updated (if needed)
Use the same format as commit messages:
feat(components): add Button component
fix(biome-config): resolve Tailwind sorting
docs: update README with new examples
Include:
- What - Brief description of changes
- Why - Reason for the change
- How - Implementation approach (if complex)
- Related issues - Link to related issues
- Screenshots - For UI changes (if applicable)
## What
Brief description of what this PR does.
## Why
Reason for these changes.
## How
Technical approach (if needed).
## Related
- Closes #123
- Related to #456
## Checklist
- [ ] Code follows project standards
- [ ] Tests pass
- [ ] Documentation updatedThis project uses Biome for linting and formatting. Configuration is provided by @tutods/biome-config.
Run linter:
pnpm lintAuto-fix issues:
pnpm lint:fix- Indentation: 2 spaces
- Quotes: Single quotes
- Semicolons: Required
- Trailing commas: Enabled
- Line width: 120 characters
- File naming:
kebab-case.tsorkebab-case.tsx
- Strict mode: Always use strict TypeScript
- No implicit any: Avoid
anytype - Return types: Explicit return types for functions
- Interfaces vs Types: Use
interfacefor object shapes,typefor unions/intersections
- Functional components: Only use functional components with hooks
- Props interfaces: Define props with TypeScript interfaces
- Default exports: Avoid; use named exports
- Component naming: PascalCase for components
- File organization: Co-locate styles, tests, and components
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Run tests for a specific package
pnpm test --filter @tutods/components- Unit tests: Test individual functions and components
- Integration tests: Test component interactions
- Coverage: Aim for 80%+ coverage
This project uses automated releases powered by:
- Conventional Commits - Determine version bump (major/minor/patch)
- NX Release - Generate changelogs and bump versions
- GitHub Actions - Automatically create Release PRs
- npm Registry - Publish on merge
- Push to main with conventional commits
- Release PR is automatically created (
release/nextbranch) - Review and merge the Release PR
- Packages are published to npm automatically
- Git tags are created (
@tutods/package@version) - GitHub releases are created with changelogs
Any commit to main that matches these types triggers a version bump:
feat- Minor version bump (0.x.0 → 0.x+1.0)fix- Patch version bump (0.0.x → 0.0.x+1)docs,refactor,chore,ci,style- Patch version bump
# This triggers a minor version bump
git commit -m "feat(components): add Modal component"
# This triggers a patch version bump
git commit -m "fix(components): resolve Button onClick issue"
# This triggers a patch version bump
git commit -m "docs: update README with new examples"See docs/RELEASE.md for detailed release documentation.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: daniel.sousa.tutods@gmail.com
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing! 🎉