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
64 changes: 31 additions & 33 deletions .changeset/aggregate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,50 @@ import fs from "node:fs/promises";
import path from "node:path";
import { execSync } from "node:child_process";

const THANKLESS_COMMITTERS = ["thdxr", "fwang", "jayair"];
const THANKLESS_COMMITTERS = ["thdxr", "fwang", "jayair", "conico974"];

const { version } = JSON.parse(
await fs.readFile("./packages/open-next/package.json"),
);

const changesets = JSON.parse(await fs.readFile(".changeset/config.json"));
const packages = changesets.fixed[0];

const changes = new Set();
for (const pkg of packages) {
const changelog = path.join(
"packages",
pkg.split("/").at(-1),
"CHANGELOG.md",
);
const lines = (await fs.readFile(changelog)).toString().split("\n");
let start = false;
for (let line of lines) {
if (!start) {
if (line === `## ${version}`) {
start = true;
continue;
}

// We only need to look for changes in packages/open-next
const changelog = path.join(
"packages",
"open-next",
"CHANGELOG.md",
);
const lines = (await fs.readFile(changelog)).toString().split("\n");
let start = false;
for (let line of lines) {
if (!start) {
if (line === `## ${version}`) {
start = true;
continue;
}
}

if (start) {
if (line.startsWith("-") || line.startsWith("*")) {
if (line.includes("Updated dependencies")) continue;
if (line.includes("@serverless-stack/")) continue;

for (const user of THANKLESS_COMMITTERS) {
line = line.replace(
`Thanks [@${user}](https://github.com/${user})! `,
"",
);
}
changes.add(line);
continue;
}
if (start) {
if (line.startsWith("-") || line.startsWith("*")) {
if (line.includes("Updated dependencies")) continue;
if (line.includes("@serverless-stack/")) continue;

if (line.startsWith("## ")) break;
for (const user of THANKLESS_COMMITTERS) {
line = line.replace(
`Thanks [@${user}](https://github.com/${user})! `,
"",
);
}
changes.add(line);
continue;
}

if (line.startsWith("## ")) break;
}
}


const notes = ["#### Changes", ...changes];
console.log(notes.join("\n"));
console.log(`::set-output name=notes::${notes.join("%0A")}`);
Expand Down
5 changes: 4 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"changelog": [
"@changesets/changelog-github",
{ "repo": "opennextjs/opennextjs-aws" }
],
"commit": false,
"fixed": [["@opennextjs/aws"]],
"linked": [],
Expand Down
Loading