Development Workflow
Make your changes
Develop your recipe following the creating recipes guide.
Run pre-commit checks
Before committing, run the comprehensive check suite:This command will:
- Fix formatting and safe linting issues automatically
- Check TypeScript types across all workspaces
- Run all tests
Restore modified fixtures
Some integration tests modify fixture files. Restore them before committing:
Commit your changes
Commit using Conventional Commits format:
Pre-Commit Checks
Thenpm run pre-commit command is your safety net. It runs:
1. Linting with Auto-Fix
- Fix formatting issues (indentation, spacing, etc.)
- Apply safe automatic fixes for common issues
- Report remaining linting errors
2. Type Checking
3. Test Suite
All three checks must pass before you can commit. If any fail, fix the issues and run
npm run pre-commit again.Commit Message Format
We follow Conventional Commits for automatic changelog generation and semantic versioning.Format
Types
| Type | Description | Example |
|---|---|---|
feat | New feature or recipe | feat(tmpdir): add tmpDir to tmpdir migration |
fix | Bug fix | fix(util-log): handle multiple arguments correctly |
docs | Documentation changes | docs(readme): update usage examples |
test | Test additions or fixes | test(crypto-fips): add edge case tests |
chore | Maintenance tasks | chore(deps): update ast-grep to v0.41.0 |
refactor | Code refactoring | refactor(utils): simplify binding resolution |
perf | Performance improvements | perf(import-assertions): optimize AST traversal |
Scope
The scope is typically the recipe name or affected area:tmpdir-to-tmpdirutil-logutilscidocs
Examples
Pull Request Process
Creating a Pull Request
Fill out the PR description
Include:
- What changes were made
- Why the changes are needed
- Link to related issues or deprecation notices
- Examples of code transformations
Link related issues
Use GitHub keywords to automatically link issues:
Closes #123- Closes the issue when PR is mergedFixes #123- Same as ClosesResolves #123- Same as ClosesRef #123- References the issue without closing
Wait for CI checks
GitHub Actions will automatically run:
- Linting and type checking
- Tests on Ubuntu, macOS, and Windows
- Tests on multiple Node.js versions (22+)
PR Acceptance Criteria
For a pull request to be merged, it must:Receive 2 approvals
Receive 2 approvals
At least 2 reviewers with write access must approve the PR.
Pass all CI checks
Pass all CI checks
All automated tests and checks must pass:
- Linting
- Type checking
- Tests on all platforms
- YAML validation
Be open for 48 hours
Be open for 48 hours
PRs must remain open for at least 48 hours to allow for review and discussion.Exceptions:
- Hotfixes for critical bugs
- Trivial corrections (typos, formatting)
No objections from reviewers
No objections from reviewers
No reviewer with write access has objected to the changes.
Follow contribution guidelines
Follow contribution guidelines
Changes follow all guidelines in this documentation:
- Proper file structure
- Complete test coverage
- Conventional commit format
- Documentation included
Git Best Practices
Branch Naming
Use descriptive branch names with type prefixes:Avoiding Force Push
Force-pushing:- Breaks the PR review process
- Loses review context and comments
- Makes it difficult for reviewers to see what changed
- Causes significant delays
Keeping Your Branch Updated
If the main branch has moved ahead:CI/CD Pipeline
The project uses GitHub Actions for continuous integration.Quality Assurance Workflow
Triggered on every push and pull request:Publish Workflow
Automatically publishes recipes to the Codemod Registry when:- Changes are merged to main
- Changes affect recipe directories
Developer’s Certificate of Origin
By contributing, you certify that:(a) Original work
(a) Original work
The contribution was created in whole or in part by you and you have the right to submit it under the open source license indicated in the file.
(b) Modified work
(b) Modified work
The contribution is based upon previous work that is covered under an appropriate open source license and you have the right to submit that work with modifications under the same open source license.
(c) Provided by others
(c) Provided by others
The contribution was provided directly to you by someone who certified (a) or (b) and you have not modified it.
(d) Public record
(d) Public record
You understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information you submit with it) is maintained indefinitely.
Getting Help
If you need assistance:GitHub Issues
Ask questions or report problems
Codemod Documentation
Learn more about the Codemod framework
Creating Recipes
Review the recipe creation guide
Testing Guide
Review testing best practices