@alwaysmeticulous/cli 2.304.0 → 2.305.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.
Files changed (142) hide show
  1. package/dist/command-utils/common-options.d.ts +5 -0
  2. package/dist/command-utils/common-options.d.ts.map +1 -1
  3. package/dist/command-utils/common-options.js +7 -2
  4. package/dist/command-utils/common-options.js.map +1 -1
  5. package/dist/command-utils/json-args.d.ts +14 -0
  6. package/dist/command-utils/json-args.d.ts.map +1 -0
  7. package/dist/command-utils/json-args.js +40 -0
  8. package/dist/command-utils/json-args.js.map +1 -0
  9. package/dist/command-utils/json-args.spec.d.ts +2 -0
  10. package/dist/command-utils/json-args.spec.d.ts.map +1 -0
  11. package/dist/command-utils/json-args.spec.js +37 -0
  12. package/dist/command-utils/json-args.spec.js.map +1 -0
  13. package/dist/command-utils/print-json.d.ts +7 -0
  14. package/dist/command-utils/print-json.d.ts.map +1 -0
  15. package/dist/command-utils/print-json.js +16 -0
  16. package/dist/command-utils/print-json.js.map +1 -0
  17. package/dist/commands/agent/index.d.ts.map +1 -1
  18. package/dist/commands/agent/index.js +11 -4
  19. package/dist/commands/agent/index.js.map +1 -1
  20. package/dist/commands/agent/js-coverage-diff.command.d.ts.map +1 -1
  21. package/dist/commands/agent/js-coverage-diff.command.js +26 -33
  22. package/dist/commands/agent/js-coverage-diff.command.js.map +1 -1
  23. package/dist/commands/agent/js-coverage.command.d.ts +3 -0
  24. package/dist/commands/agent/js-coverage.command.d.ts.map +1 -1
  25. package/dist/commands/agent/js-coverage.command.js +81 -43
  26. package/dist/commands/agent/js-coverage.command.js.map +1 -1
  27. package/dist/commands/agent/js-coverage.command.spec.js +48 -2
  28. package/dist/commands/agent/js-coverage.command.spec.js.map +1 -1
  29. package/dist/commands/agent/screenshot-dom-diff.command.d.ts +1 -0
  30. package/dist/commands/agent/screenshot-dom-diff.command.d.ts.map +1 -1
  31. package/dist/commands/agent/screenshot-dom-diff.command.js +26 -18
  32. package/dist/commands/agent/screenshot-dom-diff.command.js.map +1 -1
  33. package/dist/commands/agent/screenshot-image-files.command.d.ts +1 -0
  34. package/dist/commands/agent/screenshot-image-files.command.d.ts.map +1 -1
  35. package/dist/commands/agent/screenshot-image-files.command.js +18 -5
  36. package/dist/commands/agent/screenshot-image-files.command.js.map +1 -1
  37. package/dist/commands/agent/screenshot-image.command.d.ts +1 -0
  38. package/dist/commands/agent/screenshot-image.command.d.ts.map +1 -1
  39. package/dist/commands/agent/screenshot-image.command.js +9 -4
  40. package/dist/commands/agent/screenshot-image.command.js.map +1 -1
  41. package/dist/commands/agent/test-run-diffs.command.d.ts +1 -0
  42. package/dist/commands/agent/test-run-diffs.command.d.ts.map +1 -1
  43. package/dist/commands/agent/test-run-diffs.command.js +40 -24
  44. package/dist/commands/agent/test-run-diffs.command.js.map +1 -1
  45. package/dist/commands/agent/test-run-diffs.utils.d.ts +7 -0
  46. package/dist/commands/agent/test-run-diffs.utils.d.ts.map +1 -1
  47. package/dist/commands/agent/test-run-diffs.utils.js +48 -3
  48. package/dist/commands/agent/test-run-diffs.utils.js.map +1 -1
  49. package/dist/commands/agent/test-run-diffs.utils.spec.js +145 -2
  50. package/dist/commands/agent/test-run-diffs.utils.spec.js.map +1 -1
  51. package/dist/commands/agent/test-run-for-commit.command.d.ts.map +1 -1
  52. package/dist/commands/agent/test-run-for-commit.command.js +12 -14
  53. package/dist/commands/agent/test-run-for-commit.command.js.map +1 -1
  54. package/dist/commands/agent/timeline.command.d.ts +1 -0
  55. package/dist/commands/agent/timeline.command.d.ts.map +1 -1
  56. package/dist/commands/agent/timeline.command.js +21 -7
  57. package/dist/commands/agent/timeline.command.js.map +1 -1
  58. package/dist/commands/agent/timeline.command.spec.d.ts +2 -0
  59. package/dist/commands/agent/timeline.command.spec.d.ts.map +1 -0
  60. package/dist/commands/agent/timeline.command.spec.js +77 -0
  61. package/dist/commands/agent/timeline.command.spec.js.map +1 -0
  62. package/dist/commands/agent/trigger-test-run.command.d.ts.map +1 -1
  63. package/dist/commands/agent/trigger-test-run.command.js +7 -11
  64. package/dist/commands/agent/trigger-test-run.command.js.map +1 -1
  65. package/dist/commands/agent/upload-build.command.d.ts.map +1 -1
  66. package/dist/commands/agent/upload-build.command.js +10 -10
  67. package/dist/commands/agent/upload-build.command.js.map +1 -1
  68. package/dist/commands/all-commands.d.ts +38 -0
  69. package/dist/commands/all-commands.d.ts.map +1 -0
  70. package/dist/commands/all-commands.js +65 -0
  71. package/dist/commands/all-commands.js.map +1 -0
  72. package/dist/commands/auth/__tests__/list-projects.command.spec.js +22 -12
  73. package/dist/commands/auth/__tests__/list-projects.command.spec.js.map +1 -1
  74. package/dist/commands/auth/__tests__/login.command.spec.js +9 -7
  75. package/dist/commands/auth/__tests__/login.command.spec.js.map +1 -1
  76. package/dist/commands/auth/__tests__/logout.command.spec.js +4 -8
  77. package/dist/commands/auth/__tests__/logout.command.spec.js.map +1 -1
  78. package/dist/commands/auth/__tests__/whoami.command.spec.js +62 -21
  79. package/dist/commands/auth/__tests__/whoami.command.spec.js.map +1 -1
  80. package/dist/commands/auth/list-projects.command.d.ts.map +1 -1
  81. package/dist/commands/auth/list-projects.command.js +15 -13
  82. package/dist/commands/auth/list-projects.command.js.map +1 -1
  83. package/dist/commands/auth/login.command.d.ts.map +1 -1
  84. package/dist/commands/auth/login.command.js +4 -5
  85. package/dist/commands/auth/login.command.js.map +1 -1
  86. package/dist/commands/auth/logout.command.d.ts +1 -5
  87. package/dist/commands/auth/logout.command.d.ts.map +1 -1
  88. package/dist/commands/auth/logout.command.js +4 -9
  89. package/dist/commands/auth/logout.command.js.map +1 -1
  90. package/dist/commands/auth/set-project.command.d.ts.map +1 -1
  91. package/dist/commands/auth/set-project.command.js +3 -4
  92. package/dist/commands/auth/set-project.command.js.map +1 -1
  93. package/dist/commands/auth/unset-project.command.js +5 -5
  94. package/dist/commands/auth/unset-project.command.js.map +1 -1
  95. package/dist/commands/auth/whoami.command.d.ts +5 -1
  96. package/dist/commands/auth/whoami.command.d.ts.map +1 -1
  97. package/dist/commands/auth/whoami.command.js +71 -31
  98. package/dist/commands/auth/whoami.command.js.map +1 -1
  99. package/dist/commands/ci/prepare.command.d.ts.map +1 -1
  100. package/dist/commands/ci/prepare.command.js +3 -2
  101. package/dist/commands/ci/prepare.command.js.map +1 -1
  102. package/dist/commands/ci/run-local.command.d.ts.map +1 -1
  103. package/dist/commands/ci/run-local.command.js +6 -4
  104. package/dist/commands/ci/run-local.command.js.map +1 -1
  105. package/dist/commands/ci/run.command.d.ts.map +1 -1
  106. package/dist/commands/ci/run.command.js +3 -2
  107. package/dist/commands/ci/run.command.js.map +1 -1
  108. package/dist/commands/ci/start-tunnel.command.d.ts.map +1 -1
  109. package/dist/commands/ci/start-tunnel.command.js +4 -2
  110. package/dist/commands/ci/start-tunnel.command.js.map +1 -1
  111. package/dist/commands/ci/upload-assets.command.d.ts +1 -0
  112. package/dist/commands/ci/upload-assets.command.d.ts.map +1 -1
  113. package/dist/commands/ci/upload-assets.command.js +3 -2
  114. package/dist/commands/ci/upload-assets.command.js.map +1 -1
  115. package/dist/commands/ci/upload-container.command.d.ts +1 -0
  116. package/dist/commands/ci/upload-container.command.d.ts.map +1 -1
  117. package/dist/commands/ci/upload-container.command.js +3 -2
  118. package/dist/commands/ci/upload-container.command.js.map +1 -1
  119. package/dist/commands/debug/index.d.ts.map +1 -1
  120. package/dist/commands/debug/index.js +39 -35
  121. package/dist/commands/debug/index.js.map +1 -1
  122. package/dist/commands/replay.command.d.ts.map +1 -1
  123. package/dist/commands/replay.command.js +3 -2
  124. package/dist/commands/replay.command.js.map +1 -1
  125. package/dist/commands/schema.command.d.ts +53 -0
  126. package/dist/commands/schema.command.d.ts.map +1 -1
  127. package/dist/commands/schema.command.js +232 -106
  128. package/dist/commands/schema.command.js.map +1 -1
  129. package/dist/commands/schema.command.spec.d.ts +2 -0
  130. package/dist/commands/schema.command.spec.d.ts.map +1 -0
  131. package/dist/commands/schema.command.spec.js +198 -0
  132. package/dist/commands/schema.command.spec.js.map +1 -0
  133. package/dist/main.d.ts.map +1 -1
  134. package/dist/main.js +60 -48
  135. package/dist/main.js.map +1 -1
  136. package/dist/utils/__tests__/select-project.spec.js +6 -12
  137. package/dist/utils/__tests__/select-project.spec.js.map +1 -1
  138. package/dist/utils/select-project.d.ts +1 -3
  139. package/dist/utils/select-project.d.ts.map +1 -1
  140. package/dist/utils/select-project.js +6 -5
  141. package/dist/utils/select-project.js.map +1 -1
  142. package/package.json +10 -10
@@ -7,6 +7,11 @@ export declare const OPTIONS: {
7
7
  readonly commitSha: {
8
8
  readonly string: true;
9
9
  };
10
+ readonly dryRun: {
11
+ readonly boolean: true;
12
+ readonly default: false;
13
+ readonly description: "Print what the command would do without making any changes";
14
+ };
10
15
  readonly headless: {
11
16
  readonly boolean: true;
12
17
  readonly description: "Start browser in headless mode";
@@ -1 +1 @@
1
- {"version":3,"file":"common-options.d.ts","sourceRoot":"","sources":["../../src/command-utils/common-options.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AAGjE,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIV,CAAC;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;CAInC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBjC,CAAC"}
1
+ {"version":3,"file":"common-options.d.ts","sourceRoot":"","sources":["../../src/command-utils/common-options.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AAGjE,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIV,CAAC;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;CAInC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBjC,CAAC"}
@@ -1,5 +1,5 @@
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]="4ecb7539-d537-5191-924b-b276cb7eabb3")}catch(e){}}();
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]="bbd4b813-4f7b-5335-8b4e-e4eae64bcd67")}catch(e){}}();
3
3
 
4
4
  // We keep all options that are used by multiple commands in one file.
5
5
  // This ensures the defaults and descriptions stay in sync. Where we do want
@@ -24,6 +24,11 @@ exports.OPTIONS = {
24
24
  commitSha: {
25
25
  string: true,
26
26
  },
27
+ dryRun: {
28
+ boolean: true,
29
+ default: false,
30
+ description: "Print what the command would do without making any changes",
31
+ },
27
32
  headless: {
28
33
  // 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
29
34
  boolean: true,
@@ -188,4 +193,4 @@ exports.COMMON_RECORD_OPTIONS = {
188
193
  },
189
194
  };
190
195
  //# sourceMappingURL=common-options.js.map
191
- //# debugId=4ecb7539-d537-5191-924b-b276cb7eabb3
196
+ //# debugId=bbd4b813-4f7b-5335-8b4e-e4eae64bcd67
@@ -1 +1 @@
1
- {"version":3,"file":"common-options.js","sources":["../../src/command-utils/common-options.ts"],"sourceRoot":"","names":[],"mappings":";;;AAAA,sEAAsE;AACtE,4EAA4E;AAC5E,2DAA2D;AAC3D,EAAE;AACF,eAAe;AACf,wCAAwC;AACxC,oBAAoB;AACpB,MAAM;AACN,EAAE;AACF,uDAAuD;;;AAEvD,qDAIkC;AAErB,QAAA,0BAA0B,GAAG,sBAAsB,CAAC;AAEjE,iCAAiC;AACpB,QAAA,aAAa,GAAG,YAAY,CAAC;AAE7B,QAAA,OAAO,GAAG;IACrB,QAAQ,EAAE;QACR,MAAM,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACT,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE;QACR,gJAAgJ;QAChJ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,KAAK;KACf;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,kCAAyB,CAAC,QAAQ;KAC5C;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,WAAW,EACT,mGAAmG;QACrG,OAAO,EAAE,kCAAyB,CAAC,SAAS;KAC7C;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,8DAA8D;QAC3E,OAAO,EAAE,kCAAyB,CAAC,SAAS;KAC7C;IACD,eAAe,EAAE;QACf,OAAO,EAAE,I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CAAC,SAAS;IAC5B,aAAa,EAAE,eAAO,CAAC,aAAa;IACpC,aAAa,EAAE,eAAO,CAAC,aAAa;IACpC,qBAAqB,EAAE,eAAO,CAAC,qBAAqB;IACpD,yBAAyB,EAAE,eAAO,CAAC,yBAAyB;IAC5D,8BAA8B,EAAE,eAAO,CAAC,8BAA8B;IACtE,iBAAiB,EAAE,eAAO,CAAC,iBAAiB;IAC5C,2BAA2B,EAAE,eAAO,CAAC,2BAA2B;CACjE,CAAC;AAEF;;GAEG;AACU,QAAA,qBAAqB,GAAG;IACnC,QAAQ,EAAE,eAAO,CAAC,QAAQ;IAC1B,QAAQ,EAAE,eAAO,CAAC,QAAQ;IAC1B,SAAS,EAAE,eAAO,CAAC,SAAS;IAC5B,KAAK,EAAE,eAAO,CAAC,KAAK;IACpB,MAAM,EAAE,eAAO,CAAC,MAAM;IACtB,gBAAgB,EAAE,eAAO,CAAC,gBAAgB;IAC1C,KAAK,EAAE,eAAO,CAAC,KAAK;IACpB,sBAAsB,EAAE,eAAO,CAAC,sBAAsB;IACtD,MAAM,EAAE;QACN,WAAW,EACT,mIAAmI;QACrI,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,CAAC,iCAAwB;KACzB;IACV,cAAc,EAAE;QACd,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,0CAA0C;KAC/C;CACX,CAAC","debugId":"4ecb7539-d537-5191-924b-b276cb7eabb3"}
1
+ {"version":3,"file":"common-options.js","sources":["../../src/command-utils/common-options.ts"],"sourceRoot":"","names":[],"mappings":";;;AAAA,sEAAsE;AACtE,4EAA4E;AAC5E,2DAA2D;AAC3D,EAAE;AACF,eAAe;AACf,wCAAwC;AACxC,oBAAoB;AACpB,MAAM;AACN,EAAE;AACF,uDAAuD;;;AAEvD,qDAIkC;AAErB,QAAA,0BAA0B,GAAG,sBAAsB,CAAC;AAEjE,iCAAiC;AACpB,QAAA,aAAa,GAAG,YAAY,CAAC;AAE7B,QAAA,OAAO,GAAG;IACrB,QA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;IAC1C,KAAK,EAAE,eAAO,CAAC,KAAK;IACpB,sBAAsB,EAAE,eAAO,CAAC,sBAAsB;IACtD,MAAM,EAAE;QACN,WAAW,EACT,mIAAmI;QACrI,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,CAAC,iCAAwB;KACzB;IACV,cAAc,EAAE;QACd,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,0CAA0C;KAC/C;CACX,CAAC","debugId":"bbd4b813-4f7b-5335-8b4e-e4eae64bcd67"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Parse the `--jsonArgs` / `--rawJson` value: a JSON object whose keys are
3
+ * merged onto the parsed argv (the agent/programmatic way to pass options).
4
+ * Throws a `CliUserError` — rather than letting a raw `SyntaxError` escape as an
5
+ * uncaught stack trace — so malformed input surfaces as a clean message.
6
+ *
7
+ * Every key is validated against `knownKeys` (every option/alias the CLI
8
+ * declares). This is what would otherwise be yargs' `.strict()` check — the
9
+ * merge onto argv bypasses it — and, since the merge is a plain
10
+ * `Object.assign`, rejecting unknown keys also closes off prototype-polluting
11
+ * ones (`__proto__`, `constructor`, …), which are never option names.
12
+ */
13
+ export declare const parseJsonArgs: (jsonArgs: string, knownKeys: Set<string>) => Record<string, unknown>;
14
+ //# sourceMappingURL=json-args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-args.d.ts","sourceRoot":"","sources":["../../src/command-utils/json-args.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,aACd,MAAM,aACL,GAAG,CAAC,MAAM,CAAC,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAmBxB,CAAC"}
@@ -0,0 +1,40 @@
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]="3c85a656-a6bd-5bdc-bc2b-fffe9208a683")}catch(e){}}();
3
+
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.parseJsonArgs = void 0;
6
+ const cli_user_error_1 = require("../utils/cli-user-error");
7
+ /**
8
+ * Parse the `--jsonArgs` / `--rawJson` value: a JSON object whose keys are
9
+ * merged onto the parsed argv (the agent/programmatic way to pass options).
10
+ * Throws a `CliUserError` — rather than letting a raw `SyntaxError` escape as an
11
+ * uncaught stack trace — so malformed input surfaces as a clean message.
12
+ *
13
+ * Every key is validated against `knownKeys` (every option/alias the CLI
14
+ * declares). This is what would otherwise be yargs' `.strict()` check — the
15
+ * merge onto argv bypasses it — and, since the merge is a plain
16
+ * `Object.assign`, rejecting unknown keys also closes off prototype-polluting
17
+ * ones (`__proto__`, `constructor`, …), which are never option names.
18
+ */
19
+ const parseJsonArgs = (jsonArgs, knownKeys) => {
20
+ let parsed;
21
+ try {
22
+ parsed = JSON.parse(jsonArgs);
23
+ }
24
+ catch (error) {
25
+ const detail = error instanceof Error ? error.message : String(error);
26
+ throw new cli_user_error_1.CliUserError(`--jsonArgs must be a valid JSON string: ${detail}`);
27
+ }
28
+ if (typeof parsed !== "object" || parsed == null || Array.isArray(parsed)) {
29
+ throw new cli_user_error_1.CliUserError('--jsonArgs must be a JSON object, e.g. \'{"apiToken":"..."}\'.');
30
+ }
31
+ for (const key of Object.keys(parsed)) {
32
+ if (!knownKeys.has(key)) {
33
+ throw new cli_user_error_1.CliUserError(`--jsonArgs contains an unknown option "${key}".`);
34
+ }
35
+ }
36
+ return parsed;
37
+ };
38
+ exports.parseJsonArgs = parseJsonArgs;
39
+ //# sourceMappingURL=json-args.js.map
40
+ //# debugId=3c85a656-a6bd-5bdc-bc2b-fffe9208a683
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-args.js","sources":["../../src/command-utils/json-args.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,4DAAuD;AAEvD;;;;;;;;;;;GAWG;AACI,MAAM,aAAa,GAAG,CAC3B,QAAgB,EAChB,SAAsB,EACG,EAAE;IAC3B,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,IAAI,6BAAY,CAAC,2CAA2C,MAAM,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1E,MAAM,IAAI,6BAAY,CACpB,gEAAgE,CACjE,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,6BAAY,CAAC,0CAA0C,GAAG,IAAI,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,MAAiC,CAAC;AAC3C,CAAC,CAAC;AAtBW,QAAA,aAAa,iBAsBxB","debugId":"3c85a656-a6bd-5bdc-bc2b-fffe9208a683"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=json-args.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-args.spec.d.ts","sourceRoot":"","sources":["../../src/command-utils/json-args.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
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]="cdd72ac3-a982-5786-891a-a02e09335d22")}catch(e){}}();
3
+
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const vitest_1 = require("vitest");
6
+ const json_args_1 = require("./json-args");
7
+ const cli_user_error_1 = require("../utils/cli-user-error");
8
+ const KNOWN = new Set(["apiToken", "json"]);
9
+ (0, vitest_1.describe)("parseJsonArgs", () => {
10
+ (0, vitest_1.it)("parses a JSON object of known keys into a record", () => {
11
+ (0, vitest_1.expect)((0, json_args_1.parseJsonArgs)('{"apiToken":"abc","json":true}', KNOWN)).toEqual({
12
+ apiToken: "abc",
13
+ json: true,
14
+ });
15
+ });
16
+ (0, vitest_1.it)("throws a CliUserError (not a raw SyntaxError) for malformed JSON", () => {
17
+ (0, vitest_1.expect)(() => (0, json_args_1.parseJsonArgs)("{bad}", KNOWN)).toThrow(cli_user_error_1.CliUserError);
18
+ (0, vitest_1.expect)(() => (0, json_args_1.parseJsonArgs)("{bad}", KNOWN)).toThrow(/valid JSON string/);
19
+ });
20
+ (0, vitest_1.it)("rejects non-object JSON (array, primitive)", () => {
21
+ (0, vitest_1.expect)(() => (0, json_args_1.parseJsonArgs)("[1,2,3]", KNOWN)).toThrow(cli_user_error_1.CliUserError);
22
+ (0, vitest_1.expect)(() => (0, json_args_1.parseJsonArgs)('"a string"', KNOWN)).toThrow(/JSON object/);
23
+ (0, vitest_1.expect)(() => (0, json_args_1.parseJsonArgs)("null", KNOWN)).toThrow(/JSON object/);
24
+ });
25
+ (0, vitest_1.it)("rejects any key that is not a known option", () => {
26
+ (0, vitest_1.expect)(() => (0, json_args_1.parseJsonArgs)('{"notAnOption":1}', KNOWN)).toThrow(/unknown option "notAnOption"/);
27
+ });
28
+ (0, vitest_1.it)("rejects prototype-polluting keys (they are never known options)", () => {
29
+ (0, vitest_1.expect)(() => (0, json_args_1.parseJsonArgs)('{"__proto__":{"polluted":true}}', KNOWN)).toThrow(/unknown option "__proto__"/);
30
+ (0, vitest_1.expect)(() => (0, json_args_1.parseJsonArgs)('{"constructor":{}}', KNOWN)).toThrow(/unknown option "constructor"/);
31
+ // A valid object of known keys must still parse and keep a clean prototype.
32
+ const parsed = (0, json_args_1.parseJsonArgs)('{"apiToken":"abc"}', KNOWN);
33
+ (0, vitest_1.expect)(Object.getPrototypeOf(parsed)).toBe(Object.prototype);
34
+ });
35
+ });
36
+ //# sourceMappingURL=json-args.spec.js.map
37
+ //# debugId=cdd72ac3-a982-5786-891a-a02e09335d22
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-args.spec.js","sources":["../../src/command-utils/json-args.spec.ts"],"sourceRoot":"","names":[],"mappings":";;;;AAAA,mCAA8C;AAC9C,2CAA4C;AAC5C,4DAAuD;AAEvD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5C,IAAA,iBAAQ,EAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAA,WAAE,EAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,IAAA,eAAM,EAAC,IAAA,yBAAa,EAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;YACrE,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,kEAAkE,EAAE,GAAG,EAAE;QAC1E,IAAA,eAAM,EAAC,GAAG,EAAE,CAAC,IAAA,yBAAa,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,6BAAY,CAAC,CAAC;QAClE,IAAA,eAAM,EAAC,GAAG,EAAE,CAAC,IAAA,yBAAa,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,IA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 @@
1
+ /**
2
+ * Prints a value as pretty-printed JSON on stdout — the single formatting
3
+ * decision (2-space indent, trailing newline) shared by every command's
4
+ * `--json` output, so machine-readable output stays consistent.
5
+ */
6
+ export declare const printJson: (value: unknown) => void;
7
+ //# sourceMappingURL=print-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print-json.d.ts","sourceRoot":"","sources":["../../src/command-utils/print-json.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAW,OAAO,KAAG,IAE1C,CAAC"}
@@ -0,0 +1,16 @@
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]="ce55db0d-3eb9-5c20-9ce0-365273d93dae")}catch(e){}}();
3
+
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.printJson = void 0;
6
+ /**
7
+ * Prints a value as pretty-printed JSON on stdout — the single formatting
8
+ * decision (2-space indent, trailing newline) shared by every command's
9
+ * `--json` output, so machine-readable output stays consistent.
10
+ */
11
+ const printJson = (value) => {
12
+ console.log(JSON.stringify(value, null, 2));
13
+ };
14
+ exports.printJson = printJson;
15
+ //# sourceMappingURL=print-json.js.map
16
+ //# debugId=ce55db0d-3eb9-5c20-9ce0-365273d93dae
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print-json.js","sources":["../../src/command-utils/print-json.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA;;;;GAIG;AACI,MAAM,SAAS,GAAG,CAAC,KAAc,EAAQ,EAAE;IAChD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB","debugId":"ce55db0d-3eb9-5c20-9ce0-365273d93dae"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAY3C,eAAO,MAAM,YAAY,EAAE,aA0B1B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAY3C,eAAO,MAAM,YAAY,EAAE,aAmC1B,CAAC"}
@@ -1,5 +1,5 @@
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]="62add581-6176-55db-91f7-9c921c7f11e2")}catch(e){}}();
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]="aef0683f-1816-539c-ae2a-39b450a18844")}catch(e){}}();
3
3
 
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.agentCommand = void 0;
@@ -15,7 +15,7 @@ const trigger_test_run_command_1 = require("./trigger-test-run.command");
15
15
  const upload_build_command_1 = require("./upload-build.command");
16
16
  exports.agentCommand = {
17
17
  command: "agent",
18
- describe: "Agent commands for triggering and analysing test runs",
18
+ describe: "Agent commands for retrieving data from and interacting with Meticulous",
19
19
  builder: (yargs) => yargs
20
20
  .command(upload_build_command_1.uploadBuildCommand)
21
21
  .command(trigger_test_run_command_1.triggerTestRunCommand)
@@ -30,7 +30,14 @@ exports.agentCommand = {
30
30
  .option("verbose", {
31
31
  boolean: true,
32
32
  default: false,
33
- description: "Print progress logs. Defaults to false for agent commands — without it only essential output (e.g. the deploymentId) is printed.",
33
+ description: "Print additional logs like progress updates. Without it, only the actual output value or table is printed.",
34
+ })
35
+ .option("json", {
36
+ boolean: true,
37
+ default: false,
38
+ description: "Output the result as JSON. Only stdout is affected — progress and " +
39
+ "notices still go to stderr — and stdout is always valid JSON, " +
40
+ "including an empty array/object when there is no result.",
34
41
  })
35
42
  .demandCommand()
36
43
  .help(),
@@ -39,4 +46,4 @@ exports.agentCommand = {
39
46
  },
40
47
  };
41
48
  //# sourceMappingURL=index.js.map
42
- //# debugId=62add581-6176-55db-91f7-9c921c7f11e2
49
+ //# debugId=aef0683f-1816-539c-ae2a-39b450a18844
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/commands/agent/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,yEAAmE;AACnE,+DAA0D;AAC1D,+EAA+D;AAC/D,qFAAqE;AACrE,yEAA8D;AAC9D,qEAA+D;AAC/D,+EAAwE;AACxE,yDAAyD;AACzD,yEAAmE;AACnE,iEAA4D;AAE/C,QAAA,YAAY,GAAkB;IACzC,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,uDAAuD;IACjE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,OAAO,CAAC,yCAAkB,CAAC;SAC3B,OAAO,CAAC,gDAAqB,CAAC;SAC9B,OAAO,CAAC,4CAAmB,CAAC;SAC5B,OAAO,CAAC,4CAAc,CAAC;SACvB,OAAO,CAAC,qDAAuB,CAAC;SAChC,OAAO,CAAC,uCAAiB,CAAC;SAC1B,OAAO,CAAC,gDAAqB,CAAC;SAC9B,OAAO,CAAC,kDAAiB,CAAC;SAC1B,OAAO,CAAC,2CAAgB,CAAC;SACzB,OAAO,CAAC,sCAAmB,CAAC;SAC5B,MAAM,CAAC,SAAS,EAAE;QACjB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,KAAK;QACd,WAAW,EACT,kIAAkI;KACrI,CAAC;SACD,aAAa,EAAE;SACf,IAAI,EAAE;IACX,OAAO,EAAE,GAAG,EAAE;QACZ,0BAA0B;IAC5B,CAAC;CACF,CAAC","debugId":"62add581-6176-55db-91f7-9c921c7f11e2"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/commands/agent/index.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AACA,yEAAmE;AACnE,+DAA0D;AAC1D,+EAA+D;AAC/D,qFAAqE;AACrE,yEAA8D;AAC9D,qEAA+D;AAC/D,+EAAwE;AACxE,yDAAyD;AACzD,yEAAmE;AACnE,iEAA4D;AAE/C,QAAA,YAAY,GAAkB;IACzC,OAAO,EAAE,OAAO;IAChB,QAAQ,EACN,yEAAyE;IAC3E,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,OAAO,CAAC,yCAAkB,CAAC;SAC3B,OAAO,CAAC,gDAAqB,CAAC;SAC9B,OAAO,CAAC,4CAAmB,CAAC;SAC5B,OAAO,CAAC,4CAAc,CAAC;SACvB,OAAO,CAAC,qDAAuB,CAAC;SAChC,OAAO,CAAC,uCAAiB,CAAC;SAC1B,OAAO,CAAC,gDAAqB,CAAC;SAC9B,OAAO,CAAC,kDAAiB,CAAC;SAC1B,OAAO,CAAC,2CAAgB,CAAC;SACzB,OAAO,CAAC,sCAAmB,CAAC;SAC5B,MAAM,CAAC,SAAS,EAAE;QACjB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,KAAK;QACd,WAAW,EACT,4GAA4G;KAC/G,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,KAAK;QACd,WAAW,EACT,oEAAoE;YACpE,gEAAgE;YAChE,0DAA0D;KAC7D,CAAC;SACD,aAAa,EAAE;SACf,IAAI,EAAE;IACX,OAAO,EAAE,GAAG,EAAE;QACZ,0BAA0B;IAC5B,CAAC;CACF,CAAC","debugId":"aef0683f-1816-539c-ae2a-39b450a18844"}
@@ -1 +1 @@
1
- {"version":3,"file":"js-coverage-diff.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/js-coverage-diff.command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,UAAU,OAAO;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;CACf;AA+DD,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,CAkCjE,CAAC"}
1
+ {"version":3,"file":"js-coverage-diff.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/js-coverage-diff.command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,UAAU,OAAO;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;CACf;AA6DD,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,CA6BjE,CAAC"}
@@ -1,13 +1,13 @@
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]="60e94b8d-4609-5c30-86c1-5132de3a03cc")}catch(e){}}();
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]="aaff74c8-4b9c-5cc4-9df3-c8c20b83b491")}catch(e){}}();
3
3
 
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.jsCoverageDiffCommand = void 0;
6
6
  const client_1 = require("@alwaysmeticulous/client");
7
7
  const common_1 = require("@alwaysmeticulous/common");
8
+ const print_json_1 = require("../../command-utils/print-json");
8
9
  const sentry_utils_1 = require("../../command-utils/sentry.utils");
9
10
  const format_coverage_ranges_1 = require("../../utils/format-coverage-ranges");
10
- const log = (...args) => process.stderr.write(args.join(" ") + "\n");
11
11
  const handler = async ({ apiToken, replayDiffId, screenshotName, includeAllFiles, globFilter, json, }) => {
12
12
  (0, common_1.initLogger)();
13
13
  const client = await (0, client_1.createClientWithOAuth)({
@@ -18,40 +18,38 @@ const handler = async ({ apiToken, replayDiffId, screenshotName, includeAllFiles
18
18
  includeAllFiles,
19
19
  globFilter,
20
20
  });
21
+ const added = result.diff.filter((d) => d.status === "added").length;
22
+ const removed = result.diff.filter((d) => d.status === "removed").length;
23
+ const modified = result.diff.filter((d) => d.status === "modified").length;
21
24
  if (json) {
22
- console.log(JSON.stringify(result, null, 2));
23
- return;
25
+ (0, print_json_1.printJson)(result.diff.map((d) => ({
26
+ repoFilePath: d.filePath,
27
+ status: d.status,
28
+ baseRanges: d.baseRanges,
29
+ headRanges: d.headRanges,
30
+ })));
24
31
  }
25
- const header = ["repoFilePath", "status", "baseRanges", "headRanges"];
26
- console.log(header.join("\t"));
27
- let added = 0;
28
- let removed = 0;
29
- let modified = 0;
30
- for (const d of result.diff) {
31
- if (d.status === "added") {
32
- added++;
32
+ else {
33
+ const header = ["repoFilePath", "status", "baseRanges", "headRanges"];
34
+ console.log(header.join("\t"));
35
+ for (const d of result.diff) {
36
+ const fields = [
37
+ d.filePath,
38
+ d.status,
39
+ (0, format_coverage_ranges_1.formatCoverageRanges)(d.baseRanges),
40
+ (0, format_coverage_ranges_1.formatCoverageRanges)(d.headRanges),
41
+ ];
42
+ console.log(fields.join("\t"));
33
43
  }
34
- else if (d.status === "removed") {
35
- removed++;
36
- }
37
- else if (d.status === "modified") {
38
- modified++;
39
- }
40
- const fields = [
41
- d.filePath,
42
- d.status,
43
- (0, format_coverage_ranges_1.formatCoverageRanges)(d.baseRanges),
44
- (0, format_coverage_ranges_1.formatCoverageRanges)(d.headRanges),
45
- ];
46
- console.log(fields.join("\t"));
47
44
  }
48
- log(`${result.diff.length} file(s) with coverage changes ` +
45
+ // Summary on stderr regardless of --json (which only changes stdout).
46
+ (0, common_1.logNotice)(`${result.diff.length} file(s) with coverage changes ` +
49
47
  `(${added} added, ${removed} removed, ${modified} modified); ` +
50
48
  `base ${result.base?.length ?? 0} file(s), head ${result.head?.length ?? 0} file(s)`);
51
49
  };
52
50
  exports.jsCoverageDiffCommand = {
53
51
  command: "js-coverage-diff",
54
- describe: "Get the JS coverage diff (base vs head) for a replay diff, for a single screenshot or the whole replay",
52
+ describe: "Get the JS coverage diff for a replay diff. Outputs TSV, one row per changed file: repoFilePath, status, baseRanges, headRanges (or JSON with --json).",
55
53
  builder: {
56
54
  apiToken: { string: true, description: "Meticulous API token" },
57
55
  replayDiffId: {
@@ -72,13 +70,8 @@ exports.jsCoverageDiffCommand = {
72
70
  string: true,
73
71
  description: 'Keep only repo file paths matching this gitignore-style glob, e.g. "src/components/**". Scopes base, head, and the diff.',
74
72
  },
75
- json: {
76
- boolean: true,
77
- description: "Output the raw coverage response as JSON",
78
- default: false,
79
- },
80
73
  },
81
74
  handler: (0, sentry_utils_1.wrapHandler)(handler),
82
75
  };
83
76
  //# sourceMappingURL=js-coverage-diff.command.js.map
84
- //# debugId=60e94b8d-4609-5c30-86c1-5132de3a03cc
77
+ //# debugId=aaff74c8-4b9c-5cc4-9df3-c8c20b83b491
@@ -1 +1 @@
1
- {"version":3,"file":"js-coverage-diff.command.js","sources":["../../../src/commands/agent/js-coverage-diff.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAGkC;AAClC,qDAAsD;AAEtD,mEAA+D;AAC/D,+EAA0E;AAW1E,MAAM,GAAG,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AAEhF,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,eAAe,EACf,UAAU,EACV,IAAI,GACI,EAAiB,EAAE;IAC3B,IAAA,mBAAU,GAAE,CAAC;IACb,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAqB,EAAC;QACzC,QAAQ;QACR,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAuB,EAC1C,MAAM,EACN,YAAY,EACZ,cAAc,EACd;QACE,eAAe;QACf,UAAU;KACX,CACF,CAAC;IAEF,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE/B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,CAAC,MAA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,EAAE,IAAI;YACZ,WAAW,EACT,0HAA0H;SAC7H;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,0CAA0C;YACvD,OAAO,EAAE,KAAK;SACf;KACF;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC;CAC9B,CAAC","debugId":"60e94b8d-4609-5c30-86c1-5132de3a03cc"}
1
+ {"version":3,"file":"js-coverage-diff.command.js","sources":["../../../src/commands/agent/js-coverage-diff.command.ts"],"sourceRoot":"","names":[],"mappings":";;;;;AAAA,qDAGkC;AAClC,qDAAiE;AAEjE,+DAA2D;AAC3D,mEAA+D;AAC/D,+EAA0E;AAW1E,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,eAAe,EACf,UAAU,EACV,IAAI,GACI,EAAiB,EAAE;IAC3B,IAAA,mBAAU,GAAE,CAAC;IACb,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAqB,EAAC;QACzC,QAAQ;QACR,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAuB,EAC1C,MAAM,EACN,YAAY,EACZ,cAAc,EACd;QACE,eAAe;QACf,UAAU;KACX,CACF,CAAC;IAEF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,CAAC;IACrE,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC;IACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,MAA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Q,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE;QAC/D,YAAY,EAAE;YACZ,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,oBAAoB;YACjC,YAAY,EAAE,IAAI;SACnB;QACD,cAAc,EAAE;YACd,MAAM,EAAE,IAAI;YACZ,WAAW,EACT,wFAAwF;SAC3F;QACD,eAAe,EAAE;YACf,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;YACd,WAAW,EACT,sEAAsE;SACzE;QACD,UAAU,EAAE;YACV,MAAM,EAAE,IAAI;YACZ,WAAW,EACT,0HAA0H;SAC7H;KACF;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC;CAC9B,CAAC","debugId":"aaff74c8-4b9c-5cc4-9df3-c8c20b83b491"}
@@ -1,3 +1,4 @@
1
+ import type { CompactRange, TestRunCoverageFile } from "@alwaysmeticulous/client";
1
2
  import type { CommandModule } from "yargs";
2
3
  export interface Options {
3
4
  apiToken?: string | null | undefined;
@@ -18,6 +19,8 @@ export interface Options {
18
19
  type CoverageColumn = "executedRanges" | "executableRanges" | "uncoveredRanges" | "coveragePercentage";
19
20
  export declare const assertTestRunOnlyFlagsUnsetForReplay: (options: Options) => void;
20
21
  export declare const determineColumns: (options: Options) => CoverageColumn[];
22
+ export declare const coverageFileToJson: (file: TestRunCoverageFile, columns: CoverageColumn[]) => Record<string, unknown>;
23
+ export declare const coverageColumnValue: (file: TestRunCoverageFile, column: CoverageColumn) => CompactRange[] | number | null;
21
24
  export declare const isAmbiguousTestRunError: (error: unknown) => boolean;
22
25
  export declare const jsCoverageCommand: CommandModule<unknown, Options>;
23
26
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"js-coverage.command.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/js-coverage.command.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAY3C,MAAM,WAAW,OAAO;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,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,4BAA4B,EAAE,OAAO,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,uBAAuB,EAAE,OAAO,CAAC;IACjC,sBAAsB,EAAE,OAAO,CAAC;IAChC,yBAAyB,EAAE,OAAO,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf;AAMD,KAAK,cAAc,GACf,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,CAAC;AAsHzB,eAAO,MAAM,oCAAoC,YACtC,OAAO,KACf,IAgBF,CAAC;AAKF,eAAO,MAAM,gBAAgB,YAAa,OAAO,KAAG,cAAc,EAoBjE,CAAC;AAwKF,eAAO,MAAM,kBAAkB,SACvB,mBAAmB,WAChB,cAAc,EAAE,KACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAMxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,SACxB,mBAAmB,UACjB,cAAc,KACrB,YAAY,EAAE,GAAG,MAAM,GAAG,IAa5B,CAAC;AA2BF,eAAO,MAAM,uBAAuB,UAAW,OAAO,KAAG,OAGjC,CAAC;AAEzB,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,OAAO,EAAE,OAAO,CA2E7D,CAAC"}
@@ -1,10 +1,11 @@
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]="22f8ecf6-63eb-52da-8d14-cd9b32b8c54d")}catch(e){}}();
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]="7c46427f-0bd8-5b44-89b2-acad6e9443bb")}catch(e){}}();
3
3
 
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.jsCoverageCommand = exports.isAmbiguousTestRunError = exports.determineColumns = exports.assertTestRunOnlyFlagsUnsetForReplay = void 0;
5
+ exports.jsCoverageCommand = exports.isAmbiguousTestRunError = exports.coverageColumnValue = exports.coverageFileToJson = exports.determineColumns = exports.assertTestRunOnlyFlagsUnsetForReplay = void 0;
6
6
  const client_1 = require("@alwaysmeticulous/client");
7
7
  const common_1 = require("@alwaysmeticulous/common");
8
+ const print_json_1 = require("../../command-utils/print-json");
8
9
  const sentry_utils_1 = require("../../command-utils/sentry.utils");
9
10
  const cli_user_error_1 = require("../../utils/cli-user-error");
10
11
  const format_coverage_ranges_1 = require("../../utils/format-coverage-ranges");
@@ -17,7 +18,6 @@ const COVERAGE_COLUMN_FLAG = {
17
18
  uncoveredRanges: "includeUncoveredRanges",
18
19
  coveragePercentage: "includeCoveragePercentage",
19
20
  };
20
- const log = (...args) => process.stderr.write(args.join(" ") + "\n");
21
21
  const handler = async (options) => {
22
22
  const { apiToken, testRunId, commitSha, dontWaitForTestRunToComplete, replayId, screenshotName, globFilter, json, } = options;
23
23
  (0, common_1.initLogger)();
@@ -73,6 +73,15 @@ const handler = async (options) => {
73
73
  }
74
74
  const finishedStatus = await (0, resolve_test_run_from_commit_1.ensureTestRunFinished)(client, resolvedTestRunId, status, { dontWait: dontWaitForTestRunToComplete });
75
75
  if (finishedStatus == null) {
76
+ // Keep stdout's shape stable: an unfinished run has no coverage yet, so
77
+ // emit the empty JSON array / a header-only TSV (matching a finished run
78
+ // with zero files) rather than nothing — the notice went to stderr.
79
+ if (json) {
80
+ console.log("[]");
81
+ }
82
+ else {
83
+ console.log(["repoFilePath", ...columns].join("\t"));
84
+ }
76
85
  return;
77
86
  }
78
87
  // Reject session-pool bases (Partial); fatal failures already threw.
@@ -166,7 +175,7 @@ const printReplayCoverage = async (client, apiToken, { testRunId, commitSha, rep
166
175
  });
167
176
  // Only announce the fallback once it has actually worked, so a doomed
168
177
  // retry doesn't leave a misleading "retrying against run X" line.
169
- log(`Replay is the head of multiple test runs; resolved coverage against test run ${fallback.testRunId} from the local commit.`);
178
+ (0, common_1.logNotice)(`Replay is the head of multiple test runs; resolved coverage against test run ${fallback.testRunId} from the local commit.`);
170
179
  printReplayResult(result, json);
171
180
  return;
172
181
  }
@@ -182,18 +191,23 @@ const printReplayCoverage = async (client, apiToken, { testRunId, commitSha, rep
182
191
  }
183
192
  };
184
193
  const printReplayResult = (result, json) => {
185
- if (json) {
186
- console.log(JSON.stringify(result, null, 2));
187
- return;
188
- }
189
- console.log(["repoFilePath", "executedRanges"].join("\t"));
190
194
  // Replay coverage is keyed by repo path (source-map paths that don't resolve
191
195
  // are dropped), matching the test-run shape.
192
196
  const files = result.files ?? [];
193
- for (const [filePath, ranges] of files) {
194
- console.log([filePath, (0, format_coverage_ranges_1.formatCoverageRanges)(ranges)].join("\t"));
197
+ if (json) {
198
+ (0, print_json_1.printJson)(files.map(([repoFilePath, executedRanges]) => ({
199
+ repoFilePath,
200
+ executedRanges,
201
+ })));
202
+ }
203
+ else {
204
+ console.log(["repoFilePath", "executedRanges"].join("\t"));
205
+ for (const [filePath, ranges] of files) {
206
+ console.log([filePath, (0, format_coverage_ranges_1.formatCoverageRanges)(ranges)].join("\t"));
207
+ }
195
208
  }
196
- log(`${files.length} file(s) with coverage`);
209
+ // Summary on stderr regardless of --json (which only changes stdout).
210
+ (0, common_1.logNotice)(`${files.length} file(s) with coverage`);
197
211
  };
198
212
  const printTestRunCoverage = async (client, testRunId, options, columns, json) => {
199
213
  // Send the resolved columns as explicit flags (the default-to-executed rule
@@ -210,47 +224,76 @@ const printTestRunCoverage = async (client, testRunId, options, columns, json) =
210
224
  requestOptions.prDiffOnly = options.prDiffOnly;
211
225
  const result = await (0, client_1.getTestRunJsCoverage)(client, testRunId, requestOptions);
212
226
  if (json) {
213
- console.log(JSON.stringify(result, null, 2));
214
- return;
227
+ (0, print_json_1.printJson)(result.files.map((file) => (0, exports.coverageFileToJson)(file, columns)));
215
228
  }
216
- // Test-run coverage is the precomputed repo-mapped coverage, keyed by repo
217
- // paths. Emit `repoFilePath` then the requested columns in fixed order.
218
- console.log(["repoFilePath", ...columns].join("\t"));
219
- for (const file of result.files) {
220
- const fields = [
221
- file.repoFilePath,
222
- ...columns.map((column) => formatCoverageColumn(file, column)),
223
- ];
224
- console.log(fields.join("\t"));
229
+ else {
230
+ // Test-run coverage is the precomputed repo-mapped coverage, keyed by repo
231
+ // paths. Emit `repoFilePath` then the requested columns in fixed order.
232
+ console.log(["repoFilePath", ...columns].join("\t"));
233
+ for (const file of result.files) {
234
+ const fields = [
235
+ file.repoFilePath,
236
+ ...columns.map((column) => formatCoverageColumn(file, column)),
237
+ ];
238
+ console.log(fields.join("\t"));
239
+ }
225
240
  }
226
- log(`${result.files.length} file(s)`);
241
+ // Summary on stderr regardless of --json (which only changes stdout).
242
+ (0, common_1.logNotice)(`${result.files.length} file(s)`);
227
243
  };
228
- const formatCoverageColumn = (file, column) => {
244
+ // The JSON equivalent of a TSV row: `repoFilePath` plus the requested columns,
245
+ // with structured values (raw ranges / numeric percentage) rather than the
246
+ // TSV-formatted strings.
247
+ const coverageFileToJson = (file, columns) => {
248
+ const row = { repoFilePath: file.repoFilePath };
249
+ for (const column of columns) {
250
+ row[column] = (0, exports.coverageColumnValue)(file, column);
251
+ }
252
+ return row;
253
+ };
254
+ exports.coverageFileToJson = coverageFileToJson;
255
+ const coverageColumnValue = (file, column) => {
229
256
  switch (column) {
230
257
  case "executedRanges":
231
- return (0, format_coverage_ranges_1.formatCoverageRanges)(file.executedRanges ?? []);
258
+ return file.executedRanges ?? [];
232
259
  case "executableRanges":
233
- return (0, format_coverage_ranges_1.formatCoverageRanges)(file.executableRanges ?? []);
260
+ return file.executableRanges ?? [];
234
261
  case "uncoveredRanges":
235
- return (0, format_coverage_ranges_1.formatCoverageRanges)(file.uncoveredRanges ?? []);
262
+ return file.uncoveredRanges ?? [];
236
263
  case "coveragePercentage":
237
- return file.coveragePercentage == null
238
- ? "n/a"
239
- : file.coveragePercentage.toFixed(1);
240
- default: {
241
- // Exhaustiveness guard: a new CoverageColumn must be handled above.
242
- const exhaustive = column;
243
- throw new Error(`Unhandled coverage column: ${String(exhaustive)}`);
244
- }
264
+ return file.coveragePercentage ?? null;
265
+ default:
266
+ return assertNever(column);
245
267
  }
246
268
  };
269
+ exports.coverageColumnValue = coverageColumnValue;
270
+ // The TSV rendering of a column: the same structured value as the JSON output,
271
+ // formatted as a string (ranges joined, percentage to 1dp, absent percentage as
272
+ // "n/a"). Delegating to `coverageColumnValue` keeps a single switch over the
273
+ // column union.
274
+ const formatCoverageColumn = (file, column) => {
275
+ const value = (0, exports.coverageColumnValue)(file, column);
276
+ if (typeof value === "number") {
277
+ return value.toFixed(1);
278
+ }
279
+ if (value == null) {
280
+ return "n/a";
281
+ }
282
+ return (0, format_coverage_ranges_1.formatCoverageRanges)(value);
283
+ };
284
+ // Exhaustiveness guard for the CoverageColumn switch in `coverageColumnValue`.
285
+ // Local to this package since the public CLI can't depend on the internal
286
+ // common-utils helper.
287
+ const assertNever = (value) => {
288
+ throw new Error(`Unhandled coverage column: ${String(value)}`);
289
+ };
247
290
  const isAmbiguousTestRunError = (error) => (0, client_1.isFetchError)(error) &&
248
291
  error.response?.data?.reason ===
249
292
  "ambiguous-test-run";
250
293
  exports.isAmbiguousTestRunError = isAmbiguousTestRunError;
251
294
  exports.jsCoverageCommand = {
252
295
  command: "js-coverage",
253
- describe: "Get JS coverage for a single replay or a whole test run (use js-coverage-diff for base vs head)",
296
+ describe: "Get JS coverage for a whole test run or a single replay. Outputs TSV, one row per repo file: repoFilePath plus the requested coverage columns (or JSON with --json).",
254
297
  builder: {
255
298
  apiToken: { string: true, description: "Meticulous API token" },
256
299
  testRunId: {
@@ -308,13 +351,8 @@ exports.jsCoverageCommand = {
308
351
  default: false,
309
352
  description: "Return only coverage for files changed in the PR diff (from coverage.pr.json). Whole-test-run coverage only.",
310
353
  },
311
- json: {
312
- boolean: true,
313
- description: "Output the raw coverage response as JSON",
314
- default: false,
315
- },
316
354
  },
317
355
  handler: (0, sentry_utils_1.wrapHandler)(handler),
318
356
  };
319
357
  //# sourceMappingURL=js-coverage.command.js.map
320
- //# debugId=22f8ecf6-63eb-52da-8d14-cd9b32b8c54d
358
+ //# debugId=7c46427f-0bd8-5b44-89b2-acad6e9443bb