Skip to content

Commit 08067f3

Browse files
chore: added trusted publisher
1 parent cb1ca96 commit 08067f3

16 files changed

+7203
-9132
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets).
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).

.changeset/better-peaches-nail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-dev-middleware": patch
3+
---
4+
5+
Improved initial loading module time.

.changeset/changelog-generator.mjs

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
import { getInfo, getInfoFromPullRequest } from "@changesets/get-github-info";
2+
3+
/** @typedef {import("@changesets/types").ChangelogFunctions} ChangelogFunctions */
4+
5+
/**
6+
* @returns {{ GITHUB_SERVER_URL: string }} value
7+
*/
8+
function readEnv() {
9+
const GITHUB_SERVER_URL =
10+
process.env.GITHUB_SERVER_URL || "https://github.com";
11+
return { GITHUB_SERVER_URL };
12+
}
13+
14+
/** @type {ChangelogFunctions} */
15+
const changelogFunctions = {
16+
getDependencyReleaseLine: async (
17+
changesets,
18+
dependenciesUpdated,
19+
options,
20+
) => {
21+
if (!options.repo) {
22+
throw new Error(
23+
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]',
24+
);
25+
}
26+
if (dependenciesUpdated.length === 0) return "";
27+
28+
const changesetLink = `- Updated dependencies [${(
29+
await Promise.all(
30+
changesets.map(async (cs) => {
31+
if (cs.commit) {
32+
const { links } = await getInfo({
33+
repo: options.repo,
34+
commit: cs.commit,
35+
});
36+
return links.commit;
37+
}
38+
}),
39+
)
40+
)
41+
.filter(Boolean)
42+
.join(", ")}]:`;
43+
44+
const updatedDependenciesList = dependenciesUpdated.map(
45+
(dependency) => ` - ${dependency.name}@${dependency.newVersion}`,
46+
);
47+
48+
return [changesetLink, ...updatedDependenciesList].join("\n");
49+
},
50+
getReleaseLine: async (changeset, type, options) => {
51+
const { GITHUB_SERVER_URL } = readEnv();
52+
if (!options || !options.repo) {
53+
throw new Error(
54+
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]',
55+
);
56+
}
57+
58+
/** @type {number | undefined} */
59+
let prFromSummary;
60+
/** @type {string | undefined} */
61+
let commitFromSummary;
62+
/** @type {string[]} */
63+
const usersFromSummary = [];
64+
65+
const replacedChangelog = changeset.summary
66+
.replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => {
67+
const num = Number(pr);
68+
if (!Number.isNaN(num)) prFromSummary = num;
69+
return "";
70+
})
71+
.replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => {
72+
commitFromSummary = commit;
73+
return "";
74+
})
75+
.replaceAll(/^\s*(?:author|user):\s*@?([^\s]+)/gim, (_, user) => {
76+
usersFromSummary.push(user);
77+
return "";
78+
})
79+
.trim();
80+
81+
const [firstLine, ...futureLines] = replacedChangelog
82+
.split("\n")
83+
.map((l) => l.trimEnd());
84+
85+
const links = await (async () => {
86+
if (prFromSummary !== undefined) {
87+
let { links } = await getInfoFromPullRequest({
88+
repo: options.repo,
89+
pull: prFromSummary,
90+
});
91+
if (commitFromSummary) {
92+
const shortCommitId = commitFromSummary.slice(0, 7);
93+
links = {
94+
...links,
95+
commit: `[\`${shortCommitId}\`](${GITHUB_SERVER_URL}/${options.repo}/commit/${commitFromSummary})`,
96+
};
97+
}
98+
return links;
99+
}
100+
const commitToFetchFrom = commitFromSummary || changeset.commit;
101+
if (commitToFetchFrom) {
102+
const { links } = await getInfo({
103+
repo: options.repo,
104+
commit: commitToFetchFrom,
105+
});
106+
return links;
107+
}
108+
return {
109+
commit: null,
110+
pull: null,
111+
user: null,
112+
};
113+
})();
114+
115+
const users = usersFromSummary.length
116+
? usersFromSummary
117+
.map(
118+
(userFromSummary) =>
119+
`[@${userFromSummary}](${GITHUB_SERVER_URL}/${userFromSummary})`,
120+
)
121+
.join(", ")
122+
: links.user;
123+
124+
let suffix = "";
125+
if (links.pull || links.commit || users) {
126+
suffix = `(${users ? `by ${users} ` : ""}in ${links.pull || links.commit})`;
127+
}
128+
129+
return `\n\n- ${firstLine} ${suffix}\n${futureLines.map((l) => ` ${l}`).join("\n")}`;
130+
},
131+
};
132+
133+
export default changelogFunctions;

.changeset/config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
3+
"changelog": [
4+
"./changelog-generator.mjs",
5+
{ "repo": "webpack/webpack-dev-middleware" }
6+
],
7+
"fixed": [],
8+
"linked": [],
9+
"access": "public",
10+
"baseBranch": "main",
11+
"updateInternalDependencies": "patch",
12+
"ignore": []
13+
}

.changeset/early-rocks-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-dev-middleware": patch
3+
---
4+
5+
Removed outdated code and improved performance by avoiding extra loops.

.changeset/famous-steaks-occur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-dev-middleware": minor
3+
---
4+
5+
Added support for plugin usage, useful when the middleware will be used as a webpack plugin (no stats output, no extra actions).

.changeset/great-meals-wash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-dev-middleware": minor
3+
---
4+
5+
Added the `forwardError` option to enable error forwarding to next middleware.

.changeset/late-snails-argue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-dev-middleware": major
3+
---
4+
5+
The `getFilenameFromUrl` function now returns an object with the found `filename` (or `undefined` if the file was not found) and throws an error if the URL cannot be processed. Additionally, the object contains the `extra` property with `stats` (file system stats) and `outputFileSystem` (output file system where file was found) properties.

.changeset/moody-flowers-sleep.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-dev-middleware": minor
3+
---
4+
5+
Enable `cacheImmutable` by default for immutable assets.

.changeset/strict-drinks-stay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"webpack-dev-middleware": major
3+
---
4+
5+
Minimum supported `Node.js` version is `20.9.0`.

0 commit comments

Comments
 (0)