@majordigital/create-acorn 1.6.4 → 1.6.6
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/bin/create-acorn.mjs
CHANGED
|
@@ -118,7 +118,7 @@ async function setupPreDeploy() {
|
|
|
118
118
|
|
|
119
119
|
console.log('Installing pre-deploy tools (Lighthouse, Playwright, linkinator)...');
|
|
120
120
|
await runCommand('npm', ['install', '--save-dev', '--legacy-peer-deps',
|
|
121
|
-
'lighthouse', 'chrome-launcher', 'playwright', 'linkinator'
|
|
121
|
+
'lighthouse', 'chrome-launcher', 'playwright', 'linkinator@^7'
|
|
122
122
|
]);
|
|
123
123
|
console.log('');
|
|
124
124
|
|
package/package.json
CHANGED
|
@@ -28,10 +28,13 @@ const concurrency = isLocalhost ? 2 : 5;
|
|
|
28
28
|
|
|
29
29
|
// Support Netlify Basic Auth (password-protected preview deploys).
|
|
30
30
|
// Set NETLIFY_AUTH=user:password in your environment before running.
|
|
31
|
+
// NOTE: requires linkinator >=7 (the `headers` option is applied to every
|
|
32
|
+
// fetch). Credentials are sent via an Authorization header, not embedded in
|
|
33
|
+
// the URL — Node's fetch (undici) rejects URLs that contain credentials.
|
|
31
34
|
const netlifyAuth = process.env.NETLIFY_AUTH;
|
|
32
|
-
const
|
|
33
|
-
?
|
|
34
|
-
:
|
|
35
|
+
const headers = netlifyAuth
|
|
36
|
+
? { Authorization: `Basic ${Buffer.from(netlifyAuth).toString("base64")}` }
|
|
37
|
+
: {};
|
|
35
38
|
|
|
36
39
|
const checker = new LinkChecker();
|
|
37
40
|
|
|
@@ -49,10 +52,11 @@ console.log(`Concurrency: ${concurrency}`);
|
|
|
49
52
|
console.log("This may take several minutes...\n");
|
|
50
53
|
|
|
51
54
|
const result = await checker.check({
|
|
52
|
-
path:
|
|
55
|
+
path: baseUrl,
|
|
53
56
|
recurse: true,
|
|
54
57
|
concurrency,
|
|
55
58
|
timeout: 30000,
|
|
59
|
+
headers,
|
|
56
60
|
linksToSkip: [
|
|
57
61
|
// Skip external links to avoid false positives from rate limiting
|
|
58
62
|
`^(?!(${baseUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}))`,
|