@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 +22 -0
- package/lib/model/tags/Tags.d.ts +1 -0
- package/lib/model/tags/Tags.d.ts.map +1 -1
- package/lib/model/tags/Tags.js +10 -2
- package/lib/model/tags/Tags.js.map +1 -1
- package/lib/screenplay/questions/Masked.d.ts +1 -1
- package/lib/screenplay/questions/Masked.js +1 -1
- package/package.json +7 -7
- package/src/model/tags/Tags.ts +14 -6
- package/src/screenplay/questions/Masked.ts +1 -1
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
|
package/lib/model/tags/Tags.d.ts
CHANGED
|
@@ -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,
|
|
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"}
|
package/lib/model/tags/Tags.js
CHANGED
|
@@ -8,14 +8,22 @@ const _1 = require("./");
|
|
|
8
8
|
*/
|
|
9
9
|
class Tags {
|
|
10
10
|
static Pattern = /^@([\w-]+)[\s:]?(.*)/i;
|
|
11
|
-
static
|
|
12
|
-
|
|
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,
|
|
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,CAAC;IAEzC,MAAM,CAAC,SAAS,CAAC,OAAe;QACpC,IAAI,OAAO,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC;QAC9B,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEnD,OAAO,IAAA,kBAAK,EAAQ,IAAI,CAAC,WAAW,EAAE,CAAC;aAClC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,YAAS,EAAE,CAAC,CAAC;YACvC,gEAAgE;aAC/D,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,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
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/core",
|
|
3
|
-
"version": "3.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
58
|
-
"mocha": "10.
|
|
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": "
|
|
74
|
+
"gitHead": "c4f12cc2dd366788b88fd06b4452084a6b36b5fe"
|
|
75
75
|
}
|
package/src/model/tags/Tags.ts
CHANGED
|
@@ -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
|
-
|
|
13
|
-
|
|
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',
|
|
17
|
+
.when('manual', _ => [new ManualTag()])
|
|
17
18
|
// todo: map as arbitrary tag if value === ''; look up ticket id
|
|
18
|
-
.when(/^issues?$/,
|
|
19
|
-
.else(value
|
|
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
|
*
|