Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ You can upload your `stats.json` file [here](http://webpack.github.io/analyse/)

## Publishing V0 maintenance releases

The `v0` branch preserves the final pre-1.0 Editor line for supported 0.15.x maintenance. Current Editor development and stable releases use `main`.
The `v0` branch supports Editor releases with major version zero (`0.x.x`), including prereleases such as `0.16.0-beta.1`. The release guard rejects invalid semantic versions and any version with major version one or higher. Current Editor development and stable releases use `main`.

We use [Changesets](https://github.com/changesets/changesets) to create release pull requests, update the changelog, and publish packages.

Expand Down
9 changes: 2 additions & 7 deletions scripts/validate-v0-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ import semver from "semver";
export function validateV0Version(version) {
const parsedVersion = semver.parse(version);

if (
parsedVersion === null ||
parsedVersion.major !== 0 ||
parsedVersion.minor !== 15 ||
parsedVersion.prerelease.length !== 0
) {
if (parsedVersion === null || parsedVersion.major !== 0) {
throw new Error(
`The package version "${version}" is outside the supported stable 0.15.x maintenance line.`
`The package version "${version}" is outside the supported 0.x.x release line.`
);
}

Expand Down
46 changes: 39 additions & 7 deletions scripts/validate-v0-version.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,51 @@ import { describe, test } from "node:test";
import { validateV0Version } from "./validate-v0-version.mjs";

describe("validateV0Version", () => {
test("accepts stable versions on the 0.15.x maintenance line", () => {
for (const version of ["0.15.0", "0.15.4", "0.15.99"]) {
test("accepts any stable version with major version zero", () => {
for (const version of [
"0.0.0",
"0.14.9",
"0.15.0",
"0.15.4",
"0.15.99",
"0.16.0",
"0.99.99",
]) {
assert.equal(validateV0Version(version), version);
}
});

test("rejects versions outside the stable 0.15.x maintenance line", () => {
test("accepts prereleases and build metadata with major version zero", () => {
for (const version of [
"0.16.0-alpha.0",
"0.16.0-beta.1",
"0.16.0-rc.1",
"0.16.0+build.123",
"0.16.0-beta.1+build.123",
]) {
assert.equal(validateV0Version(version), version);
}
});

test("rejects versions with a nonzero major version", () => {
for (const version of [
"",
"0.14.9",
"0.15.5-beta.0",
"0.16.0",
"1.0.0",
"1.0.0-beta.1",
"1.0.0+build.123",
"2.0.0",
"2.0.0-rc.1",
]) {
assert.throws(() => validateV0Version(version));
}
});

test("rejects invalid semantic versions", () => {
for (const version of [
"",
"not-a-version",
"0.16",
"0.16.x",
"0.16.0-beta.01",
]) {
assert.throws(() => validateV0Version(version));
}
Expand Down
Loading