-
-
Notifications
You must be signed in to change notification settings - Fork 501
Update release script #3842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update release script #3842
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the release script to change how preview releases work and adds support for manually specifying version numbers.
Key Changes:
- Preview releases now maintain the current version and add a prerelease suffix (e.g.,
11.0.0 -> 11.0.0-preview.1) instead of bumping the minor version - Added support for manually specifying versions when creating preview releases via an optional third argument
- Updated the
updateChangelogfunction to accept areleaseTypeparameter for more accurate prerelease detection
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/release.mjs | Updated preview release logic to not auto-bump version, added manual version specification feature with validation, updated documentation and error messages |
| package.json | Version bumped from 11.1.0-preview.1 to 12.0.0 |
| async function updateChangelog(version, releaseType) { | ||
| const CHANGELOG = "CHANGELOG.md"; | ||
| const isPrerelease = version.includes("-"); | ||
| const isPrerelease = releaseType === "preview" || version.includes("-"); |
Copilot
AI
Nov 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prerelease detection logic may incorrectly classify releases when using manual versions. If a user provides pnpm release preview 12.0.0 (without prerelease suffix), the changelog will be skipped because releaseType === "preview", even though the version format indicates a stable release.
Consider determining prerelease status solely from the version format: const isPrerelease = version.includes("-"); or add validation to ensure manual versions for "preview" release type must contain a prerelease suffix.
| const isPrerelease = releaseType === "preview" || version.includes("-"); | |
| const isPrerelease = version.includes("-"); |
| // Validate manual version if provided | ||
| if (manualVersion) { | ||
| if (releaseType !== "preview") { | ||
| console.error( | ||
| "Error: Manual version can only be specified with 'preview' release type.", | ||
| ); | ||
| process.exit(1); | ||
| } | ||
| // Validate format | ||
| try { | ||
| parseVersion(manualVersion); | ||
| } catch { | ||
| console.error(`Error: Invalid version format: ${manualVersion}`); | ||
| console.error( | ||
| "Expected format: X.Y.Z or X.Y.Z-prerelease.N (e.g., 12.0.0-preview.1)", | ||
| ); | ||
| process.exit(1); | ||
| } | ||
| } |
Copilot
AI
Nov 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The manual version validation doesn't enforce that manual versions provided with releaseType === "preview" must actually be prerelease versions. This allows users to specify stable versions like 12.0.0 with the preview release type, which could lead to confusing behavior.
Consider adding a check after parseVersion(manualVersion) to ensure the version contains a prerelease suffix:
const parsed = parseVersion(manualVersion);
if (!parsed.prerelease) {
console.error("Error: Manual version for preview releases must include a prerelease suffix (e.g., 12.0.0-preview.1)");
process.exit(1);
}
No description provided.