|
| 1 | +# RFC: `vp release` Command |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +`vp release` versions and publishes workspace packages from conventional commits, package metadata, and git release tags. The user experience is split into two phases: |
| 6 | + |
| 7 | +1. local `--dry-run` planning and verification |
| 8 | +2. real publish from trusted-publishing CI |
| 9 | + |
| 10 | +## Motivation |
| 11 | + |
| 12 | +Publishing a multi-package workspace usually requires stitching together several fragile steps: |
| 13 | + |
| 14 | +```bash |
| 15 | +# Typical ad-hoc release flow |
| 16 | +changeset version |
| 17 | +pnpm -r build |
| 18 | +pnpm -r publish |
| 19 | +git tag ... |
| 20 | +git push ... |
| 21 | +``` |
| 22 | + |
| 23 | +Pain points: |
| 24 | + |
| 25 | +- no single release boundary for versioning, publish, and tags |
| 26 | +- retries are hard after a partial publish |
| 27 | +- internal dependency ranges can drift |
| 28 | +- local dry-runs often fail to resemble the real publish path |
| 29 | +- CI workflows duplicate release logic instead of reusing the CLI |
| 30 | + |
| 31 | +`vp release` aims to make publishing feel like the rest of Vite+: one command, one predictable flow, one documented operator experience. |
| 32 | + |
| 33 | +## Goals |
| 34 | + |
| 35 | +- Make release planning visible before any mutation happens. |
| 36 | +- Derive versions from conventional commits and existing tags. |
| 37 | +- Support monorepo publishing with dependency-aware ordering. |
| 38 | +- Keep local dry-runs safe and informative. |
| 39 | +- Make partial publish retries explicit and recoverable. |
| 40 | +- Default real publishes to trusted-publishing CI. |
| 41 | + |
| 42 | +## Non-Goals |
| 43 | + |
| 44 | +- Replacing npm dist-tag semantics with a custom channel system |
| 45 | +- Managing post-release announcement workflows |
| 46 | +- Replacing package-manager-native publish implementations |
| 47 | + |
| 48 | +## User Experience |
| 49 | + |
| 50 | +### Local Preview |
| 51 | + |
| 52 | +Operators should be able to preview a release from a clean local checkout: |
| 53 | + |
| 54 | +```bash |
| 55 | +vp release --dry-run |
| 56 | +``` |
| 57 | + |
| 58 | +The preview should show: |
| 59 | + |
| 60 | +- packages that will be released |
| 61 | +- current and next versions |
| 62 | +- detected release checks |
| 63 | +- trusted publishing readiness |
| 64 | +- publish commands that would run |
| 65 | +- tags that would be created |
| 66 | + |
| 67 | +### Real Release |
| 68 | + |
| 69 | +The real release is intended for CI: |
| 70 | + |
| 71 | +```bash |
| 72 | +vp release --yes |
| 73 | +``` |
| 74 | + |
| 75 | +The CLI should: |
| 76 | + |
| 77 | +1. validate release options and trusted-publishing posture |
| 78 | +2. compute the release plan |
| 79 | +3. run release checks by default |
| 80 | +4. run native publish preflight |
| 81 | +5. publish packages |
| 82 | +6. persist final manifests and changelogs |
| 83 | +7. create the release commit and tags |
| 84 | + |
| 85 | +## Release Boundary |
| 86 | + |
| 87 | +`vp release` uses git tags as the durable watermark for future runs. |
| 88 | + |
| 89 | +### Package Tags |
| 90 | + |
| 91 | +Each published package gets a tag: |
| 92 | + |
| 93 | +```text |
| 94 | +release/<package>/v<version> |
| 95 | +``` |
| 96 | + |
| 97 | +Examples: |
| 98 | + |
| 99 | +```text |
| 100 | +release/vite-plus/v1.2.3 |
| 101 | +release/voidzero-dev/vite-plus-core/v1.2.3 |
| 102 | +``` |
| 103 | + |
| 104 | +### Repository Tag |
| 105 | + |
| 106 | +When all selected packages land on the same version, `vp release` also creates: |
| 107 | + |
| 108 | +```text |
| 109 | +v<version> |
| 110 | +``` |
| 111 | + |
| 112 | +This repository tag is used for GitHub Releases and repo-wide release notes. |
| 113 | + |
| 114 | +## Version Sources |
| 115 | + |
| 116 | +### Conventional Commits |
| 117 | + |
| 118 | +Version bumps come from conventional commits: |
| 119 | + |
| 120 | +- `feat` -> minor |
| 121 | +- `fix`, `perf`, `refactor`, `revert` -> patch |
| 122 | +- breaking changes -> major |
| 123 | + |
| 124 | +For `0.y.z`, breaking changes are intentionally downgraded to the minor line. |
| 125 | + |
| 126 | +### Tag-Sourced Packages |
| 127 | + |
| 128 | +Some packages keep `"version": "0.0.0"` in source control and treat git tags as the real version history. `vp release` should support that workflow and still rewrite manifests correctly at publish time. |
| 129 | + |
| 130 | +## Prereleases and Retries |
| 131 | + |
| 132 | +### Prerelease Channels |
| 133 | + |
| 134 | +Standard prerelease channels: |
| 135 | + |
| 136 | +```bash |
| 137 | +vp release --preid alpha |
| 138 | +vp release --preid beta |
| 139 | +vp release --preid rc |
| 140 | +``` |
| 141 | + |
| 142 | +Custom channels are also valid: |
| 143 | + |
| 144 | +```bash |
| 145 | +vp release --preid canary |
| 146 | +``` |
| 147 | + |
| 148 | +Custom prerelease tags must round-trip through repository tags so retries and follow-up releases stay consistent. |
| 149 | + |
| 150 | +### Exact Version Retries |
| 151 | + |
| 152 | +If a publish succeeds for only part of the package set, operators should narrow the remaining packages and rerun with `--version`: |
| 153 | + |
| 154 | +```bash |
| 155 | +vp release --projects vite-plus --version 1.2.3 --yes |
| 156 | +``` |
| 157 | + |
| 158 | +The CLI should infer the effective dist-tag from the exact target version when possible, instead of assuming `latest`. |
| 159 | + |
| 160 | +## Release Checks |
| 161 | + |
| 162 | +The default release checks should come from familiar script names: |
| 163 | + |
| 164 | +- `build` |
| 165 | +- `pack` |
| 166 | +- `prepack` |
| 167 | +- `prepublishOnly` |
| 168 | +- `prepare` |
| 169 | +- `vitePlus.release.checkScripts` |
| 170 | + |
| 171 | +Real releases run these checks by default. Dry-runs should remain lightweight unless `--run-checks` is requested. |
| 172 | + |
| 173 | +## First Release |
| 174 | + |
| 175 | +The first publish needs extra operator guidance: |
| 176 | + |
| 177 | +- required workflow permissions for trusted publishing |
| 178 | +- matching `repository` metadata |
| 179 | +- `publishConfig.access = "public"` for public scoped packages |
| 180 | +- recommended `vp release --first-release --dry-run` and CI commands |
| 181 | + |
| 182 | +The workflow template should be a starting point, not a hidden side effect of a dry-run. |
| 183 | + |
| 184 | +## Documentation Plan |
| 185 | + |
| 186 | +The public docs should describe how to use `vp release`, not just how it is implemented. |
| 187 | + |
| 188 | +This RFC pairs with: |
| 189 | + |
| 190 | +- `/guide/release` for operator-facing usage |
| 191 | +- a short README summary line instead of embedding the full release guide in the landing page |
| 192 | + |
| 193 | +## Open Questions |
| 194 | + |
| 195 | +- How much changelog generation should be configurable in the first public version? |
| 196 | +- Should the scaffolded publish workflow use floating major actions (`@v6`) or pinned SHAs? |
| 197 | +- Should the repository tag be optional for lockstep releases, or always created? |
0 commit comments