bitfab 0.28.5 → 0.28.6
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/dist/{chunk-SAGZ674W.js → chunk-5E4BUIYA.js} +26 -2
- package/dist/chunk-5E4BUIYA.js.map +1 -0
- package/dist/{chunk-7UU5L64L.js → chunk-P4YXY7J4.js} +4 -4
- package/dist/{chunk-7UU5L64L.js.map → chunk-P4YXY7J4.js.map} +1 -1
- package/dist/index.cjs +26 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/node.cjs +26 -2
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-3E43G7OC.js → replay-IEE4RY57.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-SAGZ674W.js.map +0 -1
- /package/dist/{replay-3E43G7OC.js.map → replay-IEE4RY57.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -735,7 +735,7 @@ declare const BITFAB_PROGRESS_PREFIX = "@@bitfab:progress ";
|
|
|
735
735
|
* It writes one `@@bitfab:progress` line per trace to stderr, which the Bitfab
|
|
736
736
|
* plugin polls to report live progress while the replay runs in the background,
|
|
737
737
|
* so scripts never hand-format the wire protocol.
|
|
738
|
-
* stdout is left untouched for
|
|
738
|
+
* stdout is left untouched for direct-run ReplayResult JSON. Outside Node (no
|
|
739
739
|
* `process.stderr`, e.g. a browser) it is a no-op, and a write failure is
|
|
740
740
|
* swallowed so progress can never crash a run.
|
|
741
741
|
*/
|
|
@@ -1603,7 +1603,7 @@ declare class BitfabFunction {
|
|
|
1603
1603
|
/**
|
|
1604
1604
|
* SDK version from package.json (injected at build time)
|
|
1605
1605
|
*/
|
|
1606
|
-
declare const __version__ = "0.28.
|
|
1606
|
+
declare const __version__ = "0.28.6";
|
|
1607
1607
|
|
|
1608
1608
|
/**
|
|
1609
1609
|
* Constants for the Bitfab SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -735,7 +735,7 @@ declare const BITFAB_PROGRESS_PREFIX = "@@bitfab:progress ";
|
|
|
735
735
|
* It writes one `@@bitfab:progress` line per trace to stderr, which the Bitfab
|
|
736
736
|
* plugin polls to report live progress while the replay runs in the background,
|
|
737
737
|
* so scripts never hand-format the wire protocol.
|
|
738
|
-
* stdout is left untouched for
|
|
738
|
+
* stdout is left untouched for direct-run ReplayResult JSON. Outside Node (no
|
|
739
739
|
* `process.stderr`, e.g. a browser) it is a no-op, and a write failure is
|
|
740
740
|
* swallowed so progress can never crash a run.
|
|
741
741
|
*/
|
|
@@ -1603,7 +1603,7 @@ declare class BitfabFunction {
|
|
|
1603
1603
|
/**
|
|
1604
1604
|
* SDK version from package.json (injected at build time)
|
|
1605
1605
|
*/
|
|
1606
|
-
declare const __version__ = "0.28.
|
|
1606
|
+
declare const __version__ = "0.28.6";
|
|
1607
1607
|
|
|
1608
1608
|
/**
|
|
1609
1609
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
flushTraces,
|
|
24
24
|
getCurrentSpan,
|
|
25
25
|
getCurrentTrace
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-P4YXY7J4.js";
|
|
27
27
|
import {
|
|
28
28
|
BITFAB_PROGRESS_PREFIX,
|
|
29
29
|
BitfabError,
|
|
30
30
|
reportReplayProgress
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-5E4BUIYA.js";
|
|
32
32
|
export {
|
|
33
33
|
BITFAB_PROGRESS_PREFIX,
|
|
34
34
|
Bitfab,
|
package/dist/node.cjs
CHANGED
|
@@ -631,11 +631,35 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
|
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
|
|
634
|
+
const replayResult = {
|
|
635
635
|
items: resultItems,
|
|
636
636
|
testRunId,
|
|
637
637
|
testRunUrl: `${serviceUrl}${testRunUrl}`
|
|
638
638
|
};
|
|
639
|
+
await writeReplayResultFile(replayResult);
|
|
640
|
+
return replayResult;
|
|
641
|
+
}
|
|
642
|
+
async function writeReplayResultFile(result) {
|
|
643
|
+
const resultPath = typeof process !== "undefined" ? process.env?.BITFAB_REPLAY_RESULT_PATH : void 0;
|
|
644
|
+
if (!resultPath) {
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
try {
|
|
648
|
+
const [{ dirname }, { mkdir, writeFile }] = await Promise.all([
|
|
649
|
+
import("path"),
|
|
650
|
+
import("fs/promises")
|
|
651
|
+
]);
|
|
652
|
+
await mkdir(dirname(resultPath), { recursive: true });
|
|
653
|
+
await writeFile(resultPath, `${JSON.stringify(result, null, 2)}
|
|
654
|
+
`);
|
|
655
|
+
} catch (err) {
|
|
656
|
+
try {
|
|
657
|
+
console.warn(
|
|
658
|
+
`Bitfab: failed to write replay result to BITFAB_REPLAY_RESULT_PATH (${resultPath}): ${err instanceof Error ? err.message : String(err)}`
|
|
659
|
+
);
|
|
660
|
+
} catch {
|
|
661
|
+
}
|
|
662
|
+
}
|
|
639
663
|
}
|
|
640
664
|
var BITFAB_PROGRESS_PREFIX;
|
|
641
665
|
var init_replay = __esm({
|
|
@@ -682,7 +706,7 @@ registerAsyncLocalStorageClass(
|
|
|
682
706
|
);
|
|
683
707
|
|
|
684
708
|
// src/version.generated.ts
|
|
685
|
-
var __version__ = "0.28.
|
|
709
|
+
var __version__ = "0.28.6";
|
|
686
710
|
|
|
687
711
|
// src/constants.ts
|
|
688
712
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|