workspace-tools 0.32.0 → 0.33.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.
Files changed (60) hide show
  1. package/CHANGELOG.json +48 -1
  2. package/CHANGELOG.md +20 -2
  3. package/README.md +4 -0
  4. package/lib/getPackagePaths.d.ts +10 -2
  5. package/lib/getPackagePaths.js +32 -33
  6. package/lib/getPackagePaths.js.map +1 -1
  7. package/lib/index.d.ts +3 -3
  8. package/lib/index.js +10 -3
  9. package/lib/index.js.map +1 -1
  10. package/lib/lockfile/index.js +1 -1
  11. package/lib/lockfile/index.js.map +1 -1
  12. package/lib/logging.d.ts +5 -0
  13. package/lib/logging.js +15 -0
  14. package/lib/logging.js.map +1 -0
  15. package/lib/paths.js +7 -1
  16. package/lib/paths.js.map +1 -1
  17. package/lib/types/WorkspaceInfo.d.ts +7 -0
  18. package/lib/workspaces/findWorkspacePath.d.ts +7 -0
  19. package/lib/workspaces/findWorkspacePath.js +9 -4
  20. package/lib/workspaces/findWorkspacePath.js.map +1 -1
  21. package/lib/workspaces/getWorkspacePackageInfo.d.ts +22 -2
  22. package/lib/workspaces/getWorkspacePackageInfo.js +43 -22
  23. package/lib/workspaces/getWorkspacePackageInfo.js.map +1 -1
  24. package/lib/workspaces/getWorkspaceRoot.d.ts +8 -1
  25. package/lib/workspaces/getWorkspaceRoot.js +9 -18
  26. package/lib/workspaces/getWorkspaceRoot.js.map +1 -1
  27. package/lib/workspaces/getWorkspaces.d.ts +16 -0
  28. package/lib/workspaces/getWorkspaces.js +25 -28
  29. package/lib/workspaces/getWorkspaces.js.map +1 -1
  30. package/lib/workspaces/implementations/getWorkspaceManagerAndRoot.d.ts +22 -0
  31. package/lib/workspaces/implementations/getWorkspaceManagerAndRoot.js +63 -0
  32. package/lib/workspaces/implementations/getWorkspaceManagerAndRoot.js.map +1 -0
  33. package/lib/workspaces/implementations/getWorkspaceUtilities.d.ts +18 -0
  34. package/lib/workspaces/implementations/getWorkspaceUtilities.js +26 -0
  35. package/lib/workspaces/implementations/getWorkspaceUtilities.js.map +1 -0
  36. package/lib/workspaces/implementations/index.d.ts +2 -14
  37. package/lib/workspaces/implementations/index.js +5 -55
  38. package/lib/workspaces/implementations/index.js.map +1 -1
  39. package/lib/workspaces/implementations/lerna.d.ts +6 -2
  40. package/lib/workspaces/implementations/lerna.js +17 -10
  41. package/lib/workspaces/implementations/lerna.js.map +1 -1
  42. package/lib/workspaces/implementations/npm.d.ts +10 -1
  43. package/lib/workspaces/implementations/npm.js +19 -8
  44. package/lib/workspaces/implementations/npm.js.map +1 -1
  45. package/lib/workspaces/implementations/packageJsonWorkspaces.d.ts +8 -1
  46. package/lib/workspaces/implementations/packageJsonWorkspaces.js +26 -24
  47. package/lib/workspaces/implementations/packageJsonWorkspaces.js.map +1 -1
  48. package/lib/workspaces/implementations/pnpm.d.ts +6 -0
  49. package/lib/workspaces/implementations/pnpm.js +16 -7
  50. package/lib/workspaces/implementations/pnpm.js.map +1 -1
  51. package/lib/workspaces/implementations/rush.d.ts +6 -0
  52. package/lib/workspaces/implementations/rush.js +16 -7
  53. package/lib/workspaces/implementations/rush.js.map +1 -1
  54. package/lib/workspaces/implementations/yarn.d.ts +11 -0
  55. package/lib/workspaces/implementations/yarn.js +20 -7
  56. package/lib/workspaces/implementations/yarn.js.map +1 -1
  57. package/lib/workspaces/workspaces.d.ts +11 -3
  58. package/lib/workspaces/workspaces.js +13 -5
  59. package/lib/workspaces/workspaces.js.map +1 -1
  60. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/pnpm.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,2DAAwD;AAExD,wEAAqE;AACrE,sDAAmD;AACnD,uCAAuC;AAMvC,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,MAAM,kBAAkB,GAAG,IAAA,gBAAQ,EAAC,qBAAqB,EAAE,GAAG,CAAC,CA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B,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACrD,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;QAEhF,MAAM,cAAc,GAAG,IAAA,mBAAQ,EAAC,kBAAkB,CAAsB,CAAC;QAEzE,MAAM,YAAY,GAAG,IAAA,iCAAe,EAAC,kBAAkB,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;QAClF,MAAM,aAAa,GAAG,IAAA,iDAAuB,EAAC,YAAY,CAAC,CAAC;QAE5D,OAAO,aAAa,CAAC;KACtB;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,qCAAqC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAfD,8CAeC;AAE6B,0CAAa"}
@@ -1,3 +1,9 @@
1
1
  import { WorkspaceInfo } from "../../types/WorkspaceInfo";
2
+ /** @deprecated Use getWorkspaceRoot */
2
3
  export declare function getRushWorkspaceRoot(cwd: string): string;
4
+ /**
5
+ * Get an array with names, paths, and package.json contents for each package in a rush workspace.
6
+ * (See `../getWorkspaces` for why it's named this way.)
7
+ */
3
8
  export declare function getRushWorkspaces(cwd: string): WorkspaceInfo;
9
+ export { getRushWorkspaces as getWorkspaces };
@@ -3,20 +3,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getRushWorkspaces = exports.getRushWorkspaceRoot = void 0;
6
+ exports.getWorkspaces = exports.getRushWorkspaces = exports.getRushWorkspaceRoot = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const jju_1 = __importDefault(require("jju"));
9
9
  const fs_1 = __importDefault(require("fs"));
10
10
  const getWorkspacePackageInfo_1 = require("../getWorkspacePackageInfo");
11
- const paths_1 = require("../../paths");
11
+ const logging_1 = require("../../logging");
12
+ const getWorkspaceManagerAndRoot_1 = require("./getWorkspaceManagerAndRoot");
13
+ /** @deprecated Use getWorkspaceRoot */
12
14
  function getRushWorkspaceRoot(cwd) {
13
- const rushJsonPath = (0, paths_1.searchUp)("rush.json", cwd);
14
- if (!rushJsonPath) {
15
- throw new Error("Could not find rush workspaces root");
15
+ var _a;
16
+ const root = (_a = (0, getWorkspaceManagerAndRoot_1.getWorkspaceManagerAndRoot)(cwd, undefined, "rush")) === null || _a === void 0 ? void 0 : _a.root;
17
+ if (!root) {
18
+ throw new Error("Could not find rush workspace root from " + cwd);
16
19
  }
17
- return path_1.default.dirname(rushJsonPath);
20
+ return root;
18
21
  }
19
22
  exports.getRushWorkspaceRoot = getRushWorkspaceRoot;
23
+ /**
24
+ * Get an array with names, paths, and package.json contents for each package in a rush workspace.
25
+ * (See `../getWorkspaces` for why it's named this way.)
26
+ */
20
27
  function getRushWorkspaces(cwd) {
21
28
  try {
22
29
  const rushWorkspaceRoot = getRushWorkspaceRoot(cwd);
@@ -25,9 +32,11 @@ function getRushWorkspaces(cwd) {
25
32
  const root = path_1.default.dirname(rushJsonPath);
26
33
  return (0, getWorkspacePackageInfo_1.getWorkspacePackageInfo)(rushConfig.projects.map((project) => path_1.default.join(root, project.projectFolder)));
27
34
  }
28
- catch {
35
+ catch (err) {
36
+ (0, logging_1.logVerboseWarning)(`Error getting rush workspaces for ${cwd}`, err);
29
37
  return [];
30
38
  }
31
39
  }
32
40
  exports.getRushWorkspaces = getRushWorkspaces;
41
+ exports.getWorkspaces = getRushWorkspaces;
33
42
  //# sourceMappingURL=rush.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rush.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/rush.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,8CAAsB;AACtB,4CAAoB;AAGpB,wEAAqE;AACrE,uCAAuC;AAEvC,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,MAAM,YAAY,GAAG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AAG,CAAC,CAAC;KACnE;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAND,oDAMC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,IAAI;QACF,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QAE/D,MAAM,UAAU,GAAmD,aAAG,CAAC,KAAK,CAC1E,YAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CACvC,CAAC;QACF,MAAM,IAAI,GAAG,cAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAExC,OAAO,IAAA,iDAAuB,EAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;KAC9G;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,qCAAqC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAfD,8CAeC;AAE6B,0CAAa"}
@@ -1,4 +1,15 @@
1
1
  import { WorkspaceInfo } from "../../types/WorkspaceInfo";
2
+ /** @deprecated Use `getWorkspaceRoot` */
2
3
  export declare function getYarnWorkspaceRoot(cwd: string): string;
4
+ /**
5
+ * Get an array with names, paths, and package.json contents for each package in a yarn workspace.
6
+ * (See `../getWorkspaces` for why it's named this way.)
7
+ */
3
8
  export declare function getYarnWorkspaces(cwd: string): WorkspaceInfo;
9
+ /**
10
+ * Get an array with names, paths, and package.json contents for each package in a yarn workspace.
11
+ * (See `../getWorkspaces` for why it's named this way.)
12
+ */
4
13
  export declare function getYarnWorkspacesAsync(cwd: string): Promise<WorkspaceInfo>;
14
+ export { getYarnWorkspaces as getWorkspaces };
15
+ export { getYarnWorkspacesAsync as getWorkspacesAsync };
@@ -1,23 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getYarnWorkspacesAsync = exports.getYarnWorkspaces = exports.getYarnWorkspaceRoot = void 0;
3
+ exports.getWorkspacesAsync = exports.getWorkspaces = exports.getYarnWorkspacesAsync = exports.getYarnWorkspaces = exports.getYarnWorkspaceRoot = void 0;
4
+ const _1 = require(".");
4
5
  const packageJsonWorkspaces_1 = require("./packageJsonWorkspaces");
6
+ /** @deprecated Use `getWorkspaceRoot` */
5
7
  function getYarnWorkspaceRoot(cwd) {
6
- const yarnWorkspacesRoot = (0, packageJsonWorkspaces_1.getPackageJsonWorkspaceRoot)(cwd);
7
- if (!yarnWorkspacesRoot) {
8
- throw new Error("Could not find yarn workspaces root");
8
+ var _a;
9
+ const root = (_a = (0, _1.getWorkspaceManagerAndRoot)(cwd, undefined, "yarn")) === null || _a === void 0 ? void 0 : _a.root;
10
+ if (!root) {
11
+ throw new Error("Could not find yarn workspace root from " + cwd);
9
12
  }
10
- return yarnWorkspacesRoot;
13
+ return root;
11
14
  }
12
15
  exports.getYarnWorkspaceRoot = getYarnWorkspaceRoot;
16
+ /**
17
+ * Get an array with names, paths, and package.json contents for each package in a yarn workspace.
18
+ * (See `../getWorkspaces` for why it's named this way.)
19
+ */
13
20
  function getYarnWorkspaces(cwd) {
14
21
  const yarnWorkspacesRoot = getYarnWorkspaceRoot(cwd);
15
22
  return (0, packageJsonWorkspaces_1.getWorkspaceInfoFromWorkspaceRoot)(yarnWorkspacesRoot);
16
23
  }
17
24
  exports.getYarnWorkspaces = getYarnWorkspaces;
18
- async function getYarnWorkspacesAsync(cwd) {
25
+ exports.getWorkspaces = getYarnWorkspaces;
26
+ /**
27
+ * Get an array with names, paths, and package.json contents for each package in a yarn workspace.
28
+ * (See `../getWorkspaces` for why it's named this way.)
29
+ */
30
+ function getYarnWorkspacesAsync(cwd) {
19
31
  const yarnWorkspacesRoot = getYarnWorkspaceRoot(cwd);
20
- return await (0, packageJsonWorkspaces_1.getWorkspaceInfoFromWorkspaceRootAsync)(yarnWorkspacesRoot);
32
+ return (0, packageJsonWorkspaces_1.getWorkspaceInfoFromWorkspaceRootAsync)(yarnWorkspacesRoot);
21
33
  }
22
34
  exports.getYarnWorkspacesAsync = getYarnWorkspacesAsync;
35
+ exports.getWorkspacesAsync = getYarnWorkspacesAsync;
23
36
  //# sourceMappingURL=yarn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/yarn.ts"],"names":[],"mappings":";;;AACA,mEAIiC;AAEjC,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,MAAM,kBAAkB,GAAG,IAAA,mDAA2B,EAAC,GAAG,CAAC,CAAC;IAE5D,IAAI,CAAC,kBAAkB,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AARD,oDAQC;AAED,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACrD,OAAO,IAAA,yDAAiC,EAAC,kBAAkB,CAAC,CAAC;AAC/D,CAAC;AAHD,8CAGC;AAEM,KAAK,UAAU,sBAAsB,CAAC,GAAW;IACtD,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACrD,OAAO,MAAM,IAAA,8DAAsC,EAAC,kBAAkB,CAAC,CAAC;AAC1E,CAAC;AAHD,wDAGC"}
1
+ {"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/yarn.ts"],"names":[],"mappings":";;;AAAA,wBAA+C;AAE/C,mEAAoH;AAEpH,yCAAyC;AACzC,SAAgB,oBAAoB,CAAC,GAAW;;IAC9C,MAAM,IAAI,GAAG,MAAA,IAAA,6BAA0B,EAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,0CAAE,IAAI,CAAC;IACtE,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,0CAA0C,GAAG,GAAG,CAAC,CAAC;KACnE;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAND,oDAMC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACrD,OAAO,IAAA,yDAAiC,EAAC,kBAAkB,CAAC,CAAC;AAC/D,CAAC;AAHD,8CAGC;AAW6B,0CAAa;AAT3C;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,GAAW;IAChD,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACrD,OAAO,IAAA,8DAAsC,EAAC,kBAAkB,CAAC,CAAC;AACpE,CAAC;AAHD,wDAGC;AAGkC,oDAAkB"}
@@ -1,7 +1,15 @@
1
1
  /**
2
- * Get paths to every package.json in the workspace, given a cwd
3
- * @param cwd
2
+ * Get paths to every package.json in the workspace, given a cwd.
3
+ *
4
+ * **WARNING**: On first call for a given `cwd`, this will **read ALL package.json files,
5
+ * not only their paths**!
4
6
  */
5
7
  export declare function getAllPackageJsonFiles(cwd: string): string[];
6
- export declare function _resetCache(): void;
8
+ export declare function _resetPackageJsonFilesCache(): void;
9
+ /**
10
+ * Get paths to every package.json in the workspace, given a cwd.
11
+ *
12
+ * **WARNING**: On first call for a given `cwd`, this will **read ALL package.json files,
13
+ * not only their paths**!
14
+ */
7
15
  export declare function getAllPackageJsonFilesAsync(cwd: string): Promise<string[]>;
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAllPackageJsonFilesAsync = exports._resetCache = exports.getAllPackageJsonFiles = void 0;
3
+ exports.getAllPackageJsonFilesAsync = exports._resetPackageJsonFilesCache = exports.getAllPackageJsonFiles = void 0;
4
4
  const getWorkspaces_1 = require("./getWorkspaces");
5
5
  const cache = new Map();
6
6
  /**
7
- * Get paths to every package.json in the workspace, given a cwd
8
- * @param cwd
7
+ * Get paths to every package.json in the workspace, given a cwd.
8
+ *
9
+ * **WARNING**: On first call for a given `cwd`, this will **read ALL package.json files,
10
+ * not only their paths**!
9
11
  */
10
12
  function getAllPackageJsonFiles(cwd) {
11
13
  if (cache.has(cwd)) {
@@ -17,10 +19,16 @@ function getAllPackageJsonFiles(cwd) {
17
19
  return packageJsonFiles;
18
20
  }
19
21
  exports.getAllPackageJsonFiles = getAllPackageJsonFiles;
20
- function _resetCache() {
22
+ function _resetPackageJsonFilesCache() {
21
23
  cache.clear();
22
24
  }
23
- exports._resetCache = _resetCache;
25
+ exports._resetPackageJsonFilesCache = _resetPackageJsonFilesCache;
26
+ /**
27
+ * Get paths to every package.json in the workspace, given a cwd.
28
+ *
29
+ * **WARNING**: On first call for a given `cwd`, this will **read ALL package.json files,
30
+ * not only their paths**!
31
+ */
24
32
  async function getAllPackageJsonFilesAsync(cwd) {
25
33
  if (cache.has(cwd)) {
26
34
  return cache.get(cwd);
@@ -1 +1 @@
1
- {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../src/workspaces/workspaces.ts"],"names":[],"mappings":";;;AAAA,mDAAoE;AAEpE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;AAE1C;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,GAAW;IAChD,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAClB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;KACxB;IAED,MAAM,UAAU,GAAG,IAAA,6BAAa,EAAC,GAAG,CAAC,CAAC;IACtC,MAAM,gBAAgB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAE9F,KAAK,CAAC,GAAG,CAAC,GA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