Skip to content
Open
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
5 changes: 5 additions & 0 deletions .changeset/bump-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": patch
---

Bump production dependencies, notably `open` to v11 and `p-retry` to v8.
5 changes: 5 additions & 0 deletions .changeset/bump-express-5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Bump Express to v5. See the [Express 5 migration guide](https://expressjs.com/en/guide/migrating-5.html) for the full list of breaking changes.
5 changes: 5 additions & 0 deletions .changeset/bump-webpack-peer-dependency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Bump the `webpack` peer dependency range from `^5.0.0` to `^5.101.0`.
137 changes: 137 additions & 0 deletions .changeset/changelog-generator.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
import { getInfo, getInfoFromPullRequest } from "@changesets/get-github-info";

/** @typedef {import("@changesets/types").ChangelogFunctions} ChangelogFunctions */

/**
* @returns {{ GITHUB_SERVER_URL: string }} value
*/
function readEnv() {
const GITHUB_SERVER_URL =
process.env.GITHUB_SERVER_URL || "https://github.com";
return { GITHUB_SERVER_URL };
}

/** @type {ChangelogFunctions} */
const changelogFunctions = {
getDependencyReleaseLine: async (
changesets,
dependenciesUpdated,
options,
) => {
if (!options.repo) {
throw new Error(
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]',
);
}
if (dependenciesUpdated.length === 0) return "";

const changesetLink = `- Updated dependencies [${(
await Promise.all(
changesets.map(async (cs) => {
if (cs.commit) {
const { links } = await getInfo({
repo: options.repo,
commit: cs.commit,
});
return links.commit;
}
}),
)
)
.filter(Boolean)
.join(", ")}]:`;

const updatedDependenciesList = dependenciesUpdated.map(
(dependency) => ` - ${dependency.name}@${dependency.newVersion}`,
);

return [changesetLink, ...updatedDependenciesList].join("\n");
},
getReleaseLine: async (changeset, type, options) => {
const { GITHUB_SERVER_URL } = readEnv();
if (!options || !options.repo) {
throw new Error(
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]',
);
}

/** @type {number | undefined} */
let prFromSummary;
/** @type {string | undefined} */
let commitFromSummary;
/** @type {string[]} */
const usersFromSummary = [];

const replacedChangelog = changeset.summary
.replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => {
const num = Number(pr);
if (!Number.isNaN(num)) prFromSummary = num;
return "";
})
.replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => {
commitFromSummary = commit;
return "";
})
.replace(/^\s*(?:author|user):\s*@?([^\s]+)/gim, (_, user) => {
usersFromSummary.push(user);
return "";
})
.trim();

const [firstLine, ...futureLines] = replacedChangelog
.split("\n")
.map((l) => l.trimEnd());

const links = await (async () => {
if (prFromSummary !== undefined) {
let { links } = await getInfoFromPullRequest({
repo: options.repo,
pull: prFromSummary,
});
if (commitFromSummary) {
const shortCommitId = commitFromSummary.slice(0, 7);
links = {
...links,
commit: `[\`${shortCommitId}\`](${GITHUB_SERVER_URL}/${options.repo}/commit/${commitFromSummary})`,
};
}
return links;
}
const commitToFetchFrom = commitFromSummary || changeset.commit;
if (commitToFetchFrom) {
const { links } = await getInfo({
repo: options.repo,
commit: commitToFetchFrom,
});
return links;
}
return {
commit: null,
pull: null,
user: null,
};
})();

const users = usersFromSummary.length
? usersFromSummary
.map(
(userFromSummary) =>
`[@${userFromSummary}](${GITHUB_SERVER_URL}/${userFromSummary})`,
)
.join(", ")
: links.user;

let suffix = "";
if (links.pull || links.commit || users) {
suffix = `(${users ? `by ${users} ` : ""}in ${
links.pull || links.commit
})`;
}

return `\n\n- ${firstLine} ${suffix}\n${futureLines
.map((l) => ` ${l}`)
.join("\n")}`;
},
};

export default changelogFunctions;
141 changes: 141 additions & 0 deletions .changeset/changeset-validate.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import fs from "fs/promises";
import path from "path";
import { fileURLToPath } from "url";
import { simpleGit } from "simple-git";
import pkgJson from "../package.json" with { type: "json" };

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const rootPath = path.join(__dirname, "..");
const git = simpleGit(rootPath);

const VALID_BUMPS = new Set(["major", "minor", "patch"]);
const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/;
const ENTRY_RE = /^"([^"]+)"\s*:\s*([a-zA-Z]+)\s*$/;

const toLines = (output) =>
output
.split(/\r?\n/)
.map((line) => line.trim())
.filter(Boolean);

const isChangeset = (filePath) => {
const normalized = filePath.replace(/\\/g, "/");
return (
normalized.startsWith(".changeset/") &&
normalized.endsWith(".md") &&
normalized !== ".changeset/README.md"
);
};

const gitDiff = async (more = []) => {
const args = [
"diff",
"--name-only",
// cspell:ignore ACMR
"--diff-filter=ACMR",
...more,
"--",
".changeset/*.md",
].filter(Boolean);

return toLines(await git.raw(args));
};

const getChangedFiles = async () => {
const files = new Set();
const baseRef = process.env.GITHUB_BASE_REF;

// GitHub Actions base diff
if (baseRef) {
for (const file of await gitDiff([`origin/${baseRef}...HEAD`])) {
if (isChangeset(file)) files.add(file);
}
}
// Local working tree changes
else {
const _files = [
// Unstaged changes
...(await gitDiff()),
// Staged but uncommitted changes
...(await gitDiff(["--cached"])),
// Untracked files
...(await git.status()).not_added,
];
for (const file of _files) {
if (isChangeset(file)) files.add(file);
}
}
return files;
};

const validate = async (filePath) => {
const absoluteFilePath = path.join(rootPath, filePath);
const content = await fs.readFile(absoluteFilePath, "utf8");
const frontmatterMatch = content.match(FRONTMATTER_RE);
const errors = [];

if (!frontmatterMatch) {
errors.push("missing YAML frontmatter block");
return errors;
}

const entries = frontmatterMatch[1]
.split(/\r?\n/)
.map((line) => line.trim())
.filter(Boolean);

if (entries.length === 0) {
errors.push("frontmatter does not contain package bump entries");
return errors;
}

for (const entry of entries) {
const match = entry.match(ENTRY_RE);
if (!match) {
errors.push(`invalid frontmatter entry: ${entry}`);
continue;
}

const [, pkgName, bumpType] = match;
if (pkgName !== pkgJson.name) {
errors.push(
`invalid package name "${pkgName}", expected "${pkgJson.name}"`,
);
}

if (!VALID_BUMPS.has(bumpType)) {
errors.push(
`invalid bump type "${bumpType}", expected one of: major, minor, patch`,
);
}
}

return errors;
};

const main = async () => {
const changedFiles = await getChangedFiles();

if (changedFiles.length === 0) {
console.log("No changed changeset files found.");
return;
}

const failures = [];
for (const filePath of changedFiles) {
const errors = await validate(filePath);
for (const error of errors) {
failures.push(`${filePath}: ${error}`);
}
}

if (failures.length > 0) {
console.error("Changeset validation failed:");
for (const failure of failures) {
console.error(`- ${failure}`);
}
process.exitCode = 1;
}
};

main();
5 changes: 5 additions & 0 deletions .changeset/compression-http2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": minor
---

Enable the compression middleware for HTTP/2 connections.
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": [
"./changelog-generator.mjs",
{ "repo": "webpack/webpack-dev-server" }
],
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/drop-node-below-22.15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Drop support for Node.js < 22.15.0.
5 changes: 5 additions & 0 deletions .changeset/fix-issameorigin-loopback-aliases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": patch
---

Treat loopback aliases (`127.0.0.1`, `::1`, `localhost`) as equivalent in `isSameOrigin` so the WebSocket client does not reject valid same-origin connections.
5 changes: 5 additions & 0 deletions .changeset/migrate-to-esm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Migrate the package to ES module syntax. The package is now published as ESM-only.
5 changes: 5 additions & 0 deletions .changeset/migrate-to-node-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": patch
---

Migrate the test suite from Jest to `node:test` and set up the jsdom environment.
5 changes: 5 additions & 0 deletions .changeset/remove-cli-flags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Remove CLI flags. Use the `serve` command from `webpack-cli` together with a configuration file or the programmatic API instead.
5 changes: 5 additions & 0 deletions .changeset/remove-colorette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": minor
---

Remove the `colorette` dependency in favor of native ANSI styling.
5 changes: 5 additions & 0 deletions .changeset/remove-internalip-methods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Remove the `internalIP` and `internalIPSync` static methods from `Server`. Resolve the local IP yourself if you need it.
5 changes: 5 additions & 0 deletions .changeset/remove-proxy-bypass.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Remove the `bypass` option from proxy configuration. Use the `router` or `context` options provided by `http-proxy-middleware` instead.
5 changes: 5 additions & 0 deletions .changeset/remove-sockjs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Remove SockJS support. The `webSocketServer` option no longer accepts `"sockjs"`; use the default `"ws"` transport instead.
5 changes: 5 additions & 0 deletions .changeset/remove-spdy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Remove the `spdy` dependency. Use the built-in `node:http2` module via the `server` option for HTTP/2 support.
5 changes: 5 additions & 0 deletions .changeset/update-chokidar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": minor
---

Update `chokidar` to v5 and extend `watchFiles.options.ignored` to support glob string patterns via `tinyglobby`.
5 changes: 5 additions & 0 deletions .changeset/update-http-proxy-middleware-v3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

Update `http-proxy-middleware` to v3. See the [http-proxy-middleware v3 release notes](https://github.com/chimurai/http-proxy-middleware/releases/tag/v3.0.0) for the full list of breaking changes.
Loading
Loading