@wix/evalforge-evaluator 0.171.0 → 0.172.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 +4 -6
- package/build/index.js.map +2 -2
- package/build/index.mjs +7 -11
- package/build/index.mjs.map +3 -3
- package/package.json +2 -2
package/build/index.mjs
CHANGED
|
@@ -424,7 +424,7 @@ import {
|
|
|
424
424
|
} from "@wix/eval-assertions";
|
|
425
425
|
|
|
426
426
|
// src/run-scenario/environment.ts
|
|
427
|
-
import { mkdirSync as mkdirSync2, existsSync as existsSync2, rmSync, readFileSync as readFileSync2, writeFileSync
|
|
427
|
+
import { mkdirSync as mkdirSync2, existsSync as existsSync2, rmSync, readFileSync as readFileSync2, writeFileSync } from "fs";
|
|
428
428
|
import { mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
|
|
429
429
|
import { tmpdir } from "os";
|
|
430
430
|
import path2, { sep as sep2 } from "path";
|
|
@@ -455,10 +455,8 @@ import {
|
|
|
455
455
|
mkdirSync,
|
|
456
456
|
existsSync,
|
|
457
457
|
readFileSync,
|
|
458
|
-
writeFileSync,
|
|
459
458
|
copyFileSync,
|
|
460
|
-
cpSync
|
|
461
|
-
renameSync
|
|
459
|
+
cpSync
|
|
462
460
|
} from "fs";
|
|
463
461
|
import { createHash } from "crypto";
|
|
464
462
|
import path from "path";
|
|
@@ -473,8 +471,7 @@ function detectPackageManager(workDir) {
|
|
|
473
471
|
if (existsSync(path.join(workDir, "yarn.lock"))) {
|
|
474
472
|
return { cmd: "yarn", args: ["install", "--frozen-lockfile"], cacheSourceFile: "yarn.lock" };
|
|
475
473
|
}
|
|
476
|
-
|
|
477
|
-
return { cmd: "yarn", args: ["install"], cacheSourceFile: "package.json" };
|
|
474
|
+
return { cmd: "npm", args: ["install", "--legacy-peer-deps", "--prefer-offline", "--no-fund", "--no-audit"], cacheSourceFile: "package.json" };
|
|
478
475
|
}
|
|
479
476
|
function cloneDirectory(src, dest) {
|
|
480
477
|
if (process.platform === "darwin") {
|
|
@@ -502,7 +499,7 @@ function installWithCache(workDir, exec, cacheBase, pm) {
|
|
|
502
499
|
}
|
|
503
500
|
console.log(`[environment] Running ${pm.cmd} ${pm.args.join(" ")} in ${workDir} (cache key: ${cacheKey})`);
|
|
504
501
|
try {
|
|
505
|
-
exec(pm.cmd, pm.args, { cwd: workDir, stdio: "inherit", timeout: 18e4 });
|
|
502
|
+
exec(pm.cmd, pm.args, { cwd: workDir, stdio: "inherit", timeout: 18e4, env: { ...process.env, NODE_ENV: "development" } });
|
|
506
503
|
} catch (err) {
|
|
507
504
|
console.error("[environment] Dependency installation failed:", err instanceof Error ? err.message : String(err));
|
|
508
505
|
return;
|
|
@@ -514,8 +511,7 @@ function installWithCache(workDir, exec, cacheBase, pm) {
|
|
|
514
511
|
if (existsSync(yarnLockPath)) {
|
|
515
512
|
copyFileSync(yarnLockPath, cachedYarnLock);
|
|
516
513
|
}
|
|
517
|
-
|
|
518
|
-
cloneDirectory(cachedNodeModules, targetNodeModules);
|
|
514
|
+
cloneDirectory(targetNodeModules, cachedNodeModules);
|
|
519
515
|
} catch (err) {
|
|
520
516
|
console.error("[environment] Failed to save to cache (installation still succeeded):", err instanceof Error ? err.message : String(err));
|
|
521
517
|
}
|
|
@@ -531,7 +527,7 @@ async function installDependencies(workDir, exec = execFileSync, cacheBase) {
|
|
|
531
527
|
}
|
|
532
528
|
console.log(`[environment] Running ${pm.cmd} ${pm.args.join(" ")} in ${workDir}`);
|
|
533
529
|
try {
|
|
534
|
-
exec(pm.cmd, pm.args, { cwd: workDir, stdio: "inherit", timeout: 18e4 });
|
|
530
|
+
exec(pm.cmd, pm.args, { cwd: workDir, stdio: "inherit", timeout: 18e4, env: { ...process.env, NODE_ENV: "development" } });
|
|
535
531
|
console.log("[environment] Dependency installation complete");
|
|
536
532
|
} catch (err) {
|
|
537
533
|
console.error("[environment] Dependency installation failed:", err instanceof Error ? err.message : String(err));
|
|
@@ -577,7 +573,7 @@ function writeWixEnvFile(workDir) {
|
|
|
577
573
|
try {
|
|
578
574
|
const config = JSON.parse(readFileSync2(configPath, "utf-8"));
|
|
579
575
|
if (config.appId) {
|
|
580
|
-
|
|
576
|
+
writeFileSync(
|
|
581
577
|
path2.join(workDir, ".env"),
|
|
582
578
|
`WIX_CLIENT_ID=${config.appId}
|
|
583
579
|
`,
|