Skip to content

Commit

Permalink
chore(CHANGELOG): prepare for new release
Browse files Browse the repository at this point in the history
  • Loading branch information
tcort committed Nov 5, 2024
1 parent 332adc6 commit 492a7cc
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 102 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## Version 3.13.5

- fix: MODULE_NOT_FOUND error #368

## Version 3.13.4

- fix: MODULE_NOT_FOUND error #368
Expand Down
63 changes: 62 additions & 1 deletion bin/markdown-link-check
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,68 @@ const pkg = require('../package.json');
const { Command } = require('commander');
const program = new Command();
const { ProxyAgent } = require('proxy-agent');
const reporters = require('../reporters.js');

const reporters = {
default: async function defaultReporter(err, results, opts, filenameForOutput) {
const chalk = (await import('chalk')).default

const statusLabels = {
alive: chalk.green('✓'),
dead: chalk.red('✖'),
ignored: chalk.gray('/'),
error: chalk.yellow('⚠'),
};

if (err) {
console.error(chalk.red("\n ERROR: something went wrong!"));
console.error(err.stack);
}

if (results.length === 0 && !opts.quiet) {
console.log(chalk.yellow(" No hyperlinks found!"));
}
results.forEach(function (result) {
// Skip messages for non-deadlinks in quiet mode.
if (opts.quiet && result.status !== "dead") {
return;
}

if (opts.verbose) {
if (result.err) {
console.log(
" [%s] %s → Status: %s %s",
statusLabels[result.status],
result.link,
result.statusCode,
result.err
);
} else {
console.log(" [%s] %s → Status: %s", statusLabels[result.status], result.link, result.statusCode);
}
} else if (!opts.quiet) {
console.log(" [%s] %s", statusLabels[result.status], result.link);
}
});

if (!opts.quiet) {
console.log("\n %s links checked.", results.length);
}

if (results.some((result) => result.status === "dead")) {
let deadLinks = results.filter((result) => {
return result.status === "dead";
});
if (!opts.quiet) {
console.error(chalk.red("\n ERROR: %s dead links found!"), deadLinks.length);
} else {
console.error(chalk.red("\n ERROR: %s dead links found in %s !"), deadLinks.length, filenameForOutput);
}
deadLinks.forEach(function (result) {
console.log(" [%s] %s → Status: %s", statusLabels[result.status], result.link, result.statusCode);
});
}
},
};

class Input {
constructor(filenameForOutput, stream, opts) {
Expand Down
59 changes: 0 additions & 59 deletions default.js

This file was deleted.

36 changes: 0 additions & 36 deletions junit.js

This file was deleted.

6 changes: 0 additions & 6 deletions reporters.js

This file was deleted.

0 comments on commit 492a7cc

Please sign in to comment.