@alwaysmeticulous/cli 2.62.0 → 2.64.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.
@@ -13,52 +13,52 @@ export declare const OPTIONS: {
13
13
  readonly devTools: {
14
14
  readonly boolean: true;
15
15
  readonly description: "Open Chrome Dev Tools";
16
- readonly default: false;
16
+ readonly default: boolean;
17
17
  };
18
18
  readonly bypassCSP: {
19
19
  readonly boolean: true;
20
20
  readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
21
- readonly default: false;
21
+ readonly default: boolean;
22
22
  };
23
23
  readonly shiftTime: {
24
24
  readonly boolean: true;
25
25
  readonly description: "Shift time during simulation to be set as the recording time";
26
- readonly default: true;
26
+ readonly default: boolean;
27
27
  };
28
28
  readonly networkStubbing: {
29
29
  readonly boolean: true;
30
30
  readonly description: "Stub network requests during replay";
31
- readonly default: true;
31
+ readonly default: boolean;
32
32
  };
33
33
  readonly skipPauses: {
34
34
  readonly boolean: true;
35
35
  readonly description: "Fast forward through any pauses to replay as fast as possible.";
36
- readonly default: true;
36
+ readonly default: boolean;
37
37
  };
38
38
  readonly moveBeforeClick: {
39
39
  readonly boolean: true;
40
40
  readonly description: "Simulate mouse movement before clicking";
41
- readonly default: true;
41
+ readonly default: boolean;
42
42
  };
43
43
  readonly diffThreshold: {
44
44
  readonly number: true;
45
45
  readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
46
- readonly default: 0.01;
46
+ readonly default: number;
47
47
  };
48
48
  readonly diffPixelThreshold: {
49
49
  readonly number: true;
50
50
  readonly description: "A number between 0 and 1. Color/brightness differences in individual pixels will be ignored if the difference is less than this threshold. A value of 1.0 would accept any difference in color, while a value of 0.0 would accept no difference in color.";
51
- readonly default: 0.01;
51
+ readonly default: number;
52
52
  };
53
53
  readonly disableRemoteFonts: {
54
54
  readonly boolean: true;
55
55
  readonly description: "Pass the disable remote fonts flag into chromium";
56
- readonly default: false;
56
+ readonly default: boolean;
57
57
  };
58
58
  readonly noSandbox: {
59
59
  readonly boolean: true;
60
60
  readonly description: "Pass the no sandbox flag into chromium";
61
- readonly default: false;
61
+ readonly default: boolean;
62
62
  };
63
63
  readonly maxDurationMs: {
64
64
  readonly number: true;
@@ -71,17 +71,17 @@ export declare const OPTIONS: {
71
71
  readonly storyboard: {
72
72
  readonly boolean: true;
73
73
  readonly description: "Take a storyboard of screenshots during simulation";
74
- readonly default: true;
74
+ readonly default: boolean;
75
75
  };
76
76
  readonly essentialFeaturesOnly: {
77
77
  readonly boolean: true;
78
78
  readonly description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.";
79
- readonly default: false;
79
+ readonly default: boolean;
80
80
  };
81
81
  readonly logPossibleNonDeterminism: {
82
82
  readonly boolean: true;
83
83
  readonly description: "Enable logging of non-determinism events";
84
- readonly default: false;
84
+ readonly default: boolean;
85
85
  readonly hidden: true;
86
86
  };
87
87
  };
@@ -89,17 +89,17 @@ export declare const SCREENSHOT_DIFF_OPTIONS: {
89
89
  diffThreshold: {
90
90
  readonly number: true;
91
91
  readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
92
- readonly default: 0.01;
92
+ readonly default: number;
93
93
  };
94
94
  diffPixelThreshold: {
95
95
  readonly number: true;
96
96
  readonly description: "A number between 0 and 1. Color/brightness differences in individual pixels will be ignored if the difference is less than this threshold. A value of 1.0 would accept any difference in color, while a value of 0.0 would accept no difference in color.";
97
- readonly default: 0.01;
97
+ readonly default: number;
98
98
  };
99
99
  storyboard: {
100
100
  readonly boolean: true;
101
101
  readonly description: "Take a storyboard of screenshots during simulation";
102
- readonly default: true;
102
+ readonly default: boolean;
103
103
  };
104
104
  };
105
105
  /**
@@ -114,37 +114,37 @@ export declare const COMMON_REPLAY_OPTIONS: {
114
114
  devTools: {
115
115
  readonly boolean: true;
116
116
  readonly description: "Open Chrome Dev Tools";
117
- readonly default: false;
117
+ readonly default: boolean;
118
118
  };
119
119
  bypassCSP: {
120
120
  readonly boolean: true;
121
121
  readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
122
- readonly default: false;
122
+ readonly default: boolean;
123
123
  };
124
124
  shiftTime: {
125
125
  readonly boolean: true;
126
126
  readonly description: "Shift time during simulation to be set as the recording time";
127
- readonly default: true;
127
+ readonly default: boolean;
128
128
  };
129
129
  networkStubbing: {
130
130
  readonly boolean: true;
131
131
  readonly description: "Stub network requests during replay";
132
- readonly default: true;
132
+ readonly default: boolean;
133
133
  };
134
134
  skipPauses: {
135
135
  readonly boolean: true;
136
136
  readonly description: "Fast forward through any pauses to replay as fast as possible.";
137
- readonly default: true;
137
+ readonly default: boolean;
138
138
  };
139
139
  disableRemoteFonts: {
140
140
  readonly boolean: true;
141
141
  readonly description: "Pass the disable remote fonts flag into chromium";
142
- readonly default: false;
142
+ readonly default: boolean;
143
143
  };
144
144
  noSandbox: {
145
145
  readonly boolean: true;
146
146
  readonly description: "Pass the no sandbox flag into chromium";
147
- readonly default: false;
147
+ readonly default: boolean;
148
148
  };
149
149
  maxDurationMs: {
150
150
  readonly number: true;
@@ -157,12 +157,12 @@ export declare const COMMON_REPLAY_OPTIONS: {
157
157
  essentialFeaturesOnly: {
158
158
  readonly boolean: true;
159
159
  readonly description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.";
160
- readonly default: false;
160
+ readonly default: boolean;
161
161
  };
162
162
  logPossibleNonDeterminism: {
163
163
  readonly boolean: true;
164
164
  readonly description: "Enable logging of non-determinism events";
165
- readonly default: false;
165
+ readonly default: boolean;
166
166
  readonly hidden: true;
167
167
  };
168
168
  };
@@ -11,6 +11,7 @@
11
11
  // This then makes the difference in behaviour explicit
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.COMMON_REPLAY_OPTIONS = exports.SCREENSHOT_DIFF_OPTIONS = exports.OPTIONS = void 0;
14
+ const common_1 = require("@alwaysmeticulous/common");
14
15
  exports.OPTIONS = {
15
16
  apiToken: {
16
17
  string: true,
@@ -19,6 +20,7 @@ exports.OPTIONS = {
19
20
  string: true,
20
21
  },
21
22
  headless: {
23
+ // Note: when running in CI we default to headless (see DEFAULT_EXECUTION_OPTIONS), but for local runs via the CLI we use headed mode by default
22
24
  boolean: true,
23
25
  description: "Start browser in headless mode",
24
26
  default: false,
@@ -26,54 +28,55 @@ exports.OPTIONS = {
26
28
  devTools: {
27
29
  boolean: true,
28
30
  description: "Open Chrome Dev Tools",
29
- default: false,
31
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.devTools,
30
32
  },
31
33
  bypassCSP: {
32
34
  boolean: true,
33
35
  description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)",
34
- default: false,
36
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.bypassCSP,
35
37
  },
36
38
  shiftTime: {
37
39
  boolean: true,
38
40
  description: "Shift time during simulation to be set as the recording time",
39
- default: true,
41
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.shiftTime,
40
42
  },
41
43
  networkStubbing: {
42
44
  boolean: true,
43
45
  description: "Stub network requests during replay",
44
- default: true,
46
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.networkStubbing,
45
47
  },
46
48
  skipPauses: {
47
49
  boolean: true,
48
50
  description: "Fast forward through any pauses to replay as fast as possible.",
49
- default: true,
51
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.skipPauses,
50
52
  },
51
53
  moveBeforeClick: {
52
54
  boolean: true,
53
55
  description: "Simulate mouse movement before clicking",
54
- default: true,
56
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.moveBeforeClick,
55
57
  },
56
58
  diffThreshold: {
57
59
  number: true,
58
60
  description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.",
59
- default: 0.01,
61
+ default: common_1.DEFAULT_SCREENSHOTTING_OPTIONS.diffOptions.diffThreshold,
60
62
  },
61
63
  diffPixelThreshold: {
62
64
  number: true,
63
65
  description: "A number between 0 and 1. Color/brightness differences in individual pixels will be ignored if the difference is less than this threshold. A value of 1.0 would accept any difference in color, while a value of 0.0 would accept no difference in color.",
64
- default: 0.01,
66
+ default: common_1.DEFAULT_SCREENSHOTTING_OPTIONS.diffOptions.diffPixelThreshold,
65
67
  },
66
68
  disableRemoteFonts: {
67
69
  boolean: true,
68
70
  description: "Pass the disable remote fonts flag into chromium",
69
- default: false,
71
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.disableRemoteFonts,
70
72
  },
71
73
  noSandbox: {
72
74
  boolean: true,
73
75
  description: "Pass the no sandbox flag into chromium",
74
- default: false,
76
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.noSandbox,
75
77
  },
76
78
  maxDurationMs: {
79
+ // Note: when running in CI we default to 5 minutes (see DEFAULT_EXECUTION_OPTIONS), but for local runs via the CLI we have no default limit
77
80
  number: true,
78
81
  description: "Maximum duration (in milliseconds) the simulation will run",
79
82
  },
@@ -84,17 +87,17 @@ exports.OPTIONS = {
84
87
  storyboard: {
85
88
  boolean: true,
86
89
  description: "Take a storyboard of screenshots during simulation",
87
- default: true,
90
+ default: common_1.DEFAULT_SCREENSHOTTING_OPTIONS.storyboardOptions.enabled,
88
91
  },
89
92
  essentialFeaturesOnly: {
90
93
  boolean: true,
91
94
  description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.",
92
- default: false,
95
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.essentialFeaturesOnly,
93
96
  },
94
97
  logPossibleNonDeterminism: {
95
98
  boolean: true,
96
99
  description: "Enable logging of non-determinism events",
97
- default: false,
100
+ default: common_1.DEFAULT_EXECUTION_OPTIONS.logPossibleNonDeterminism,
98
101
  hidden: true,
99
102
  },
100
103
  };
@@ -8,17 +8,17 @@ export declare const replayCommand: import("yargs").CommandModule<unknown, impor
8
8
  diffThreshold: {
9
9
  readonly number: true;
10
10
  readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
11
- readonly default: 0.01;
11
+ readonly default: number;
12
12
  };
13
13
  diffPixelThreshold: {
14
14
  readonly number: true;
15
15
  readonly description: "A number between 0 and 1. Color/brightness differences in individual pixels will be ignored if the difference is less than this threshold. A value of 1.0 would accept any difference in color, while a value of 0.0 would accept no difference in color.";
16
- readonly default: 0.01;
16
+ readonly default: number;
17
17
  };
18
18
  storyboard: {
19
19
  readonly boolean: true;
20
20
  readonly description: "Take a storyboard of screenshots during simulation";
21
- readonly default: true;
21
+ readonly default: boolean;
22
22
  };
23
23
  headless: {
24
24
  readonly boolean: true;
@@ -28,37 +28,37 @@ export declare const replayCommand: import("yargs").CommandModule<unknown, impor
28
28
  devTools: {
29
29
  readonly boolean: true;
30
30
  readonly description: "Open Chrome Dev Tools";
31
- readonly default: false;
31
+ readonly default: boolean;
32
32
  };
33
33
  bypassCSP: {
34
34
  readonly boolean: true;
35
35
  readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
36
- readonly default: false;
36
+ readonly default: boolean;
37
37
  };
38
38
  shiftTime: {
39
39
  readonly boolean: true;
40
40
  readonly description: "Shift time during simulation to be set as the recording time";
41
- readonly default: true;
41
+ readonly default: boolean;
42
42
  };
43
43
  networkStubbing: {
44
44
  readonly boolean: true;
45
45
  readonly description: "Stub network requests during replay";
46
- readonly default: true;
46
+ readonly default: boolean;
47
47
  };
48
48
  skipPauses: {
49
49
  readonly boolean: true;
50
50
  readonly description: "Fast forward through any pauses to replay as fast as possible.";
51
- readonly default: true;
51
+ readonly default: boolean;
52
52
  };
53
53
  disableRemoteFonts: {
54
54
  readonly boolean: true;
55
55
  readonly description: "Pass the disable remote fonts flag into chromium";
56
- readonly default: false;
56
+ readonly default: boolean;
57
57
  };
58
58
  noSandbox: {
59
59
  readonly boolean: true;
60
60
  readonly description: "Pass the no sandbox flag into chromium";
61
- readonly default: false;
61
+ readonly default: boolean;
62
62
  };
63
63
  maxDurationMs: {
64
64
  readonly number: true;
@@ -71,12 +71,12 @@ export declare const replayCommand: import("yargs").CommandModule<unknown, impor
71
71
  essentialFeaturesOnly: {
72
72
  readonly boolean: true;
73
73
  readonly description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.";
74
- readonly default: false;
74
+ readonly default: boolean;
75
75
  };
76
76
  logPossibleNonDeterminism: {
77
77
  readonly boolean: true;
78
78
  readonly description: "Enable logging of non-determinism events";
79
- readonly default: false;
79
+ readonly default: boolean;
80
80
  readonly hidden: true;
81
81
  };
82
82
  apiToken: {
@@ -111,7 +111,7 @@ export declare const replayCommand: import("yargs").CommandModule<unknown, impor
111
111
  moveBeforeClick: {
112
112
  readonly boolean: true;
113
113
  readonly description: "Simulate mouse movement before clicking";
114
- readonly default: true;
114
+ readonly default: boolean;
115
115
  };
116
116
  cookiesFile: {
117
117
  string: true;
@@ -5,6 +5,7 @@ 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
+ const apply_default_execution_options_from_project_1 = require("../../utils/apply-default-execution-options-from-project");
8
9
  const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
9
10
  const replay_debugger_ui_1 = require("./utils/replay-debugger.ui");
10
11
  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, logPossibleNonDeterminism, debugger: enableStepThroughDebugger, }) => {
@@ -27,7 +28,7 @@ const replayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, si
27
28
  maxDurationMs: maxDurationMs !== null && maxDurationMs !== void 0 ? maxDurationMs : null,
28
29
  maxEventCount: maxEventCount !== null && maxEventCount !== void 0 ? maxEventCount : null,
29
30
  essentialFeaturesOnly,
30
- logPossibleNonDeterminism
31
+ logPossibleNonDeterminism,
31
32
  };
32
33
  const generatedByOption = { type: "replayCommand" };
33
34
  const storyboardOptions = storyboard
@@ -56,7 +57,10 @@ const replayCommandHandler = async ({ apiToken, commitSha, sessionId, appUrl, si
56
57
  appUrl: appUrl !== null && appUrl !== void 0 ? appUrl : null,
57
58
  simulationIdForAssets: simulationIdForAssets !== null && simulationIdForAssets !== void 0 ? simulationIdForAssets : null,
58
59
  }),
59
- executionOptions,
60
+ executionOptions: await (0, apply_default_execution_options_from_project_1.applyDefaultExecutionOptionsFromProject)({
61
+ apiToken,
62
+ executionOptions,
63
+ }),
60
64
  screenshottingOptions,
61
65
  apiToken,
62
66
  commitSha,
@@ -3,17 +3,17 @@ export declare const runAllTestsCommand: import("yargs").CommandModule<unknown,
3
3
  readonly diffThreshold: {
4
4
  readonly number: true;
5
5
  readonly description: "Acceptable maximum proportion of changed pixels, between 0 and 1. If this proportion is exceeded then the test will fail.";
6
- readonly default: 0.01;
6
+ readonly default: number;
7
7
  };
8
8
  readonly diffPixelThreshold: {
9
9
  readonly number: true;
10
10
  readonly description: "A number between 0 and 1. Color/brightness differences in individual pixels will be ignored if the difference is less than this threshold. A value of 1.0 would accept any difference in color, while a value of 0.0 would accept no difference in color.";
11
- readonly default: 0.01;
11
+ readonly default: number;
12
12
  };
13
13
  readonly storyboard: {
14
14
  readonly boolean: true;
15
15
  readonly description: "Take a storyboard of screenshots during simulation";
16
- readonly default: true;
16
+ readonly default: boolean;
17
17
  };
18
18
  readonly headless: {
19
19
  readonly boolean: true;
@@ -23,37 +23,37 @@ export declare const runAllTestsCommand: import("yargs").CommandModule<unknown,
23
23
  readonly devTools: {
24
24
  readonly boolean: true;
25
25
  readonly description: "Open Chrome Dev Tools";
26
- readonly default: false;
26
+ readonly default: boolean;
27
27
  };
28
28
  readonly bypassCSP: {
29
29
  readonly boolean: true;
30
30
  readonly description: "Enables bypass CSP in the browser (danger: this could mean you tests hit your production backend)";
31
- readonly default: false;
31
+ readonly default: boolean;
32
32
  };
33
33
  readonly shiftTime: {
34
34
  readonly boolean: true;
35
35
  readonly description: "Shift time during simulation to be set as the recording time";
36
- readonly default: true;
36
+ readonly default: boolean;
37
37
  };
38
38
  readonly networkStubbing: {
39
39
  readonly boolean: true;
40
40
  readonly description: "Stub network requests during replay";
41
- readonly default: true;
41
+ readonly default: boolean;
42
42
  };
43
43
  readonly skipPauses: {
44
44
  readonly boolean: true;
45
45
  readonly description: "Fast forward through any pauses to replay as fast as possible.";
46
- readonly default: true;
46
+ readonly default: boolean;
47
47
  };
48
48
  readonly disableRemoteFonts: {
49
49
  readonly boolean: true;
50
50
  readonly description: "Pass the disable remote fonts flag into chromium";
51
- readonly default: false;
51
+ readonly default: boolean;
52
52
  };
53
53
  readonly noSandbox: {
54
54
  readonly boolean: true;
55
55
  readonly description: "Pass the no sandbox flag into chromium";
56
- readonly default: false;
56
+ readonly default: boolean;
57
57
  };
58
58
  readonly maxDurationMs: {
59
59
  readonly number: true;
@@ -66,12 +66,12 @@ export declare const runAllTestsCommand: import("yargs").CommandModule<unknown,
66
66
  readonly essentialFeaturesOnly: {
67
67
  readonly boolean: true;
68
68
  readonly description: "Disable any features that are non-essential for running tests/executing replays. This includes disabling recording a video of the replay, for playback in the web app. This flag is useful to reduce noise when debugging.";
69
- readonly default: false;
69
+ readonly default: boolean;
70
70
  };
71
71
  readonly logPossibleNonDeterminism: {
72
72
  readonly boolean: true;
73
73
  readonly description: "Enable logging of non-determinism events";
74
- readonly default: false;
74
+ readonly default: boolean;
75
75
  readonly hidden: true;
76
76
  };
77
77
  readonly apiToken: {
@@ -124,6 +124,6 @@ export declare const runAllTestsCommand: import("yargs").CommandModule<unknown,
124
124
  readonly moveBeforeClick: {
125
125
  readonly boolean: true;
126
126
  readonly description: "Simulate mouse movement before clicking";
127
- readonly default: true;
127
+ readonly default: boolean;
128
128
  };
129
129
  }>>;
@@ -5,6 +5,7 @@ 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
+ const apply_default_execution_options_from_project_1 = require("../../utils/apply-default-execution-options-from-project");
8
9
  const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
9
10
  const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl, headless, devTools, bypassCSP, diffThreshold, diffPixelThreshold, shiftTime, networkStubbing, githubSummary, parallelize, parallelTasks: parrelelTasks_, maxRetriesOnFailure, rerunTestsNTimes, testsFile, disableRemoteFonts, noSandbox, skipPauses, moveBeforeClick, maxDurationMs, maxEventCount, storyboard, essentialFeaturesOnly, logPossibleNonDeterminism, baseTestRunId, }) => {
10
11
  const executionOptions = {
@@ -35,7 +36,10 @@ const handler = async ({ apiToken, commitSha: commitSha_, baseCommitSha, appUrl,
35
36
  try {
36
37
  const { testRun } = await (0, replay_orchestrator_launcher_1.executeTestRun)({
37
38
  testsFile: testsFile !== null && testsFile !== void 0 ? testsFile : null,
38
- executionOptions,
39
+ executionOptions: await (0, apply_default_execution_options_from_project_1.applyDefaultExecutionOptionsFromProject)({
40
+ apiToken,
41
+ executionOptions,
42
+ }),
39
43
  screenshottingOptions,
40
44
  apiToken: apiToken !== null && apiToken !== void 0 ? apiToken : null,
41
45
  commitSha,
@@ -0,0 +1,5 @@
1
+ import { ReplayExecutionOptions } from "@alwaysmeticulous/sdk-bundles-api";
2
+ export declare const applyDefaultExecutionOptionsFromProject: ({ apiToken, executionOptions, }: {
3
+ apiToken: string | undefined | null;
4
+ executionOptions: ReplayExecutionOptions;
5
+ }) => Promise<ReplayExecutionOptions>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.applyDefaultExecutionOptionsFromProject = void 0;
7
+ const client_1 = require("@alwaysmeticulous/client");
8
+ const common_1 = require("@alwaysmeticulous/common");
9
+ const loglevel_1 = __importDefault(require("loglevel"));
10
+ const applyDefaultExecutionOptionsFromProject = async ({ apiToken, executionOptions, }) => {
11
+ const logger = loglevel_1.default.getLogger(common_1.METICULOUS_LOGGER_NAME);
12
+ const client = (0, client_1.createClient)({ apiToken });
13
+ const project = await (0, client_1.getProject)(client);
14
+ if (!project) {
15
+ throw new Error(`Could not retrieve project data. Is the API token correct?`);
16
+ }
17
+ if (executionOptions.networkStubbingMode != null ||
18
+ project.settings.networkStubbingMode == null) {
19
+ return executionOptions;
20
+ }
21
+ if (project.settings.networkStubbingMode.type === "stub-non-ssr-requests") {
22
+ logger.info("");
23
+ logger.info("Stubbing all requests, except requests to render server components and requests for static assets");
24
+ logger.info("Visit your project settings page if you wish to change this");
25
+ logger.info("");
26
+ }
27
+ if (project.settings.networkStubbingMode.type === "custom-stubbing") {
28
+ logger.info("");
29
+ logger.info(`Stubbing all requests, except requests which match one of the following regexes: [${project.settings.networkStubbingMode.requestsToNotStub
30
+ .map((request) => `'${request.urlRegex}'`)
31
+ .join(", ")}]`);
32
+ logger.info("Visit your project settings page if you wish to change this");
33
+ logger.info("");
34
+ }
35
+ return {
36
+ ...executionOptions,
37
+ networkStubbingMode: project.settings.networkStubbingMode,
38
+ };
39
+ };
40
+ exports.applyDefaultExecutionOptionsFromProject = applyDefaultExecutionOptionsFromProject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/cli",
3
- "version": "2.62.0",
3
+ "version": "2.64.0",
4
4
  "description": "The Meticulous CLI",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -27,14 +27,14 @@
27
27
  "depcheck": "depcheck --ignore-patterns=dist"
28
28
  },
29
29
  "dependencies": {
30
- "@alwaysmeticulous/api": "^2.62.0",
31
- "@alwaysmeticulous/client": "^2.62.0",
32
- "@alwaysmeticulous/common": "^2.62.0",
33
- "@alwaysmeticulous/downloading-helpers": "^2.62.0",
34
- "@alwaysmeticulous/record": "^2.62.0",
30
+ "@alwaysmeticulous/api": "^2.63.0",
31
+ "@alwaysmeticulous/client": "^2.64.0",
32
+ "@alwaysmeticulous/common": "^2.64.0",
33
+ "@alwaysmeticulous/downloading-helpers": "^2.64.0",
34
+ "@alwaysmeticulous/record": "^2.64.0",
35
35
  "@alwaysmeticulous/replay-debugger-ui": "^2.46.0",
36
- "@alwaysmeticulous/replay-orchestrator-launcher": "^2.62.0",
37
- "@alwaysmeticulous/sdk-bundles-api": "^2.62.0",
36
+ "@alwaysmeticulous/replay-orchestrator-launcher": "^2.64.0",
37
+ "@alwaysmeticulous/sdk-bundles-api": "^2.63.0",
38
38
  "@alwaysmeticulous/sentry": "^2.40.0",
39
39
  "@sentry/node": "^7.36.0",
40
40
  "loglevel": "^1.8.0",
@@ -78,5 +78,5 @@
78
78
  "coverageDirectory": "../coverage",
79
79
  "testEnvironment": "node"
80
80
  },
81
- "gitHead": "27a1e339c921064c144792812c25e44181794881"
81
+ "gitHead": "8ba197167afa07133c9cadde537ce279eaf5e3f2"
82
82
  }