|
| 1 | +# Contributing to MCP Apps SDK |
| 2 | + |
| 3 | +We welcome contributions to the MCP Apps SDK! This document outlines the process for contributing to the project. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. Fork the repository |
| 8 | +2. Clone your fork: `git clone https://github.com/YOUR-USERNAME/ext-apps.git` |
| 9 | +3. Install dependencies: `npm install` |
| 10 | +4. Build the project: `npm run build` |
| 11 | +5. Run tests: `npm test` |
| 12 | + |
| 13 | +## Development Process |
| 14 | + |
| 15 | +1. Create a new branch for your changes |
| 16 | +2. Make your changes |
| 17 | +3. Run `npm run prettier` to ensure code style compliance |
| 18 | +4. Run `npm test` to verify all tests pass |
| 19 | +5. Submit a pull request |
| 20 | + |
| 21 | +## Pull Request Guidelines |
| 22 | + |
| 23 | +- Follow the existing code style |
| 24 | +- Include tests for new functionality |
| 25 | +- Update documentation as needed |
| 26 | +- Keep changes focused and atomic |
| 27 | +- Provide a clear description of changes |
| 28 | + |
| 29 | +## Running Examples |
| 30 | + |
| 31 | +Start the development environment with hot reloading: |
| 32 | + |
| 33 | +```bash |
| 34 | +npm run examples:dev |
| 35 | +``` |
| 36 | + |
| 37 | +Or build and run examples: |
| 38 | + |
| 39 | +```bash |
| 40 | +npm run examples:start |
| 41 | +``` |
| 42 | + |
| 43 | +## Code of Conduct |
| 44 | + |
| 45 | +This project follows our [Code of Conduct](CODE_OF_CONDUCT.md). Please review it before contributing. |
| 46 | + |
| 47 | +## Reporting Issues |
| 48 | + |
| 49 | +- Use the [GitHub issue tracker](https://github.com/modelcontextprotocol/ext-apps/issues) |
| 50 | +- Search existing issues before creating a new one |
| 51 | +- Provide clear reproduction steps |
| 52 | + |
| 53 | +## Security Issues |
| 54 | + |
| 55 | +Please review our [Security Policy](SECURITY.md) for reporting security vulnerabilities. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## For Maintainers |
| 60 | + |
| 61 | +### Repository Setup |
| 62 | + |
| 63 | +Before publishing releases, ensure the following are configured: |
| 64 | + |
| 65 | +1. **NPM_TOKEN secret**: Add an npm automation token to the repository secrets |
| 66 | + - Go to Settings ’ Secrets and variables ’ Actions |
| 67 | + - Create a new secret named `NPM_TOKEN` |
| 68 | + - Value: an npm automation token with publish permissions for `@modelcontextprotocol/ext-apps` |
| 69 | + |
| 70 | +2. **`release` environment** (optional): Create a protected environment for additional safeguards |
| 71 | + - Go to Settings ’ Environments ’ New environment |
| 72 | + - Name it `release` |
| 73 | + - Add required reviewers or other protection rules as needed |
| 74 | + |
| 75 | +### Publishing a Release |
| 76 | + |
| 77 | +Releases are published automatically via GitHub Actions when a GitHub Release is created. |
| 78 | + |
| 79 | +#### Steps to publish: |
| 80 | + |
| 81 | +1. **Update the version** in `package.json`: |
| 82 | + ```bash |
| 83 | + # For a regular release |
| 84 | + npm version patch # or minor, or major |
| 85 | + |
| 86 | + # For a beta release |
| 87 | + npm version prerelease --preid=beta |
| 88 | + ``` |
| 89 | + |
| 90 | +2. **Commit the version bump** (if not done by `npm version`): |
| 91 | + ```bash |
| 92 | + git add package.json |
| 93 | + git commit -m "Bump version to X.Y.Z" |
| 94 | + git push origin main |
| 95 | + ``` |
| 96 | + |
| 97 | +3. **Create a GitHub Release**: |
| 98 | + - Go to [Releases](https://github.com/modelcontextprotocol/ext-apps/releases) |
| 99 | + - Click "Draft a new release" |
| 100 | + - Create a new tag matching the version (e.g., `v0.1.0`) |
| 101 | + - Set the target branch (usually `main`) |
| 102 | + - Write release notes describing the changes |
| 103 | + - Click "Publish release" |
| 104 | + |
| 105 | +4. **Monitor the workflow**: |
| 106 | + - The [npm-publish workflow](https://github.com/modelcontextprotocol/ext-apps/actions/workflows/npm-publish.yml) will trigger automatically |
| 107 | + - It runs build and test jobs before publishing |
| 108 | + - On success, the package is published to npm with provenance |
| 109 | + |
| 110 | +#### npm Tags |
| 111 | + |
| 112 | +The workflow automatically determines the npm dist-tag: |
| 113 | + |
| 114 | +| Version Pattern | npm Tag | Install Command | |
| 115 | +|-----------------|---------|-----------------| |
| 116 | +| `X.Y.Z` (from main) | `latest` | `npm install @modelcontextprotocol/ext-apps` | |
| 117 | +| `X.Y.Z-beta.N` | `beta` | `npm install @modelcontextprotocol/ext-apps@beta` | |
| 118 | +| `X.Y.Z` (from release branch) | `release-X.Y` | `npm install @modelcontextprotocol/[email protected]` | |
| 119 | + |
| 120 | +#### Maintenance Releases |
| 121 | + |
| 122 | +To release a patch for an older version: |
| 123 | + |
| 124 | +1. Create a release branch from the tag: `git checkout -b release-0.1 v0.1.0` |
| 125 | +2. Cherry-pick or apply fixes |
| 126 | +3. Bump the patch version |
| 127 | +4. Create a GitHub Release targeting the release branch |
| 128 | +5. The package will be published with tag `release-0.1` |
| 129 | + |
| 130 | +### Testing Pre-releases |
| 131 | + |
| 132 | +Every commit and PR automatically publishes a preview package via [pkg-pr-new](https://github.com/pkg-pr-new/pkg-pr-new). Check the PR comments or workflow logs for the install command. |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +## License |
| 137 | + |
| 138 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
0 commit comments