Skip to content

Commit 492a7cc

Browse files
committed
chore(CHANGELOG): prepare for new release
1 parent 332adc6 commit 492a7cc

File tree

5 files changed

+66
-102
lines changed

5 files changed

+66
-102
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## Version 3.13.5
4+
5+
- fix: MODULE_NOT_FOUND error #368
6+
37
## Version 3.13.4
48

59
- fix: MODULE_NOT_FOUND error #368

bin/markdown-link-check

+62-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,68 @@ const pkg = require('../package.json');
1212
const { Command } = require('commander');
1313
const program = new Command();
1414
const { ProxyAgent } = require('proxy-agent');
15-
const reporters = require('../reporters.js');
15+
16+
const reporters = {
17+
default: async function defaultReporter(err, results, opts, filenameForOutput) {
18+
const chalk = (await import('chalk')).default
19+
20+
const statusLabels = {
21+
alive: chalk.green('✓'),
22+
dead: chalk.red('✖'),
23+
ignored: chalk.gray('/'),
24+
error: chalk.yellow('⚠'),
25+
};
26+
27+
if (err) {
28+
console.error(chalk.red("\n ERROR: something went wrong!"));
29+
console.error(err.stack);
30+
}
31+
32+
if (results.length === 0 && !opts.quiet) {
33+
console.log(chalk.yellow(" No hyperlinks found!"));
34+
}
35+
results.forEach(function (result) {
36+
// Skip messages for non-deadlinks in quiet mode.
37+
if (opts.quiet && result.status !== "dead") {
38+
return;
39+
}
40+
41+
if (opts.verbose) {
42+
if (result.err) {
43+
console.log(
44+
" [%s] %s → Status: %s %s",
45+
statusLabels[result.status],
46+
result.link,
47+
result.statusCode,
48+
result.err
49+
);
50+
} else {
51+
console.log(" [%s] %s → Status: %s", statusLabels[result.status], result.link, result.statusCode);
52+
}
53+
} else if (!opts.quiet) {
54+
console.log(" [%s] %s", statusLabels[result.status], result.link);
55+
}
56+
});
57+
58+
if (!opts.quiet) {
59+
console.log("\n %s links checked.", results.length);
60+
}
61+
62+
if (results.some((result) => result.status === "dead")) {
63+
let deadLinks = results.filter((result) => {
64+
return result.status === "dead";
65+
});
66+
if (!opts.quiet) {
67+
console.error(chalk.red("\n ERROR: %s dead links found!"), deadLinks.length);
68+
} else {
69+
console.error(chalk.red("\n ERROR: %s dead links found in %s !"), deadLinks.length, filenameForOutput);
70+
}
71+
deadLinks.forEach(function (result) {
72+
console.log(" [%s] %s → Status: %s", statusLabels[result.status], result.link, result.statusCode);
73+
});
74+
}
75+
},
76+
};
1677

1778
class Input {
1879
constructor(filenameForOutput, stream, opts) {

default.js

-59
This file was deleted.

junit.js

-36
This file was deleted.

reporters.js

-6
This file was deleted.

0 commit comments

Comments
 (0)