Skip to content

Commit 8a99d47

Browse files
committed
docs(release): add release guide and RFC
1 parent dc0f280 commit 8a99d47

5 files changed

Lines changed: 334 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@ Vite+ is the unified entry point for local web development. It combines [Vite](h
1919
- **`vp build`:** Build applications for production with Vite + Rolldown
2020
- **`vp run`:** Execute monorepo tasks with caching and dependency-aware scheduling
2121
- **`vp pack`:** Build libraries for npm publishing or standalone app binaries
22-
- **`vp release`:** Version and publish workspace packages with native publish preflight during `--dry-run`, release checks before real publishes by default, retry-friendly exact version overrides via `--version`, optional changelog generation via `--changelog`, prerelease channels like `--preid alpha` / `beta` / `rc`, and `--projects` order respected between independent packages
22+
- **`vp release`:** Version and publish workspace packages
2323
- **`vp create` / `vp migrate`:** Scaffold new projects and migrate existing ones
2424

2525
All of this is configured from your project root and works across Vite's framework ecosystem.
2626
Vite+ is fully open-source under the MIT license.
2727

28-
`vp release` detects likely checks from `build`, `pack`, `prepack`, `prepublishOnly`, `prepare`, and `vitePlus.release.checkScripts`. Real releases run those checks before publishing unless you pass `--no-run-checks`; dry-runs stay lightweight by default and can opt in with `--run-checks`. `--dry-run` also runs the native publisher in dry-run mode from a temporary release manifest state when the git worktree is clean. Use `--yes` for CI or other non-interactive runs, and `--version <x.y.z>` when retrying a partial publish at an exact version.
29-
30-
Real releases always create git tags after a successful publish. When every released package shares the same target version, `vp release` also creates a repository-level `v<version>` tag so GitHub Releases and repo-wide release notes can follow the same watermark. Preview-only flags such as `--skip-publish` and `--no-git-tag` are therefore limited to `--dry-run`.
31-
3228
## Getting Started
3329

3430
Install Vite+ globally as `vp`:

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const guideSidebar = [
5656
items: [
5757
{ text: 'Build', link: '/guide/build' },
5858
{ text: 'Pack', link: '/guide/pack' },
59+
{ text: 'Release', link: '/guide/release' },
5960
],
6061
},
6162
{

docs/guide/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Vite+ can handle the entire local frontend development cycle from starting a pro
103103

104104
- [`vp build`](/guide/build) builds apps.
105105
- [`vp pack`](/guide/pack) builds libraries or standalone artifacts.
106+
- [`vp release`](/guide/release) versions and publishes workspace packages.
106107
- [`vp preview`](/guide/build) previews the production build locally.
107108

108109
### Manage Dependencies

docs/guide/release.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Release
2+
3+
`vp release` versions and publishes workspace packages from conventional commits and git tags. The intended workflow is: preview locally with `--dry-run`, then run the real publish from trusted-publishing CI.
4+
5+
## Overview
6+
7+
`vp release` is built for monorepos with multiple publishable packages:
8+
9+
- It detects releasable changes from conventional commits.
10+
- It computes the next version for each selected package.
11+
- It updates internal dependency ranges before publish.
12+
- It runs publish preflight and release checks before a real release.
13+
- It creates package tags like `release/pkg-name/v1.2.3`.
14+
15+
When every released package lands on the same version, `vp release` also creates a repository tag like `v1.2.3`.
16+
17+
## Recommended Workflow
18+
19+
### 1. Preview Locally
20+
21+
Use a local dry-run to inspect the release plan without mutating files:
22+
23+
```bash
24+
vp release --dry-run
25+
```
26+
27+
This shows:
28+
29+
- planned package versions
30+
- detected release checks
31+
- trusted publishing readiness
32+
- publish command shape
33+
- git tags that would be created
34+
35+
If you want the dry-run to execute detected checks too:
36+
37+
```bash
38+
vp release --dry-run --run-checks
39+
```
40+
41+
### 2. Publish From CI
42+
43+
Real publishes are designed for trusted-publishing CI:
44+
45+
```bash
46+
vp release --yes
47+
```
48+
49+
Use `--yes` in CI to skip the interactive confirmation prompt.
50+
51+
## Common Flags
52+
53+
### Limit the release to specific packages
54+
55+
```bash
56+
vp release --projects vite-plus,@voidzero-dev/vite-plus-core --dry-run
57+
```
58+
59+
When multiple package patterns are provided, their order is used as a tie-breaker for otherwise independent packages.
60+
61+
### Publish a prerelease
62+
63+
```bash
64+
vp release --preid alpha --yes
65+
vp release --preid beta --yes
66+
vp release --preid rc --yes
67+
```
68+
69+
Custom prerelease channels are also supported:
70+
71+
```bash
72+
vp release --preid canary --yes
73+
```
74+
75+
### Retry a partial publish with an exact version
76+
77+
If a publish stops partway through, rerun the remaining packages with an exact version:
78+
79+
```bash
80+
vp release --projects vite-plus --version 1.2.3 --yes
81+
```
82+
83+
## Release Checks
84+
85+
`vp release` looks for likely pre-release checks from:
86+
87+
- `build`
88+
- `pack`
89+
- `prepack`
90+
- `prepublishOnly`
91+
- `prepare`
92+
- `vitePlus.release.checkScripts`
93+
94+
Real releases run these checks by default. Dry-runs stay lightweight by default, but can opt in with `--run-checks`.
95+
96+
## First Release
97+
98+
For the first publish of a workspace or package set:
99+
100+
```bash
101+
vp release --first-release --dry-run
102+
```
103+
104+
The first-release guidance explains:
105+
106+
- the publish workflow file expected by trusted publishing
107+
- required `repository` metadata
108+
- `publishConfig.access = "public"` for scoped public packages
109+
- the commands to run for dry-run and real publish
110+
111+
## Git Tags
112+
113+
`vp release` uses git tags as the durable release watermark:
114+
115+
- package tags: `release/<package>/v<version>`
116+
- repository tag: `v<version>` when all selected packages share the same target version
117+
118+
Real releases always create git tags after a successful publish. Preview-only shortcuts such as `--skip-publish` and `--no-git-tag` are restricted to `--dry-run`.
119+
120+
## Configuration
121+
122+
Release-specific check scripts can be added in `package.json`:
123+
124+
```json
125+
{
126+
"vitePlus": {
127+
"release": {
128+
"checkScripts": ["release:verify"]
129+
}
130+
}
131+
}
132+
```
133+
134+
Use this when your publish validation does not fit the default script names.

rfcs/release-command.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
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

Comments
 (0)