@majordigital/create-acorn 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -29,9 +29,9 @@ const concurrency = isLocalhost ? 2 : 5;
|
|
|
29
29
|
// Support Netlify Basic Auth (password-protected preview deploys).
|
|
30
30
|
// Set NETLIFY_AUTH=user:password in your environment before running.
|
|
31
31
|
const netlifyAuth = process.env.NETLIFY_AUTH;
|
|
32
|
-
const
|
|
33
|
-
?
|
|
34
|
-
:
|
|
32
|
+
const crawlUrl = netlifyAuth
|
|
33
|
+
? baseUrl.replace(/^(https?:\/\/)/, `$1${netlifyAuth}@`)
|
|
34
|
+
: baseUrl;
|
|
35
35
|
|
|
36
36
|
const checker = new LinkChecker();
|
|
37
37
|
|
|
@@ -49,17 +49,27 @@ console.log(`Concurrency: ${concurrency}`);
|
|
|
49
49
|
console.log("This may take several minutes...\n");
|
|
50
50
|
|
|
51
51
|
const result = await checker.check({
|
|
52
|
-
path:
|
|
52
|
+
path: crawlUrl,
|
|
53
53
|
recurse: true,
|
|
54
54
|
concurrency,
|
|
55
55
|
timeout: 30000,
|
|
56
|
-
headers,
|
|
57
|
-
// Skip external links to avoid false positives from rate limiting
|
|
58
56
|
linksToSkip: [
|
|
57
|
+
// Skip external links to avoid false positives from rate limiting
|
|
59
58
|
`^(?!(${baseUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}))`,
|
|
59
|
+
// Skip multi-filter URLs — the filter UI generates combinatorial links
|
|
60
|
+
// (e.g. ?filter=a%2Cb%2Cc) that cause a crawl explosion. Not real links.
|
|
61
|
+
".*[?&]filter=.*%2C.*",
|
|
60
62
|
],
|
|
61
63
|
});
|
|
62
64
|
|
|
65
|
+
process.on("uncaughtException", (err) => {
|
|
66
|
+
if (err.name === "TimeoutError" || err.name === "AbortError") {
|
|
67
|
+
console.error("\nWarning: crawl timed out — some pages may be slow or unresponsive.");
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
throw err;
|
|
71
|
+
});
|
|
72
|
+
|
|
63
73
|
const broken = result.links.filter((l) => l.state === "BROKEN");
|
|
64
74
|
const ok = result.links.filter((l) => l.state === "OK");
|
|
65
75
|
const skipped = result.links.filter((l) => l.state === "SKIPPED");
|