|
| 1 | +# Release & Git Workflow |
| 2 | + |
| 3 | +Guide for versioning, commits, pull requests, and release process. |
| 4 | + |
| 5 | +## Conventional Commits |
| 6 | + |
| 7 | +All commits follow the Conventional Commits specification. This is enforced by review. |
| 8 | + |
| 9 | +### Format |
| 10 | + |
| 11 | +``` |
| 12 | +<type>(<scope>): <subject> |
| 13 | +
|
| 14 | +<body> |
| 15 | +
|
| 16 | +<footer> |
| 17 | +``` |
| 18 | + |
| 19 | +### Commit Types |
| 20 | + |
| 21 | +- **`feat:`** New feature |
| 22 | +- **`fix:`** Bug fix |
| 23 | +- **`perf:`** Performance improvement |
| 24 | +- **`docs:`** Documentation only |
| 25 | +- **`refactor:`** Code restructuring (no feature change) |
| 26 | +- **`test:`** Test addition or update |
| 27 | +- **`chore:`** Tooling, dependencies, config |
| 28 | + |
| 29 | +### Breaking Changes |
| 30 | + |
| 31 | +For breaking changes: |
| 32 | + |
| 33 | +1. Use `feat!:` or `fix!:` prefix |
| 34 | +2. Add footer: `BREAKING CHANGE: <description>` |
| 35 | + |
| 36 | +Example: |
| 37 | + |
| 38 | +``` |
| 39 | +feat!: change parser return type |
| 40 | +
|
| 41 | +BREAKING CHANGE: parseAsInteger now throws on invalid input instead of returning null |
| 42 | +``` |
| 43 | + |
| 44 | +## Semantic Versioning |
| 45 | + |
| 46 | +Version bumping is **automated by `semantic-release`**: |
| 47 | + |
| 48 | +- **Patch** (v1.2.3 → v1.2.4) — `fix:` commits |
| 49 | +- **Minor** (v1.2.0 → v1.3.0) — `feat:` commits |
| 50 | +- **Major** (v1.0.0 → v2.0.0) — `feat!:` or `fix!:` (breaking changes) |
| 51 | + |
| 52 | +**Do not manually bump versions** — The automation handles this. |
| 53 | + |
| 54 | +## Release Branch |
| 55 | + |
| 56 | +- **Release branch:** `next` |
| 57 | +- Commits to `next` trigger `semantic-release` |
| 58 | +- Publishing to NPM is automatic |
| 59 | +- Check [GitHub Releases](../../releases) for version history |
| 60 | + |
| 61 | +## Pull Request Standards |
| 62 | + |
| 63 | +### Before Opening a PR |
| 64 | + |
| 65 | +1. Ensure commit messages follow Conventional Commits |
| 66 | +2. Run local tests: `pnpm test` |
| 67 | +3. Verify types with type-level tests |
| 68 | +4. Update documentation if applicable |
| 69 | +5. Consider if breaking change justification is needed |
| 70 | + |
| 71 | +### PR Description |
| 72 | + |
| 73 | +Include: |
| 74 | + |
| 75 | +- **Summary** — What is this PR doing and why? |
| 76 | +- **Type** — Is this a feature, fix, refactor, or doc update? |
| 77 | +- **Changes** — High-level list of modified areas |
| 78 | +- **Testing** — What test coverage was added? |
| 79 | +- **Breaking Changes** — If applicable, describe migration path |
| 80 | + |
| 81 | +### PR Title |
| 82 | + |
| 83 | +PR title should match the first commit message (Conventional Commit format): |
| 84 | + |
| 85 | +- `feat: add new parser type` |
| 86 | +- `fix: handle edge case in batching` |
| 87 | +- `docs: update adapter setup guide` |
| 88 | + |
| 89 | +### PR Checklist |
| 90 | + |
| 91 | +Before marking ready for review: |
| 92 | + |
| 93 | +- [ ] `pnpm test` passes locally |
| 94 | +- [ ] Tests added/updated for new behavior |
| 95 | +- [ ] All new exports documented |
| 96 | +- [ ] Docs content updated if applicable |
| 97 | +- [ ] README updated if user-facing change |
| 98 | +- [ ] No unintended bundle size growth |
| 99 | +- [ ] Conventional Commit message |
| 100 | +- [ ] No unresolved TODOs introduced |
| 101 | +- [ ] No stray console logs (except controlled debug) |
| 102 | + |
| 103 | +## Documentation Updates |
| 104 | + |
| 105 | +Update documentation when: |
| 106 | + |
| 107 | +- **Public API surface changes** (new exports, hook signature) |
| 108 | +- **Parser behavior changes** (parsing rules, serialization) |
| 109 | +- **Adapter requirements change** (new options, breaking changes) |
| 110 | + |
| 111 | +### What to Update |
| 112 | + |
| 113 | +1. **README.md** |
| 114 | + - Examples section |
| 115 | + - API reference |
| 116 | + - Adapter list |
| 117 | + |
| 118 | +2. **MDX docs** under `packages/docs/content` |
| 119 | + - Mirror relevant README sections |
| 120 | + - Add detailed examples |
| 121 | + - Document configuration options |
| 122 | + |
| 123 | +### Documentation Best Practices |
| 124 | + |
| 125 | +- Keep examples concise |
| 126 | +- Link to existing demos instead of duplicating code |
| 127 | +- Maintain consistency with existing documentation style |
| 128 | +- Add examples that show common use cases |
| 129 | +- Update table of contents if adding new sections |
| 130 | + |
| 131 | +## Decision Log |
| 132 | + |
| 133 | +When making non-trivial architectural changes: |
| 134 | + |
| 135 | +1. Add a short note to AGENTS.md Decision Log section |
| 136 | +2. Format: `YYYY-MM-DD - <Title> - Rationale / Impact / Migration (if any)` |
| 137 | +3. Examples: |
| 138 | + - `2025-01-15 - Add batching optimization - Reduces URL updates by 40% when multiple state changes occur in same tick. No migration needed.` |
| 139 | + - `2025-01-20 - Parser requires eq method - Enables custom equality checks for complex types. Existing parsers automatically compatible.` |
| 140 | + |
| 141 | +## Automation & Tools |
| 142 | + |
| 143 | +The team uses the following automation: |
| 144 | + |
| 145 | +- **Conventional Commits:** Enforced by commit linting |
| 146 | +- **Type checking:** Part of `pnpm test` |
| 147 | +- **semantic-release:** Automatic versioning and publishing from `next` branch |
| 148 | +- **PR checks:** Linting, testing, type checking run automatically |
| 149 | + |
| 150 | +**Agents may:** |
| 151 | + |
| 152 | +- Generate parser boilerplate |
| 153 | +- Update Adapters section in documentation |
| 154 | +- Append PR checklist results |
| 155 | +- Run local tests & lint before proposing changes |
| 156 | + |
| 157 | +**Agents must not:** |
| 158 | + |
| 159 | +- Auto-commit version bumps (handled by release automation) |
| 160 | +- Force push to main/master |
| 161 | +- Modify git configuration |
| 162 | +- Skip git hooks |
0 commit comments