@wix/evalforge-evaluator 0.192.0 → 0.193.0
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/build/index.js +25 -1
- package/build/index.js.map +3 -3
- package/build/index.mjs +35 -4
- package/build/index.mjs.map +3 -3
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -7372,8 +7372,29 @@ var import_fs = require("fs");
|
|
|
7372
7372
|
var import_crypto = require("crypto");
|
|
7373
7373
|
var import_path2 = __toESM(require("path"));
|
|
7374
7374
|
var import_child_process = require("child_process");
|
|
7375
|
-
var INSTALL_TIMEOUT_MS =
|
|
7375
|
+
var INSTALL_TIMEOUT_MS = 1e5;
|
|
7376
7376
|
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
7377
|
+
function reportRegistry(workDir, onProgress) {
|
|
7378
|
+
try {
|
|
7379
|
+
const registry = (0, import_child_process.execFileSync)("npm", ["config", "get", "registry"], {
|
|
7380
|
+
cwd: workDir,
|
|
7381
|
+
encoding: "utf8"
|
|
7382
|
+
}).trim();
|
|
7383
|
+
onProgress(`[diag] npm registry = ${registry}`);
|
|
7384
|
+
} catch (err) {
|
|
7385
|
+
onProgress(
|
|
7386
|
+
`[diag] npm registry = <unreadable: ${err instanceof Error ? err.message : String(err)}>`
|
|
7387
|
+
);
|
|
7388
|
+
}
|
|
7389
|
+
}
|
|
7390
|
+
function reportNodeModules(workDir, onProgress) {
|
|
7391
|
+
try {
|
|
7392
|
+
const nm = import_path2.default.join(workDir, "node_modules");
|
|
7393
|
+
const count = (0, import_fs.existsSync)(nm) ? (0, import_fs.readdirSync)(nm).length : 0;
|
|
7394
|
+
onProgress(`[diag] node_modules top-level entries: ${count}`);
|
|
7395
|
+
} catch {
|
|
7396
|
+
}
|
|
7397
|
+
}
|
|
7377
7398
|
function defaultExec(cmd, args, opts) {
|
|
7378
7399
|
return new Promise((resolve3, reject) => {
|
|
7379
7400
|
const child = (0, import_child_process.spawn)(cmd, args, {
|
|
@@ -7441,6 +7462,7 @@ function cloneDirectory(src, dest) {
|
|
|
7441
7462
|
}
|
|
7442
7463
|
}
|
|
7443
7464
|
async function runInstall(exec, pm, workDir, onProgress) {
|
|
7465
|
+
reportRegistry(workDir, onProgress);
|
|
7444
7466
|
onProgress(`[diag] npm install starting: ${pm.cmd} ${pm.args.join(" ")}`);
|
|
7445
7467
|
const startedAt = Date.now();
|
|
7446
7468
|
const heartbeat = setInterval(() => {
|
|
@@ -7457,11 +7479,13 @@ async function runInstall(exec, pm, workDir, onProgress) {
|
|
|
7457
7479
|
env: { ...process.env, NODE_ENV: "development" }
|
|
7458
7480
|
});
|
|
7459
7481
|
onProgress(`[diag] npm install finished in ${Date.now() - startedAt}ms`);
|
|
7482
|
+
reportNodeModules(workDir, onProgress);
|
|
7460
7483
|
return true;
|
|
7461
7484
|
} catch (err) {
|
|
7462
7485
|
onProgress(
|
|
7463
7486
|
`[diag] npm install FAILED after ${Date.now() - startedAt}ms: ${err instanceof Error ? err.message : String(err)}`
|
|
7464
7487
|
);
|
|
7488
|
+
reportNodeModules(workDir, onProgress);
|
|
7465
7489
|
return false;
|
|
7466
7490
|
} finally {
|
|
7467
7491
|
clearInterval(heartbeat);
|