Run typecheck on CI (#478)

This commit is contained in:
Mateusz Burzyński
2025-05-11 11:01:53 +02:00
committed by GitHub
parent 9d933dcd11
commit c1f57e52f9
7 changed files with 51 additions and 85 deletions
+5 -5
View File
@@ -81,7 +81,7 @@ describe("version", () => {
await runVersion({
octokit: setupOctokit("@@GITHUB_TOKEN"),
git: new Git(),
git: new Git({ cwd }),
cwd,
});
@@ -115,7 +115,7 @@ describe("version", () => {
await runVersion({
octokit: setupOctokit("@@GITHUB_TOKEN"),
git: new Git(),
git: new Git({ cwd }),
cwd,
});
@@ -149,7 +149,7 @@ describe("version", () => {
await runVersion({
octokit: setupOctokit("@@GITHUB_TOKEN"),
git: new Git(),
git: new Git({ cwd }),
cwd,
});
@@ -203,7 +203,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
await runVersion({
octokit: setupOctokit("@@GITHUB_TOKEN"),
git: new Git(),
git: new Git({ cwd }),
cwd,
prBodyMaxCharacters: 1000,
});
@@ -261,7 +261,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
await runVersion({
octokit: setupOctokit("@@GITHUB_TOKEN"),
git: new Git(),
git: new Git({ cwd }),
cwd,
prBodyMaxCharacters: 500,
});
+4 -6
View File
@@ -1,6 +1,7 @@
import unified from "unified";
import remarkParse from "remark-parse";
import remarkStringify from "remark-stringify";
import type { Root } from "mdast";
// @ts-ignore
import mdastToString from "mdast-util-to-string";
import { getPackages, Package } from "@manypkg/get-packages";
@@ -35,11 +36,11 @@ export async function getChangedPackages(
}
export function getChangelogEntry(changelog: string, version: string) {
let ast = unified().use(remarkParse).parse(changelog);
let ast = unified().use(remarkParse).parse(changelog) as Root;
let highestLevel: number = BumpLevels.dep;
let nodes = ast.children as Array<any>;
let nodes = ast.children;
let headingStartInfo:
| {
index: number;
@@ -75,10 +76,7 @@ export function getChangelogEntry(changelog: string, version: string) {
}
}
if (headingStartInfo) {
ast.children = (ast.children as any).slice(
headingStartInfo.index + 1,
endIndex
);
ast.children = ast.children.slice(headingStartInfo.index + 1, endIndex);
}
return {
content: unified().use(remarkStringify).stringify(ast),