@wix/evalforge-evaluator 0.195.0 → 0.196.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 +10 -55
- package/build/index.js.map +2 -2
- package/build/index.mjs +10 -55
- package/build/index.mjs.map +2 -2
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -7373,7 +7373,6 @@ var import_crypto = require("crypto");
|
|
|
7373
7373
|
var import_path2 = __toESM(require("path"));
|
|
7374
7374
|
var import_child_process = require("child_process");
|
|
7375
7375
|
var INSTALL_TIMEOUT_MS = 1e5;
|
|
7376
|
-
var PNPM_BOOTSTRAP_TIMEOUT_MS = 6e4;
|
|
7377
7376
|
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
7378
7377
|
function reportRegistry(workDir, onProgress) {
|
|
7379
7378
|
try {
|
|
@@ -7462,80 +7461,36 @@ function cloneDirectory(src, dest) {
|
|
|
7462
7461
|
(0, import_fs.cpSync)(src, dest, { recursive: true });
|
|
7463
7462
|
}
|
|
7464
7463
|
}
|
|
7465
|
-
async function
|
|
7466
|
-
|
|
7464
|
+
async function runInstall(exec, pm, workDir, onProgress) {
|
|
7465
|
+
reportRegistry(workDir, onProgress);
|
|
7466
|
+
onProgress(`[diag] npm install starting: ${pm.cmd} ${pm.args.join(" ")}`);
|
|
7467
7467
|
const startedAt = Date.now();
|
|
7468
7468
|
const heartbeat = setInterval(() => {
|
|
7469
7469
|
onProgress(
|
|
7470
|
-
`[diag]
|
|
7470
|
+
`[diag] npm install still running: ${Math.round(
|
|
7471
7471
|
(Date.now() - startedAt) / 1e3
|
|
7472
7472
|
)}s elapsed`
|
|
7473
7473
|
);
|
|
7474
7474
|
}, HEARTBEAT_INTERVAL_MS);
|
|
7475
7475
|
try {
|
|
7476
|
-
await exec(cmd, args, {
|
|
7476
|
+
await exec(pm.cmd, pm.args, {
|
|
7477
7477
|
cwd: workDir,
|
|
7478
|
-
timeoutMs,
|
|
7478
|
+
timeoutMs: INSTALL_TIMEOUT_MS,
|
|
7479
7479
|
env: { ...process.env, NODE_ENV: "development" }
|
|
7480
7480
|
});
|
|
7481
|
-
onProgress(`[diag]
|
|
7481
|
+
onProgress(`[diag] npm install finished in ${Date.now() - startedAt}ms`);
|
|
7482
|
+
reportNodeModules(workDir, onProgress);
|
|
7482
7483
|
return true;
|
|
7483
7484
|
} catch (err) {
|
|
7484
7485
|
onProgress(
|
|
7485
|
-
`[diag]
|
|
7486
|
+
`[diag] npm install FAILED after ${Date.now() - startedAt}ms: ${err instanceof Error ? err.message : String(err)}`
|
|
7486
7487
|
);
|
|
7488
|
+
reportNodeModules(workDir, onProgress);
|
|
7487
7489
|
return false;
|
|
7488
7490
|
} finally {
|
|
7489
7491
|
clearInterval(heartbeat);
|
|
7490
7492
|
}
|
|
7491
7493
|
}
|
|
7492
|
-
var PNPM_INSTALL_ARGS = [
|
|
7493
|
-
"install",
|
|
7494
|
-
"--shamefully-hoist",
|
|
7495
|
-
"--ignore-scripts",
|
|
7496
|
-
"--network-concurrency=8"
|
|
7497
|
-
];
|
|
7498
|
-
async function runInstall(exec, pm, workDir, onProgress) {
|
|
7499
|
-
reportRegistry(workDir, onProgress);
|
|
7500
|
-
const pnpmReady = await runCommand(
|
|
7501
|
-
exec,
|
|
7502
|
-
"npm",
|
|
7503
|
-
["install", "-g", "pnpm"],
|
|
7504
|
-
workDir,
|
|
7505
|
-
onProgress,
|
|
7506
|
-
"pnpm bootstrap",
|
|
7507
|
-
PNPM_BOOTSTRAP_TIMEOUT_MS
|
|
7508
|
-
);
|
|
7509
|
-
if (pnpmReady) {
|
|
7510
|
-
const pnpmOk = await runCommand(
|
|
7511
|
-
exec,
|
|
7512
|
-
"pnpm",
|
|
7513
|
-
PNPM_INSTALL_ARGS,
|
|
7514
|
-
workDir,
|
|
7515
|
-
onProgress,
|
|
7516
|
-
"pnpm install",
|
|
7517
|
-
INSTALL_TIMEOUT_MS
|
|
7518
|
-
);
|
|
7519
|
-
if (pnpmOk) {
|
|
7520
|
-
reportNodeModules(workDir, onProgress);
|
|
7521
|
-
return true;
|
|
7522
|
-
}
|
|
7523
|
-
onProgress("[diag] pnpm install failed \u2014 falling back to npm");
|
|
7524
|
-
} else {
|
|
7525
|
-
onProgress("[diag] pnpm bootstrap failed \u2014 falling back to npm");
|
|
7526
|
-
}
|
|
7527
|
-
const ok = await runCommand(
|
|
7528
|
-
exec,
|
|
7529
|
-
pm.cmd,
|
|
7530
|
-
pm.args,
|
|
7531
|
-
workDir,
|
|
7532
|
-
onProgress,
|
|
7533
|
-
"npm install",
|
|
7534
|
-
INSTALL_TIMEOUT_MS
|
|
7535
|
-
);
|
|
7536
|
-
reportNodeModules(workDir, onProgress);
|
|
7537
|
-
return ok;
|
|
7538
|
-
}
|
|
7539
7494
|
async function installWithCache(workDir, exec, cacheBase, pm, onProgress) {
|
|
7540
7495
|
const sourceContent = (0, import_fs.readFileSync)(
|
|
7541
7496
|
import_path2.default.join(workDir, pm.cacheSourceFile),
|