Contributing
If you wish to contribute to the yantrix codebase or documentation, feel free to fork the repository and submit a pull request. We use Turborepo and PNPM to manage the monorepository, therefore, for completeness of perception, we recommend that you familiarize yourself with the official documentation of each of them.
⌨️ Prerequisites
Before you start working with the repository, make sure that you have the following tools globally installed:
🚀 Quick Start
When working with the repository, do the following steps:
- Fork and clone the repository (make sure you're on the
mainbranch). - Run
pnpm install --frozen-lockfile. - Run
pnpm buildto build local packages. - Сode whatever your heart desires.
- Run
pnpm run testto make sure you haven't messed up. - Push your local changes to your remote repository.
- Submit a pull request (make sure you follow the conventional commit format).
- Voilà, you're in business.
For advanced repository management, you can read this article.
Common Operations
| Command | What it does |
|---|---|
pnpm build | Full monorepo build (all 4 steps) + build summary table |
pnpm test | Run all tests + print test summary table |
pnpm run build:yantrix | Build only @yantrix/* packages |
pnpm run build:rest | Build non-@yantrix packages |
pnpm run build:affected | Build packages changed vs origin/main |
pnpm run test:affected | Test packages changed vs origin/main |
pnpm turbo run build --filter=@yantrix/<pkg> | Build a single package |
pnpm turbo run test --filter=@yantrix/<pkg> | Test a single package |
cd packages/<pkg> && pnpm build | Build a single package (shorter form) |
cd packages/<pkg> && pnpm test | Test a single package (shorter form) |
pnpm run summary:build | Print build stats table without rebuilding |
pnpm run summary:test | Print test results without re-running tests |
pnpm run lint | Lint the entire monorepo |
pnpm run format | Auto-fix lint issues |
pnpm clean | Remove all dist/, coverage/, generated outputs |
If you use Claude Code as your AI assistant, optional slash commands for common tasks (safe commits, changelog generation) are documented here.
Adding a New Dialect
To add a new target language (dialect) to codegen, follow the step-by-step guide in Adding a Dialect.
Testing the Code Generator
For an explanation of the two-layer test model, utilities, naming conventions, and worked examples for all dialects (including Python subprocess tests), see Testing the Code Generator.
Patching Codegen Dialects
When fixing TypeScript errors in generated files, read Patching Codegen Dialects first. It covers the hasTypes pipeline, the expression serializer chain, strict-mode suppression patterns, turbo cache cascade behavior, and the rule against patching core libraries to fix generated output.
Codegen Internals
For architecture diagrams and dialect-specific implementation references, see:
- Codegen Architecture Overview - Dialect comparison and the full code generation pipeline
- JS / TS Dialect Template Reference - Template hierarchy,
itobject schema, include order, and reducer compilation - PureJS / PureTS Dialect Template Reference - Self-contained factory output: template steps, module-level exports, and instance shape
- Python Dialect Template Reference -
it.pythonobject, template steps, module-level exports, and instance shape