@alwaysmeticulous/cli 2.45.2 → 2.45.3

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,21 +1,5 @@
1
1
  /// <reference types="yargs" />
2
- import { Replay, ScreenshotDiffOptions } from "@alwaysmeticulous/api";
3
- import { ReplayExecutionOptions, ReplayTarget } from "@alwaysmeticulous/sdk-bundles-api";
4
- export interface RawReplayCommandHandlerOptions extends ScreenshotDiffOptions, Omit<ReplayExecutionOptions, "maxDurationMs" | "maxEventCount"> {
5
- screenshot: boolean;
6
- appUrl: string | null | undefined;
7
- simulationIdForAssets: string | null | undefined;
8
- maxDurationMs: number | null | undefined;
9
- maxEventCount: number | null | undefined;
10
- storyboard: boolean;
11
- apiToken: string | null | undefined;
12
- commitSha: string | null | undefined;
13
- sessionId: string;
14
- cookiesFile: string | null | undefined;
15
- debugger: boolean;
16
- baseReplayId: string | null | undefined;
17
- }
18
- export declare const rawReplayCommandHandler: ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, baseReplayId, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, debugger: enableStepThroughDebugger, }: RawReplayCommandHandlerOptions) => Promise<Replay>;
2
+ import { ReplayTarget } from "@alwaysmeticulous/sdk-bundles-api";
19
3
  export declare const getReplayTarget: ({ appUrl, simulationIdForAssets, }: {
20
4
  appUrl: string | null;
21
5
  simulationIdForAssets: string | null;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.replayCommand = exports.getReplayTarget = exports.rawReplayCommandHandler = void 0;
3
+ exports.replayCommand = exports.getReplayTarget = void 0;
4
4
  const common_1 = require("@alwaysmeticulous/common");
5
5
  const replay_orchestrator_launcher_1 = require("@alwaysmeticulous/replay-orchestrator-launcher");
6
6
  const command_builder_1 = require("../../command-utils/command-builder");
7
7
  const common_options_1 = require("../../command-utils/common-options");
8
8
  const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
9
9
  const replay_debugger_ui_1 = require("./utils/replay-debugger.ui");
10
- const rawReplayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, baseReplayId, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, debugger: enableStepThroughDebugger, }) => {
10
+ const replayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, simulationIdForAssets, headless, devTools, bypassCSP, screenshot, baseReplayId, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, moveBeforeClick, cookiesFile, disableRemoteFonts, noSandbox, skipPauses, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, debugger: enableStepThroughDebugger, }) => {
11
11
  if (!screenshot && storyboard) {
12
12
  throw new Error("Cannot take storyboard screenshots without taking end state screenshots. Please set '--screenshot' to true, or '--storyboard' to false.");
13
13
  }
@@ -81,8 +81,7 @@ const rawReplayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl,
81
81
  getOnBeforeUserEventCallback.resolve(stepThroughDebuggerUI.onBeforeUserEvent);
82
82
  getOnClosePageCallback.resolve(stepThroughDebuggerUI.close);
83
83
  }
84
- const { replay } = await replayExecution.finalResult;
85
- return replay;
84
+ await replayExecution.finalResult;
86
85
  }
87
86
  catch (error) {
88
87
  if ((0, out_of_date_client_error_1.isOutOfDateClientError)(error)) {
@@ -93,7 +92,6 @@ const rawReplayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl,
93
92
  }
94
93
  }
95
94
  };
96
- exports.rawReplayCommandHandler = rawReplayCommandHandler;
97
95
  const getReplayTarget = ({ appUrl, simulationIdForAssets, }) => {
98
96
  if (simulationIdForAssets) {
99
97
  return { type: "snapshotted-assets", simulationIdForAssets };
@@ -149,5 +147,5 @@ exports.replayCommand = (0, command_builder_1.buildCommand)("simulate")
149
147
  ...common_options_1.SCREENSHOT_DIFF_OPTIONS,
150
148
  })
151
149
  .handler(async (options) => {
152
- await (0, exports.rawReplayCommandHandler)(options);
150
+ await replayCommandHandler(options);
153
151
  });
@@ -38,13 +38,17 @@ exports.setOptions = setOptions;
38
38
  const wrapHandler = function wrapHandler_(handler) {
39
39
  return async (args) => {
40
40
  await handler(args)
41
- .then(() => {
41
+ .then(async () => {
42
42
  var _a;
43
43
  const transaction = (_a = Sentry.getCurrentHub().getScope()) === null || _a === void 0 ? void 0 : _a.getTransaction();
44
44
  if (transaction !== undefined) {
45
45
  transaction.setStatus("ok");
46
46
  transaction.finish();
47
47
  }
48
+ await Sentry.flush(sentry_1.SENTRY_FLUSH_TIMEOUT.toMillis());
49
+ // This is required: otherwise the process will hang for a while,
50
+ // presumably waiting on some setTimeout to trigger
51
+ process.exit(0);
48
52
  })
49
53
  .catch(async (error) => {
50
54
  var _a;
@@ -54,6 +58,7 @@ const wrapHandler = function wrapHandler_(handler) {
54
58
  transaction.setStatus("unknown_error");
55
59
  transaction.finish();
56
60
  }
61
+ await Sentry.flush(sentry_1.SENTRY_FLUSH_TIMEOUT.toMillis());
57
62
  // Don't display the help text which can obscure the error
58
63
  process.exit(1);
59
64
  });
@@ -67,5 +72,4 @@ const reportHandlerError = async (error) => {
67
72
  logger.info("");
68
73
  logger.info("Tip: run `meticulous <command> --help` for help on a particular command, or `meticulous --help` for a list of the available commands.");
69
74
  Sentry.captureException(error);
70
- await Sentry.flush(sentry_1.SENTRY_FLUSH_TIMEOUT.toMillis());
71
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/cli",
3
- "version": "2.45.2",
3
+ "version": "2.45.3",
4
4
  "description": "The Meticulous CLI",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -33,8 +33,8 @@
33
33
  "@alwaysmeticulous/downloading-helpers": "^2.44.1",
34
34
  "@alwaysmeticulous/record": "^2.44.1",
35
35
  "@alwaysmeticulous/replay-debugger-ui": "^2.45.2",
36
- "@alwaysmeticulous/replay-orchestrator-launcher": "^2.45.0",
37
- "@alwaysmeticulous/sdk-bundles-api": "^2.45.0",
36
+ "@alwaysmeticulous/replay-orchestrator-launcher": "^2.45.3",
37
+ "@alwaysmeticulous/sdk-bundles-api": "^2.45.3",
38
38
  "@alwaysmeticulous/sentry": "^2.40.0",
39
39
  "@sentry/node": "^7.36.0",
40
40
  "axios": "^1.2.6",
@@ -79,5 +79,5 @@
79
79
  "coverageDirectory": "../coverage",
80
80
  "testEnvironment": "node"
81
81
  },
82
- "gitHead": "3093e2cc8552f2821bac908b98a5be7316bc98b2"
82
+ "gitHead": "d4e536d8ea889e75077bb9889399016d35082339"
83
83
  }