Prerequisites
Before you begin, ensure you have current versions of:- Node.js
- npm
Project Structure
Our codebase is organized as a monorepo using npm workspaces:Recipe Structure
Each recipe resides inrecipes/<recipe-name>/ with the following structure:
Development Setup
1
Clone the repository
2
Install dependencies
3
Run tests
Verify your setup by running the test suite:
Available Scripts
The project provides several npm scripts for development:Shared Utilities
Theutils/ workspace provides helpful utilities for building codemods:
- Import utilities:
getNodeImportStatements(),getNodeImportCalls() - Require utilities:
getNodeRequireCalls() - Binding resolution:
resolveBindingPath(),removeBinding() - Code cleanup:
removeLines()
Useful Resources
- Codemod CLI Reference
- Codemod Workflow Documentation
- Codemod Studio Documentation
- JS ast-grep (jssg) API Reference
- JS ast-grep Testing Utilities
- JS ast-grep Semantic Analysis
- ast-grep Documentation
Next Steps
Creating Recipes
Learn how to create new migration recipes
Testing
Understand testing requirements and best practices
Development Workflow
Follow our development and PR process