squirrelscan 0.0.181 → 0.0.183
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 +1 -1
- package/scripts/postinstall.js +39 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "squirrelscan",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.183",
|
|
4
4
|
"description": "Website QA tool built for coding agents. 300+ rules across SEO, performance, security, accessibility & agent experience, from the CLI, cloud, or MCP.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"squirrel": "bin/squirrel.js"
|
package/scripts/postinstall.js
CHANGED
|
@@ -69,7 +69,9 @@ function httpsGetAt(url, redirects, get) {
|
|
|
69
69
|
reject(new Error(`Invalid redirect URL: ${res.headers.location}`));
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
return httpsGetAt(next.href, redirects + 1, get)
|
|
72
|
+
return httpsGetAt(next.href, redirects + 1, get)
|
|
73
|
+
.then(resolve)
|
|
74
|
+
.catch(reject);
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
if (res.statusCode !== 200) {
|
|
@@ -110,6 +112,37 @@ async function fetchWithRetry(url, attempts = 3) {
|
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Warning lines for a finished `self install` spawn (empty on success).
|
|
117
|
+
* A signal kill reports status null, so the signal has to be read too: a
|
|
118
|
+
* SIGKILL is almost always the out-of-memory killer, and "retry by hand"
|
|
119
|
+
* fails again on the same machine.
|
|
120
|
+
*/
|
|
121
|
+
function selfInstallWarnings(result) {
|
|
122
|
+
if (result.signal === "SIGKILL") {
|
|
123
|
+
return [
|
|
124
|
+
"Native install setup was killed by the system, most likely because the machine ran out of memory",
|
|
125
|
+
"The binary itself downloaded and passed its checksum, and npm install succeeded",
|
|
126
|
+
"Add swap or memory (for example 1GB of swap) and run 'squirrel self install' again, or download the binary directly: https://github.com/" +
|
|
127
|
+
REPO +
|
|
128
|
+
"/releases",
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
if (result.signal) {
|
|
132
|
+
return [
|
|
133
|
+
`Native install setup was stopped by signal ${result.signal}, but npm install succeeded`,
|
|
134
|
+
"Run 'squirrel self install' manually for full functionality",
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
if (result.status !== 0) {
|
|
138
|
+
return [
|
|
139
|
+
"Native install setup failed, but npm install succeeded",
|
|
140
|
+
"Run 'squirrel self install' manually for full functionality",
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
|
|
113
146
|
/**
|
|
114
147
|
* Compute SHA256 hash
|
|
115
148
|
*/
|
|
@@ -208,7 +241,9 @@ async function main() {
|
|
|
208
241
|
// Get binary info for platform
|
|
209
242
|
const binaryInfo = manifest.binaries?.[platform];
|
|
210
243
|
if (!binaryInfo) {
|
|
211
|
-
error(
|
|
244
|
+
error(
|
|
245
|
+
`No binary available for platform: ${platform}\n See: https://github.com/${REPO}/releases/tag/${version}`,
|
|
246
|
+
);
|
|
212
247
|
}
|
|
213
248
|
|
|
214
249
|
const { filename, sha256: expectedSha256 } = binaryInfo;
|
|
@@ -260,17 +295,14 @@ async function main() {
|
|
|
260
295
|
});
|
|
261
296
|
|
|
262
297
|
// Don't fail npm install if self install fails - binary still works via wrapper fallback
|
|
263
|
-
|
|
264
|
-
warn("Native install setup failed, but npm install succeeded");
|
|
265
|
-
warn("Run 'squirrel self install' manually for full functionality");
|
|
266
|
-
}
|
|
298
|
+
for (const line of selfInstallWarnings(result)) warn(line);
|
|
267
299
|
|
|
268
300
|
log("Installation complete!");
|
|
269
301
|
info("Run 'squirrel --help' to get started");
|
|
270
302
|
info("Install agent integrations explicitly with 'squirrel skills install'");
|
|
271
303
|
}
|
|
272
304
|
|
|
273
|
-
module.exports = { httpsGet, normalizeVersion, resolveVersion };
|
|
305
|
+
module.exports = { httpsGet, normalizeVersion, resolveVersion, selfInstallWarnings };
|
|
274
306
|
|
|
275
307
|
if (require.main === module) {
|
|
276
308
|
main().catch((err) => {
|