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
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

23 changes: 2 additions & 21 deletions dist/index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/index.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */

/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
30 changes: 30 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// eslint.config.js
import { defineConfig, globalIgnores } from "eslint/config";

import github from "eslint-plugin-github";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default defineConfig([
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.stylistic,
{
languageOptions: {
ecmaVersion: 9,
sourceType: "module"
}
},
{
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" }
]
}
},
{
plugins: { github }
},
globalIgnores(["dist/", "lib/", "node_modules/"])
]);
11 changes: 0 additions & 11 deletions jest.config.js

This file was deleted.

49 changes: 24 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"test": "jest"
"test": "vitest run",
"test-watch": "vitest watch"
},
"repository": {
"type": "git",
Expand All @@ -20,33 +21,31 @@
"author": "Thomas Eizinger",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.3",
"remark-parse": "^7.0.2",
"remark-stringify": "^8.1.1",
"stream-buffers": "^3.0.2",
"unified": "^8.4.2"
"@actions/core": "^2.0.1",
"@actions/exec": "^2.0.0",
"@eslint/js": "^9.39.2",
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
"stream-buffers": "^3.0.3",
"typescript-eslint": "^8.49.0",
"unified": "^11.0.5"
},
"devDependencies": {
"@types/jest": "^24.0.23",
"@types/node": "^12.7.12",
"@types/stream-buffers": "^3.0.3",
"@types/unist": "^2.0.3",
"@types/node": "^25.0.1",
"@types/stream-buffers": "^3.0.8",
"@types/unist": "^3.0.3",
"@types/vfile": "^4.0.0",
"@typescript-eslint/parser": "^2.8.0",
"eslint": "^5.16.0",
"eslint-plugin-github": "^2.0.0",
"eslint-plugin-jest": "^22.21.0",
"jest": "^24.9.0",
"jest-circus": "^24.9.0",
"js-yaml": "^3.13.1",
"@typescript-eslint/parser": "^8.49.0",
"eslint": "^9.39.0",
"eslint-plugin-github": "^6.0.0",
"js-yaml": "^4.1.1",
"mock-env": "^0.2.0",
"prettier": "^1.19.1",
"to-vfile": "^6.0.0",
"ts-jest": "^24.2.0",
"ts-loader": "^6.2.1",
"typescript": "^3.7.3",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
"prettier": "^3.7.4",
"to-vfile": "^8.0.0",
"ts-loader": "^9.5.4",
"typescript": "^5.9.3",
"vitest": "^4.0.15",
"webpack": "^5.103.0",
"webpack-cli": "^6.0.1"
}
}
10 changes: 3 additions & 7 deletions src/getReleaseNotes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unified, { Transformer } from "unified";
import { unified, Transformer } from "unified";
import markdown from "remark-parse";
import stringify from "remark-stringify";
import { VFile } from "vfile";
Expand Down Expand Up @@ -35,16 +35,12 @@ function releaseNotesExtraction(version: string) {
}
}

export default function getReleaseNotes(
file: VFile,
version: string
): string {
// @ts-ignore
export default function getReleaseNotes(file: VFile, version: string): string {
return unified()
.use(markdown)
.use(releaseNotesExtraction, version)
.data("settings", {
listItemIndent: "1",
listItemIndent: "one",
tightDefinitions: true,
bullet: "-"
})
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function run(): Promise<void> {
const releaseNotes = getReleaseNotes(newChangelog, version);
setOutput("release-notes", releaseNotes);
} catch (error) {
setFailed(error.message);
setFailed(error as Error);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/updateChangelog.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import unified, { Transformer } from "unified";
import { unified, Transformer } from "unified";
import markdown from "remark-parse";
import stringify from "remark-stringify";
import { VFile } from "vfile";
Expand Down Expand Up @@ -87,10 +87,11 @@ function convertUnreleasedSectionToNewRelease(

const child = unreleasedSection.children.shift();

// remark parses shorcut links as "text" if it can't locate the footer link, which is the case for the first release test case
if (
!child ||
unreleasedSection.children.length > 0 ||
child.type !== "linkReference"
(child.type !== "linkReference" && child.type !== "text")
) {
throw new Error(
"Invalid changelog format, Unreleased section should only be a link reference"
Expand Down Expand Up @@ -213,7 +214,6 @@ export default async function updateChangelog(
owner: string,
repo: string
): Promise<VFile> {
// @ts-ignore
return await unified()
.use(markdown)
.use(releaseTransformation, {
Expand All @@ -225,7 +225,7 @@ export default async function updateChangelog(
repo
})
.data("settings", {
listItemIndent: "1",
listItemIndent: "one",
tightDefinitions: true,
bullet: "-"
})
Expand Down
7 changes: 7 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
globals: true
},
});
Loading
Loading