Thank you for your interest in contributing to runtyping! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Testing
- Commit Guidelines
- Pull Request Process
- Creating a New Package
By participating in this project, you are expected to uphold a professional and respectful environment. Please be considerate and constructive in your interactions with other contributors.
-
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/runtyping.git cd runtyping -
Install dependencies
yarn
This will install all dependencies and link the workspace packages together.
-
Build all packages
yarn build
-
Run tests to verify setup
yarn test
If you're using VSCode, make sure to:
- Accept the workspace TypeScript version when prompted
- The project includes workspace settings and recommended extensions
For other editors, you'll need to install the Yarn SDK for proper TypeScript support:
yarn dlx @yarnpkg/sdks <editor-name>Please commit the generated SDK files with your PR if you're using a new editor.
This is a monorepo managed with Yarn workspaces. The structure is:
runtyping/
├── packages/ # All packages live here
│ ├── generator/ # Core generator package
│ ├── io-ts/ # io-ts type writer
│ ├── runtypes/ # runtypes type writer
│ ├── valibot/ # valibot type writer
│ ├── yup/ # yup type writer
│ ├── zod/ # zod type writer
│ ├── zod-mini/ # zod-mini type writer
│ ├── zod-core/ # shared zod core utilities
│ └── test-type-writers/ # testing utilities
├── scaffold/ # Package scaffolding templates
└── .github/ # GitHub workflows and configuration
Each package contains:
src/- Source codetest/- Test filesfixtures/- Test fixtures (for type writer packages)tsconfig.json- TypeScript configurationvitest.config.ts- Vitest test configurationpackage.json- Package metadata
-
Create a new branch
git checkout -b feature/your-feature-name
Use descriptive branch names:
feature/for new featuresfix/for bug fixesdocs/for documentation changesrefactor/for code refactoring
-
Make your changes
- Write clean, readable code
- Follow existing code style and patterns
- Add or update tests as needed
- Update documentation if applicable
-
Build and test locally
# Build all packages yarn build # Run all tests yarn test
All packages use Vitest for testing.
# Run all tests
yarn test
# Run tests for a specific package
cd packages/zod
yarn test- Place test files in the
test/directory - Use
.test.tsor.spec.tssuffix for test files - Fixtures should go in the
fixtures/directory - Follow existing test patterns in the package you're modifying
This project uses Conventional Commits for commit messages. This enables automatic changelog generation and semantic versioning.
<type>(<scope>): <subject>
[optional body]
[optional footer]
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Code style changes (formatting, missing semi colons, etc)refactor: Code refactoring without changing functionalityperf: Performance improvementstest: Adding or updating testschore: Changes to build process or auxiliary toolsci: Changes to CI configuration
feat(zod): add support for branded types
fix(generator): handle circular references correctly
docs(readme): update installation instructions
test(valibot): add tests for optional fields-
Ensure your code is ready
- All tests pass
- Code builds successfully
- No linting errors
- Documentation is updated
-
Update the Pull Request
- Provide a clear description of what changes you've made
- Reference any related issues
- Include screenshots for UI changes (if applicable)
- List any breaking changes
-
Submit the Pull Request
- Push your branch to your fork
- Open a pull request against the
masterbranch - Fill out the PR template completely
-
Code Review
- Respond to feedback from maintainers
- Make requested changes
- Push updates to your branch (they'll automatically update the PR)
-
CI Checks
- All CI checks must pass (tests run on Node.js 20, 22, 24, and 25)
- Fix any failing tests or build issues
-
Merge
- Once approved and all checks pass, a maintainer will merge your PR
- The project uses automated releases, so your changes will be published automatically
To create a new type writer package, use the scaffolding tool:
yarn scaffoldThis will guide you through creating a new package with the proper structure and configuration.
- Questions: Open a discussion
- Bugs: Open an issue
- Security: Contact the maintainers privately for security concerns
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to runtyping! Your efforts help make runtime validation easier for everyone. 🎉