@wix/evalforge-evaluator 0.190.0 → 0.191.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 +30 -4
- package/build/index.js.map +2 -2
- package/build/index.mjs +30 -4
- package/build/index.mjs.map +2 -2
- package/package.json +2 -2
package/build/index.mjs
CHANGED
|
@@ -7592,11 +7592,36 @@ async function fetchAndWriteTemplateFiles(template, workDir, onProgress) {
|
|
|
7592
7592
|
);
|
|
7593
7593
|
}
|
|
7594
7594
|
await writeFilesToDirectory(workDir, sourceFiles);
|
|
7595
|
+
const extraFiles = template.extraFiles ?? [];
|
|
7596
|
+
onProgress(`[diag] resolving ${extraFiles.length} extra file(s)`);
|
|
7595
7597
|
await Promise.all(
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7598
|
+
extraFiles.map(async (ef) => {
|
|
7599
|
+
let content;
|
|
7600
|
+
if (ef.gitSource) {
|
|
7601
|
+
const { owner, repo, path: gitPath, ref } = ef.gitSource;
|
|
7602
|
+
const startedAt = Date.now();
|
|
7603
|
+
onProgress(
|
|
7604
|
+
`[diag] extra fetch start: ${ef.path} <- ${owner}/${repo}/${gitPath ?? ""}@${ref ?? "default"}`
|
|
7605
|
+
);
|
|
7606
|
+
try {
|
|
7607
|
+
content = await withTimeout(
|
|
7608
|
+
fetchGitHubFile(ef.gitSource, { userAgent: "EvalForge-Evaluator" }),
|
|
7609
|
+
3e4,
|
|
7610
|
+
`extra file fetch (${ef.path})`
|
|
7611
|
+
);
|
|
7612
|
+
onProgress(
|
|
7613
|
+
`[diag] extra fetch done: ${ef.path} (${content.length} bytes) in ${Date.now() - startedAt}ms`
|
|
7614
|
+
);
|
|
7615
|
+
} catch (err) {
|
|
7616
|
+
onProgress(
|
|
7617
|
+
`[diag] extra fetch FAILED: ${ef.path} after ${Date.now() - startedAt}ms: ${err instanceof Error ? err.message : String(err)}`
|
|
7618
|
+
);
|
|
7619
|
+
throw err;
|
|
7620
|
+
}
|
|
7621
|
+
} else {
|
|
7622
|
+
content = ef.content ?? "";
|
|
7623
|
+
onProgress(`[diag] extra inline: ${ef.path} (${content.length} bytes)`);
|
|
7624
|
+
}
|
|
7600
7625
|
const dest = path2.resolve(workDir, ef.path);
|
|
7601
7626
|
if (!dest.startsWith(workDir + sep2)) {
|
|
7602
7627
|
throw new Error(
|
|
@@ -7607,6 +7632,7 @@ async function fetchAndWriteTemplateFiles(template, workDir, onProgress) {
|
|
|
7607
7632
|
await writeFile2(dest, content, "utf8");
|
|
7608
7633
|
})
|
|
7609
7634
|
);
|
|
7635
|
+
onProgress("[diag] all extra files written");
|
|
7610
7636
|
}
|
|
7611
7637
|
function writeWixEnvFile(workDir) {
|
|
7612
7638
|
const configPath = path2.join(workDir, "wix.config.json");
|