virtual-code-owners 7.0.3 → 8.0.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022-2023 Sander Verweij
3
+ Copyright (c) 2022-2024 Sander Verweij
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -202,6 +202,15 @@ npx virtual-code-owners --emitLabeler
202
202
  If you have an alternate file location for the `labeler.yml` you can specify that
203
203
  with virtual-code-owner's `--labelerLocation` parameter.
204
204
 
205
+ > [!NOTE]
206
+ > actions/labeler changed the labeler.yml format from v4 to v5.
207
+ >
208
+ > - virtual-code-owners < 8.0.0 generates labeler.yml v4 format,
209
+ > - virtual-code-owners >= 8.0.0 generates labeler.yml v5 format.
210
+ >
211
+ > see [actions/labeler#v5](https://github.com/actions/labeler/blob/8558fd74291d67161a8a78ce36a881fa63b766a9/README.md)
212
+ > for details on the v5 format.
213
+
205
214
  ### What validations does virtual-code-owners perform?
206
215
 
207
216
  virtual-code-owners checks for basic CODEOWNERS format errors and invalid
@@ -17,10 +17,13 @@ export default function generateLabelerYml(
17
17
  let lReturnValue = pGeneratedWarning;
18
18
  for (const lTeamName in pTeamMap) {
19
19
  const lPatternsForTeam = getPatternsForTeam(pCodeOwners, lTeamName)
20
- .map((pPattern) => ` - ${transformForYamlAndMinimatch(pPattern)}${EOL}`)
20
+ .map(
21
+ (pPattern) =>
22
+ ` - any-glob-to-any-file: ${transformForYamlAndMinimatch(pPattern)}${EOL}`,
23
+ )
21
24
  .join("");
22
25
  if (lPatternsForTeam) {
23
- lReturnValue += `${lTeamName}:${EOL}${lPatternsForTeam}${EOL}`;
26
+ lReturnValue += `${lTeamName}:${EOL} - changed-files:${EOL}${lPatternsForTeam}${EOL}`;
24
27
  }
25
28
  }
26
29
  return lReturnValue;
@@ -18,10 +18,7 @@ function assertTeamMapValid(pTeamMap, pVirtualTeamsFileName) {
18
18
  });
19
19
  if (!ajv.validate(virtualTeamsSchema, pTeamMap)) {
20
20
  throw new Error(
21
- `This is not a valid virtual-teams.yml:${EOL}${formatAjvErrors(
22
- ajv.errors,
23
- pVirtualTeamsFileName,
24
- )}.\n`,
21
+ `This is not a valid virtual-teams.yml:${EOL}${formatAjvErrors(ajv.errors, pVirtualTeamsFileName)}.\n`,
25
22
  );
26
23
  }
27
24
  }
@@ -31,7 +28,5 @@ function formatAjvErrors(pAjvErrors, pVirtualTeamsFileName) {
31
28
  .join(EOL);
32
29
  }
33
30
  function formatAjvError(pAjvError, pVirtualTeamsFileName) {
34
- return `${pVirtualTeamsFileName}: ${
35
- pAjvError.instancePath
36
- } - ${JSON.stringify(pAjvError.data)} ${pAjvError.message}`;
31
+ return `${pVirtualTeamsFileName}: ${pAjvError.instancePath} - ${JSON.stringify(pAjvError.data)} ${pAjvError.message}`;
37
32
  }
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "7.0.3";
1
+ export const VERSION = "8.0.1";
@@ -16,10 +16,7 @@ export default function readVirtualCodeOwners(
16
16
  const lAnomalies = getAnomalies(lVirtualCodeOwners);
17
17
  if (lAnomalies.length > 0) {
18
18
  throw new Error(
19
- `This is not a valid virtual code-owners file:${EOL}${reportAnomalies(
20
- pVirtualCodeOwnersFileName,
21
- lAnomalies,
22
- )}`,
19
+ `This is not a valid virtual code-owners file:${EOL}${reportAnomalies(pVirtualCodeOwnersFileName, lAnomalies)}`,
23
20
  );
24
21
  }
25
22
  return lVirtualCodeOwners;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "virtual-code-owners",
3
- "version": "7.0.3",
4
- "description": "Makes your CODEOWNERS file liveable again",
3
+ "version": "8.0.1",
4
+ "description": "CODEOWNERS with teams for teams that can't use GitHub teams",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "virtual-code-owners": "dist/run-cli.js"
@@ -27,9 +27,12 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "ajv": "8.12.0",
30
- "yaml": "2.3.4"
30
+ "yaml": "2.4.0"
31
31
  },
32
32
  "engines": {
33
33
  "node": "^18.11.0||>=20.0.0"
34
+ },
35
+ "scripts": {
36
+ "test": "echo for test, build and static analysis scripts: see the github repository"
34
37
  }
35
- }
38
+ }