@majordigital/create-acorn 1.6.1 → 1.6.2
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
|
@@ -21,6 +21,18 @@ const outputDir = process.argv[3] || ".claude/pre-deployment-result";
|
|
|
21
21
|
|
|
22
22
|
mkdirSync(outputDir, { recursive: true });
|
|
23
23
|
|
|
24
|
+
// Lower concurrency for localhost — the Next.js dev server + CMS API calls
|
|
25
|
+
// can't handle many parallel requests and returns 500s under concurrent load.
|
|
26
|
+
const isLocalhost = baseUrl.includes("localhost") || baseUrl.includes("127.0.0.1");
|
|
27
|
+
const concurrency = isLocalhost ? 2 : 5;
|
|
28
|
+
|
|
29
|
+
// Support Netlify Basic Auth (password-protected preview deploys).
|
|
30
|
+
// Set NETLIFY_AUTH=user:password in your environment before running.
|
|
31
|
+
const netlifyAuth = process.env.NETLIFY_AUTH;
|
|
32
|
+
const headers = netlifyAuth
|
|
33
|
+
? { Authorization: `Basic ${Buffer.from(netlifyAuth).toString("base64")}` }
|
|
34
|
+
: {};
|
|
35
|
+
|
|
24
36
|
const checker = new LinkChecker();
|
|
25
37
|
|
|
26
38
|
checker.on("link", (result) => {
|
|
@@ -32,16 +44,19 @@ checker.on("link", (result) => {
|
|
|
32
44
|
});
|
|
33
45
|
|
|
34
46
|
console.log(`Checking links on: ${baseUrl}`);
|
|
47
|
+
if (netlifyAuth) console.log("Using Basic Auth from NETLIFY_AUTH env var");
|
|
48
|
+
console.log(`Concurrency: ${concurrency}`);
|
|
35
49
|
console.log("This may take several minutes...\n");
|
|
36
50
|
|
|
37
51
|
const result = await checker.check({
|
|
38
52
|
path: baseUrl,
|
|
39
53
|
recurse: true,
|
|
40
|
-
concurrency
|
|
54
|
+
concurrency,
|
|
41
55
|
timeout: 30000,
|
|
56
|
+
headers,
|
|
42
57
|
// Skip external links to avoid false positives from rate limiting
|
|
43
58
|
linksToSkip: [
|
|
44
|
-
|
|
59
|
+
`^(?!(${baseUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}))`,
|
|
45
60
|
],
|
|
46
61
|
});
|
|
47
62
|
|