@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.mjs
CHANGED
|
@@ -7390,12 +7390,40 @@ async function writeFilesToDirectory(targetDir, files) {
|
|
|
7390
7390
|
}
|
|
7391
7391
|
|
|
7392
7392
|
// src/run-scenario/install-dependencies.ts
|
|
7393
|
-
import {
|
|
7393
|
+
import {
|
|
7394
|
+
mkdirSync,
|
|
7395
|
+
existsSync,
|
|
7396
|
+
readFileSync,
|
|
7397
|
+
readdirSync,
|
|
7398
|
+
copyFileSync,
|
|
7399
|
+
cpSync
|
|
7400
|
+
} from "fs";
|
|
7394
7401
|
import { createHash } from "crypto";
|
|
7395
7402
|
import path from "path";
|
|
7396
7403
|
import { spawn, execFileSync } from "child_process";
|
|
7397
|
-
var INSTALL_TIMEOUT_MS =
|
|
7404
|
+
var INSTALL_TIMEOUT_MS = 1e5;
|
|
7398
7405
|
var HEARTBEAT_INTERVAL_MS = 5e3;
|
|
7406
|
+
function reportRegistry(workDir, onProgress) {
|
|
7407
|
+
try {
|
|
7408
|
+
const registry = execFileSync("npm", ["config", "get", "registry"], {
|
|
7409
|
+
cwd: workDir,
|
|
7410
|
+
encoding: "utf8"
|
|
7411
|
+
}).trim();
|
|
7412
|
+
onProgress(`[diag] npm registry = ${registry}`);
|
|
7413
|
+
} catch (err) {
|
|
7414
|
+
onProgress(
|
|
7415
|
+
`[diag] npm registry = <unreadable: ${err instanceof Error ? err.message : String(err)}>`
|
|
7416
|
+
);
|
|
7417
|
+
}
|
|
7418
|
+
}
|
|
7419
|
+
function reportNodeModules(workDir, onProgress) {
|
|
7420
|
+
try {
|
|
7421
|
+
const nm = path.join(workDir, "node_modules");
|
|
7422
|
+
const count = existsSync(nm) ? readdirSync(nm).length : 0;
|
|
7423
|
+
onProgress(`[diag] node_modules top-level entries: ${count}`);
|
|
7424
|
+
} catch {
|
|
7425
|
+
}
|
|
7426
|
+
}
|
|
7399
7427
|
function defaultExec(cmd, args, opts) {
|
|
7400
7428
|
return new Promise((resolve3, reject) => {
|
|
7401
7429
|
const child = spawn(cmd, args, {
|
|
@@ -7463,6 +7491,7 @@ function cloneDirectory(src, dest) {
|
|
|
7463
7491
|
}
|
|
7464
7492
|
}
|
|
7465
7493
|
async function runInstall(exec, pm, workDir, onProgress) {
|
|
7494
|
+
reportRegistry(workDir, onProgress);
|
|
7466
7495
|
onProgress(`[diag] npm install starting: ${pm.cmd} ${pm.args.join(" ")}`);
|
|
7467
7496
|
const startedAt = Date.now();
|
|
7468
7497
|
const heartbeat = setInterval(() => {
|
|
@@ -7479,11 +7508,13 @@ async function runInstall(exec, pm, workDir, onProgress) {
|
|
|
7479
7508
|
env: { ...process.env, NODE_ENV: "development" }
|
|
7480
7509
|
});
|
|
7481
7510
|
onProgress(`[diag] npm install finished in ${Date.now() - startedAt}ms`);
|
|
7511
|
+
reportNodeModules(workDir, onProgress);
|
|
7482
7512
|
return true;
|
|
7483
7513
|
} catch (err) {
|
|
7484
7514
|
onProgress(
|
|
7485
7515
|
`[diag] npm install FAILED after ${Date.now() - startedAt}ms: ${err instanceof Error ? err.message : String(err)}`
|
|
7486
7516
|
);
|
|
7517
|
+
reportNodeModules(workDir, onProgress);
|
|
7487
7518
|
return false;
|
|
7488
7519
|
} finally {
|
|
7489
7520
|
clearInterval(heartbeat);
|
|
@@ -11344,7 +11375,7 @@ var simpleAgentAdapter = new SimpleAgentAdapter();
|
|
|
11344
11375
|
defaultRegistry.register(simpleAgentAdapter);
|
|
11345
11376
|
|
|
11346
11377
|
// src/run-scenario/file-diff.ts
|
|
11347
|
-
import { readdirSync, readFileSync as readFileSync3, statSync, existsSync as existsSync3 } from "fs";
|
|
11378
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync3, statSync, existsSync as existsSync3 } from "fs";
|
|
11348
11379
|
import { join as join10, relative } from "path";
|
|
11349
11380
|
|
|
11350
11381
|
// ../../node_modules/diff/lib/index.mjs
|
|
@@ -11968,7 +11999,7 @@ function snapshotDirectory(dir, baseDir) {
|
|
|
11968
11999
|
if (!existsSync3(dir)) {
|
|
11969
12000
|
return snapshot;
|
|
11970
12001
|
}
|
|
11971
|
-
const entries =
|
|
12002
|
+
const entries = readdirSync2(dir, { withFileTypes: true });
|
|
11972
12003
|
for (const entry of entries) {
|
|
11973
12004
|
const fullPath = join10(dir, entry.name);
|
|
11974
12005
|
const relativePath = relative(base, fullPath);
|