@bitfab/sdk 0.36.10 → 0.36.12
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-RSM2TLKG.js → chunk-OCJSHTJR.js} +24 -12
- package/dist/chunk-OCJSHTJR.js.map +1 -0
- package/dist/{chunk-AAMRJGZJ.js → chunk-VUYTATF5.js} +19 -9
- package/dist/chunk-VUYTATF5.js.map +1 -0
- package/dist/index.cjs +39 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/node.cjs +39 -17
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-WKWBBIGE.js → replay-P35CUNGH.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-AAMRJGZJ.js.map +0 -1
- package/dist/chunk-RSM2TLKG.js.map +0 -1
- /package/dist/{replay-WKWBBIGE.js.map → replay-P35CUNGH.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -2575,7 +2575,7 @@ declare class BitfabFunction {
|
|
|
2575
2575
|
/**
|
|
2576
2576
|
* SDK version from package.json (injected at build time)
|
|
2577
2577
|
*/
|
|
2578
|
-
declare const __version__ = "0.36.
|
|
2578
|
+
declare const __version__ = "0.36.12";
|
|
2579
2579
|
|
|
2580
2580
|
/**
|
|
2581
2581
|
* Constants for the Bitfab SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -2575,7 +2575,7 @@ declare class BitfabFunction {
|
|
|
2575
2575
|
/**
|
|
2576
2576
|
* SDK version from package.json (injected at build time)
|
|
2577
2577
|
*/
|
|
2578
|
-
declare const __version__ = "0.36.
|
|
2578
|
+
declare const __version__ = "0.36.12";
|
|
2579
2579
|
|
|
2580
2580
|
/**
|
|
2581
2581
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getCurrentReplayBranch,
|
|
12
12
|
getCurrentSpan,
|
|
13
13
|
getCurrentTrace
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OCJSHTJR.js";
|
|
15
15
|
import {
|
|
16
16
|
BITFAB_PROGRESS_PREFIX,
|
|
17
17
|
BitfabError,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
flushTraces,
|
|
24
24
|
reportReplayProgress,
|
|
25
25
|
serializeReplayResult
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VUYTATF5.js";
|
|
27
27
|
export {
|
|
28
28
|
BITFAB_PROGRESS_PREFIX,
|
|
29
29
|
Bitfab,
|
package/dist/node.cjs
CHANGED
|
@@ -88,7 +88,7 @@ var __version__;
|
|
|
88
88
|
var init_version_generated = __esm({
|
|
89
89
|
"src/version.generated.ts"() {
|
|
90
90
|
"use strict";
|
|
91
|
-
__version__ = "0.36.
|
|
91
|
+
__version__ = "0.36.12";
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
|
|
@@ -2267,7 +2267,7 @@ async function captureCodeChangeFromGit(cwd, label) {
|
|
|
2267
2267
|
const tracked = await git(root, [
|
|
2268
2268
|
"diff",
|
|
2269
2269
|
"--name-status",
|
|
2270
|
-
"--
|
|
2270
|
+
"--find-renames",
|
|
2271
2271
|
"-z",
|
|
2272
2272
|
base,
|
|
2273
2273
|
"--",
|
|
@@ -2283,23 +2283,23 @@ async function captureCodeChangeFromGit(cwd, label) {
|
|
|
2283
2283
|
]);
|
|
2284
2284
|
const entries = [
|
|
2285
2285
|
...parseNameStatusZ(tracked ?? ""),
|
|
2286
|
-
...(untracked ?? "").split(NUL).filter((p) => p.length > 0).map((path) => ({ status: "A", path }))
|
|
2286
|
+
...(untracked ?? "").split(NUL).filter((p) => p.length > 0).map((path) => ({ status: "A", beforePath: path, path }))
|
|
2287
2287
|
];
|
|
2288
2288
|
if (entries.length === 0) {
|
|
2289
2289
|
return null;
|
|
2290
2290
|
}
|
|
2291
2291
|
const files = [];
|
|
2292
2292
|
let totalBytes = 0;
|
|
2293
|
-
for (const { status, path } of entries) {
|
|
2293
|
+
for (const { status, beforePath, path } of entries) {
|
|
2294
2294
|
if (files.length >= MAX_FILES) {
|
|
2295
2295
|
break;
|
|
2296
2296
|
}
|
|
2297
|
-
const beforeBytes = status === "A" ? 0 : await blobBytes(base,
|
|
2297
|
+
const beforeBytes = status === "A" ? 0 : await blobBytes(base, beforePath);
|
|
2298
2298
|
const afterBytes = status === "D" ? 0 : await workingBytes(path);
|
|
2299
2299
|
if (beforeBytes > MAX_FILE_BYTES || afterBytes > MAX_FILE_BYTES) {
|
|
2300
2300
|
continue;
|
|
2301
2301
|
}
|
|
2302
|
-
const before = (status === "A" ? "" : await git(root, ["show", `${base}:${
|
|
2302
|
+
const before = (status === "A" ? "" : await git(root, ["show", `${base}:${beforePath}`]) ?? "").replace(/\r\n/g, "\n");
|
|
2303
2303
|
const after = (status === "D" ? "" : await readWorkingFile(readFile, root, path)).replace(/\r\n/g, "\n");
|
|
2304
2304
|
if (before === after) {
|
|
2305
2305
|
continue;
|
|
@@ -2357,8 +2357,18 @@ async function readWorkingFile(readFile, root, path) {
|
|
|
2357
2357
|
function parseNameStatusZ(raw) {
|
|
2358
2358
|
const parts = raw.split(NUL).filter((p) => p.length > 0);
|
|
2359
2359
|
const out = [];
|
|
2360
|
-
|
|
2361
|
-
|
|
2360
|
+
let i = 0;
|
|
2361
|
+
while (i + 1 < parts.length) {
|
|
2362
|
+
const status = parts[i].charAt(0);
|
|
2363
|
+
i += 1;
|
|
2364
|
+
const beforePath = parts[i];
|
|
2365
|
+
i += 1;
|
|
2366
|
+
if ((status === "R" || status === "C") && i < parts.length) {
|
|
2367
|
+
out.push({ status, beforePath, path: parts[i] });
|
|
2368
|
+
i += 1;
|
|
2369
|
+
} else {
|
|
2370
|
+
out.push({ status, beforePath, path: beforePath });
|
|
2371
|
+
}
|
|
2362
2372
|
}
|
|
2363
2373
|
return out;
|
|
2364
2374
|
}
|
|
@@ -6105,14 +6115,19 @@ var Bitfab = class {
|
|
|
6105
6115
|
counters.set(counterKey, callIndex + 1);
|
|
6106
6116
|
const mockKey = `${counterKey}:${callIndex}`;
|
|
6107
6117
|
const mockSpan = replayCtxForMock.mockTree.spans.get(mockKey);
|
|
6108
|
-
const emitMock = (output) => {
|
|
6109
|
-
void sendSpan({
|
|
6118
|
+
const emitMock = (output, mockSource) => {
|
|
6119
|
+
void sendSpan({
|
|
6120
|
+
result: output,
|
|
6121
|
+
mocked: true,
|
|
6122
|
+
mockTarget: "output",
|
|
6123
|
+
mockSource
|
|
6124
|
+
});
|
|
6110
6125
|
if (fnReturnsPromise) {
|
|
6111
6126
|
return Promise.resolve(output);
|
|
6112
6127
|
}
|
|
6113
6128
|
return output;
|
|
6114
6129
|
};
|
|
6115
|
-
const emitMockAsync = (pending) => {
|
|
6130
|
+
const emitMockAsync = (pending, mockSource) => {
|
|
6116
6131
|
if (!fnReturnsPromise) {
|
|
6117
6132
|
throw new BitfabError(
|
|
6118
6133
|
`Cannot mock synchronous span "${traceFunctionKey}" with an asynchronously-resolved value (lazy recorded-output fetch or an async value function). Make the wrapped function async, or use mock: "all" so recorded outputs are fetched eagerly.`
|
|
@@ -6120,7 +6135,12 @@ var Bitfab = class {
|
|
|
6120
6135
|
}
|
|
6121
6136
|
return (async () => {
|
|
6122
6137
|
const output = await pending;
|
|
6123
|
-
void sendSpan({
|
|
6138
|
+
void sendSpan({
|
|
6139
|
+
result: output,
|
|
6140
|
+
mocked: true,
|
|
6141
|
+
mockTarget: "output",
|
|
6142
|
+
mockSource
|
|
6143
|
+
});
|
|
6124
6144
|
return output;
|
|
6125
6145
|
})();
|
|
6126
6146
|
};
|
|
@@ -6162,18 +6182,18 @@ var Bitfab = class {
|
|
|
6162
6182
|
getOriginalOutput: () => Promise.resolve(resolveRecordedOutput())
|
|
6163
6183
|
});
|
|
6164
6184
|
if (injected instanceof Promise) {
|
|
6165
|
-
return emitMockAsync(injected);
|
|
6185
|
+
return emitMockAsync(injected, "override");
|
|
6166
6186
|
}
|
|
6167
|
-
return emitMock(injected);
|
|
6187
|
+
return emitMock(injected, "override");
|
|
6168
6188
|
}
|
|
6169
6189
|
}
|
|
6170
6190
|
const shouldMock = replayCtxForMock.mockStrategy === "all" || replayCtxForMock.mockStrategy === "marked" && options.mockOnReplay === true;
|
|
6171
6191
|
if (shouldMock && mockSpan) {
|
|
6172
6192
|
const recorded = resolveRecordedOutput();
|
|
6173
6193
|
if (recorded instanceof Promise) {
|
|
6174
|
-
return emitMockAsync(recorded);
|
|
6194
|
+
return emitMockAsync(recorded, "recorded");
|
|
6175
6195
|
}
|
|
6176
|
-
return emitMock(recorded);
|
|
6196
|
+
return emitMock(recorded, "recorded");
|
|
6177
6197
|
}
|
|
6178
6198
|
}
|
|
6179
6199
|
const recordSpan = (result) => {
|
|
@@ -6473,7 +6493,9 @@ var Bitfab = class {
|
|
|
6473
6493
|
traceFunctionKey: params.traceFunctionKey,
|
|
6474
6494
|
rawSpan: externalSpan,
|
|
6475
6495
|
...params.testRunId && { testRunId: params.testRunId },
|
|
6476
|
-
...params.mocked && { mocked: true }
|
|
6496
|
+
...params.mocked && { mocked: true },
|
|
6497
|
+
...params.mockTarget && { mockTarget: params.mockTarget },
|
|
6498
|
+
...params.mockSource && { mockSource: params.mockSource }
|
|
6477
6499
|
});
|
|
6478
6500
|
}
|
|
6479
6501
|
registerMockOverride(overrideOrMatch, value) {
|