virtual-code-owners 2.2.1 → 3.0.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.
@@ -22,14 +22,14 @@ function shouldAppearInResult(pLine) {
22
22
  function convertLine(pTeamMap) {
23
23
  return (pUntreatedLine) => {
24
24
  const lTrimmedLine = pUntreatedLine.trim();
25
- const lSplitLine = lTrimmedLine.match(/^(?<filesPattern>[^\s]+\s+)(?<userNames>.*)$/);
26
- if (lTrimmedLine.startsWith("#") ||
27
- lTrimmedLine === "" ||
28
- !lSplitLine?.groups) {
25
+ const lSplitLine = lTrimmedLine.match(/^(?<filesPattern>[^\s]+)(?<spaces>\s+)(?<userNames>.*)$/);
26
+ if (lTrimmedLine.startsWith("#") || !lSplitLine?.groups) {
29
27
  return pUntreatedLine;
30
28
  }
31
29
  const lUserNames = replaceTeamNames(lSplitLine.groups.userNames, pTeamMap);
32
- return lSplitLine.groups.filesPattern + uniqAndSortUserNames(lUserNames);
30
+ return (lSplitLine.groups.filesPattern +
31
+ lSplitLine.groups.spaces +
32
+ uniqAndSortUserNames(lUserNames));
33
33
  };
34
34
  }
35
35
  function replaceTeamNames(pUserNames, pTeamMap) {
@@ -2,12 +2,12 @@ import { readFileSync } from "node:fs";
2
2
  import yaml from "js-yaml";
3
3
  import { convert } from "./convert-virtual-code-owners.js";
4
4
  export function readAndConvert(pVirtualCodeOwnersFileName, pVirtualTeamsFileName) {
5
- const lVirtualCodeOwnersFileAsAString = readFileSync(pVirtualCodeOwnersFileName, {
5
+ const lVirtualCodeOwnersAsAString = readFileSync(pVirtualCodeOwnersFileName, {
6
6
  encoding: "utf-8",
7
7
  });
8
- const lVirtualTeamsYamlAsAString = readFileSync(pVirtualTeamsFileName, {
8
+ const lVirtualTeamsAsAString = readFileSync(pVirtualTeamsFileName, {
9
9
  encoding: "utf-8",
10
10
  });
11
- const lTeamMap = yaml.load(lVirtualTeamsYamlAsAString);
12
- return convert(lVirtualCodeOwnersFileAsAString, lTeamMap);
11
+ const lTeamMap = yaml.load(lVirtualTeamsAsAString);
12
+ return convert(lVirtualCodeOwnersAsAString, lTeamMap);
13
13
  }
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "2.2.1";
1
+ export const VERSION = "3.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-code-owners",
3
- "version": "2.2.1",
3
+ "version": "3.0.0",
4
4
  "description": "Merges a VIRTUAL-CODEOWNERS.txt and a virtual-teams.yml into CODEOWNERS",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,14 +20,14 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "scripts": {
23
- "build": "rm -rf dist && ts-node --esm tools/get-version.ts > src/version.ts && tsc",
23
+ "build": "rm -rf dist && node --no-warnings --loader ts-node/esm tools/get-version.ts > src/version.ts && tsc",
24
24
  "check": "npm run format && npm run build && npm run depcruise -- --no-progress && npm test",
25
- "depcruise": "depcruise src tools --config .dependency-cruiser.cjs",
26
- "depcruise:graph": "depcruise src --include-only '^(src)' --config --output-type dot | dot -T svg | depcruise-wrap-stream-in-html > dependency-graph.html",
27
- "depcruise:graph:dev": "depcruise src --prefix vscode://file/$(pwd)/ --config --output-type dot | dot -T svg | depcruise-wrap-stream-in-html | browser",
28
- "depcruise:graph:diff:dev": "depcruise src --prefix vscode://file/$(pwd)/ --config --output-type dot --reaches \"$(watskeburt $SHA -T regex)\"| dot -T svg | depcruise-wrap-stream-in-html | browser",
29
- "depcruise:graph:diff:mermaid": "depcruise src tools --config --output-type mermaid --output-to - --reaches \"$(watskeburt $SHA -T regex)\"",
30
- "depcruise:html": "depcruise src tools --config --output-type err-html --output-to dependency-violation-report.html",
25
+ "depcruise": "depcruise src tools",
26
+ "depcruise:graph": "depcruise src --include-only '^(src)' --output-type dot | dot -T svg | depcruise-wrap-stream-in-html > dependency-graph.html",
27
+ "depcruise:graph:dev": "depcruise src --prefix vscode://file/$(pwd)/ --output-type dot | dot -T svg | depcruise-wrap-stream-in-html | browser",
28
+ "depcruise:graph:diff:dev": "depcruise src --prefix vscode://file/$(pwd)/ --output-type dot --reaches \"$(watskeburt $SHA -T regex)\"| dot -T svg | depcruise-wrap-stream-in-html | browser",
29
+ "depcruise:graph:diff:mermaid": "depcruise src tools --output-type mermaid --output-to - --reaches \"$(watskeburt $SHA -T regex)\"",
30
+ "depcruise:html": "depcruise src tools --output-type err-html --output-to dependency-violation-report.html",
31
31
  "format": "prettier --loglevel warn --write \"**/*.{md,ts,json,yml}\"",
32
32
  "prepare": "husky install",
33
33
  "scm:stage": "git add .",
@@ -54,23 +54,32 @@
54
54
  "devDependencies": {
55
55
  "@types/js-yaml": "4.0.5",
56
56
  "@types/mocha": "10.0.1",
57
- "@types/node": "18.15.3",
57
+ "@types/node": "20.0.0",
58
58
  "c8": "7.13.0",
59
- "dependency-cruiser": "12.11.0",
59
+ "dependency-cruiser": "^13.0.0-beta-7",
60
60
  "husky": "8.0.3",
61
- "lint-staged": "13.2.0",
61
+ "lint-staged": "13.2.2",
62
62
  "mocha": "10.2.0",
63
- "prettier": "2.8.4",
63
+ "prettier": "2.8.8",
64
64
  "ts-node": "10.9.1",
65
- "typescript": "5.0.2",
65
+ "typescript": "5.0.4",
66
66
  "upem": "7.3.2",
67
- "watskeburt": "0.10.1"
67
+ "watskeburt": "0.11.1"
68
68
  },
69
69
  "dependencies": {
70
- "commander": "10.0.0",
70
+ "commander": "10.0.1",
71
71
  "js-yaml": "4.1.0"
72
72
  },
73
+ "upem": {
74
+ "policies": [
75
+ {
76
+ "package": "dependency-cruiser",
77
+ "policy": "wanted",
78
+ "because": "we're beta testing dependency-cruiser v13 and the _latest_ policy would bump down to v12 again"
79
+ }
80
+ ]
81
+ },
73
82
  "engines": {
74
- "node": "^14.13.1||^16||>=18"
83
+ "node": "^16.14||>=18"
75
84
  }
76
85
  }