Skip to content

Commit

Permalink
Update remark, unified and mdast packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Jun 23, 2023
1 parent 2bb9bcb commit b830702
Show file tree
Hide file tree
Showing 3 changed files with 393 additions and 260 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,19 @@
"@manypkg/get-packages": "^1.1.3",
"@octokit/plugin-throttling": "^5.2.1",
"fs-extra": "^8.1.0",
"mdast-util-to-string": "^1.0.6",
"remark-parse": "^7.0.1",
"remark-stringify": "^7.0.3",
"mdast-util-to-string": "^3.2.0",
"remark-parse": "^10.0.2",
"remark-stringify": "^10.0.3",
"resolve-from": "^5.0.0",
"semver": "^7.5.3",
"unified": "^8.3.2"
"unified": "^10.1.2"
},
"husky": {
"hooks": {}
},
"prettier": {},
"resolutions": {
"**/@octokit/core": "4.2.0",
"trim": "^0.0.3",
"y18n": "^4.0.1"
}
}
7 changes: 3 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import unified from "unified";
import { unified } from "unified";
import remarkParse from "remark-parse";
import remarkStringify from "remark-stringify";
// @ts-ignore
import mdastToString from "mdast-util-to-string";
import * as mdast from "mdast-util-to-string";
import { getPackages, Package } from "@manypkg/get-packages";

export const BumpLevels = {
Expand Down Expand Up @@ -51,7 +50,7 @@ export function getChangelogEntry(changelog: string, version: string) {
for (let i = 0; i < nodes.length; i++) {
let node = nodes[i];
if (node.type === "heading") {
let stringified: string = mdastToString(node);
let stringified = mdast.toString(node);
let match = stringified.toLowerCase().match(/(major|minor|patch)/);
if (match !== null) {
let level = BumpLevels[match[0] as "major" | "minor" | "patch"];
Expand Down
Loading

0 comments on commit b830702

Please sign in to comment.