@alwaysmeticulous/cli 2.281.0 → 2.282.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.
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bfef332d-fb8c-58e5-b566-16312c894d79")}catch(e){}}();
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.downloadReplayCommand = void 0;
|
|
6
|
-
const promises_1 = require("fs/promises");
|
|
7
|
-
const path_1 = require("path");
|
|
8
6
|
const client_1 = require("@alwaysmeticulous/client");
|
|
9
7
|
const common_1 = require("@alwaysmeticulous/common");
|
|
10
8
|
const downloading_helpers_1 = require("@alwaysmeticulous/downloading-helpers");
|
|
@@ -18,60 +16,7 @@ const handler = async ({ apiToken, replayId }) => {
|
|
|
18
16
|
const { fileName: replayMetadataFileName } = await (0, downloading_helpers_1.getOrFetchReplay)(client, replayId);
|
|
19
17
|
logger.info(`Downloaded replay metadata to: ${replayMetadataFileName}`);
|
|
20
18
|
const { fileName: replayFolderFilePath } = await (0, downloading_helpers_1.getOrFetchReplayArchive)(client, replayId, "everything", true);
|
|
21
|
-
|
|
22
|
-
const logsFileExists = await (0, promises_1.access)(logsFile)
|
|
23
|
-
.then(() => true)
|
|
24
|
-
.catch(() => false);
|
|
25
|
-
if (logsFileExists) {
|
|
26
|
-
try {
|
|
27
|
-
const logs = (await (0, promises_1.readFile)(logsFile, "utf8"))
|
|
28
|
-
.split("\n")
|
|
29
|
-
.filter((line) => line !== "")
|
|
30
|
-
.map((line) => JSON.parse(line));
|
|
31
|
-
let virtualTime = 0;
|
|
32
|
-
const conciseLogs = logs.map((log) => {
|
|
33
|
-
if (log.type === "virtual-time-change") {
|
|
34
|
-
virtualTime = log.virtualTime;
|
|
35
|
-
return "";
|
|
36
|
-
}
|
|
37
|
-
const commonPostfix = `${log.repetitionCount ? " [x" + log.repetitionCount + "]" : ""} ${log.message}`;
|
|
38
|
-
if (log.source === "application") {
|
|
39
|
-
return `[trace-id: ${log.stackTraceId}] [virtual: ${virtualTime}ms] [application]${commonPostfix}`;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return `[trace-id: ${log.stackTraceId}] [virtual: ${virtualTime}ms, real: ${log.realTime}ms]${commonPostfix}`;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
await (0, promises_1.writeFile)((0, path_1.join)(replayFolderFilePath, "logs.concise.txt"), conciseLogs.join("\n"));
|
|
46
|
-
virtualTime = 0;
|
|
47
|
-
const deterministicLogs = logs.flatMap((log) => {
|
|
48
|
-
if (log.type === "virtual-time-change") {
|
|
49
|
-
virtualTime = log.virtualTime;
|
|
50
|
-
return [""];
|
|
51
|
-
}
|
|
52
|
-
if (log.message.includes("[non-deterministic]")) {
|
|
53
|
-
return [];
|
|
54
|
-
}
|
|
55
|
-
// Event ids are unstable so filter them out to minimize noise
|
|
56
|
-
const message = log.message.startsWith("Executing event")
|
|
57
|
-
? log.message.replace(/"id": ?\d+/g, '"id": "<non-deterministic>"')
|
|
58
|
-
: log.message;
|
|
59
|
-
const commonPostfix = `${log.repetitionCount ? " [x" + log.repetitionCount + "]" : ""} ${message}`;
|
|
60
|
-
if (log.source === "application") {
|
|
61
|
-
return [
|
|
62
|
-
`[virtual: ${virtualTime}ms] [application]${commonPostfix}`,
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
return [`[virtual: ${virtualTime}ms]${commonPostfix}`];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
await (0, promises_1.writeFile)((0, path_1.join)(replayFolderFilePath, "logs.deterministic.txt"), deterministicLogs.join("\n"));
|
|
70
|
-
}
|
|
71
|
-
catch (err) {
|
|
72
|
-
logger.error("Error creating concise version of logs file", err);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
19
|
+
await (0, downloading_helpers_1.ensureReplayLogTextFiles)(replayFolderFilePath);
|
|
75
20
|
logger.info(`Downloaded replay data to: ${replayFolderFilePath}`);
|
|
76
21
|
};
|
|
77
22
|
exports.downloadReplayCommand = {
|
|
@@ -89,4 +34,4 @@ exports.downloadReplayCommand = {
|
|
|
89
34
|
handler: (0, sentry_utils_1.wrapHandler)(handler),
|
|
90
35
|
};
|
|
91
36
|
//# sourceMappingURL=replay.command.js.map
|
|
92
|
-
//# debugId=
|
|
37
|
+
//# debugId=bfef332d-fb8c-58e5-b566-16312c894d79
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.command.js","sources":["../../../src/commands/download/replay.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"replay.command.js","sources":["../../../src/commands/download/replay.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAAiE;AACjE,qDAAsD;AACtD,+EAI+C;AAE/C,mEAA+D;AAO/D,MAAM,OAAO,GAAG,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAW,EAAiB,EAAE;IACvE,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAqB,EAAC;QACzC,QAAQ;QACR,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,MAAM,EAAE,QAAQ,EAAE,sBAAsB,EAAE,GAAG,MAAM,IAAA,sCAAgB,EACjE,MAAM,EACN,QAAQ,CACT,CAAC;IACF,MAAM,CAAC,IAAI,CAAC,kCAAkC,sBAAsB,EAAE,CAAC,CAAC;IACxE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,GAAG,MAAM,IAAA,6CAAuB,EACtE,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,IAAI,CACL,CAAC;IAEF,MAAM,IAAA,8CAAwB,EAAC,oBAAoB,CAAC,CAAC;IAErD,MAAM,CAAC,IAAI,CAAC,8BAA8B,oBAAoB,EAAE,CAAC,CAAC;AACpE,CAAC,CAAC;AAEW,QAAA,qBAAqB,GAAoC;IACpE,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,mCAAmC;IAC7C,OAAO,EAAE;QACP,QAAQ,EAAE;YACR,MAAM,EAAE,IAAI;SACb;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAI;SACnB;KACF;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC;CAC9B,CAAC","debugId":"bfef332d-fb8c-58e5-b566-16312c894d79"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwaysmeticulous/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.282.0",
|
|
4
4
|
"description": "The Meticulous CLI",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"@alwaysmeticulous/api": "2.280.0",
|
|
27
27
|
"@alwaysmeticulous/client": "2.281.0",
|
|
28
28
|
"@alwaysmeticulous/common": "2.280.0",
|
|
29
|
-
"@alwaysmeticulous/debug-workspace": "2.
|
|
30
|
-
"@alwaysmeticulous/downloading-helpers": "2.
|
|
29
|
+
"@alwaysmeticulous/debug-workspace": "2.282.0",
|
|
30
|
+
"@alwaysmeticulous/downloading-helpers": "2.282.0",
|
|
31
31
|
"@alwaysmeticulous/record": "2.280.0",
|
|
32
32
|
"@alwaysmeticulous/remote-replay-launcher": "2.281.0",
|
|
33
33
|
"@alwaysmeticulous/replay-debugger-ui": "2.280.0",
|
|
34
|
-
"@alwaysmeticulous/replay-orchestrator-launcher": "2.
|
|
34
|
+
"@alwaysmeticulous/replay-orchestrator-launcher": "2.282.0",
|
|
35
35
|
"@alwaysmeticulous/sdk-bundles-api": "2.280.0",
|
|
36
36
|
"@alwaysmeticulous/sentry": "2.280.0",
|
|
37
37
|
"@alwaysmeticulous/tunnels-client": "2.280.0"
|