|
| 1 | +# Contributing to ModelMesh |
| 2 | + |
| 3 | +Thank you for your interest in contributing! This guide will help you get set up. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- **Python 3.11+** — for the core library and tests |
| 8 | +- **Node.js 18+** — for the TypeScript library and tests |
| 9 | +- **Git** — for version control |
| 10 | +- **Docker** (optional) — for proxy deployment testing |
| 11 | + |
| 12 | +## Quick Setup |
| 13 | + |
| 14 | +```bash |
| 15 | +# 1. Clone the repository |
| 16 | +git clone https://github.com/ApartsinProjects/ModelMesh.git |
| 17 | +cd ModelMesh |
| 18 | + |
| 19 | +# 2. Install Python package (editable + dev dependencies) |
| 20 | +pip install -e "./src/python[yaml,dev]" |
| 21 | + |
| 22 | +# 3. Install TypeScript dependencies |
| 23 | +cd src/typescript && npm install && cd ../.. |
| 24 | + |
| 25 | +# 4. Install sample dependencies (links the local TypeScript package) |
| 26 | +npm install # from the root — uses workspaces |
| 27 | + |
| 28 | +# 5. Run the full test suite |
| 29 | +./scripts/test-all.sh |
| 30 | +``` |
| 31 | + |
| 32 | +## Running Tests |
| 33 | + |
| 34 | +```bash |
| 35 | +# All tests (Python + TypeScript) |
| 36 | +./scripts/test-all.sh |
| 37 | + |
| 38 | +# Python only (1,166 tests) |
| 39 | +cd src/python && python -m pytest ../../tests/ -v |
| 40 | + |
| 41 | +# TypeScript only (713 tests) |
| 42 | +cd src/typescript && npm test |
| 43 | +``` |
| 44 | + |
| 45 | +## Running Samples |
| 46 | + |
| 47 | +**Python samples** require the package to be installed: |
| 48 | + |
| 49 | +```bash |
| 50 | +pip install -e "./src/python[yaml]" |
| 51 | +python samples/quickstart/python/00_hello.py |
| 52 | +``` |
| 53 | + |
| 54 | +**TypeScript samples** require workspace setup: |
| 55 | + |
| 56 | +```bash |
| 57 | +npm install # from repo root |
| 58 | +npx tsx samples/quickstart/typescript/00_hello.ts # from repo root |
| 59 | +``` |
| 60 | + |
| 61 | +## Project Structure |
| 62 | + |
| 63 | +``` |
| 64 | +ModelMesh/ |
| 65 | +├── src/python/ # Python library source |
| 66 | +├── src/typescript/ # TypeScript library source |
| 67 | +├── tests/ # Python test suite |
| 68 | +├── samples/ # Code samples (Python + TypeScript) |
| 69 | +│ ├── quickstart/ # Getting started examples |
| 70 | +│ ├── system/ # Multi-provider integration examples |
| 71 | +│ ├── cdk/ # Connector Development Kit tutorials |
| 72 | +│ └── connectors/ # Custom connector examples |
| 73 | +├── docs/ # Documentation (GitHub Pages) |
| 74 | +├── scripts/ # Automation scripts |
| 75 | +└── .github/workflows/ # CI/CD pipelines |
| 76 | +``` |
| 77 | + |
| 78 | +## Code Style |
| 79 | + |
| 80 | +- **Python**: Follows [ruff](https://github.com/astral-sh/ruff) defaults, 120 char line length |
| 81 | +- **TypeScript**: Strict mode, 2-space indent |
| 82 | + |
| 83 | +## Pull Request Process |
| 84 | + |
| 85 | +1. Fork the repository and create a feature branch |
| 86 | +2. Make your changes with tests |
| 87 | +3. Run the full test suite: `./scripts/test-all.sh` |
| 88 | +4. Submit a PR against the `master` branch |
| 89 | +5. Describe what changed and why in the PR description |
| 90 | + |
| 91 | +## Adding a Custom Connector |
| 92 | + |
| 93 | +See the [CDK Developer Guide](docs/cdk/DeveloperGuide.md) for tutorials on building: |
| 94 | +- Custom providers |
| 95 | +- Custom rotation policies |
| 96 | +- Custom secret stores, storage, observability, and discovery connectors |
| 97 | + |
| 98 | +## License |
| 99 | + |
| 100 | +By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE). |
0 commit comments