@alwaysmeticulous/cli 2.19.2 → 2.20.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 (33) hide show
  1. package/dist/api/replay.api.d.ts +1 -1
  2. package/dist/api/session.api.d.ts +2 -1
  3. package/dist/commands/replay/replay.command.d.ts +10 -3
  4. package/dist/commands/replay/replay.command.js +48 -22
  5. package/dist/commands/replay/utils/{compute-and-save-diff.d.ts → compute-diff.d.ts} +3 -2
  6. package/dist/commands/replay/utils/{compute-and-save-diff.js → compute-diff.js} +5 -21
  7. package/dist/commands/run-all-tests/run-all-tests.command.d.ts +5 -0
  8. package/dist/commands/run-all-tests/run-all-tests.command.js +7 -1
  9. package/dist/commands/screenshot-diff/screenshot-diff.command.d.ts +5 -2
  10. package/dist/commands/screenshot-diff/screenshot-diff.command.js +23 -18
  11. package/dist/config/config.types.d.ts +6 -1
  12. package/dist/deflake-tests/deflake-tests.handler.d.ts +1 -0
  13. package/dist/deflake-tests/deflake-tests.handler.js +2 -5
  14. package/dist/local-data/local-data.utils.d.ts +19 -0
  15. package/dist/local-data/local-data.utils.js +95 -1
  16. package/dist/local-data/replays.d.ts +2 -1
  17. package/dist/local-data/replays.js +30 -32
  18. package/dist/local-data/sessions.d.ts +2 -1
  19. package/dist/local-data/sessions.js +12 -27
  20. package/dist/main.js +1 -7
  21. package/dist/parallel-tests/__tests__/merge-test-results.spec.d.ts +1 -0
  22. package/dist/parallel-tests/__tests__/merge-test-results.spec.js +179 -0
  23. package/dist/parallel-tests/merge-test-results.d.ts +10 -0
  24. package/dist/parallel-tests/merge-test-results.js +98 -0
  25. package/dist/parallel-tests/parallel-tests.handler.d.ts +1 -0
  26. package/dist/parallel-tests/parallel-tests.handler.js +113 -24
  27. package/dist/parallel-tests/run-all-tests.d.ts +7 -1
  28. package/dist/parallel-tests/run-all-tests.js +35 -52
  29. package/dist/parallel-tests/run-all-tests.types.d.ts +1 -0
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/dist/utils/sentry.utils.d.ts +0 -1
  32. package/dist/utils/sentry.utils.js +19 -14
  33. package/package.json +26 -6
@@ -1,4 +1,3 @@
1
1
  export declare const initSentry: (meticulousVersion: string) => void;
2
2
  export declare const setOptions: (options: any) => void;
3
- export declare const reportHandlerError: (error: any) => Promise<void>;
4
3
  export declare const wrapHandler: <T>(handler: (args: T) => Promise<void>) => (args: T) => Promise<void>;
@@ -22,10 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.wrapHandler = exports.reportHandlerError = exports.setOptions = exports.initSentry = void 0;
29
+ exports.wrapHandler = exports.setOptions = exports.initSentry = void 0;
30
+ const common_1 = require("@alwaysmeticulous/common");
27
31
  const Sentry = __importStar(require("@sentry/node"));
28
32
  const tracing_1 = require("@sentry/tracing");
33
+ const loglevel_1 = __importDefault(require("loglevel"));
29
34
  const luxon_1 = require("luxon");
30
35
  const SENTRY_DSN = "https://10c6a6c9f5434786b37fb81b01323798@o914390.ingest.sentry.io/6435232";
31
36
  const SENTRY_FLUSH_TIMEOUT = luxon_1.Duration.fromObject({ seconds: 1 });
@@ -50,11 +55,6 @@ const setOptions = (options) => {
50
55
  Sentry.setContext("invoke-options", options);
51
56
  };
52
57
  exports.setOptions = setOptions;
53
- const reportHandlerError = async (error) => {
54
- Sentry.captureException(error);
55
- await Sentry.flush(SENTRY_FLUSH_TIMEOUT.toMillis());
56
- };
57
- exports.reportHandlerError = reportHandlerError;
58
58
  const wrapHandler = function wrapHandler_(handler) {
59
59
  return async (args) => {
60
60
  await handler(args)
@@ -63,24 +63,29 @@ const wrapHandler = function wrapHandler_(handler) {
63
63
  const transaction = (_a = Sentry.getCurrentHub().getScope()) === null || _a === void 0 ? void 0 : _a.getTransaction();
64
64
  if (transaction !== undefined) {
65
65
  transaction.setStatus("ok");
66
+ transaction.finish();
66
67
  }
67
68
  })
68
69
  .catch(async (error) => {
69
70
  var _a;
70
- await (0, exports.reportHandlerError)(error);
71
+ await reportHandlerError(error);
71
72
  const transaction = (_a = Sentry.getCurrentHub().getScope()) === null || _a === void 0 ? void 0 : _a.getTransaction();
72
73
  if (transaction !== undefined) {
73
74
  transaction.setStatus("unknown_error");
74
- }
75
- throw error;
76
- })
77
- .finally(() => {
78
- var _a;
79
- const transaction = (_a = Sentry.getCurrentHub().getScope()) === null || _a === void 0 ? void 0 : _a.getTransaction();
80
- if (transaction !== undefined) {
81
75
  transaction.finish();
82
76
  }
77
+ // Don't display the help text which can obscure the error
78
+ process.exit(1);
83
79
  });
84
80
  };
85
81
  };
86
82
  exports.wrapHandler = wrapHandler;
83
+ const reportHandlerError = async (error) => {
84
+ const logger = loglevel_1.default.getLogger(common_1.METICULOUS_LOGGER_NAME);
85
+ logger.info("");
86
+ logger.error(error instanceof Error ? error.message : error);
87
+ logger.info("");
88
+ logger.info("Tip: run `meticulous <command> --help` for help on a particular command, or `meticulous --help` for a list of the available commands.");
89
+ Sentry.captureException(error);
90
+ await Sentry.flush(SENTRY_FLUSH_TIMEOUT.toMillis());
91
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/cli",
3
- "version": "2.19.2",
3
+ "version": "2.20.0",
4
4
  "description": "The Meticulous CLI",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -21,10 +21,11 @@
21
21
  "lint:commit": "eslint --cache $(git diff --relative --name-only --diff-filter=ACMRTUXB master | grep -E \"(.js$|.ts$|.tsx$)\")",
22
22
  "lint:fix": "eslint src --ext=ts,tsx,js --cache --fix",
23
23
  "cli": "node dist/main.js",
24
- "cli:dev": "ts-node src/main.ts"
24
+ "cli:dev": "ts-node src/main.ts",
25
+ "test": "jest"
25
26
  },
26
27
  "dependencies": {
27
- "@alwaysmeticulous/common": "^2.19.1",
28
+ "@alwaysmeticulous/common": "^2.20.0",
28
29
  "@sentry/node": "^7.21.1",
29
30
  "@sentry/tracing": "^7.21.1",
30
31
  "adm-zip": "^0.5.9",
@@ -38,11 +39,13 @@
38
39
  "luxon": "^2.4.0",
39
40
  "pixelmatch": "^5.3.0",
40
41
  "pngjs": "^6.0.0",
42
+ "proper-lockfile": "^4.1.2",
41
43
  "yargs": "^17.5.1"
42
44
  },
43
45
  "devDependencies": {
44
- "@alwaysmeticulous/api": "^2.19.1",
45
- "@types/express": "^4.17.14"
46
+ "@alwaysmeticulous/api": "^2.20.0",
47
+ "@types/express": "^4.17.14",
48
+ "@types/proper-lockfile": "^4.1.2"
46
49
  },
47
50
  "peerDependencies": {
48
51
  "@alwaysmeticulous/record": "^2.3.3",
@@ -77,5 +80,22 @@
77
80
  "bugs": {
78
81
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
79
82
  },
80
- "gitHead": "e21ef2e0db964bc04d1cad74b6d57421d463d822"
83
+ "jest": {
84
+ "moduleFileExtensions": [
85
+ "js",
86
+ "json",
87
+ "ts"
88
+ ],
89
+ "rootDir": "src",
90
+ "testRegex": ".*\\.spec\\.ts$",
91
+ "transform": {
92
+ "^.+\\.(t|j)s$": "ts-jest"
93
+ },
94
+ "collectCoverageFrom": [
95
+ "**/*.(t|j)s"
96
+ ],
97
+ "coverageDirectory": "../coverage",
98
+ "testEnvironment": "node"
99
+ },
100
+ "gitHead": "f9494ff5044559a3febbf45fd0f9600a8f4f2e99"
81
101
  }