Thanks for considering contributing to morph! Here's how to get started.
# Clone the repo
git clone https://github.com/alvinreal/morph.git
cd morph
# Build
cargo build
# Run tests
cargo test
# Run with logging
RUST_LOG=debug cargo run -- -i test.json -o test.yamlsrc/
├── main.rs # CLI entry point
├── lib.rs # Library root
├── value.rs # Universal Value type
├── error.rs # Error types
├── cli.rs # Argument parsing
├── formats/ # Format readers/writers
│ ├── mod.rs # Registry & detection
│ ├── json.rs
│ ├── yaml.rs
│ └── ...
├── mapping/ # Mapping language
│ ├── lexer.rs # Tokenizer
│ ├── parser.rs # AST construction
│ ├── ast.rs # AST types
│ ├── eval.rs # Evaluator
│ └── functions.rs # Built-in functions
└── tests/
- Tests: Add tests for any new functionality
- Formatting: Run
cargo fmtbefore committing - Linting: Run
cargo clippyand address warnings - Docs: Update relevant docs for user-facing changes
- Create
src/formats/<name>.rs - Implement the
ReaderandWritertraits - Register in
src/formats/mod.rs - Add file extension mappings
- Add round-trip tests in
tests/formats/ - Update the format table in README.md and PRD.md
- Add the function implementation in
src/mapping/functions.rs - Register it in the function lookup table
- Add tests in
tests/mapping/ - Document in
docs/MAPPING_LANGUAGE.md
- Keep PRs focused — one feature or fix per PR
- Include tests
- Update docs if needed
- Describe what and why in the PR description
Be kind, be constructive, be respectful. We're all here to build something useful.