Welcome Contributors
Thank you for your interest in contributing to Zayne Labs Toolkit! This guide will help you get started with development and understand our workflows.The toolkit is an open-source project maintained by Ryan Zayne. We welcome contributions from developers of all skill levels.
Getting Started
Prerequisites
Before you begin, ensure you have the following installed:- Node.js: v18.x or higher
- pnpm: v10.28.2 (package manager)
- Git: For version control
Development Setup
Project Structure
The repository is organized as a monorepo using Turborepo:Development Workflow
Available Scripts
Root-level scripts:Package-Specific Development
To work on a specific package:- toolkit-core
- toolkit-react
- toolkit-type-helpers
Making Changes
Adding New Features
Develop your feature
- Add your code in the appropriate package under
src/ - Export your function/hook from the package’s
index.ts - Follow existing code patterns and conventions
Code Quality Standards
TypeScript Guidelines
TypeScript Guidelines
- Use TypeScript 5.9.x features
- Prefer type inference over explicit types
- Use
typefor object shapes,interfacefor extensible contracts - Avoid
any- useunknownor proper types - Export types separately from implementation
Testing Requirements
Testing Requirements
- Write tests for all new features
- Use Vitest for unit tests
- Test edge cases and error conditions
- Maintain or improve code coverage
- Use
happy-domfor browser environment tests
Code Style
Code Style
- Follow the ESLint configuration
- Use Prettier for formatting (automatic via lint-staged)
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
Performance
Performance
- Monitor bundle size with size-limit
- Avoid unnecessary dependencies
- Use tree-shakeable exports
- Consider lazy loading for heavy features
Commit Guidelines
The project uses Husky for pre-commit hooks:Pre-commit Checks
lint-staged.config.js
- ESLint on changed files
- Tests for TypeScript files
- Type checking
- Bundle size validation
- Package.json validation
Commit Message Format
Use clear, descriptive commit messages:Changesets
The project uses Changesets for version management.Creating a Changeset
When your PR includes user-facing changes:Select affected packages
Choose which packages your changes affect:
@zayne-labs/toolkit-core@zayne-labs/toolkit-react@zayne-labs/toolkit-type-helpers
Choose version bump
Select the type of version bump:
- patch: Bug fixes and small changes
- minor: New features (backwards compatible)
- major: Breaking changes
Continuous Integration
The project uses GitHub Actions for CI/CD:Automated Checks
Lint and Type Check
Runs ESLint and TypeScript checks on all PRs
Size Limit
Validates bundle sizes stay within limits
Release Preview
Publishes preview releases via pkg.pr.new
Dependency Review
Scans for security vulnerabilities
Test Release
Every PR automatically gets a test release published via pkg.pr.new:.github/workflows/release-and-publish(pkg.pr.new).yml
Pull Request Process
Prepare your PR
- Ensure all tests pass
- Add changeset if needed
- Update documentation
- Write clear PR description
Submit PR
- Push your branch to GitHub
- Open a pull request against
main - Fill out the PR template
- Link any related issues
Release Process
Releases are automated using Changesets:- When PRs with changesets are merged, a “Version Packages” PR is created
- This PR updates version numbers and CHANGELOG files
- When merged, packages are automatically published to npm
- Release notes are generated via changelogithub
Getting Help
GitHub Discussions
Ask questions and share ideas
GitHub Issues
Report bugs and request features
Contributing Guidelines
Detailed contribution guidelines
Code of Conduct
Community guidelines
Recognition
All contributors are recognized in:- GitHub contributors page
- Release notes
- Project README