workspace-tools 0.41.0 → 0.41.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.
Files changed (160) hide show
  1. package/README.md +1 -1
  2. package/lib/dependencies/index.d.ts +2 -2
  3. package/lib/dependencies/index.js +31 -12
  4. package/lib/dependencies/index.js.map +1 -1
  5. package/lib/dependencies/transitiveDeps.d.ts +1 -1
  6. package/lib/dependencies/transitiveDeps.js +59 -38
  7. package/lib/dependencies/transitiveDeps.js.map +1 -1
  8. package/lib/getPackageInfo.d.ts +1 -1
  9. package/lib/getPackageInfo.js +46 -40
  10. package/lib/getPackageInfo.js.map +1 -1
  11. package/lib/getPackageInfos.d.ts +4 -2
  12. package/lib/getPackageInfos.js +35 -53
  13. package/lib/getPackageInfos.js.map +1 -1
  14. package/lib/git/config.d.ts +1 -1
  15. package/lib/git/config.js +15 -12
  16. package/lib/git/config.js.map +1 -1
  17. package/lib/git/getDefaultRemote.js +45 -30
  18. package/lib/git/getDefaultRemote.js.map +1 -1
  19. package/lib/git/getDefaultRemoteBranch.d.ts +1 -1
  20. package/lib/git/getDefaultRemoteBranch.js +35 -24
  21. package/lib/git/getDefaultRemoteBranch.js.map +1 -1
  22. package/lib/git/getRepositoryName.d.ts +1 -1
  23. package/lib/git/getRepositoryName.js +17 -19
  24. package/lib/git/getRepositoryName.js.map +1 -1
  25. package/lib/git/git.d.ts +2 -5
  26. package/lib/git/git.js +62 -64
  27. package/lib/git/git.js.map +1 -1
  28. package/lib/git/gitUtilities.d.ts +3 -3
  29. package/lib/git/gitUtilities.js +377 -147
  30. package/lib/git/gitUtilities.js.map +1 -1
  31. package/lib/git/index.d.ts +5 -5
  32. package/lib/git/index.js +50 -28
  33. package/lib/git/index.js.map +1 -1
  34. package/lib/git/types.js +4 -3
  35. package/lib/git/types.js.map +1 -1
  36. package/lib/graph/createDependencyMap.d.ts +2 -2
  37. package/lib/graph/createDependencyMap.js +18 -18
  38. package/lib/graph/createDependencyMap.js.map +1 -1
  39. package/lib/graph/createPackageGraph.d.ts +3 -3
  40. package/lib/graph/createPackageGraph.js +58 -45
  41. package/lib/graph/createPackageGraph.js.map +1 -1
  42. package/lib/graph/getPackageDependencies.d.ts +1 -1
  43. package/lib/graph/getPackageDependencies.js +17 -17
  44. package/lib/graph/getPackageDependencies.js.map +1 -1
  45. package/lib/graph/index.d.ts +4 -4
  46. package/lib/graph/index.js +25 -27
  47. package/lib/graph/index.js.map +1 -1
  48. package/lib/index.d.ts +29 -26
  49. package/lib/index.js +154 -70
  50. package/lib/index.js.map +1 -1
  51. package/lib/isCachingEnabled.js +17 -6
  52. package/lib/isCachingEnabled.js.map +1 -1
  53. package/lib/lockfile/nameAtVersion.js +9 -4
  54. package/lib/lockfile/nameAtVersion.js.map +1 -1
  55. package/lib/lockfile/parseBerryLock.d.ts +1 -1
  56. package/lib/lockfile/parseBerryLock.js +13 -11
  57. package/lib/lockfile/parseBerryLock.js.map +1 -1
  58. package/lib/lockfile/parseLockFile.d.ts +2 -0
  59. package/lib/lockfile/parseLockFile.js +87 -0
  60. package/lib/lockfile/parseLockFile.js.map +1 -0
  61. package/lib/lockfile/parseNpmLock.d.ts +1 -1
  62. package/lib/lockfile/parseNpmLock.js +15 -7
  63. package/lib/lockfile/parseNpmLock.js.map +1 -1
  64. package/lib/lockfile/parsePnpmLock.d.ts +1 -1
  65. package/lib/lockfile/parsePnpmLock.js +14 -9
  66. package/lib/lockfile/parsePnpmLock.js.map +1 -1
  67. package/lib/lockfile/queryLockFile.d.ts +1 -1
  68. package/lib/lockfile/queryLockFile.js +11 -6
  69. package/lib/lockfile/queryLockFile.js.map +1 -1
  70. package/lib/lockfile/readYaml.js +17 -9
  71. package/lib/lockfile/readYaml.js.map +1 -1
  72. package/lib/lockfile/types.js +3 -2
  73. package/lib/lockfile/types.js.map +1 -1
  74. package/lib/logging.js +10 -6
  75. package/lib/logging.js.map +1 -1
  76. package/lib/paths.d.ts +1 -1
  77. package/lib/paths.js +59 -59
  78. package/lib/paths.js.map +1 -1
  79. package/lib/scope.js +30 -21
  80. package/lib/scope.js.map +1 -1
  81. package/lib/types/Catalogs.js +8 -3
  82. package/lib/types/Catalogs.js.map +1 -1
  83. package/lib/types/PackageGraph.js +4 -3
  84. package/lib/types/PackageGraph.js.map +1 -1
  85. package/lib/types/PackageInfo.d.ts +1 -1
  86. package/lib/types/PackageInfo.js +3 -2
  87. package/lib/types/PackageInfo.js.map +1 -1
  88. package/lib/types/WorkspaceInfo.d.ts +1 -1
  89. package/lib/types/WorkspaceInfo.js +3 -2
  90. package/lib/types/WorkspaceInfo.js.map +1 -1
  91. package/lib/types/WorkspaceManager.js +3 -2
  92. package/lib/types/WorkspaceManager.js.map +1 -1
  93. package/lib/workspaces/catalogsToYaml.d.ts +1 -1
  94. package/lib/workspaces/catalogsToYaml.js +12 -10
  95. package/lib/workspaces/catalogsToYaml.js.map +1 -1
  96. package/lib/workspaces/findWorkspacePath.d.ts +2 -1
  97. package/lib/workspaces/findWorkspacePath.js +10 -12
  98. package/lib/workspaces/findWorkspacePath.js.map +1 -1
  99. package/lib/workspaces/getAllPackageJsonFiles.js +32 -28
  100. package/lib/workspaces/getAllPackageJsonFiles.js.map +1 -1
  101. package/lib/workspaces/getCatalogVersion.d.ts +1 -1
  102. package/lib/workspaces/getCatalogVersion.js +19 -32
  103. package/lib/workspaces/getCatalogVersion.js.map +1 -1
  104. package/lib/workspaces/getCatalogs.d.ts +2 -2
  105. package/lib/workspaces/getCatalogs.js +17 -22
  106. package/lib/workspaces/getCatalogs.js.map +1 -1
  107. package/lib/workspaces/getChangedPackages.d.ts +1 -1
  108. package/lib/workspaces/getChangedPackages.js +47 -30
  109. package/lib/workspaces/getChangedPackages.js.map +1 -1
  110. package/lib/workspaces/getPackagesByFiles.js +29 -24
  111. package/lib/workspaces/getPackagesByFiles.js.map +1 -1
  112. package/lib/workspaces/getWorkspaceInfos.d.ts +2 -2
  113. package/lib/workspaces/getWorkspaceInfos.js +43 -58
  114. package/lib/workspaces/getWorkspaceInfos.js.map +1 -1
  115. package/lib/workspaces/getWorkspaceManagerRoot.d.ts +1 -1
  116. package/lib/workspaces/getWorkspaceManagerRoot.js +16 -13
  117. package/lib/workspaces/getWorkspaceManagerRoot.js.map +1 -1
  118. package/lib/workspaces/getWorkspacePackagePaths.d.ts +1 -1
  119. package/lib/workspaces/getWorkspacePackagePaths.js +86 -72
  120. package/lib/workspaces/getWorkspacePackagePaths.js.map +1 -1
  121. package/lib/workspaces/getWorkspacePatterns.d.ts +1 -1
  122. package/lib/workspaces/getWorkspacePatterns.js +18 -20
  123. package/lib/workspaces/getWorkspacePatterns.js.map +1 -1
  124. package/lib/workspaces/implementations/WorkspaceUtilities.d.ts +1 -1
  125. package/lib/workspaces/implementations/WorkspaceUtilities.js +3 -2
  126. package/lib/workspaces/implementations/WorkspaceUtilities.js.map +1 -1
  127. package/lib/workspaces/implementations/getPackageJsonWorkspacePatterns.d.ts +1 -1
  128. package/lib/workspaces/implementations/getPackageJsonWorkspacePatterns.js +24 -22
  129. package/lib/workspaces/implementations/getPackageJsonWorkspacePatterns.js.map +1 -1
  130. package/lib/workspaces/implementations/getWorkspaceManagerAndRoot.d.ts +1 -1
  131. package/lib/workspaces/implementations/getWorkspaceManagerAndRoot.js +38 -43
  132. package/lib/workspaces/implementations/getWorkspaceManagerAndRoot.js.map +1 -1
  133. package/lib/workspaces/implementations/getWorkspaceUtilities.d.ts +2 -2
  134. package/lib/workspaces/implementations/getWorkspaceUtilities.js +25 -13
  135. package/lib/workspaces/implementations/getWorkspaceUtilities.js.map +1 -1
  136. package/lib/workspaces/implementations/index.d.ts +2 -2
  137. package/lib/workspaces/implementations/index.js +19 -7
  138. package/lib/workspaces/implementations/index.js.map +1 -1
  139. package/lib/workspaces/implementations/lerna.d.ts +1 -1
  140. package/lib/workspaces/implementations/lerna.js +55 -31
  141. package/lib/workspaces/implementations/lerna.js.map +1 -1
  142. package/lib/workspaces/implementations/npm.d.ts +1 -1
  143. package/lib/workspaces/implementations/npm.js +12 -7
  144. package/lib/workspaces/implementations/npm.js.map +1 -1
  145. package/lib/workspaces/implementations/pnpm.d.ts +1 -1
  146. package/lib/workspaces/implementations/pnpm.js +28 -17
  147. package/lib/workspaces/implementations/pnpm.js.map +1 -1
  148. package/lib/workspaces/implementations/rush.d.ts +1 -1
  149. package/lib/workspaces/implementations/rush.js +27 -16
  150. package/lib/workspaces/implementations/rush.js.map +1 -1
  151. package/lib/workspaces/implementations/yarn.d.ts +1 -1
  152. package/lib/workspaces/implementations/yarn.js +34 -26
  153. package/lib/workspaces/implementations/yarn.js.map +1 -1
  154. package/lib/workspaces/wrapWorkspaceUtility.d.ts +1 -1
  155. package/lib/workspaces/wrapWorkspaceUtility.js +25 -27
  156. package/lib/workspaces/wrapWorkspaceUtility.js.map +1 -1
  157. package/package.json +21 -12
  158. package/lib/lockfile/index.d.ts +0 -6
  159. package/lib/lockfile/index.js +0 -105
  160. package/lib/lockfile/index.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ // NOTE: never place the import of lockfile implementation here, as it slows down the library as a whole
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "parseLockFile", {
7
+ enumerable: true,
8
+ get: function() {
9
+ return parseLockFile;
10
+ }
11
+ });
12
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
13
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
14
+ const _paths = require("../paths.js");
15
+ const _parsePnpmLock = require("./parsePnpmLock.js");
16
+ const _parseNpmLock = require("./parseNpmLock.js");
17
+ const _readYaml = require("./readYaml.js");
18
+ const _parseBerryLock = require("./parseBerryLock.js");
19
+ function _interop_require_default(obj) {
20
+ return obj && obj.__esModule ? obj : {
21
+ default: obj
22
+ };
23
+ }
24
+ const memoization = {};
25
+ async function parseLockFile(packageRoot) {
26
+ const yarnLockPath = (0, _paths.searchUp)([
27
+ "yarn.lock",
28
+ "common/config/rush/yarn.lock"
29
+ ], packageRoot);
30
+ // First, test out whether this works for yarn
31
+ if (yarnLockPath) {
32
+ if (memoization[yarnLockPath]) {
33
+ return memoization[yarnLockPath];
34
+ }
35
+ const yarnLock = _fs.default.readFileSync(yarnLockPath, "utf-8");
36
+ const isBerry = yarnLock.includes("__metadata") || _fs.default.existsSync(_path.default.resolve(yarnLock.replace("yarn.lock", ".yarnrc.yml")));
37
+ let parsed = {
38
+ type: "success",
39
+ object: {}
40
+ };
41
+ if (isBerry) {
42
+ const yaml = (0, _readYaml.readYaml)(yarnLockPath);
43
+ parsed = (0, _parseBerryLock.parseBerryLock)(yaml);
44
+ } else {
45
+ // TODO: this should be an async import in the future (currently causes issues with jest setup)
46
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
47
+ const parseYarnLock = require("@yarnpkg/lockfile").parse;
48
+ parsed = parseYarnLock(yarnLock);
49
+ }
50
+ memoization[yarnLockPath] = parsed;
51
+ return parsed;
52
+ }
53
+ // Second, test out whether this works for pnpm
54
+ const pnpmLockPath = (0, _paths.searchUp)([
55
+ "pnpm-lock.yaml",
56
+ "common/config/rush/pnpm-lock.yaml"
57
+ ], packageRoot);
58
+ if (pnpmLockPath) {
59
+ if (memoization[pnpmLockPath]) {
60
+ return memoization[pnpmLockPath];
61
+ }
62
+ const yaml = (0, _readYaml.readYaml)(pnpmLockPath);
63
+ const parsed = (0, _parsePnpmLock.parsePnpmLock)(yaml);
64
+ memoization[pnpmLockPath] = parsed;
65
+ return memoization[pnpmLockPath];
66
+ }
67
+ // Third, try for npm workspaces
68
+ const npmLockPath = (0, _paths.searchUp)("package-lock.json", packageRoot);
69
+ if (npmLockPath) {
70
+ if (memoization[npmLockPath]) {
71
+ return memoization[npmLockPath];
72
+ }
73
+ let npmLockJson;
74
+ try {
75
+ npmLockJson = _fs.default.readFileSync(npmLockPath, "utf-8");
76
+ } catch {
77
+ throw new Error("Couldn't read package-lock.json");
78
+ }
79
+ const npmLock = JSON.parse(npmLockJson.toString());
80
+ if (!npmLock?.lockfileVersion || npmLock.lockfileVersion < 2) {
81
+ throw new Error(`Your package-lock.json version is not supported: lockfileVersion is ${npmLock.lockfileVersion}. You need npm version 7 or above and package-lock version 2 or above. Please, upgrade npm or choose a different package manager.`);
82
+ }
83
+ memoization[npmLockPath] = (0, _parseNpmLock.parseNpmLock)(npmLock);
84
+ return memoization[npmLockPath];
85
+ }
86
+ throw new Error("You do not have yarn.lock, pnpm-lock.yaml or package-lock.json. Please use one of these package managers.");
87
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lockfile/parseLockFile.ts"],"sourcesContent":["// NOTE: never place the import of lockfile implementation here, as it slows down the library as a whole\nimport fs from \"fs\";\nimport path from \"path\";\nimport { type ParsedLock, type PnpmLockFile, type NpmLockFile, type BerryLockFile } from \"./types.js\";\nimport { searchUp } from \"../paths.js\";\nimport { parsePnpmLock } from \"./parsePnpmLock.js\";\nimport { parseNpmLock } from \"./parseNpmLock.js\";\nimport { readYaml } from \"./readYaml.js\";\nimport { parseBerryLock } from \"./parseBerryLock.js\";\n\nconst memoization: { [path: string]: ParsedLock } = {};\n\n// eslint-disable-next-line @typescript-eslint/require-await -- was async due to async imports, and will be again in future\nexport async function parseLockFile(packageRoot: string): Promise<ParsedLock> {\n const yarnLockPath = searchUp([\"yarn.lock\", \"common/config/rush/yarn.lock\"], packageRoot);\n\n // First, test out whether this works for yarn\n if (yarnLockPath) {\n if (memoization[yarnLockPath]) {\n return memoization[yarnLockPath];\n }\n\n const yarnLock = fs.readFileSync(yarnLockPath, \"utf-8\");\n\n const isBerry =\n yarnLock.includes(\"__metadata\") || fs.existsSync(path.resolve(yarnLock.replace(\"yarn.lock\", \".yarnrc.yml\")));\n\n let parsed: {\n type: \"success\" | \"merge\" | \"conflict\";\n object: any;\n } = {\n type: \"success\",\n object: {},\n };\n\n if (isBerry) {\n const yaml = readYaml<BerryLockFile>(yarnLockPath);\n parsed = parseBerryLock(yaml);\n } else {\n // TODO: this should be an async import in the future (currently causes issues with jest setup)\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const parseYarnLock = require(\"@yarnpkg/lockfile\").parse;\n parsed = parseYarnLock(yarnLock);\n }\n\n memoization[yarnLockPath] = parsed;\n\n return parsed;\n }\n\n // Second, test out whether this works for pnpm\n const pnpmLockPath = searchUp([\"pnpm-lock.yaml\", \"common/config/rush/pnpm-lock.yaml\"], packageRoot);\n\n if (pnpmLockPath) {\n if (memoization[pnpmLockPath]) {\n return memoization[pnpmLockPath];\n }\n\n const yaml = readYaml<PnpmLockFile>(pnpmLockPath);\n const parsed = parsePnpmLock(yaml);\n memoization[pnpmLockPath] = parsed;\n\n return memoization[pnpmLockPath];\n }\n\n // Third, try for npm workspaces\n const npmLockPath = searchUp(\"package-lock.json\", packageRoot);\n\n if (npmLockPath) {\n if (memoization[npmLockPath]) {\n return memoization[npmLockPath];\n }\n\n let npmLockJson;\n try {\n npmLockJson = fs.readFileSync(npmLockPath, \"utf-8\");\n } catch {\n throw new Error(\"Couldn't read package-lock.json\");\n }\n\n const npmLock: NpmLockFile = JSON.parse(npmLockJson.toString());\n\n if (!npmLock?.lockfileVersion || npmLock.lockfileVersion < 2) {\n throw new Error(\n `Your package-lock.json version is not supported: lockfileVersion is ${npmLock.lockfileVersion}. You need npm version 7 or above and package-lock version 2 or above. Please, upgrade npm or choose a different package manager.`\n );\n }\n\n memoization[npmLockPath] = parseNpmLock(npmLock);\n return memoization[npmLockPath];\n }\n\n throw new Error(\n \"You do not have yarn.lock, pnpm-lock.yaml or package-lock.json. Please use one of these package managers.\"\n );\n}\n"],"names":["parseLockFile","memoization","packageRoot","yarnLockPath","searchUp","yarnLock","fs","readFileSync","isBerry","includes","existsSync","path","resolve","replace","parsed","type","object","yaml","readYaml","parseBerryLock","parseYarnLock","require","parse","pnpmLockPath","parsePnpmLock","npmLockPath","npmLockJson","Error","npmLock","JSON","toString","lockfileVersion","parseNpmLock"],"mappings":"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AElD,IAAIuB,aAAa;QACf,IAAIxB,WAAW,CAACwB,YAAY,EAAE;YAC5B,OAAOxB,WAAW,CAACwB,YAAY;QACjC;QAEA,IAAIC;QACJ,IAAI;YACFA,cAAcpB,WAAE,CAACC,YAAY,CAACkB,aAAa;QAC7C,EAAE,OAAM;YACN,MAAM,IAAIE,MAAM;QAClB;QAEA,MAAMC,UAAuBC,KAAKP,KAAK,CAACI,YAAYI,QAAQ;QAE5D,IAAI,CAACF,SAASG,mBAAmBH,QAAQG,eAAe,GAAG,GAAG;YAC5D,MAAM,IAAIJ,MACR,CAAC,oEAAoE,EAAEC,QAAQG,eAAe,CAAC,iIAAiI,CAAC;QAErO;QAEA9B,WAAW,CAACwB,YAAY,GAAGO,IAAAA,0BAAY,EAACJ;QACxC,OAAO3B,WAAW,CAACwB,YAAY;IACjC;IAEA,MAAM,IAAIE,MACR;AAEJ"}
@@ -1,2 +1,2 @@
1
- import { ParsedLock, NpmLockFile } from "./types";
1
+ import { type ParsedLock, type NpmLockFile } from "./types.js";
2
2
  export declare function parseNpmLock(lock: NpmLockFile): ParsedLock;
@@ -1,15 +1,23 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseNpmLock = void 0;
4
- const nameAtVersion_1 = require("./nameAtVersion");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "parseNpmLock", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return parseNpmLock;
9
+ }
10
+ });
11
+ const _nameAtVersion = require("./nameAtVersion.js");
5
12
  function parseNpmLock(lock) {
6
13
  // Re-format the dependencies object so that the key includes the version, similarly to yarn.lock.
7
14
  // For example, `"@microsoft/task-scheduler": { }` will become `"@microsoft/task-scheduler@2.7.1": { }`.
8
- const dependencies = Object.fromEntries(Object.entries(lock.dependencies ?? {}).map(([key, dep]) => [(0, nameAtVersion_1.nameAtVersion)(key, dep.version), dep]));
15
+ const dependencies = Object.fromEntries(Object.entries(lock.dependencies ?? {}).map(([key, dep])=>[
16
+ (0, _nameAtVersion.nameAtVersion)(key, dep.version),
17
+ dep
18
+ ]));
9
19
  return {
10
20
  object: dependencies,
11
- type: "success",
21
+ type: "success"
12
22
  };
13
23
  }
14
- exports.parseNpmLock = parseNpmLock;
15
- //# sourceMappingURL=parseNpmLock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parseNpmLock.js","sourceRoot":"","sources":["../../src/lockfile/parseNpmLock.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAGhD,SAAgB,YAAY,CAAC,IAAiB;IAC5C,kGAAkG;IAClG,wGAAwG;IACxG,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CACrC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,6BAAa,EAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CACpG,CAAC;IAEF,OAAO;QACL,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE,SAAS;KAChB,CAAC;AACJ,CAAC;AAXD,oCAWC"}
1
+ {"version":3,"sources":["../../src/lockfile/parseNpmLock.ts"],"sourcesContent":["import { nameAtVersion } from \"./nameAtVersion.js\";\nimport { type ParsedLock, type NpmLockFile } from \"./types.js\";\n\nexport function parseNpmLock(lock: NpmLockFile): ParsedLock {\n // Re-format the dependencies object so that the key includes the version, similarly to yarn.lock.\n // For example, `\"@microsoft/task-scheduler\": { }` will become `\"@microsoft/task-scheduler@2.7.1\": { }`.\n const dependencies = Object.fromEntries(\n Object.entries(lock.dependencies ?? {}).map(([key, dep]) => [nameAtVersion(key, dep.version), dep])\n );\n\n return {\n object: dependencies,\n type: \"success\",\n };\n}\n"],"names":["parseNpmLock","lock","dependencies","Object","fromEntries","entries","map","key","dep","nameAtVersion","version","object","type"],"mappings":";;;;+BAGgBA;;;eAAAA;;;+BAHc;AAGvB,SAASA,aAAaC,IAAiB;IAC5C,kGAAkG;IAClG,wGAAwG;IACxG,MAAMC,eAAeC,OAAOC,WAAW,CACrCD,OAAOE,OAAO,CAACJ,KAAKC,YAAY,IAAI,CAAC,GAAGI,GAAG,CAAC,CAAC,CAACC,KAAKC,IAAI,GAAK;YAACC,IAAAA,4BAAa,EAACF,KAAKC,IAAIE,OAAO;YAAGF;SAAI;IAGpG,OAAO;QACLG,QAAQT;QACRU,MAAM;IACR;AACF"}
@@ -1,2 +1,2 @@
1
- import { ParsedLock, PnpmLockFile } from "./types";
1
+ import { type ParsedLock, type PnpmLockFile } from "./types.js";
2
2
  export declare function parsePnpmLock(yaml: PnpmLockFile): ParsedLock;
@@ -1,25 +1,30 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parsePnpmLock = void 0;
4
- const nameAtVersion_1 = require("./nameAtVersion");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "parsePnpmLock", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return parsePnpmLock;
9
+ }
10
+ });
11
+ const _nameAtVersion = require("./nameAtVersion.js");
5
12
  function parsePnpmLock(yaml) {
6
13
  const object = {};
7
14
  if (yaml && yaml.packages) {
8
- for (const [pkgSpec, snapshot] of Object.entries(yaml.packages)) {
15
+ for (const [pkgSpec, snapshot] of Object.entries(yaml.packages)){
9
16
  // TODO: handle file:foo.tgz syntax (rush uses this for internal package links)
10
17
  const specParts = pkgSpec.split(/\//);
11
18
  const name = specParts.length > 3 ? `${specParts[1]}/${specParts[2]}` : specParts[1];
12
19
  const version = specParts.length > 3 ? specParts[3] : specParts[2];
13
- object[(0, nameAtVersion_1.nameAtVersion)(name, version)] = {
20
+ object[(0, _nameAtVersion.nameAtVersion)(name, version)] = {
14
21
  version,
15
- dependencies: snapshot.dependencies,
22
+ dependencies: snapshot.dependencies
16
23
  };
17
24
  }
18
25
  }
19
26
  return {
20
27
  object,
21
- type: "success",
28
+ type: "success"
22
29
  };
23
30
  }
24
- exports.parsePnpmLock = parsePnpmLock;
25
- //# sourceMappingURL=parsePnpmLock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parsePnpmLock.js","sourceRoot":"","sources":["../../src/lockfile/parsePnpmLock.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAGhD,SAAgB,aAAa,CAAC,IAAkB;IAC9C,MAAM,MAAM,GAER,EAAE,CAAC;IAEP,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;QACzB,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC/D,+EAA+E;YAC/E,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACrF,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAEnE,MAAM,CAAC,IAAA,6BAAa,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC,GAAG;gBACrC,OAAO;gBACP,YAAY,EAAE,QAAQ,CAAC,YAAY;aACpC,CAAC;SACH;KACF;IAED,OAAO;QACL,MAAM;QACN,IAAI,EAAE,SAAS;KAChB,CAAC;AACJ,CAAC;AAvBD,sCAuBC"}
1
+ {"version":3,"sources":["../../src/lockfile/parsePnpmLock.ts"],"sourcesContent":["import { nameAtVersion } from \"./nameAtVersion.js\";\nimport { type LockDependency, type ParsedLock, type PnpmLockFile } from \"./types.js\";\n\nexport function parsePnpmLock(yaml: PnpmLockFile): ParsedLock {\n const object: {\n [key in string]: LockDependency;\n } = {};\n\n if (yaml && yaml.packages) {\n for (const [pkgSpec, snapshot] of Object.entries(yaml.packages)) {\n // TODO: handle file:foo.tgz syntax (rush uses this for internal package links)\n const specParts = pkgSpec.split(/\\//);\n const name = specParts.length > 3 ? `${specParts[1]}/${specParts[2]}` : specParts[1];\n const version = specParts.length > 3 ? specParts[3] : specParts[2];\n\n object[nameAtVersion(name, version)] = {\n version,\n dependencies: snapshot.dependencies,\n };\n }\n }\n\n return {\n object,\n type: \"success\",\n };\n}\n"],"names":["parsePnpmLock","yaml","object","packages","pkgSpec","snapshot","Object","entries","specParts","split","name","length","version","nameAtVersion","dependencies","type"],"mappings":";;;;+BAGgBA;;;eAAAA;;;+BAHc;AAGvB,SAASA,cAAcC,IAAkB;IAC9C,MAAMC,SAEF,CAAC;IAEL,IAAID,QAAQA,KAAKE,QAAQ,EAAE;QACzB,KAAK,MAAM,CAACC,SAASC,SAAS,IAAIC,OAAOC,OAAO,CAACN,KAAKE,QAAQ,EAAG;YAC/D,+EAA+E;YAC/E,MAAMK,YAAYJ,QAAQK,KAAK,CAAC;YAChC,MAAMC,OAAOF,UAAUG,MAAM,GAAG,IAAI,GAAGH,SAAS,CAAC,EAAE,CAAC,CAAC,EAAEA,SAAS,CAAC,EAAE,EAAE,GAAGA,SAAS,CAAC,EAAE;YACpF,MAAMI,UAAUJ,UAAUG,MAAM,GAAG,IAAIH,SAAS,CAAC,EAAE,GAAGA,SAAS,CAAC,EAAE;YAElEN,MAAM,CAACW,IAAAA,4BAAa,EAACH,MAAME,SAAS,GAAG;gBACrCA;gBACAE,cAAcT,SAASS,YAAY;YACrC;QACF;IACF;IAEA,OAAO;QACLZ;QACAa,MAAM;IACR;AACF"}
@@ -1,2 +1,2 @@
1
- import { LockDependency, ParsedLock } from "./types";
1
+ import { type LockDependency, type ParsedLock } from "./types.js";
2
2
  export declare function queryLockFile(name: string, versionRange: string, lock: ParsedLock): LockDependency;
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.queryLockFile = void 0;
4
- const nameAtVersion_1 = require("./nameAtVersion");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "queryLockFile", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return queryLockFile;
9
+ }
10
+ });
11
+ const _nameAtVersion = require("./nameAtVersion.js");
5
12
  function queryLockFile(name, versionRange, lock) {
6
- const versionRangeSignature = (0, nameAtVersion_1.nameAtVersion)(name, versionRange);
13
+ const versionRangeSignature = (0, _nameAtVersion.nameAtVersion)(name, versionRange);
7
14
  return lock.object[versionRangeSignature];
8
15
  }
9
- exports.queryLockFile = queryLockFile;
10
- //# sourceMappingURL=queryLockFile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryLockFile.js","sourceRoot":"","sources":["../../src/lockfile/queryLockFile.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAGhD,SAAgB,aAAa,CAAC,IAAY,EAAE,YAAoB,EAAE,IAAgB;IAChF,MAAM,qBAAqB,GAAG,IAAA,6BAAa,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAChE,OAAO,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC5C,CAAC;AAHD,sCAGC"}
1
+ {"version":3,"sources":["../../src/lockfile/queryLockFile.ts"],"sourcesContent":["import { nameAtVersion } from \"./nameAtVersion.js\";\nimport { type LockDependency, type ParsedLock } from \"./types.js\";\n\nexport function queryLockFile(name: string, versionRange: string, lock: ParsedLock): LockDependency {\n const versionRangeSignature = nameAtVersion(name, versionRange);\n return lock.object[versionRangeSignature];\n}\n"],"names":["queryLockFile","name","versionRange","lock","versionRangeSignature","nameAtVersion","object"],"mappings":";;;;+BAGgBA;;;eAAAA;;;+BAHc;AAGvB,SAASA,cAAcC,IAAY,EAAEC,YAAoB,EAAEC,IAAgB;IAChF,MAAMC,wBAAwBC,IAAAA,4BAAa,EAACJ,MAAMC;IAClD,OAAOC,KAAKG,MAAM,CAACF,sBAAsB;AAC3C"}
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.readYaml = void 0;
7
- const fs_1 = __importDefault(require("fs"));
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "readYaml", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return readYaml;
9
+ }
10
+ });
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ function _interop_require_default(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
8
17
  function readYaml(file) {
9
18
  // This is delay loaded to avoid the perf penalty of parsing YAML utilities any time the package
10
19
  // is used (since usage of the YAML utilities is less common).
20
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
11
21
  const jsYaml = require("js-yaml");
12
- const content = fs_1.default.readFileSync(file, "utf8");
22
+ const content = _fs.default.readFileSync(file, "utf8");
13
23
  return jsYaml.load(content);
14
24
  }
15
- exports.readYaml = readYaml;
16
- //# sourceMappingURL=readYaml.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"readYaml.js","sourceRoot":"","sources":["../../src/lockfile/readYaml.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAGpB,SAAgB,QAAQ,CAAU,IAAY;IAC5C,gGAAgG;IAChG,8DAA8D;IAC9D,MAAM,MAAM,GAAsB,OAAO,CAAC,SAAS,CAAC,CAAC;IAErD,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAY,CAAC;AACzC,CAAC;AAPD,4BAOC"}
1
+ {"version":3,"sources":["../../src/lockfile/readYaml.ts"],"sourcesContent":["import fs from \"fs\";\nimport type jsYamlType from \"js-yaml\";\n\nexport function readYaml<TReturn>(file: string): TReturn {\n // This is delay loaded to avoid the perf penalty of parsing YAML utilities any time the package\n // is used (since usage of the YAML utilities is less common).\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const jsYaml: typeof jsYamlType = require(\"js-yaml\");\n\n const content = fs.readFileSync(file, \"utf8\");\n return jsYaml.load(content) as TReturn;\n}\n"],"names":["readYaml","file","jsYaml","require","content","fs","readFileSync","load"],"mappings":";;;;+BAGgBA;;;eAAAA;;;2DAHD;;;;;;AAGR,SAASA,SAAkBC,IAAY;IAC5C,gGAAgG;IAChG,8DAA8D;IAC9D,qGAAqG;IACrG,MAAMC,SAA4BC,QAAQ;IAE1C,MAAMC,UAAUC,WAAE,CAACC,YAAY,CAACL,MAAM;IACtC,OAAOC,OAAOK,IAAI,CAACH;AACrB"}
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lockfile/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/lib/logging.js CHANGED
@@ -1,14 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logVerboseWarning = void 0;
4
1
  /**
5
2
  * Helper that logs an error to `console.warn` if `process.env.VERBOSE` is set.
6
3
  * This should be replaced with a proper logging system eventually.
7
- */
4
+ */ "use strict";
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "logVerboseWarning", {
9
+ enumerable: true,
10
+ get: function() {
11
+ return logVerboseWarning;
12
+ }
13
+ });
8
14
  function logVerboseWarning(description, err) {
9
15
  if (process.env.VERBOSE) {
10
16
  console.warn(`${description}${err ? ":\n" : ""}`, err?.stack || err || "");
11
17
  }
12
18
  }
13
- exports.logVerboseWarning = logVerboseWarning;
14
- //# sourceMappingURL=logging.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,WAAmB,EAAE,GAAa;IAClE,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE;QACvB,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,EAAG,GAAyB,EAAE,KAAK,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;KACnG;AACH,CAAC;AAJD,8CAIC"}
1
+ {"version":3,"sources":["../src/logging.ts"],"sourcesContent":["/**\n * Helper that logs an error to `console.warn` if `process.env.VERBOSE` is set.\n * This should be replaced with a proper logging system eventually.\n */\nexport function logVerboseWarning(description: string, err?: unknown): void {\n if (process.env.VERBOSE) {\n console.warn(`${description}${err ? \":\\n\" : \"\"}`, (err as Error | undefined)?.stack || err || \"\");\n }\n}\n"],"names":["logVerboseWarning","description","err","process","env","VERBOSE","console","warn","stack"],"mappings":"AAAA;;;CAGC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,kBAAkBC,WAAmB,EAAEC,GAAa;IAClE,IAAIC,QAAQC,GAAG,CAACC,OAAO,EAAE;QACvBC,QAAQC,IAAI,CAAC,GAAGN,cAAcC,MAAM,QAAQ,IAAI,EAAE,AAACA,KAA2BM,SAASN,OAAO;IAChG;AACF"}
package/lib/paths.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { WorkspaceManager } from "./types/WorkspaceManager";
1
+ import type { WorkspaceManager } from "./types/WorkspaceManager.js";
2
2
  /**
3
3
  * Starting from `cwd`, searches up the directory hierarchy for `filePath`.
4
4
  * If multiple strings are given, searches each directory level for any of them.
package/lib/paths.js CHANGED
@@ -1,86 +1,86 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isChildOf = exports.findProjectRoot = exports.findPackageRoot = exports.findGitRoot = exports.searchUp = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const fs_1 = __importDefault(require("fs"));
9
- const getWorkspaceManagerRoot_1 = require("./workspaces/getWorkspaceManagerRoot");
10
- const git_1 = require("./git");
11
- const logging_1 = require("./logging");
12
- /**
13
- * Starting from `cwd`, searches up the directory hierarchy for `filePath`.
14
- * If multiple strings are given, searches each directory level for any of them.
15
- * @returns Full path to the item found, or undefined if not found.
16
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get findGitRoot () {
13
+ return findGitRoot;
14
+ },
15
+ get findPackageRoot () {
16
+ return findPackageRoot;
17
+ },
18
+ get findProjectRoot () {
19
+ return findProjectRoot;
20
+ },
21
+ get isChildOf () {
22
+ return isChildOf;
23
+ },
24
+ get searchUp () {
25
+ return searchUp;
26
+ }
27
+ });
28
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
29
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
30
+ const _getWorkspaceManagerRoot = require("./workspaces/getWorkspaceManagerRoot.js");
31
+ const _git = require("./git");
32
+ const _logging = require("./logging.js");
33
+ function _interop_require_default(obj) {
34
+ return obj && obj.__esModule ? obj : {
35
+ default: obj
36
+ };
37
+ }
17
38
  function searchUp(filePath, cwd) {
18
- const paths = typeof filePath === "string" ? [filePath] : filePath;
39
+ const paths = typeof filePath === "string" ? [
40
+ filePath
41
+ ] : filePath;
19
42
  // convert to an absolute path if needed
20
- cwd = path_1.default.resolve(cwd);
21
- const root = path_1.default.parse(cwd).root;
43
+ cwd = _path.default.resolve(cwd);
44
+ const root = _path.default.parse(cwd).root;
22
45
  let foundPath;
23
- while (!foundPath && cwd !== root) {
24
- foundPath = paths.find((p) => fs_1.default.existsSync(path_1.default.join(cwd, p)));
46
+ while(!foundPath && cwd !== root){
47
+ foundPath = paths.find((p)=>_fs.default.existsSync(_path.default.join(cwd, p)));
25
48
  if (foundPath) {
26
49
  break;
27
50
  }
28
- cwd = path_1.default.dirname(cwd);
51
+ cwd = _path.default.dirname(cwd);
29
52
  }
30
- return foundPath ? path_1.default.join(cwd, foundPath) : undefined;
53
+ return foundPath ? _path.default.join(cwd, foundPath) : undefined;
31
54
  }
32
- exports.searchUp = searchUp;
33
- /**
34
- * Starting from `cwd`, uses `git rev-parse --show-toplevel` to find the root of the git repo.
35
- * Throws if `cwd` is not in a Git repository.
36
- */
37
55
  function findGitRoot(cwd) {
38
- const output = (0, git_1.git)(["rev-parse", "--show-toplevel"], { cwd });
56
+ const output = (0, _git.git)([
57
+ "rev-parse",
58
+ "--show-toplevel"
59
+ ], {
60
+ cwd
61
+ });
39
62
  if (!output.success) {
40
63
  throw new Error(`Directory "${cwd}" is not in a git repository`);
41
64
  }
42
- return path_1.default.normalize(output.stdout);
65
+ return _path.default.normalize(output.stdout);
43
66
  }
44
- exports.findGitRoot = findGitRoot;
45
- /**
46
- * Starting from `cwd`, searches up the directory hierarchy for `package.json`.
47
- */
48
67
  function findPackageRoot(cwd) {
49
68
  const jsonPath = searchUp("package.json", cwd);
50
- return jsonPath && path_1.default.dirname(jsonPath);
69
+ return jsonPath && _path.default.dirname(jsonPath);
51
70
  }
52
- exports.findPackageRoot = findPackageRoot;
53
- /**
54
- * Starting from `cwd`, searches up the directory hierarchy for the project root (workspace/monorepo
55
- * manager root), falling back to the git root if no manager root is detected. Results are cached by
56
- * `cwd`, and an error is thrown if no project root is found and it's not a git repo.
57
- *
58
- * To skip the git root fallback, use `getWorkspaceManagerRoot`. Usually the monorepo manager root
59
- * is the same as the git root, but this may not be the case with multiple "monorepos" in a single
60
- * git repo, or in project structures with multiple languages where the JS is not at the root.
61
- *
62
- * @param manager Optional workspace/monorepo manager to look for specifically
63
- */
64
71
  function findProjectRoot(cwd, manager) {
65
72
  let workspaceRoot;
66
73
  try {
67
- workspaceRoot = (0, getWorkspaceManagerRoot_1.getWorkspaceManagerRoot)(cwd, manager);
74
+ workspaceRoot = (0, _getWorkspaceManagerRoot.getWorkspaceManagerRoot)(cwd, manager);
68
75
  if (!workspaceRoot) {
69
- (0, logging_1.logVerboseWarning)(`Could not find workspace manager root for ${cwd}. Falling back to git root.`);
76
+ (0, _logging.logVerboseWarning)(`Could not find workspace manager root for ${cwd}. Falling back to git root.`);
70
77
  }
71
- }
72
- catch (err) {
73
- (0, logging_1.logVerboseWarning)(`Error getting workspace manager root for ${cwd} (will fall back to git root)`, err);
78
+ } catch (err) {
79
+ (0, _logging.logVerboseWarning)(`Error getting workspace manager root for ${cwd} (will fall back to git root)`, err);
74
80
  }
75
81
  return workspaceRoot || findGitRoot(cwd);
76
82
  }
77
- exports.findProjectRoot = findProjectRoot;
78
- /**
79
- * Determines if `child` path is a subdirectory of `parent` path.
80
- */
81
83
  function isChildOf(child, parent) {
82
- const relativePath = path_1.default.relative(child, parent);
83
- return /^[.\/\\]+$/.test(relativePath);
84
+ const relativePath = _path.default.relative(child, parent);
85
+ return /^[./\\]+$/.test(relativePath);
84
86
  }
85
- exports.isChildOf = isChildOf;
86
- //# sourceMappingURL=paths.js.map
package/lib/paths.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4CAAoB;AACpB,kFAA+E;AAC/E,+BAA4B;AAC5B,uCA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MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IAC/C,OAAO,QAAQ,IAAI,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAHD,0CAGC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,eAAe,CAAC,GAAW,EAAE,OAA0B;IACrE,IAAI,aAAiC,CAAC;IACtC,IAAI;QACF,aAAa,GAAG,IAAA,iDAAuB,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,aAAa,EAAE;YAClB,IAAA,2BAAiB,EAAC,6CAA6C,GAAG,6BAA6B,CAAC,CAAC;SAClG;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,4CAA4C,GAAG,+BAA+B,EAAE,GAAG,CAAC,CAAC;KACxG;IAED,OAAO,aAAa,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAZD,0CAYC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,MAAc;IACrD,MAAM,YAAY,GAAG,cAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,OAAO,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACzC,CAAC;AAHD,8BAGC"}
1
+ {"version":3,"sources":["../src/paths.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { getWorkspaceManagerRoot } from \"./workspaces/getWorkspaceManagerRoot.js\";\nimport { git } from \"./git\";\nimport { logVerboseWarning } from \"./logging.js\";\nimport type { WorkspaceManager } from \"./types/WorkspaceManager.js\";\n\n/**\n * Starting from `cwd`, searches up the directory hierarchy for `filePath`.\n * If multiple strings are given, searches each directory level for any of them.\n * @returns Full path to the item found, or undefined if not found.\n */\nexport function searchUp(filePath: string | string[], cwd: string): string | undefined {\n const paths = typeof filePath === \"string\" ? [filePath] : filePath;\n // convert to an absolute path if needed\n cwd = path.resolve(cwd);\n const root = path.parse(cwd).root;\n\n let foundPath: string | undefined;\n\n while (!foundPath && cwd !== root) {\n foundPath = paths.find((p) => fs.existsSync(path.join(cwd, p)));\n if (foundPath) {\n break;\n }\n\n cwd = path.dirname(cwd);\n }\n\n return foundPath ? path.join(cwd, foundPath) : undefined;\n}\n\n/**\n * Starting from `cwd`, uses `git rev-parse --show-toplevel` to find the root of the git repo.\n * Throws if `cwd` is not in a Git repository.\n */\nexport function findGitRoot(cwd: string): string {\n const output = git([\"rev-parse\", \"--show-toplevel\"], { cwd });\n if (!output.success) {\n throw new Error(`Directory \"${cwd}\" is not in a git repository`);\n }\n\n return path.normalize(output.stdout);\n}\n\n/**\n * Starting from `cwd`, searches up the directory hierarchy for `package.json`.\n */\nexport function findPackageRoot(cwd: string): string | undefined {\n const jsonPath = searchUp(\"package.json\", cwd);\n return jsonPath && path.dirname(jsonPath);\n}\n\n/**\n * Starting from `cwd`, searches up the directory hierarchy for the project root (workspace/monorepo\n * manager root), falling back to the git root if no manager root is detected. Results are cached by\n * `cwd`, and an error is thrown if no project root is found and it's not a git repo.\n *\n * To skip the git root fallback, use `getWorkspaceManagerRoot`. Usually the monorepo manager root\n * is the same as the git root, but this may not be the case with multiple \"monorepos\" in a single\n * git repo, or in project structures with multiple languages where the JS is not at the root.\n *\n * @param manager Optional workspace/monorepo manager to look for specifically\n */\nexport function findProjectRoot(cwd: string, manager?: WorkspaceManager): string {\n let workspaceRoot: string | undefined;\n try {\n workspaceRoot = getWorkspaceManagerRoot(cwd, manager);\n if (!workspaceRoot) {\n logVerboseWarning(`Could not find workspace manager root for ${cwd}. Falling back to git root.`);\n }\n } catch (err) {\n logVerboseWarning(`Error getting workspace manager root for ${cwd} (will fall back to git root)`, err);\n }\n\n return workspaceRoot || findGitRoot(cwd);\n}\n\n/**\n * Determines if `child` path is a subdirectory of `parent` path.\n */\nexport function isChildOf(child: string, parent: string): boolean {\n const relativePath = path.relative(child, parent);\n return /^[./\\\\]+$/.test(relativePath);\n}\n"],"names":["findGitRoot","findPackageRoot","findProjectRoot","isChildOf","searchUp","filePath","cwd","paths","path","resolve","root","parse","foundPath","find","p","fs","existsSync","join","dirname","undefined","output","git","success","Error","normalize","stdout","jsonPath","manager","workspaceRoot","getWorkspaceManagerRoot","logVerboseWarning","err","child","parent","relativePath","relative","test"],"mappings":";;;;;;;;;;;QAoCgBA;eAAAA;;QAYAC;eAAAA;;QAgBAC;eAAAA;;QAiBAC;eAAAA;;QArEAC;eAAAA;;;6DAZC;2DACF;yCACyB;qBACpB;yBACc;;;;;;AAQ3B,SAASA,SAASC,QAA2B,EAAEC,GAAW;IAC/D,MAAMC,QAAQ,OAAOF,aAAa,WAAW;QAACA;KAAS,GAAGA;IAC1D,wCAAwC;IACxCC,MAAME,aAAI,CAACC,OAAO,CAACH;IACnB,MAAMI,OAAOF,aAAI,CAACG,KAAK,CAACL,KAAKI,IAAI;IAEjC,IAAIE;IAEJ,MAAO,CAACA,aAAaN,QAAQI,KAAM;QACjCE,YAAYL,MAAMM,IAAI,CAAC,CAACC,IAAMC,WAAE,CAACC,UAAU,CAACR,aAAI,CAACS,IAAI,CAACX,KAAKQ;QAC3D,IAAIF,WAAW;YACb;QACF;QAEAN,MAAME,aAAI,CAACU,OAAO,CAACZ;IACrB;IAEA,OAAOM,YAAYJ,aAAI,CAACS,IAAI,CAACX,KAAKM,aAAaO;AACjD;AAMO,SAASnB,YAAYM,GAAW;IACrC,MAAMc,SAASC,IAAAA,QAAG,EAAC;QAAC;QAAa;KAAkB,EAAE;QAAEf;IAAI;IAC3D,IAAI,CAACc,OAAOE,OAAO,EAAE;QACnB,MAAM,IAAIC,MAAM,CAAC,WAAW,EAAEjB,IAAI,4BAA4B,CAAC;IACjE;IAEA,OAAOE,aAAI,CAACgB,SAAS,CAACJ,OAAOK,MAAM;AACrC;AAKO,SAASxB,gBAAgBK,GAAW;IACzC,MAAMoB,WAAWtB,SAAS,gBAAgBE;IAC1C,OAAOoB,YAAYlB,aAAI,CAACU,OAAO,CAACQ;AAClC;AAaO,SAASxB,gBAAgBI,GAAW,EAAEqB,OAA0B;IACrE,IAAIC;IACJ,IAAI;QACFA,gBAAgBC,IAAAA,gDAAuB,EAACvB,KAAKqB;QAC7C,IAAI,CAACC,eAAe;YAClBE,IAAAA,0BAAiB,EAAC,CAAC,0CAA0C,EAAExB,IAAI,2BAA2B,CAAC;QACjG;IACF,EAAE,OAAOyB,KAAK;QACZD,IAAAA,0BAAiB,EAAC,CAAC,yCAAyC,EAAExB,IAAI,6BAA6B,CAAC,EAAEyB;IACpG;IAEA,OAAOH,iBAAiB5B,YAAYM;AACtC;AAKO,SAASH,UAAU6B,KAAa,EAAEC,MAAc;IACrD,MAAMC,eAAe1B,aAAI,CAAC2B,QAAQ,CAACH,OAAOC;IAC1C,OAAO,YAAYG,IAAI,CAACF;AAC1B"}
package/lib/scope.js CHANGED
@@ -1,49 +1,58 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getScopedPackages = void 0;
7
- const micromatch_1 = __importDefault(require("micromatch"));
8
- /**
9
- * Searches all package names based on "scoping" (i.e. "scope" in the sense of inclusion).
10
- * NOTE: this is not the same as package scopes (`@scope/package`).
11
- */
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getScopedPackages", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return getScopedPackages;
9
+ }
10
+ });
11
+ const _micromatch = /*#__PURE__*/ _interop_require_default(require("micromatch"));
12
+ function _interop_require_default(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
12
17
  function getScopedPackages(search, packages) {
13
18
  const packageNames = Array.isArray(packages) ? packages : Object.keys(packages);
14
19
  const results = new Set();
15
20
  // perform a package-scoped search (e.g. search is @scope/foo*)
16
- const scopedSearch = search.filter((needle) => needle.startsWith("@") || needle.startsWith("!@"));
21
+ const scopedSearch = search.filter((needle)=>needle.startsWith("@") || needle.startsWith("!@"));
17
22
  if (scopedSearch.length > 0) {
18
- const matched = (0, micromatch_1.default)(packageNames, scopedSearch, { nocase: true });
19
- for (const pkg of matched) {
23
+ const matched = (0, _micromatch.default)(packageNames, scopedSearch, {
24
+ nocase: true
25
+ });
26
+ for (const pkg of matched){
20
27
  results.add(pkg);
21
28
  }
22
29
  }
23
30
  // perform a package-unscoped search (e.g. search is foo*)
24
- const unscopedSearch = search.filter((needle) => !needle.startsWith("@") && !needle.startsWith("!@"));
31
+ const unscopedSearch = search.filter((needle)=>!needle.startsWith("@") && !needle.startsWith("!@"));
25
32
  if (unscopedSearch.length > 0) {
26
33
  // only generate the bare package map if there ARE unscoped searches
27
34
  const barePackageMap = generateBarePackageMap(packageNames);
28
- let matched = (0, micromatch_1.default)(Object.keys(barePackageMap), unscopedSearch, { nocase: true });
29
- for (const bare of matched) {
30
- for (const pkg of barePackageMap[bare]) {
35
+ const matched = (0, _micromatch.default)(Object.keys(barePackageMap), unscopedSearch, {
36
+ nocase: true
37
+ });
38
+ for (const bare of matched){
39
+ for (const pkg of barePackageMap[bare]){
31
40
  results.add(pkg);
32
41
  }
33
42
  }
34
43
  }
35
- return [...results];
44
+ return [
45
+ ...results
46
+ ];
36
47
  }
37
- exports.getScopedPackages = getScopedPackages;
38
48
  function generateBarePackageMap(packageNames) {
39
49
  const barePackageMap = {};
40
50
  // create a map of bare package name -> list of full package names
41
51
  // NOTE: do not perform barePackageMap lookup if any of the "scopes" arg starts with "@"
42
- for (const pkg of packageNames) {
52
+ for (const pkg of packageNames){
43
53
  const bare = pkg.replace(/^@[^/]+\//, "");
44
54
  barePackageMap[bare] = barePackageMap[bare] || [];
45
55
  barePackageMap[bare].push(pkg);
46
56
  }
47
57
  return barePackageMap;
48
58
  }
49
- //# sourceMappingURL=scope.js.map
package/lib/scope.js.map CHANGED
@@ -1 +1 @@
1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AC,CAAC;QACxF,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;YAC1B,KAAK,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aAClB;SACF;KACF;IAED,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AACtB,CAAC;AA7BD,8CA6BC;AAED,SAAS,sBAAsB,CAAC,YAAsB;IACpD,MAAM,cAAc,GAAgC,EAAE,CAAC;IAEvD,kEAAkE;IAClE,wFAAwF;IACxF,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;QAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC1C,cAAc,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAClD,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAChC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
1
+ {"version":3,"sources":["../src/scope.ts"],"sourcesContent":["import micromatch from \"micromatch\";\n\n/**\n * Searches all package names based on \"scoping\" (i.e. \"scope\" in the sense of inclusion).\n * NOTE: this is not the same as package scopes (`@scope/package`).\n */\nexport function getScopedPackages(search: string[], packages: { [pkg: string]: unknown } | string[]): string[] {\n const packageNames = Array.isArray(packages) ? packages : Object.keys(packages);\n\n const results = new Set<string>();\n\n // perform a package-scoped search (e.g. search is @scope/foo*)\n const scopedSearch = search.filter((needle) => needle.startsWith(\"@\") || needle.startsWith(\"!@\"));\n if (scopedSearch.length > 0) {\n const matched = micromatch(packageNames, scopedSearch, { nocase: true });\n for (const pkg of matched) {\n results.add(pkg);\n }\n }\n\n // perform a package-unscoped search (e.g. search is foo*)\n const unscopedSearch = search.filter((needle) => !needle.startsWith(\"@\") && !needle.startsWith(\"!@\"));\n if (unscopedSearch.length > 0) {\n // only generate the bare package map if there ARE unscoped searches\n const barePackageMap = generateBarePackageMap(packageNames);\n\n const matched = micromatch(Object.keys(barePackageMap), unscopedSearch, { nocase: true });\n for (const bare of matched) {\n for (const pkg of barePackageMap[bare]) {\n results.add(pkg);\n }\n }\n }\n\n return [...results];\n}\n\nfunction generateBarePackageMap(packageNames: string[]) {\n const barePackageMap: { [key: string]: string[] } = {};\n\n // create a map of bare package name -> list of full package names\n // NOTE: do not perform barePackageMap lookup if any of the \"scopes\" arg starts with \"@\"\n for (const pkg of packageNames) {\n const bare = pkg.replace(/^@[^/]+\\//, \"\");\n barePackageMap[bare] = barePackageMap[bare] || [];\n barePackageMap[bare].push(pkg);\n }\n\n return barePackageMap;\n}\n"],"names":["getScopedPackages","search","packages","packageNames","Array","isArray","Object","keys","results","Set","scopedSearch","filter","needle","startsWith","length","matched","micromatch","nocase","pkg","add","unscopedSearch","barePackageMap","generateBarePackageMap","bare","replace","push"],"mappings":";;;;+BAMgBA;;;eAAAA;;;mEANO;;;;;;AAMhB,SAASA,kBAAkBC,MAAgB,EAAEC,QAA+C;IACjG,MAAMC,eAAeC,MAAMC,OAAO,CAACH,YAAYA,WAAWI,OAAOC,IAAI,CAACL;IAEtE,MAAMM,UAAU,IAAIC;IAEpB,+DAA+D;IAC/D,MAAMC,eAAeT,OAAOU,MAAM,CAAC,CAACC,SAAWA,OAAOC,UAAU,CAAC,QAAQD,OAAOC,UAAU,CAAC;IAC3F,IAAIH,aAAaI,MAAM,GAAG,GAAG;QAC3B,MAAMC,UAAUC,IAAAA,mBAAU,EAACb,cAAcO,cAAc;YAAEO,QAAQ;QAAK;QACtE,KAAK,MAAMC,OAAOH,QAAS;YACzBP,QAAQW,GAAG,CAACD;QACd;IACF;IAEA,0DAA0D;IAC1D,MAAME,iBAAiBnB,OAAOU,MAAM,CAAC,CAACC,SAAW,CAACA,OAAOC,UAAU,CAAC,QAAQ,CAACD,OAAOC,UAAU,CAAC;IAC/F,IAAIO,eAAeN,MAAM,GAAG,GAAG;QAC7B,oEA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