beachball 2.65.1 → 2.65.3

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 (63) hide show
  1. package/README.md +4 -0
  2. package/lib/bump/bumpInMemory.js +1 -1
  3. package/lib/bump/bumpInMemory.js.map +1 -1
  4. package/lib/bump/bumpMinSemverRange.d.ts +7 -4
  5. package/lib/bump/bumpMinSemverRange.d.ts.map +1 -1
  6. package/lib/bump/bumpMinSemverRange.js +13 -7
  7. package/lib/bump/bumpMinSemverRange.js.map +1 -1
  8. package/lib/bump/setDependentVersions.d.ts +5 -1
  9. package/lib/bump/setDependentVersions.d.ts.map +1 -1
  10. package/lib/bump/setDependentVersions.js +14 -8
  11. package/lib/bump/setDependentVersions.js.map +1 -1
  12. package/lib/changefile/getAllChangedPackages.d.ts +18 -0
  13. package/lib/changefile/getAllChangedPackages.d.ts.map +1 -0
  14. package/lib/changefile/getAllChangedPackages.js +78 -0
  15. package/lib/changefile/getAllChangedPackages.js.map +1 -0
  16. package/lib/changefile/getCatalogChangedPackages.d.ts +19 -0
  17. package/lib/changefile/getCatalogChangedPackages.d.ts.map +1 -0
  18. package/lib/changefile/getCatalogChangedPackages.js +84 -0
  19. package/lib/changefile/getCatalogChangedPackages.js.map +1 -0
  20. package/lib/changefile/getChangedPackages.d.ts +12 -14
  21. package/lib/changefile/getChangedPackages.d.ts.map +1 -1
  22. package/lib/changefile/getChangedPackages.js +56 -109
  23. package/lib/changefile/getChangedPackages.js.map +1 -1
  24. package/lib/changefile/isPackageIncluded.d.ts +18 -0
  25. package/lib/changefile/isPackageIncluded.d.ts.map +1 -0
  26. package/lib/changefile/isPackageIncluded.js +33 -0
  27. package/lib/changefile/isPackageIncluded.js.map +1 -0
  28. package/lib/changefile/writeChangeFiles.d.ts.map +1 -1
  29. package/lib/changefile/writeChangeFiles.js +6 -10
  30. package/lib/changefile/writeChangeFiles.js.map +1 -1
  31. package/lib/changelog/writeChangelog.js +2 -3
  32. package/lib/changelog/writeChangelog.js.map +1 -1
  33. package/lib/commands/canary.js +1 -1
  34. package/lib/commands/canary.js.map +1 -1
  35. package/lib/commands/configGet.js +3 -3
  36. package/lib/commands/configGet.js.map +1 -1
  37. package/lib/commands/configList.js +2 -2
  38. package/lib/commands/configList.js.map +1 -1
  39. package/lib/commands/sync.js +6 -2
  40. package/lib/commands/sync.js.map +1 -1
  41. package/lib/env.d.ts +2 -0
  42. package/lib/env.d.ts.map +1 -1
  43. package/lib/env.js +3 -0
  44. package/lib/env.js.map +1 -1
  45. package/lib/git/ensureSharedHistory.d.ts +8 -2
  46. package/lib/git/ensureSharedHistory.d.ts.map +1 -1
  47. package/lib/git/ensureSharedHistory.js +25 -21
  48. package/lib/git/ensureSharedHistory.js.map +1 -1
  49. package/lib/git/fetch.d.ts +13 -4
  50. package/lib/git/fetch.d.ts.map +1 -1
  51. package/lib/git/fetch.js +18 -8
  52. package/lib/git/fetch.js.map +1 -1
  53. package/lib/monorepo/diffCatalogs.d.ts +14 -0
  54. package/lib/monorepo/diffCatalogs.d.ts.map +1 -0
  55. package/lib/monorepo/diffCatalogs.js +47 -0
  56. package/lib/monorepo/diffCatalogs.js.map +1 -0
  57. package/lib/monorepo/filterIgnoredFiles.d.ts +1 -1
  58. package/lib/monorepo/filterIgnoredFiles.d.ts.map +1 -1
  59. package/lib/monorepo/filterIgnoredFiles.js +11 -5
  60. package/lib/monorepo/filterIgnoredFiles.js.map +1 -1
  61. package/lib/types/BeachballOptions.d.ts +1 -0
  62. package/lib/types/BeachballOptions.d.ts.map +1 -1
  63. package/package.json +3 -3
package/README.md CHANGED
@@ -110,6 +110,10 @@ beachball publish -r http://localhost:4873 -t beta
110
110
 
111
111
  In large monorepos, the process of fetching versions for sync or before publishing can be time-consuming due to the high number of packages. To optimize performance, you can override the concurrency for fetching from the registry by setting `options.npmReadConcurrency` (default: 5). You can also increase concurrency for hook calls and publish operations via `options.concurrency` (default: 1; respects topological order).
112
112
 
113
+ ### Optimizing for large monorepos
114
+
115
+ If you have a large to very large monorepo, there are several configuration options and strategies that can help improve Beachball's performance. For details, see the [large repos guide](https://microsoft.github.io/beachball/concepts/large-repos.html).
116
+
113
117
  ### API surface
114
118
 
115
119
  Beachball **does not** have a public API beyond the provided [options](https://microsoft.github.io/beachball/overview/configuration.html). Usage of private APIs is not supported and may break at any time.
@@ -59,7 +59,7 @@ function bumpInMemory(options, context) {
59
59
  (0, bumpPackageInfoVersion_1.bumpPackageInfoVersion)(pkgName, bumpInfo, options);
60
60
  }
61
61
  // step 5: Bump all the dependency version ranges and collect dependentChangedBy for the changelog.
62
- const dependentChangedBy = (0, setDependentVersions_1.setDependentVersions)(bumpInfo, options);
62
+ const dependentChangedBy = (0, setDependentVersions_1.setDependentVersions)({ bumpInfo, options });
63
63
  // For now, add any modifiedPackages not previously detected (due to bumpDeps: false or scopes).
64
64
  // TODO: Rethink all of this... https://github.com/microsoft/beachball/issues/1123
65
65
  Object.keys(dependentChangedBy).forEach(pkg => bumpInfo.modifiedPackages.add(pkg));
@@ -1 +1 @@
1
- {"version":3,"file":"bumpInMemory.js","sourceRoot":"","sources":["../../src/bump/bumpInMemory.ts"],"names":[],"mappings":";;;AAAA,2DAA2F;AAG3F,uDAAoD;AAGpD,yEAAsE;AACtE,uEAAoE;AACpE,qEAAkE;AAClE,iEAA8D;AAE9D;;;;GAIG;AACH,SAAgB,YAAY,CAAC,OAAyB,EAAE,OAAyC;IAC/F,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE7B,mFAAmF;IACnF,oDAAoD;IACpD,MAAM,qBAAqB,GAAG,IAAA,0CAA4B,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE9E,yGAAyG;IACzG,MAAM,QAAQ,GAAmE;QAC/E,qBAAqB;QACrB,YAAY,EAAE,IAAA,yBAAW,EAAC,OAAO,CAAC,oBAAoB,CAAC;QACvD,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,gBAAgB,EAAE,IAAI,GA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AG,CAAC,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAEnF,OAAO;QACL,GAAG,QAAQ;QACX,qBAAqB,EAAE,OAAO,CAAC,SAAS;QACxC,kBAAkB;KACnB,CAAC;AACJ,CAAC;AAlED,oCAkEC"}
@@ -1,13 +1,16 @@
1
1
  /**
2
2
  * Bump the semver range for a dependency to match the new version of a package.
3
- * @param newVersion The new version of the package
4
- * @param currentRange Current version range for the dependency.
5
- * @returns New semver range for the dependency
3
+ *
4
+ * @returns
5
+ * - If a bump is needed, string of the new dependency range
6
+ * - `true` for implicit bumps: if `currentRange` is any `catalog:` version or `workspace:[*~^]`),
7
+ * the range in package.json doesn't change now, but will be updated right before publishing
8
+ * - `undefined` if `newVersion` satisfies `currentRange`
6
9
  */
7
10
  export declare function bumpMinSemverRange(params: {
8
11
  /** The new version of the package */
9
12
  newVersion: string;
10
13
  /** Current semver range specified for the dependency */
11
14
  currentRange: string;
12
- }): string;
15
+ }): string | true | undefined;
13
16
  //# sourceMappingURL=bumpMinSemverRange.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bumpMinSemverRange.d.ts","sourceRoot":"","sources":["../../src/bump/bumpMinSemverRange.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CA+CT"}
1
+ {"version":3,"file":"bumpMinSemverRange.d.ts","sourceRoot":"","sources":["../../src/bump/bumpMinSemverRange.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAkD5B"}
@@ -9,14 +9,20 @@ const workspace_tools_1 = require("workspace-tools");
9
9
  const getWorkspaceRange_1 = require("../packageManager/getWorkspaceRange");
10
10
  /**
11
11
  * Bump the semver range for a dependency to match the new version of a package.
12
- * @param newVersion The new version of the package
13
- * @param currentRange Current version range for the dependency.
14
- * @returns New semver range for the dependency
12
+ *
13
+ * @returns
14
+ * - If a bump is needed, string of the new dependency range
15
+ * - `true` for implicit bumps: if `currentRange` is any `catalog:` version or `workspace:[*~^]`),
16
+ * the range in package.json doesn't change now, but will be updated right before publishing
17
+ * - `undefined` if `newVersion` satisfies `currentRange`
15
18
  */
16
19
  function bumpMinSemverRange(params) {
17
20
  const { newVersion, currentRange } = params;
18
- if (currentRange === '*' || currentRange.startsWith('file:') || (0, workspace_tools_1.isCatalogVersion)(currentRange)) {
19
- return currentRange;
21
+ if (currentRange === '*' || currentRange.startsWith('file:')) {
22
+ return undefined; // Don't modify wildcard or file: ranges
23
+ }
24
+ if ((0, workspace_tools_1.isCatalogVersion)(currentRange)) {
25
+ return true;
20
26
  }
21
27
  if (currentRange[0] === '~' || currentRange[0] === '^') {
22
28
  // ~1.0.0
@@ -27,7 +33,7 @@ function bumpMinSemverRange(params) {
27
33
  if (workspaceRange === '*' || workspaceRange === '~' || workspaceRange === '^') {
28
34
  // For basic workspace ranges we can just preserve current value and replace during publish
29
35
  // https://pnpm.io/workspaces#workspace-protocol-workspace
30
- return currentRange;
36
+ return true;
31
37
  }
32
38
  if (workspaceRange && (workspaceRange[0] === '~' || workspaceRange[0] === '^')) {
33
39
  // workspace:~1.0.0
@@ -50,7 +56,7 @@ function bumpMinSemverRange(params) {
50
56
  }
51
57
  // For unrecognized valid semver ranges: if the new version satisfies the current range, keep it
52
58
  if (semver_1.default.validRange(currentRange) && semver_1.default.satisfies(newVersion, currentRange)) {
53
- return currentRange;
59
+ return undefined;
54
60
  }
55
61
  // Fallback: return the exact new version
56
62
  return newVersion;
@@ -1 +1 @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AAE;QAC9E,2FAA2F;QAC3F,0DAA0D;QAC1D,OAAO,IAAI,CAAC;KACb;IACD,IAAI,cAAc,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE;QAC9E,mBAAmB;QACnB,mBAAmB;QACnB,OAAO,aAAa,cAAc,CAAC,CAAC,CAAC,GAAG,UAAU,EAAE,CAAC;KACtD;IAED,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC9B,qFAAqF;QACrF,8EAA8E;QAC9E,iBAAiB;QACjB,OAAO,KAAK,UAAU,KAAK,gBAAM,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC;KAC9D;IACD,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChC,gBAAgB;QAChB,OAAO,GAAG,UAAU,MAAM,gBAAM,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC;KAC7D;IAED,IAAI,gBAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QAC9B,kCAAkC;QAClC,OAAO,UAAU,CAAC;KACnB;IAED,gGAAgG;IAChG,IAAI,gBAAM,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,gBAAM,CAAC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE;QACjF,OAAO,SAAS,CAAC;KAClB;IAED,yCAAyC;IACzC,OAAO,UAAU,CAAC;AACpB,CAAC;AAvDD,gDAuDC"}
@@ -8,5 +8,9 @@ import type { BumpInfo } from '../types/BumpInfo';
8
8
  *
9
9
  * **This mutates dependency versions in `packageInfos`!**
10
10
  */
11
- export declare function setDependentVersions(bumpInfo: Pick<BumpInfo, 'packageInfos' | 'scopedPackages' | 'modifiedPackages'>, options: Pick<BeachballOptions, 'verbose'>): BumpInfo['dependentChangedBy'];
11
+ export declare function setDependentVersions(params: {
12
+ bumpInfo: Pick<BumpInfo, 'packageInfos' | 'scopedPackages' | 'modifiedPackages'>;
13
+ options: Pick<BeachballOptions, 'verbose'>;
14
+ skipImplicitBumps?: boolean;
15
+ }): BumpInfo['dependentChangedBy'];
12
16
  //# sourceMappingURL=setDependentVersions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setDependentVersions.d.ts","sourceRoot":"","sources":["../../src/bump/setDependentVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIlD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,EAChF,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GACzC,QAAQ,CAAC,oBAAoB,CAAC,CA6ChC"}
1
+ {"version":3,"file":"setDependentVersions.d.ts","sourceRoot":"","sources":["../../src/bump/setDependentVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIlD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,CAAC;IACjF,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAmDjC"}
@@ -11,7 +11,8 @@ const bumpMinSemverRange_1 = require("./bumpMinSemverRange");
11
11
  *
12
12
  * **This mutates dependency versions in `packageInfos`!**
13
13
  */
14
- function setDependentVersions(bumpInfo, options) {
14
+ function setDependentVersions(params) {
15
+ const { bumpInfo, options, skipImplicitBumps } = params;
15
16
  const { packageInfos, scopedPackages, modifiedPackages } = bumpInfo;
16
17
  const { verbose } = options;
17
18
  const dependentChangedBy = {};
@@ -27,20 +28,25 @@ function setDependentVersions(bumpInfo, options) {
27
28
  if (!depPackage || !modifiedPackages.has(dep)) {
28
29
  continue;
29
30
  }
30
- const bumpedVersionRange = (0, bumpMinSemverRange_1.bumpMinSemverRange)({
31
+ // Bump the range if relevant (see doc comment about the return value)
32
+ const newRange = (0, bumpMinSemverRange_1.bumpMinSemverRange)({
31
33
  newVersion: depPackage.version,
32
34
  currentRange: existingVersionRange,
33
35
  });
34
- // TODO: dependent bumps in workspace:*/^/~ and catalog: ranges will be missed https://github.com/microsoft/beachball/issues/981
35
- // And all this logic is questionable with bumpDeps: false or scopes... https://github.com/microsoft/beachball/issues/1123
36
+ // TODO: All this logic is questionable with bumpDeps: false or scopes... https://github.com/microsoft/beachball/issues/1123
36
37
  // see also https://github.com/microsoft/beachball/issues/620 and https://github.com/microsoft/beachball/issues/1033
37
- if (existingVersionRange !== bumpedVersionRange) {
38
- // Update the version range of the dependency if it changed due to bumps.
39
- deps[dep] = bumpedVersionRange;
38
+ const rangeChanged = typeof newRange === 'string';
39
+ if (rangeChanged) {
40
+ // Update the version range of the dependency if the literal range changed due to bumps.
41
+ deps[dep] = newRange;
42
+ }
43
+ if (rangeChanged || (newRange === true && !skipImplicitBumps)) {
40
44
  dependentChangedBy[pkgName] ?? (dependentChangedBy[pkgName] = new Set());
41
45
  dependentChangedBy[pkgName].add(dep);
42
46
  if (verbose) {
43
- console.log(`${pkgName} needs to be bumped because ${dep} ${existingVersionRange} -> ${bumpedVersionRange}`);
47
+ console.log(rangeChanged
48
+ ? `${pkgName} needs to be bumped because ${dep} ${existingVersionRange} -> ${newRange}`
49
+ : `${pkgName} needs a changelog entry because ${dep} was bumped to ${depPackage.version} (range ${existingVersionRange} unchanged)`);
44
50
  }
45
51
  }
46
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"setDependentVersions.js","sourceRoot":"","sources":["../../src/bump/setDependentVersions.ts"],"names":[],"mappings":";;;AAEA,sDAA8D;AAC9D,6DAA0D;AAE1D;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAClC,QAAgF,EAChF,OAA0C;IAE1C,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,GAAG,QAAQ,CAAC;IACpE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,MAAM,kBAAkB,GAAmC,EAAE,CAAC;IAE9D,KAAK,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QAC1D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YAChC,SAAS,CAAC,eAAe;SAC1B;QAED,KAAK,MAAM,OAAO,IAAI,oCAAsB,EAAE;YAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEjC,KAAK,MAAM,CAAC,GAAG,EAAE,oBAAoB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAC9D,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;gBACrC,qFAAqF;gBACrF,IAAI,CAAC,UAAU,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBAC7C,SAAS;iBACV;gBAED,MAAM,kBAAkB,GAAG,IAAA,uCAAkB,EAAC;oBAC5C,UAAU,EAAE,UAAU,CAAC,OAAO;oBAC9B,YAAY,EAAE,oBAAoB;iBACnC,CAAC,CAAC;gBACH,gIAAgI;gBAChI,0HAA0H;gBAC1H,oHAAoH;gBACpH,IAAI,oBAAoB,KAAK,kBAAkB,EAAE;oBAC/C,yEAAyE;oBACzE,IAAI,CAAC,GAAG,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,CAAC,GAAG,CAAC,CAAC;gBACrC,qFAAqF;gBACrF,IAAI,CAAC,UAAU,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;oBAC7C,SAAS;iBACV;gBAED,sEAAsE;gBACtE,MAAM,QAAQ,GAAG,IAAA,uCAAkB,EAAC;oBAClC,UAAU,EAAE,UAAU,CAAC,OAAO;oBAC9B,YAAY,EAAE,oBAAoB;iBACnC,CAAC,CAAC;gBAEH,4HAA4H;gBAC5H,oHAAoH;gBACpH,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC;gBAClD,IAAI,YAAY,EAAE;oBAChB,wFAAwF;oBACxF,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;iBACtB;gBACD,IAAI,YAAY,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,iBAAiB,CAAC,EAAE;oBAC7D,kBAAkB,CAAC,OAAO,MAA1B,kBAAkB,CAAC,OAAO,IAAM,IAAI,GAAG,EAAU,EAAC;oBAClD,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;oBAErC,IAAI,OAAO,EAAE;wBACX,OAAO,CAAC,GAAG,CACT,YAAY;4BACV,CAAC,CAAC,GAAG,OAAO,+BAA+B,GAAG,IAAI,oBAAoB,OAAO,QAAQ,EAAE;4BACvF,CAAC,CAAC,GAAG,OAAO,oCAAoC,GAAG,kBAAkB,UAAU,CAAC,OAAO,WAAW,oBAAoB,aAAa,CACtI,CAAC;qBACH;iBACF;aACF;SACF;KACF;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAvDD,oDAuDC"}
@@ -0,0 +1,18 @@
1
+ import type { BeachballOptions } from '../types/BeachballOptions';
2
+ import type { PackageInfos, ScopedPackages } from '../types/PackageInfo';
3
+ /**
4
+ * Gets all the changed package names, regardless of the change files.
5
+ *
6
+ * PRE: Assumes shared git history has already been fetched, probably by `getChangedPackages`.
7
+ */
8
+ export declare function getAllChangedPackages(params: {
9
+ options: Pick<BeachballOptions, 'path' | 'changeDir' | 'ignorePatterns' | 'verbose'>;
10
+ packageInfos: PackageInfos;
11
+ scopedPackages: ScopedPackages;
12
+ /**
13
+ * Paths of all committed and staged files in the current branch as returned by git,
14
+ * relative to `options.path` with forward slashes.
15
+ */
16
+ allChangedFiles: Set<string>;
17
+ }): string[];
18
+ //# sourceMappingURL=getAllChangedPackages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllChangedPackages.d.ts","sourceRoot":"","sources":["../../src/changefile/getAllChangedPackages.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAe,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,WAAW,GAAG,gBAAgB,GAAG,SAAS,CAAC,CAAC;IACrF,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;IAC/B;;;OAGG;IACH,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC9B,GAAG,MAAM,EAAE,CAwDX"}
@@ -0,0 +1,78 @@
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.getAllChangedPackages = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const filterIgnoredFiles_1 = require("../monorepo/filterIgnoredFiles");
9
+ const isPackageIncluded_1 = require("./isPackageIncluded");
10
+ const count = (n, str) => `${n} ${str}${n === 1 ? '' : 's'}`;
11
+ /**
12
+ * Gets all the changed package names, regardless of the change files.
13
+ *
14
+ * PRE: Assumes shared git history has already been fetched, probably by `getChangedPackages`.
15
+ */
16
+ function getAllChangedPackages(params) {
17
+ const { options, packageInfos, scopedPackages, allChangedFiles } = params;
18
+ const { path: cwd, changeDir } = options;
19
+ const { verboseLog, logIgnored, logIncluded } = (0, isPackageIncluded_1.getIncludedLoggers)(options);
20
+ if (!allChangedFiles.size) {
21
+ verboseLog('Found no changed files in current branch');
22
+ return [];
23
+ }
24
+ verboseLog(`Found ${count(allChangedFiles.size, 'changed file')} in current branch (before filtering)`);
25
+ // Filter out changed files which are ignored by ignorePatterns.
26
+ // Also ignore the CHANGELOG files and change files because they're generated by beachball.
27
+ const nonIgnoredChanges = (0, filterIgnoredFiles_1.filterIgnoredFiles)({
28
+ filePaths: allChangedFiles,
29
+ ignorePatterns: [...(options.ignorePatterns || []), `${changeDir}/*.json`, 'CHANGELOG.{md,json}'],
30
+ logIgnored,
31
+ });
32
+ if (!nonIgnoredChanges.length) {
33
+ verboseLog('All files were ignored');
34
+ return [];
35
+ }
36
+ // Determine which package each changed file came from (using packageInfos[x].packageJsonPath),
37
+ // and whether that package is in scope and not private
38
+ const includedPackages = new Set();
39
+ let fileCount = 0;
40
+ const packageInfosByPath = {};
41
+ for (const info of Object.values(packageInfos)) {
42
+ packageInfosByPath[path_1.default.normalize(path_1.default.dirname(info.packageJsonPath))] = info;
43
+ }
44
+ for (const moddedFile of nonIgnoredChanges) {
45
+ const packageInfo = getMatchingPackageInfo(moddedFile, cwd, packageInfosByPath);
46
+ if (!packageInfo) {
47
+ logIgnored(moddedFile, 'not in a package');
48
+ continue;
49
+ }
50
+ const { isIncluded, reason } = (0, isPackageIncluded_1.isPackageIncluded)(packageInfo, scopedPackages);
51
+ if (!isIncluded) {
52
+ logIgnored(moddedFile, reason);
53
+ }
54
+ else {
55
+ includedPackages.add(packageInfo.name);
56
+ fileCount++;
57
+ logIncluded(moddedFile);
58
+ }
59
+ }
60
+ verboseLog(`Found ${count(fileCount, 'file')} in ${count(includedPackages.size, 'package')} that should be published`);
61
+ return [...includedPackages];
62
+ }
63
+ exports.getAllChangedPackages = getAllChangedPackages;
64
+ function getMatchingPackageInfo(file, cwd, packageInfosByPath) {
65
+ // Normalize all the paths before comparing (the packageInfosByPath entries should also be normalized)
66
+ // to ensure that this doesn't break on Windows if any input paths have forward slashes
67
+ cwd = path_1.default.normalize(cwd);
68
+ const absFile = path_1.default.normalize(path_1.default.join(cwd, file));
69
+ let absDir = '';
70
+ do {
71
+ absDir = path_1.default.dirname(absDir || absFile);
72
+ if (packageInfosByPath[absDir]) {
73
+ return packageInfosByPath[absDir];
74
+ }
75
+ } while (absDir !== cwd);
76
+ return undefined;
77
+ }
78
+ //# sourceMappingURL=getAllChangedPackages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllChangedPackages.js","sourceRoot":"","sources":["../../src/changefile/getAllChangedPackages.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,uEAAoE;AAGpE,2DAA4E;AAE5E,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAE7E;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,MASrC;IACC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAC1E,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACzC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAA,sCAAkB,EAAC,OAAO,CAAC,CAAC;IAE5E,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;QACzB,UAAU,CAAC,0CAA0C,CAAC,CAAC;QACvD,OAAO,EAAE,CAAC;KACX;IAED,UAAU,CAAC,SAAS,KAAK,CAAC,eAAe,CAAC,IAAI,EA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;YACvC,SAAS,EAAE,CAAC;YACZ,WAAW,CAAC,UAAU,CAAC,CAAC;SACzB;KACF;IAED,UAAU,CACR,SAAS,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC,2BAA2B,CAC3G,CAAC;IAEF,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC/B,CAAC;AAjED,sDAiEC;AAED,SAAS,sBAAsB,CAC7B,IAAY,EACZ,GAAW,EACX,kBAAuE;IAEvE,sGAAsG;IACtG,uFAAuF;IACvF,GAAG,GAAG,cAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,OAAO,GAAG,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IACrD,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,GAAG;QACD,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC;QACzC,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;YAC9B,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;SACnC;KACF,QAAQ,MAAM,KAAK,GAAG,EAAE;IAEzB,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { BeachballOptions } from '../types/BeachballOptions';
2
+ import { type PackageInfos, type ScopedPackages } from '../types/PackageInfo';
3
+ /**
4
+ * Get the packages that were changed due to catalog version modifications.
5
+ *
6
+ * PRE: Assumes shared git history has already been fetched, probably by `getChangedPackages`.
7
+ */
8
+ export declare function getCatalogChangedPackages(params: {
9
+ packageInfos: PackageInfos;
10
+ scopedPackages: ScopedPackages;
11
+ options: Pick<BeachballOptions, 'branch' | 'path' | 'verbose'>;
12
+ /**
13
+ * All changed file paths in the current branch, relative to `options.path` with forward slashes.
14
+ * This is only used to determine if the file which might have catalog info has changed (to avoid
15
+ * reading it from git history in the most common case where it hasn't changed).
16
+ */
17
+ allChangedFiles: Set<string>;
18
+ }): string[];
19
+ //# sourceMappingURL=getCatalogChangedPackages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCatalogChangedPackages.d.ts","sourceRoot":"","sources":["../../src/changefile/getCatalogChangedPackages.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,KAAK,YAAY,EAA0B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtG;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/D;;;;OAIG;IACH,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC9B,GAAG,MAAM,EAAE,CA+EX"}
@@ -0,0 +1,84 @@
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.getCatalogChangedPackages = void 0;
7
+ const workspace_tools_1 = require("workspace-tools");
8
+ const PackageInfo_1 = require("../types/PackageInfo");
9
+ const isPackageIncluded_1 = require("./isPackageIncluded");
10
+ const diffCatalogs_1 = require("../monorepo/diffCatalogs");
11
+ const path_1 = __importDefault(require("path"));
12
+ /**
13
+ * Get the packages that were changed due to catalog version modifications.
14
+ *
15
+ * PRE: Assumes shared git history has already been fetched, probably by `getChangedPackages`.
16
+ */
17
+ function getCatalogChangedPackages(params) {
18
+ const { options, packageInfos, scopedPackages, allChangedFiles } = params;
19
+ const { branch, path: cwd } = options;
20
+ const { verboseLog, logIncluded } = (0, isPackageIncluded_1.getIncludedLoggers)(options);
21
+ const currentCatalogs = (0, workspace_tools_1.getCatalogs)(cwd);
22
+ const catalogFilePath = currentCatalogs && (0, workspace_tools_1.getCatalogFilePath)(cwd);
23
+ // If there are catalogs, convert the file path to relative with forward slashes for comparison
24
+ // with git output. (Do the slash conversion to be safe, but realistically this should be either
25
+ // .yarnrc.yml, package.json, or pnpm-workspace.yaml directly under cwd.)
26
+ const relCatalogFilePath = catalogFilePath && path_1.default.relative(cwd, catalogFilePath.filePath).replace(/\\/g, '/');
27
+ // If the repo doesn't define catalogs or the catalog file hasn't changed, return early
28
+ // (skip the git operation to read the file from history, since this can be expensive in
29
+ // very large repos, and the change command is run frequently by developers)
30
+ if (!relCatalogFilePath || !currentCatalogs || !allChangedFiles.has(relCatalogFilePath)) {
31
+ return [];
32
+ }
33
+ verboseLog('Checking for changes to catalog: dependencies...');
34
+ // Get the old catalog file content from the branch we're comparing against
35
+ const oldCatalogFileContent = (0, workspace_tools_1.getFileFromRef)({ ref: branch, filePath: relCatalogFilePath, cwd });
36
+ const oldCatalogs = oldCatalogFileContent
37
+ ? (0, workspace_tools_1.parseCatalogContent)(oldCatalogFileContent, catalogFilePath.manager)
38
+ : undefined;
39
+ // Calculate the diff before going into packages, so we only check everything in the less-common
40
+ // case that a catalog version has changed
41
+ const catalogsDiff = oldCatalogs ? (0, diffCatalogs_1.diffCatalogs)({ before: oldCatalogs, after: currentCatalogs }) : currentCatalogs;
42
+ if (!catalogsDiff) {
43
+ verboseLog('No catalog: changes found');
44
+ return [];
45
+ }
46
+ const changedPackages = [];
47
+ const changedCatalogDepNames = [
48
+ Object.keys(catalogsDiff.default || {}),
49
+ Object.values(catalogsDiff.named || {}).map(catalog => Object.keys(catalog)),
50
+ ].flat(2);
51
+ for (const pkg of Object.values(packageInfos)) {
52
+ // Skip logging exclude reasons for catalog references
53
+ if (!(0, isPackageIncluded_1.isPackageIncluded)(pkg, scopedPackages).isIncluded)
54
+ continue;
55
+ const changedDeps = [];
56
+ for (const depType of PackageInfo_1.consideredDependencies) {
57
+ const deps = pkg[depType];
58
+ if (!deps)
59
+ continue;
60
+ for (const [name, version] of Object.entries(deps)) {
61
+ // If this dep name might be one of the changed catalog dependencies, check if the version
62
+ // specified in this package can be resolved from the catalog diff. If so, it's a change.
63
+ // (it's possible some package could specify a non-catalog version of the same dep)
64
+ if (changedCatalogDepNames.includes(name) &&
65
+ (0, workspace_tools_1.getCatalogVersion)({ name, version, catalogs: catalogsDiff, allowNotFound: true })) {
66
+ changedDeps.push(name);
67
+ }
68
+ }
69
+ }
70
+ if (changedDeps.length) {
71
+ if (!changedPackages.length) {
72
+ verboseLog('catalog: dependencies referenced by the following packages have changed:');
73
+ }
74
+ changedPackages.push(pkg.name);
75
+ logIncluded(`${pkg.name}: ${changedDeps.join(', ')}`);
76
+ }
77
+ }
78
+ if (!changedPackages.length) {
79
+ verboseLog('No changes found to catalog: dependencies of in-scope published packages');
80
+ }
81
+ return changedPackages;
82
+ }
83
+ exports.getCatalogChangedPackages = getCatalogChangedPackages;
84
+ //# sourceMappingURL=getCatalogChangedPackages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCatalogChangedPackages.js","sourceRoot":"","sources":["../../src/changefile/getCatalogChangedPackages.ts"],"names":[],"mappings":";;;;;;AAAA,qDAMyB;AAEzB,sDAAsG;AACtG,2DAA4E;AAC5E,2DAAwD;AACxD,gDAAwB;AAExB;;;;GAIG;AACH,SAAgB,yBAAyB,CAAC,MAUzC;IACC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAC1E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IACtC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAA,sCAAkB,EAAC,OAAO,CAAC,CAAC;IAEhE,MAAM,eAAe,GAAG,IAAA,6BAAW,EAAC,GAAG,CAAC,CAAC;IACzC,MAAM,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,CAAC;KACxF;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAzFD,8DAyFC"}
@@ -1,21 +1,19 @@
1
1
  import type { BeachballOptions } from '../types/BeachballOptions';
2
- import type { PackageInfos, PackageInfo, ScopedPackages } from '../types/PackageInfo';
2
+ import type { PackageInfos, ScopedPackages } from '../types/PackageInfo';
3
3
  /**
4
- * Determines whether the package is included in the list of potentially-changed published packages,
5
- * based on private flags and scopedPackages.
4
+ * Gets all the changed packages which **do not already have a change file** and are in scope.
5
+ * This includes all packages which should change due to catalog version changes.
6
+ * This is only used by the `change` and `check` commands, not the bump/publish process.
6
7
  *
7
- * (All the reasons except nonexistent include the package name.)
8
- */
9
- export declare function isPackageIncluded(packageInfo: PackageInfo | undefined, scopedPackages: ScopedPackages): {
10
- isIncluded: boolean;
11
- reason: string;
12
- };
13
- /**
14
- * Gets all the changed packages which do not already have a change file and are in scope.
15
- * Exceptions:
8
+ * Special cases:
16
9
  * - If `options.package` is provided, use that as-is (skipping all git operations).
17
- * - If `options.all` is true, returns all the packages in scope (skipping all git operations),
18
- * regardless of whether they've changed.
10
+ * - If `options.all` is true, gets all the packages in scope regardless of whether they've changed
11
+ * (skipping git diff of files), omitting packages that already have change files.
12
+ *
13
+ * Usually (without `options.package`) this has the side effect of calling `ensureSharedHistory` to
14
+ * verify that enough git history is available to check for changes between `HEAD` and
15
+ * `options.branch` (only an issue for shallow clones), and deepens the history if needed.
16
+ * Unless `options.fetch` is `false`, it will also fetch from the remote.
19
17
  */
20
18
  export declare function getChangedPackages(options: BeachballOptions, packageInfos: PackageInfos, scopedPackages: ScopedPackages): string[];
21
19
  //# sourceMappingURL=getChangedPackages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getChangedPackages.d.ts","sourceRoot":"","sources":["../../src/changefile/getChangedPackages.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA6BtF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,cAAc,EAAE,cAAc,GAC7B;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAazC;AAkFD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,GAC7B,MAAM,EAAE,CAsDV"}
1
+ {"version":3,"file":"getChangedPackages.d.ts","sourceRoot":"","sources":["../../src/changefile/getChangedPackages.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQzE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,GAC7B,MAAM,EAAE,CAgGV"}