@serenity-js/core 3.16.2 → 3.18.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
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.18.0](https://github.com/serenity-js/serenity-js/compare/v3.17.0...v3.18.0) (2024-02-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** update dependency diff to v5.2.0 ([17f5a2e](https://github.com/serenity-js/serenity-js/commit/17f5a2e61576bae958f1f30490da8b24351d08f8))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.17.0](https://github.com/serenity-js/serenity-js/compare/v3.16.2...v3.17.0) (2024-02-10)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **playwright-test:** fix lint issue, refactors and add integration tests to custom tags reporting ([0f055c7](https://github.com/serenity-js/serenity-js/commit/0f055c7f4e0a9f6d29ef20c615c2055baebf85ec))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [3.16.2](https://github.com/serenity-js/serenity-js/compare/v3.16.1...v3.16.2) (2024-02-05)
7
29
 
8
30
  **Note:** Version bump only for package @serenity-js/core
@@ -4,6 +4,7 @@ import type { Tag } from './';
4
4
  */
5
5
  export declare class Tags {
6
6
  private static Pattern;
7
+ private static matchTags;
7
8
  static from(text: string): Tag[];
8
9
  }
9
10
  //# sourceMappingURL=Tags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AAG9B;;GAEG;AACH,qBAAa,IAAI;IACb,OAAO,CAAC,MAAM,CAAC,OAAO,CAA4B;WAEpC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE;CAS1C"}
1
+ {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AAG9B;;GAEG;AACH,qBAAa,IAAI;IACb,OAAO,CAAC,MAAM,CAAC,OAAO,CAA2B;IAEjD,OAAO,CAAC,MAAM,CAAC,SAAS;WAWV,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE;CAM1C"}
@@ -8,14 +8,22 @@ const _1 = require("./");
8
8
  */
9
9
  class Tags {
10
10
  static Pattern = /^@([\w-]+)[\s:]?(.*)/i;
11
- static from(text) {
12
- const [, type, value] = Tags.Pattern.exec(text);
11
+ static matchTags(tagText) {
12
+ if (tagText === '')
13
+ return [];
14
+ const [, type, value] = Tags.Pattern.exec(tagText);
13
15
  return (0, tiny_types_1.match)(type.toLowerCase())
14
16
  .when('manual', _ => [new _1.ManualTag()])
15
17
  // todo: map as arbitrary tag if value === ''; look up ticket id
16
18
  .when(/^issues?$/, _ => value.split(',').map(value => new _1.IssueTag(value.trim())))
17
19
  .else(value => [new _1.ArbitraryTag(value.trim())]);
18
20
  }
21
+ static from(text) {
22
+ const tags = text.split(/\s+/)
23
+ .filter(word => word.startsWith('@'))
24
+ .flatMap(tag => Tags.matchTags(tag));
25
+ return tags ?? Tags.matchTags(text);
26
+ }
19
27
  }
20
28
  exports.Tags = Tags;
21
29
  //# sourceMappingURL=Tags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/model/tags/Tags.ts"],"names":[],"mappings":";;;AAAA,2CAAmC;AAGnC,yBAAuD;AAEvD;;GAEG;AACH,MAAa,IAAI;IACL,MAAM,CAAC,OAAO,GAAG,uBAAuB,CAAE;IAE3C,MAAM,CAAC,IAAI,CAAC,IAAY;QAC3B,MAAM,CAAE,AAAD,EAAG,IAAI,EAAE,KAAK,CAAE,GAAG,IAAI,CAAC,OAAO,CAA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WAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;aACjF,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,eAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IACxD,CAAC;IAEM,MAAM,CAAC,IAAI,CAAC,IAAY;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;aACzB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACpC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;;AAnBL,oBAoBC"}
@@ -23,7 +23,7 @@ export declare class Masked {
23
23
  *
24
24
  * await actorCalled('John')
25
25
  * .attemptsTo(
26
- * Enter.theValue(Masked.valueOf('your little secret').into(Form.exampleInput())
26
+ * Enter.theValue(Masked.valueOf('your little secret')).into(Form.exampleInput())
27
27
  * );
28
28
  * ```
29
29
  *
@@ -25,7 +25,7 @@ class Masked {
25
25
  *
26
26
  * await actorCalled('John')
27
27
  * .attemptsTo(
28
- * Enter.theValue(Masked.valueOf('your little secret').into(Form.exampleInput())
28
+ * Enter.theValue(Masked.valueOf('your little secret')).into(Form.exampleInput())
29
29
  * );
30
30
  * ```
31
31
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serenity-js/core",
3
- "version": "3.16.2",
3
+ "version": "3.18.0",
4
4
  "description": "Serenity/JS Screenplay, reporting engine and core interfaces.",
5
5
  "author": {
6
6
  "name": "Jan Molak",
@@ -35,12 +35,12 @@
35
35
  "dependencies": {
36
36
  "@paralleldrive/cuid2": "2.2.2",
37
37
  "chalk": "4.1.2",
38
- "diff": "5.1.0",
38
+ "diff": "5.2.0",
39
39
  "error-stack-parser": "2.1.4",
40
40
  "fast-glob": "3.3.2",
41
41
  "filenamify": "4.3.0",
42
42
  "graceful-fs": "4.2.11",
43
- "semver": "7.5.4",
43
+ "semver": "7.6.0",
44
44
  "tiny-types": "1.21.0",
45
45
  "upath": "2.0.1",
46
46
  "validate-npm-package-name": "5.0.0"
@@ -50,12 +50,12 @@
50
50
  "@types/diff": "5.0.9",
51
51
  "@types/filenamify": "2.0.2",
52
52
  "@types/mocha": "10.0.6",
53
- "@types/semver": "7.5.6",
53
+ "@types/semver": "7.5.7",
54
54
  "@types/validate-npm-package-name": "4.0.2",
55
55
  "assertion-error-formatter": "3.0.0",
56
56
  "c8": "9.1.0",
57
- "memfs": "4.6.0",
58
- "mocha": "10.2.0",
57
+ "memfs": "4.7.1",
58
+ "mocha": "10.3.0",
59
59
  "mocha-multi": "1.1.7",
60
60
  "ts-node": "10.9.2",
61
61
  "typescript": "5.2.2"
@@ -71,5 +71,5 @@
71
71
  "engines": {
72
72
  "node": "^16.13 || ^18.12 || ^20"
73
73
  },
74
- "gitHead": "d24b15b34b550b0a9b2541529e8d1f92a30f8944"
74
+ "gitHead": "c4f12cc2dd366788b88fd06b4452084a6b36b5fe"
75
75
  }
@@ -7,15 +7,23 @@ import { ArbitraryTag, IssueTag, ManualTag } from './';
7
7
  * @package
8
8
  */
9
9
  export class Tags {
10
- private static Pattern = /^@([\w-]+)[\s:]?(.*)/i ;
10
+ private static Pattern = /^@([\w-]+)[\s:]?(.*)/i;
11
11
 
12
- public static from(text: string): Tag[] {
13
- const [ , type, value ] = Tags.Pattern.exec(text);
12
+ private static matchTags(tagText: string): Tag[] {
13
+ if (tagText === '') return [];
14
+ const [, type, value] = Tags.Pattern.exec(tagText);
14
15
 
15
16
  return match<Tag[]>(type.toLowerCase())
16
- .when('manual', _ => [ new ManualTag() ])
17
+ .when('manual', _ => [new ManualTag()])
17
18
  // todo: map as arbitrary tag if value === ''; look up ticket id
18
- .when(/^issues?$/, _ => value.split(',').map(value => new IssueTag(value.trim())))
19
- .else(value => [ new ArbitraryTag(value.trim()) ]);
19
+ .when(/^issues?$/, _ => value.split(',').map(value => new IssueTag(value.trim())))
20
+ .else(value => [new ArbitraryTag(value.trim())])
21
+ }
22
+
23
+ public static from(text: string): Tag[] {
24
+ const tags = text.split(/\s+/)
25
+ .filter(word => word.startsWith('@'))
26
+ .flatMap(tag => Tags.matchTags(tag));
27
+ return tags ?? Tags.matchTags(text);
20
28
  }
21
29
  }
@@ -25,7 +25,7 @@ export class Masked {
25
25
  *
26
26
  * await actorCalled('John')
27
27
  * .attemptsTo(
28
- * Enter.theValue(Masked.valueOf('your little secret').into(Form.exampleInput())
28
+ * Enter.theValue(Masked.valueOf('your little secret')).into(Form.exampleInput())
29
29
  * );
30
30
  * ```
31
31
  *