virtual-code-owners 4.0.1 → 4.1.1
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/README.md
CHANGED
|
@@ -62,6 +62,7 @@ libs/ubc-sales/ @abraham-ableton-ch @boris-bubbleblower-ch @charlotte-ch
|
|
|
62
62
|
libs/ubc-after-sales/ @daisy-duck @donald-duck @john-doe-ch @pete-peterson-ch @william-the-fourth-ch
|
|
63
63
|
libs/ubc-pre-sales/ @averel-dalton-ch @jean-claude-ch @john-galt-ch @valerie-valerton-ch
|
|
64
64
|
libs/ubc-refund/ @abraham-ableton-ch @boris-bubbleblower-ch @charlotte-charleston-ch @dagny-taggert-ch @daisy-duck @donald-duck @gregory-gregson-ch @jane-doe-ch @john-doe-ch @karl-marx-ch @pete-peterson-ch @william-the-fourth-ch
|
|
65
|
+
libs/ubc-baarden/ jan@example.com korneel@example.com pier@example.com tjorus@example.com
|
|
65
66
|
```
|
|
66
67
|
|
|
67
68
|
This is where `virtual-code-owners` comes in.
|
|
@@ -104,6 +105,7 @@ libs/ubc-sales/ @ch/sales
|
|
|
104
105
|
libs/ubc-after-sales/ @ch/after-sales
|
|
105
106
|
libs/ubc-pre-sales/ @ch/pre-sales
|
|
106
107
|
libs/ubc-refund/ @ch/sales @ch/after-sales
|
|
108
|
+
libs/ubc-baarden/ @ch/mannen-met-baarden
|
|
107
109
|
```
|
|
108
110
|
|
|
109
111
|
### virtual-teams.yml
|
|
@@ -167,8 +169,9 @@ team name and _virtual-code-owners_ will leave the real name alone.
|
|
|
167
169
|
|
|
168
170
|
### Any limitations I should know of?
|
|
169
171
|
|
|
170
|
-
- Currently only works for
|
|
171
|
-
addresses
|
|
172
|
+
- ~~Currently only works for _user names_ to identify team members - not for e-mail
|
|
173
|
+
addresses.~~
|
|
174
|
+
Works with both user names and e-mail addresses
|
|
172
175
|
- _virtual-code-owners_ assumes the VIRTUAL-CODEOWNERS.txt is a valid CODEOWNERS
|
|
173
176
|
file and the virtual-teams.yml is a valid yaml file with teams names as keys
|
|
174
177
|
and team members as arrays under these. It will likely throw errors when this
|
|
@@ -178,7 +181,7 @@ team name and _virtual-code-owners_ will leave the real name alone.
|
|
|
178
181
|
|
|
179
182
|
Various editors assume an ALL_CAPS file name with `#` characters on various lines
|
|
180
183
|
to be markdown, and will auto format them as such - making for either very ugly
|
|
181
|
-
or in worst cases invalid
|
|
184
|
+
or in worst cases invalid CODEOWNERS files. Usually such autoformatting is not
|
|
182
185
|
present on text files.
|
|
183
186
|
|
|
184
187
|
Apparently these editors know about CODEOWNERS, though so this auto formatting
|
|
@@ -40,7 +40,14 @@ function replaceTeamNames(pUserNames, pTeamMap) {
|
|
|
40
40
|
return lReturnValue;
|
|
41
41
|
}
|
|
42
42
|
function stringifyTeamMembers(pTeamMap, pTeamName) {
|
|
43
|
-
return pTeamMap[pTeamName].map(
|
|
43
|
+
return pTeamMap[pTeamName].map(userNameToCodeOwner).join(" ");
|
|
44
|
+
}
|
|
45
|
+
function userNameToCodeOwner(pUserName) {
|
|
46
|
+
const lEmailIshUsernameRE = /^.+@.+$/;
|
|
47
|
+
if (pUserName.match(lEmailIshUsernameRE)) {
|
|
48
|
+
return pUserName;
|
|
49
|
+
}
|
|
50
|
+
return `@${pUserName}`;
|
|
44
51
|
}
|
|
45
52
|
function uniqAndSortUserNames(pUserNames) {
|
|
46
53
|
return Array.from(new Set(pUserNames.split(/\s+/)))
|
package/dist/read-and-convert.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
|
-
import
|
|
3
|
-
import { convert } from "./convert-
|
|
2
|
+
import { parse } from "yaml";
|
|
3
|
+
import { convert } from "./convert-to-codeowners.js";
|
|
4
4
|
export function readAndConvert(pVirtualCodeOwnersFileName, pVirtualTeamsFileName) {
|
|
5
5
|
const lVirtualCodeOwnersAsAString = readFileSync(pVirtualCodeOwnersFileName, {
|
|
6
6
|
encoding: "utf-8",
|
|
@@ -8,6 +8,6 @@ export function readAndConvert(pVirtualCodeOwnersFileName, pVirtualTeamsFileName
|
|
|
8
8
|
const lVirtualTeamsAsAString = readFileSync(pVirtualTeamsFileName, {
|
|
9
9
|
encoding: "utf-8",
|
|
10
10
|
});
|
|
11
|
-
const lTeamMap =
|
|
11
|
+
const lTeamMap = parse(lVirtualTeamsAsAString);
|
|
12
12
|
return convert(lVirtualCodeOwnersAsAString, lTeamMap);
|
|
13
13
|
}
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "4.
|
|
1
|
+
export const VERSION = "4.1.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virtual-code-owners",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Merges a VIRTUAL-CODEOWNERS.txt and a virtual-teams.yml into CODEOWNERS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -52,22 +52,21 @@
|
|
|
52
52
|
"url": "https://github.com/sverweij/virtual-code-owners/issues"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/js-yaml": "4.0.5",
|
|
56
55
|
"@types/mocha": "10.0.1",
|
|
57
56
|
"@types/node": "20.2.5",
|
|
58
|
-
"c8": "7.
|
|
59
|
-
"dependency-cruiser": "13.0.
|
|
57
|
+
"c8": "7.14.0",
|
|
58
|
+
"dependency-cruiser": "13.0.3",
|
|
60
59
|
"husky": "8.0.3",
|
|
61
60
|
"lint-staged": "13.2.2",
|
|
62
61
|
"mocha": "10.2.0",
|
|
63
62
|
"prettier": "2.8.8",
|
|
64
63
|
"ts-node": "10.9.1",
|
|
65
|
-
"typescript": "5.
|
|
64
|
+
"typescript": "5.1.3",
|
|
66
65
|
"upem": "7.3.2",
|
|
67
|
-
"watskeburt": "0.11.
|
|
66
|
+
"watskeburt": "0.11.3"
|
|
68
67
|
},
|
|
69
68
|
"dependencies": {
|
|
70
|
-
"
|
|
69
|
+
"yaml": "2.3.1"
|
|
71
70
|
},
|
|
72
71
|
"engines": {
|
|
73
72
|
"node": "^16.19.0||^18.11.0||>=20.0.0"
|