@wix/evalforge-evaluator 0.82.0 → 0.84.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 +21 -0
- package/build/index.js.map +3 -3
- package/build/index.mjs +24 -3
- package/build/index.mjs.map +3 -3
- package/package.json +3 -3
package/build/index.js
CHANGED
|
@@ -476,6 +476,26 @@ async function fetchAndWriteTemplateFiles(template, workDir) {
|
|
|
476
476
|
});
|
|
477
477
|
await writeSkillFiles(workDir, files);
|
|
478
478
|
}
|
|
479
|
+
function writeWixEnvFile(workDir) {
|
|
480
|
+
const configPath = import_path2.default.join(workDir, "wix.config.json");
|
|
481
|
+
if (!(0, import_fs.existsSync)(configPath)) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
try {
|
|
485
|
+
const config = JSON.parse((0, import_fs.readFileSync)(configPath, "utf-8"));
|
|
486
|
+
if (config.appId) {
|
|
487
|
+
(0, import_fs.writeFileSync)(
|
|
488
|
+
import_path2.default.join(workDir, ".env"),
|
|
489
|
+
`WIX_CLIENT_ID=${config.appId}
|
|
490
|
+
`,
|
|
491
|
+
"utf-8"
|
|
492
|
+
);
|
|
493
|
+
console.log("[environment] Wrote WIX_CLIENT_ID to .env");
|
|
494
|
+
}
|
|
495
|
+
} catch {
|
|
496
|
+
console.warn("[environment] Failed to read wix.config.json");
|
|
497
|
+
}
|
|
498
|
+
}
|
|
479
499
|
async function prepareWorkingDirectory(config, evalRunId2, targetId, scenarioId, template) {
|
|
480
500
|
const baseDir = config.evaluationsDir ?? import_path2.default.join((0, import_os.tmpdir)(), "evalforge-evaluations");
|
|
481
501
|
if (template) {
|
|
@@ -491,6 +511,7 @@ async function prepareWorkingDirectory(config, evalRunId2, targetId, scenarioId,
|
|
|
491
511
|
(0, import_fs.mkdirSync)(workDir2, { recursive: true });
|
|
492
512
|
await fetchAndWriteTemplateFiles(template, workDir2);
|
|
493
513
|
console.log(`Template files written to ${workDir2}`);
|
|
514
|
+
writeWixEnvFile(workDir2);
|
|
494
515
|
return workDir2;
|
|
495
516
|
}
|
|
496
517
|
const workDir = import_path2.default.join(baseDir, `${evalRunId2}_${targetId}_${scenarioId}`);
|