Skip to content

Conversation

@ntotten
Copy link
Member

@ntotten ntotten commented Nov 28, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 28, 2025 19:19
@ntotten ntotten merged commit e510b68 into main Nov 28, 2025
12 checks passed
@ntotten ntotten deleted the update_release branch November 28, 2025 19:19
Copy link
Contributor

Copilot AI left a 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 updateChangelog function to accept a releaseType parameter 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("-");
Copy link

Copilot AI Nov 28, 2025

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.

Suggested change
const isPrerelease = releaseType === "preview" || version.includes("-");
const isPrerelease = version.includes("-");

Copilot uses AI. Check for mistakes.
Comment on lines +162 to +180
// 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);
}
}
Copy link

Copilot AI Nov 28, 2025

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);
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants