|
| 1 | +# Changesets |
| 2 | + |
| 3 | +This monorepo uses [changesets](https://github.com/changesets/changesets) for version management and publishing. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +```bash |
| 8 | +# Create a changeset |
| 9 | +pnpm changeset |
| 10 | + |
| 11 | +# Check changeset status |
| 12 | +pnpm changeset:status |
| 13 | + |
| 14 | +# Version packages (usually done by CI) |
| 15 | +pnpm changeset:version |
| 16 | + |
| 17 | +# Publish packages (usually done by CI) |
| 18 | +pnpm changeset:publish |
| 19 | +``` |
| 20 | + |
| 21 | +## Creating Changesets |
| 22 | + |
| 23 | +When you make changes that should be released, create a changeset: |
| 24 | + |
| 25 | +```bash |
| 26 | +pnpm changeset |
| 27 | +``` |
| 28 | + |
| 29 | +This will: |
| 30 | +1. Ask which packages have changed |
| 31 | +2. Ask what type of change (major/minor/patch) for each |
| 32 | +3. Prompt you to write a summary |
| 33 | + |
| 34 | +## Change Types |
| 35 | + |
| 36 | +- **patch** (0.0.x): Bug fixes, small improvements, documentation updates |
| 37 | +- **minor** (0.x.0): New features, new API methods (backwards compatible) |
| 38 | +- **major** (x.0.0): Breaking changes, API changes that break existing code |
| 39 | + |
| 40 | +## Changeset Categories |
| 41 | + |
| 42 | +Use these prefixes in your changeset summaries: |
| 43 | + |
| 44 | +- `feat:` New features |
| 45 | +- `fix:` Bug fixes |
| 46 | +- `docs:` Documentation changes |
| 47 | +- `refactor:` Code refactoring |
| 48 | +- `perf:` Performance improvements |
| 49 | +- `test:` Test additions/changes |
| 50 | +- `chore:` Maintenance tasks |
| 51 | +- `breaking:` Breaking changes (auto-triggers major version) |
| 52 | + |
| 53 | +## Example Changeset |
| 54 | + |
| 55 | +```markdown |
| 56 | +--- |
| 57 | +"@ensemble-ai/sdk": minor |
| 58 | +"@ensemble-ai/cli": patch |
| 59 | +--- |
| 60 | + |
| 61 | +feat: Add subgraphUrl as required parameter to SDK configuration |
| 62 | + |
| 63 | +- SDK: subgraphUrl is now required in EnsembleConfig |
| 64 | +- CLI: Updated to always provide subgraphUrl from config |
| 65 | +- This ensures agent query methods always work correctly |
| 66 | +``` |
| 67 | + |
| 68 | +## Package Versioning |
| 69 | + |
| 70 | +Each package versions independently: |
| 71 | + |
| 72 | +- **@ensemble-ai/sdk**: Core SDK, follows semver strictly |
| 73 | +- **@ensemble-ai/cli**: CLI tool, minor bumps for new commands |
| 74 | +- **@ensemble-ai/contracts**: Smart contracts, major bumps for contract changes |
| 75 | +- **@ensemble-ai/subgraph**: Subgraph indexer, syncs with contract versions |
| 76 | +- **@ensemble-ai/mcp-server**: MCP server, independent versioning |
| 77 | + |
| 78 | +## Release Process |
| 79 | + |
| 80 | +### Automated (Recommended) |
| 81 | +1. Create changeset with your PR |
| 82 | +2. Merge PR to main |
| 83 | +3. CI creates "Release packages" PR |
| 84 | +4. Review and merge release PR |
| 85 | +5. CI publishes to npm |
| 86 | + |
| 87 | +### Manual |
| 88 | +```bash |
| 89 | +pnpm changeset:version # Update versions and changelogs |
| 90 | +pnpm changeset:publish # Publish to npm |
| 91 | +``` |
| 92 | + |
| 93 | +### Prerelease |
| 94 | +```bash |
| 95 | +# Enter prerelease mode |
| 96 | +pnpm changeset pre enter alpha |
| 97 | + |
| 98 | +# Create changesets normally |
| 99 | +pnpm changeset |
| 100 | + |
| 101 | +# Version and publish with tag |
| 102 | +pnpm changeset:version |
| 103 | +pnpm changeset:publish --tag alpha |
| 104 | + |
| 105 | +# Exit prerelease mode |
| 106 | +pnpm changeset pre exit |
| 107 | +``` |
| 108 | + |
| 109 | +## Troubleshooting |
| 110 | + |
| 111 | +### "No changesets present" |
| 112 | +You forgot to create a changeset! Run `pnpm changeset`. |
| 113 | + |
| 114 | +### Package not updating |
| 115 | +Make sure the package is listed in your changeset markdown. |
| 116 | + |
| 117 | +### Wrong version bump |
| 118 | +Delete the changeset file and recreate it with the correct type. |
| 119 | + |
| 120 | +### Internal dependency conflicts |
| 121 | +Changesets will automatically update internal dependencies based on the `updateInternalDependencies` setting. |
0 commit comments