@serenity-js/core 3.0.0-rc.30 → 3.0.0-rc.32

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-rc.32](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.31...v3.0.0-rc.32) (2022-10-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **core:** invocation location detection works for built-in interactions ([2ef0688](https://github.com/serenity-js/serenity-js/commit/2ef0688ada99cd372a2b2f9508b5d6b8e18b37f1))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-rc.31](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.30...v3.0.0-rc.31) (2022-10-07)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **core:** corrected file system location reporting for built-in Interactions ([ce9acfc](https://github.com/serenity-js/serenity-js/commit/ce9acfc023442230a5060ff823d2198b92f72a30))
23
+ * **core:** improved invocation location detection on Windows ([#1332](https://github.com/serenity-js/serenity-js/issues/1332)) ([43dd9b9](https://github.com/serenity-js/serenity-js/commit/43dd9b95803b75cbcfce0eaa91ff272f33f7a60f))
24
+
25
+
26
+
27
+
28
+
6
29
  # [3.0.0-rc.30](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.29...v3.0.0-rc.30) (2022-10-05)
7
30
 
8
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"Activity.d.ts","sourceRoot":"","sources":["../../src/screenplay/Activity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAQ,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,8BAAsB,QAAQ;IAKtB,SAAS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 -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.Activity = void 0;
7
+ const path_1 = __importDefault(require("path"));
4
8
  const errors_1 = require("../errors");
5
9
  const io_1 = require("../io");
6
10
  /**
@@ -41,10 +45,12 @@ class Activity {
41
45
  throw new Error('Location');
42
46
  }
43
47
  catch (error) {
48
+ const nonSerenityNodeModulePattern = new RegExp(`node_modules` + `\\` + path_1.default.sep + `(?!@serenity-js` + `\\` + path_1.default.sep + `)`);
44
49
  const frames = this.errorStackParser.parse(error);
45
50
  const userLandFrames = frames.filter(frame => !((frame === null || frame === void 0 ? void 0 : frame.fileName.startsWith('node:')) || // node 16 and 18
46
51
  (frame === null || frame === void 0 ? void 0 : frame.fileName.startsWith('internal')) || // node 14
47
- (frame === null || frame === void 0 ? void 0 : frame.fileName.includes('node_modules'))));
52
+ nonSerenityNodeModulePattern.test(frame === null || frame === void 0 ? void 0 : frame.fileName) // ignore node_modules, except for @serenity-js/*
53
+ ));
48
54
  const index = Math.min(Math.max(1, frameOffset), userLandFrames.length - 1);
49
55
  // use the desired user-land frame, or the last one from the stack trace for internal invocations
50
56
  const invocationFrame = userLandFrames[index] || frames[frames.length - 1];
@@ -1 +1 @@
1
- {"version":3,"file":"Activity.js","sourceRoot":"","sources":["../../src/screenplay/Activity.ts"],"names":[],"mappings":";;;AAAA,sCAA6C;AAC7C,8BAAiD;AAGjD;;;;;;;;;;GAUG;AACH,MAAsB,QAAQ;IAI1B,YACuB,WAAmB,EACrB,WAA+B,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QADvD,gBAAW,GAAX,WAAW,CAAQ;QACrB,aAAQ,GAAR,QAAQ,CAAiD;IAE9E,CAAC;IAED;;OAEG;IACH,qBAAqB;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAe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IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAC5E,iGAAiG;YACjG,MAAM,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAE3E,OAAO,IAAI,uBAAkB,CACzB,SAAI,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EACnC,eAAe,CAAC,UAAU,EAC1B,eAAe,CAAC,YAAY,CAC/B,CAAC;SACL;IACL,CAAC;;AAjEL,4BAkEC;AAhEkB,yBAAgB,GAAG,IAAI,yBAAgB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/core",
3
- "version": "3.0.0-rc.30",
3
+ "version": "3.0.0-rc.32",
4
4
  "description": "Serenity/JS Screenplay, reporting engine and core interfaces.",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -38,7 +38,7 @@
38
38
  "filenamify": "^4.3.0",
39
39
  "graceful-fs": "^4.2.10",
40
40
  "moment": "^2.29.4",
41
- "semver": "^7.3.7",
41
+ "semver": "^7.3.8",
42
42
  "tiny-types": "^1.19.0",
43
43
  "upath": "^2.0.1",
44
44
  "validate-npm-package-name": "^4.0.0"
@@ -70,5 +70,5 @@
70
70
  "node": "^14 || ^16 || ^18",
71
71
  "npm": "^6 || ^7 || ^8"
72
72
  },
73
- "gitHead": "fa832ca71c7fb142db468a433a1c51a2bffe4667"
73
+ "gitHead": "3480ba44d83ff663a6a7c3e51ab1f977776cc9d0"
74
74
  }
@@ -1,3 +1,5 @@
1
+ import path from 'path';
2
+
1
3
  import { ErrorStackParser } from '../errors';
2
4
  import { FileSystemLocation, Path } from '../io';
3
5
  import { AnswersQuestions, PerformsActivities, UsesAbilities } from './actor';
@@ -59,11 +61,13 @@ export abstract class Activity {
59
61
  try {
60
62
  throw new Error('Location');
61
63
  } catch (error) {
64
+ const nonSerenityNodeModulePattern = new RegExp(`node_modules` + `\\` + path.sep + `(?!@serenity-js`+ `\\` + path.sep +`)`);
65
+
62
66
  const frames = this.errorStackParser.parse(error);
63
67
  const userLandFrames = frames.filter(frame => ! (
64
- frame?.fileName.startsWith('node:') || // node 16 and 18
65
- frame?.fileName.startsWith('internal') || // node 14
66
- frame?.fileName.includes('node_modules')
68
+ frame?.fileName.startsWith('node:') || // node 16 and 18
69
+ frame?.fileName.startsWith('internal') || // node 14
70
+ nonSerenityNodeModulePattern.test(frame?.fileName) // ignore node_modules, except for @serenity-js/*
67
71
  ));
68
72
 
69
73
  const index = Math.min(Math.max(1, frameOffset), userLandFrames.length - 1);