beachball 2.51.1 → 2.52.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.
- package/lib/bump/bumpInPlace.js +2 -2
- package/lib/bump/bumpInPlace.js.map +1 -1
- package/lib/bump/gatherBumpInfo.d.ts.map +1 -1
- package/lib/bump/gatherBumpInfo.js +1 -7
- package/lib/bump/gatherBumpInfo.js.map +1 -1
- package/lib/bump/updateRelatedChangeType.d.ts +19 -13
- package/lib/bump/updateRelatedChangeType.d.ts.map +1 -1
- package/lib/bump/updateRelatedChangeType.js +62 -57
- package/lib/bump/updateRelatedChangeType.js.map +1 -1
- package/lib/changefile/changeTypes.d.ts +6 -8
- package/lib/changefile/changeTypes.d.ts.map +1 -1
- package/lib/changefile/changeTypes.js +13 -12
- package/lib/changefile/changeTypes.js.map +1 -1
- package/lib/types/BeachballOptions.d.ts +6 -1
- package/lib/types/BeachballOptions.d.ts.map +1 -1
- package/lib/types/BumpInfo.d.ts +10 -2
- package/lib/types/BumpInfo.d.ts.map +1 -1
- package/lib/types/ChangeInfo.d.ts +7 -3
- package/lib/types/ChangeInfo.d.ts.map +1 -1
- package/lib/validation/isValidDependentChangeType.d.ts +4 -0
- package/lib/validation/isValidDependentChangeType.d.ts.map +1 -1
- package/lib/validation/isValidDependentChangeType.js +10 -3
- package/lib/validation/isValidDependentChangeType.js.map +1 -1
- package/package.json +1 -1
package/lib/bump/bumpInPlace.js
CHANGED
|
@@ -28,8 +28,8 @@ function bumpInPlace(bumpInfo, options) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
// Calculate change types for packages and dependencies
|
|
31
|
-
for (const {
|
|
32
|
-
(0, updateRelatedChangeType_1.updateRelatedChangeType)({
|
|
31
|
+
for (const { change } of changeFileChangeInfos) {
|
|
32
|
+
(0, updateRelatedChangeType_1.updateRelatedChangeType)({ change, bumpInfo, dependents, bumpDeps });
|
|
33
33
|
}
|
|
34
34
|
// pass 3: actually bump the packages in the bumpInfo in memory (no disk writes at this point)
|
|
35
35
|
Object.keys(calculatedChangeTypes).forEach(pkgName => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bumpInPlace.js","sourceRoot":"","sources":["../../src/bump/bumpInPlace.ts"],"names":[],"mappings":";;;AACA,yEAAsE;AACtE,uEAAoE;AACpE,qEAAkE;AAElE,iEAA8D;AAE9D;;;;GAIG;AACH,SAAgB,WAAW,CAAC,QAAkB,EAAE,OAAyB;IACvE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,GAAG,QAAQ,CAAC;IAEpF,0HAA0H;IAC1H,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAA,mDAAwB,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEtE,0GAA0G;IAC1G,sFAAsF;IACtF,kFAAkF;IAElF,4DAA4D;IAC5D,KAAK,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,qBAAqB,EAAE;QAC1D,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;QAE/G,IAAI,KAAK,EAAE;YACT,KAAK,MAAM,kBAAkB,IAAI,KAAK,CAAC,YAAY,EAAE;gBACnD,qBAAqB,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC;aAC7D;SACF;KACF;IAED,uDAAuD;IACvD,KAAK,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"bumpInPlace.js","sourceRoot":"","sources":["../../src/bump/bumpInPlace.ts"],"names":[],"mappings":";;;AACA,yEAAsE;AACtE,uEAAoE;AACpE,qEAAkE;AAElE,iEAA8D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EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACrF,CAAC;AAnCD,kCAmCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatherBumpInfo.d.ts","sourceRoot":"","sources":["../../src/bump/gatherBumpInfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"gatherBumpInfo.d.ts","sourceRoot":"","sources":["../../src/bump/gatherBumpInfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,GAAG,QAAQ,CAmB9F"}
|
|
@@ -10,15 +10,9 @@ const getPackageGroups_1 = require("../monorepo/getPackageGroups");
|
|
|
10
10
|
* Gather bump info and bump versions in memory.
|
|
11
11
|
*/
|
|
12
12
|
function gatherBumpInfo(options, packageInfos) {
|
|
13
|
-
// Collate the changes per package
|
|
14
13
|
const changes = (0, readChangeFiles_1.readChangeFiles)(options, packageInfos);
|
|
15
|
-
//
|
|
14
|
+
// Determine base change types for each package (not considering disallowedChangeTypes or groups)
|
|
16
15
|
const calculatedChangeTypes = (0, changeTypes_1.initializePackageChangeTypes)(changes);
|
|
17
|
-
Object.keys(calculatedChangeTypes).forEach(packageName => {
|
|
18
|
-
if (!packageInfos[packageName]) {
|
|
19
|
-
delete calculatedChangeTypes[packageName];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
16
|
const bumpInfo = {
|
|
23
17
|
calculatedChangeTypes,
|
|
24
18
|
packageInfos,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatherBumpInfo.js","sourceRoot":"","sources":["../../src/bump/gatherBumpInfo.ts"],"names":[],"mappings":";;;AAAA,2DAAyE;AACzE,mEAAgE;AAEhE,+CAA4C;AAE5C,qEAAkE;AAElE,mEAAgE;AAEhE;;GAEG;AACH,SAAgB,cAAc,CAAC,OAAyB,EAAE,YAA0B;IAClF,
|
|
1
|
+
{"version":3,"file":"gatherBumpInfo.js","sourceRoot":"","sources":["../../src/bump/gatherBumpInfo.ts"],"names":[],"mappings":";;;AAAA,2DAAyE;AACzE,mEAAgE;AAEhE,+CAA4C;AAE5C,qEAAkE;AAElE,mEAAgE;AAEhE;;GAEG;AACH,SAAgB,cAAc,CAAC,OAAyB,EAAE,YAA0B;IAClF,MAAM,OAAO,GAAG,IAAA,iCAAe,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAEvD,iGAAiG;IACjG,MAAM,qBAAqB,GAAG,IAAA,0CAA4B,EAAC,OAAO,CAAC,CAAC;IAEpE,MAAM,QAAQ,GAAa;QACzB,qBAAqB;QACrB,YAAY;QACZ,aAAa,EAAE,IAAA,mCAAgB,EAAC,YAAY,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;QAC3E,qBAAqB,EAAE,OAAO;QAC9B,gBAAgB,EAAE,IAAI,GAAG,EAAU;QACnC,cAAc,EAAE,IAAI,GAAG,CAAC,IAAA,qCAAiB,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACjE,kBAAkB,EAAE,EAAE;KACvB,CAAC;IAEF,IAAA,yBAAW,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE/B,OAAO,QAAQ,CAAC;AAClB,CAAC;AAnBD,wCAmBC"}
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import type { BumpInfo, PackageDependents } from '../types/BumpInfo';
|
|
2
|
+
import { ChangeFileInfo } from '../types/ChangeInfo';
|
|
2
3
|
/**
|
|
3
|
-
* This is the core of the bumpInfo dependency bumping logic - done once per change
|
|
4
|
+
* This is the core of the `bumpInfo` dependency bumping logic - done once per change info.
|
|
4
5
|
*
|
|
5
|
-
* The algorithm is an iterative graph traversal algorithm (breadth first)
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
6
|
+
* The algorithm is an iterative graph traversal algorithm (breadth first):
|
|
7
|
+
* - One root entry: `change.packageName`
|
|
8
|
+
* - For each parent in `dependents`:
|
|
9
|
+
* - Update its `calculatedChangeTypes` entry to `max(current value, change.dependentChangeType)`
|
|
10
|
+
* - Enqueue all of its dependents to be seen
|
|
11
|
+
* - If the package is part of a group, enqueue all packages in the group
|
|
12
|
+
*
|
|
13
|
+
* Preconditions:
|
|
14
|
+
* - `bumpInfo.calculatedChangeTypes` includes:
|
|
15
|
+
* - For non-grouped packages that have changed, the highest change type from any change file
|
|
16
|
+
* - For each grouped package where anything in the group has changed, the highest change type
|
|
17
|
+
* from any change file in the group
|
|
12
18
|
*
|
|
13
19
|
* What it mutates:
|
|
14
|
-
* - bumpInfo.calculatedChangeTypes
|
|
15
|
-
* - all dependents change types as part of a group update
|
|
20
|
+
* - `bumpInfo.calculatedChangeTypes`: updates dependents' change types
|
|
21
|
+
* - all dependents' change types as part of a group update
|
|
16
22
|
*
|
|
17
23
|
* What it does not do:
|
|
18
|
-
* - bumpInfo.calculatedChangeTypes
|
|
24
|
+
* - `bumpInfo.calculatedChangeTypes`: will not mutate the `change.packageName` change type
|
|
19
25
|
*/
|
|
20
26
|
export declare function updateRelatedChangeType(params: {
|
|
21
|
-
|
|
22
|
-
bumpInfo: Pick<BumpInfo, 'calculatedChangeTypes' | '
|
|
27
|
+
change: ChangeFileInfo;
|
|
28
|
+
bumpInfo: Pick<BumpInfo, 'calculatedChangeTypes' | 'packageGroups' | 'packageInfos'>;
|
|
23
29
|
dependents: PackageDependents;
|
|
24
30
|
bumpDeps: boolean;
|
|
25
31
|
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateRelatedChangeType.d.ts","sourceRoot":"","sources":["../../src/bump/updateRelatedChangeType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"updateRelatedChangeType.d.ts","sourceRoot":"","sources":["../../src/bump/updateRelatedChangeType.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE;IAC9C,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,uBAAuB,GAAG,eAAe,GAAG,cAAc,CAAC,CAAC;IACrF,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAsEP"}
|
|
@@ -3,73 +3,78 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateRelatedChangeType = void 0;
|
|
4
4
|
const changeTypes_1 = require("../changefile/changeTypes");
|
|
5
5
|
/**
|
|
6
|
-
* This is the core of the bumpInfo dependency bumping logic - done once per change
|
|
6
|
+
* This is the core of the `bumpInfo` dependency bumping logic - done once per change info.
|
|
7
7
|
*
|
|
8
|
-
* The algorithm is an iterative graph traversal algorithm (breadth first)
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
*
|
|
8
|
+
* The algorithm is an iterative graph traversal algorithm (breadth first):
|
|
9
|
+
* - One root entry: `change.packageName`
|
|
10
|
+
* - For each parent in `dependents`:
|
|
11
|
+
* - Update its `calculatedChangeTypes` entry to `max(current value, change.dependentChangeType)`
|
|
12
|
+
* - Enqueue all of its dependents to be seen
|
|
13
|
+
* - If the package is part of a group, enqueue all packages in the group
|
|
14
|
+
*
|
|
15
|
+
* Preconditions:
|
|
16
|
+
* - `bumpInfo.calculatedChangeTypes` includes:
|
|
17
|
+
* - For non-grouped packages that have changed, the highest change type from any change file
|
|
18
|
+
* - For each grouped package where anything in the group has changed, the highest change type
|
|
19
|
+
* from any change file in the group
|
|
15
20
|
*
|
|
16
21
|
* What it mutates:
|
|
17
|
-
* - bumpInfo.calculatedChangeTypes
|
|
18
|
-
* - all dependents change types as part of a group update
|
|
22
|
+
* - `bumpInfo.calculatedChangeTypes`: updates dependents' change types
|
|
23
|
+
* - all dependents' change types as part of a group update
|
|
19
24
|
*
|
|
20
25
|
* What it does not do:
|
|
21
|
-
* - bumpInfo.calculatedChangeTypes
|
|
26
|
+
* - `bumpInfo.calculatedChangeTypes`: will not mutate the `change.packageName` change type
|
|
22
27
|
*/
|
|
23
28
|
function updateRelatedChangeType(params) {
|
|
24
|
-
const {
|
|
25
|
-
const { calculatedChangeTypes,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// Step 1. Update change type of the subjectPackage according to the dependent change type propagation
|
|
47
|
-
const packageInfo = packageInfos[subjectPackage];
|
|
48
|
-
if (!packageInfo) {
|
|
29
|
+
const { change, bumpInfo, dependents, bumpDeps } = params;
|
|
30
|
+
const { calculatedChangeTypes, packageGroups, packageInfos } = bumpInfo;
|
|
31
|
+
// If dependentChangeType is none (or somehow unset), there's nothing to do.
|
|
32
|
+
const updatedChangeType = (0, changeTypes_1.getMaxChangeType)(change.dependentChangeType);
|
|
33
|
+
if (updatedChangeType === 'none') {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const entryPointPackageName = change.packageName;
|
|
37
|
+
// Enqueue the first package.
|
|
38
|
+
// This part of the bump algorithm is a performance bottleneck, so it's important to bail early
|
|
39
|
+
// whenever possible, and to use `seen` to reduce queue insertion.
|
|
40
|
+
// https://github.com/microsoft/beachball/pull/1042
|
|
41
|
+
const queue = [{ subjectPackage: entryPointPackageName, changeType: changeTypes_1.MinChangeType }];
|
|
42
|
+
const seen = new Set();
|
|
43
|
+
while (queue.length > 0) {
|
|
44
|
+
const { subjectPackage, changeType } = queue.shift();
|
|
45
|
+
// Step 1. Update change type of the subjectPackage according to dependentChangeType if needed.
|
|
46
|
+
if (subjectPackage !== entryPointPackageName) {
|
|
47
|
+
const oldType = calculatedChangeTypes[subjectPackage];
|
|
48
|
+
calculatedChangeTypes[subjectPackage] = (0, changeTypes_1.getMaxChangeType)(oldType, changeType, packageInfos[subjectPackage]?.combinedOptions?.disallowedChangeTypes);
|
|
49
|
+
if (calculatedChangeTypes[subjectPackage] === oldType) {
|
|
50
|
+
// We didn't change this type, so keep going.
|
|
49
51
|
continue;
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
}
|
|
54
|
+
// Step 2. For all dependent packages of the current subjectPackage, place in queue to be updated at least to the "updatedChangeType"
|
|
55
|
+
const dependentPackages = dependents[subjectPackage];
|
|
56
|
+
if (bumpDeps && dependentPackages?.length) {
|
|
57
|
+
for (const dependentPackage of dependentPackages) {
|
|
58
|
+
if (seen.has(dependentPackage)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
seen.add(dependentPackage);
|
|
62
|
+
queue.push({ subjectPackage: dependentPackage, changeType: updatedChangeType });
|
|
59
63
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
}
|
|
65
|
+
// TODO: when we do "locked", or "lock step" versioning, we could simply skip this grouped traversal,
|
|
66
|
+
// - set the version for all packages in the group in bumpPackageInfoVersion()
|
|
67
|
+
// - the main concern is how to capture the bump reason in grouped changelog
|
|
68
|
+
// Step 3. For group-linked packages, update the change type to the max(change file info's change type, propagated update change type)
|
|
69
|
+
const group = Object.values(packageGroups).find(g => g.packageNames.includes(subjectPackage));
|
|
70
|
+
if (group && !group.disallowedChangeTypes?.includes(updatedChangeType)) {
|
|
71
|
+
for (const packageNameInGroup of group.packageNames) {
|
|
72
|
+
if (!seen.has(packageNameInGroup)) {
|
|
73
|
+
seen.add(packageNameInGroup);
|
|
74
|
+
queue.push({
|
|
75
|
+
subjectPackage: packageNameInGroup,
|
|
76
|
+
changeType: updatedChangeType,
|
|
77
|
+
});
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateRelatedChangeType.js","sourceRoot":"","sources":["../../src/bump/updateRelatedChangeType.ts"],"names":[],"mappings":";;;AAAA,2DAA4E;
|
|
1
|
+
{"version":3,"file":"updateRelatedChangeType.js","sourceRoot":"","sources":["../../src/bump/updateRelatedChange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QAErD,IAAI,QAAQ,IAAI,iBAAiB,EAAE,MAAM,EAAE;YACzC,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE;gBAChD,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;oBAC9B,SAAS;iBACV;gBAED,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;gBAC3B,KAAK,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC;aACjF;SACF;QAED,qGAAqG;QACrG,oFAAoF;QACpF,kFAAkF;QAElF,sIAAsI;QACtI,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAE9F,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EAAE;YACtE,KAAK,MAAM,kBAAkB,IAAI,KAAK,CAAC,YAAY,EAAE;gBACnD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;oBACjC,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;oBAC7B,KAAK,CAAC,IAAI,CAAC;wBACT,cAAc,EAAE,kBAAkB;wBAClC,UAAU,EAAE,iBAAiB;qBAC9B,CAAC,CAAC;iBACJ;aACF;SACF;KACF;AACH,CAAC;AA3ED,0DA2EC"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
+
import { BumpInfo } from '../types/BumpInfo';
|
|
1
2
|
import type { ChangeSet, ChangeType } from '../types/ChangeInfo';
|
|
2
3
|
/**
|
|
3
4
|
* List of all change types from least to most significant.
|
|
4
5
|
*/
|
|
5
|
-
export declare const SortedChangeTypes:
|
|
6
|
-
/**
|
|
7
|
-
* Change type with the smallest weight.
|
|
8
|
-
*/
|
|
6
|
+
export declare const SortedChangeTypes: readonly ["none", "prerelease", "prepatch", "patch", "preminor", "minor", "premajor", "major"];
|
|
7
|
+
/** `'none'` change type (smallest weight) */
|
|
9
8
|
export declare const MinChangeType: ChangeType;
|
|
10
9
|
/**
|
|
11
10
|
* Get initial package change types based on the greatest change type set for each package in any
|
|
12
11
|
* change file, accounting for any disallowed change types or nonexistent packages.
|
|
12
|
+
* Anything with change type "none" will be ignored.
|
|
13
13
|
*/
|
|
14
|
-
export declare function initializePackageChangeTypes(changeSet: ChangeSet):
|
|
15
|
-
[pkgName: string]: ChangeType;
|
|
16
|
-
};
|
|
14
|
+
export declare function initializePackageChangeTypes(changeSet: ChangeSet): BumpInfo['calculatedChangeTypes'];
|
|
17
15
|
/**
|
|
18
16
|
* Get the max allowed change type based on `a` and `b`, accounting for disallowed change types:
|
|
19
17
|
* e.g. if `a` is "major" and `b` is "patch", and "major" is disallowed, the result will be "minor"
|
|
20
18
|
* (the greatest allowed change type).
|
|
21
19
|
*/
|
|
22
|
-
export declare function getMaxChangeType(a: ChangeType | undefined, b
|
|
20
|
+
export declare function getMaxChangeType(a: ChangeType | undefined, b?: ChangeType, disallowedChangeTypes?: ReadonlyArray<ChangeType> | null): ChangeType;
|
|
23
21
|
//# sourceMappingURL=changeTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeTypes.d.ts","sourceRoot":"","sources":["../../src/changefile/changeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"changeTypes.d.ts","sourceRoot":"","sources":["../../src/changefile/changeTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,iBAAiB,gGASY,CAAC;AAE3C,6CAA6C;AAC7C,eAAO,MAAM,aAAa,EAAE,UAAmB,CAAC;AAQhD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,SAAS,GAAG,QAAQ,CAAC,uBAAuB,CAAC,CAapG;AAeD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,UAAU,GAAG,SAAS,EACzB,CAAC,CAAC,EAAE,UAAU,EACd,qBAAqB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,IAAI,GACvD,UAAU,CAOZ"}
|
|
@@ -14,10 +14,8 @@ exports.SortedChangeTypes = [
|
|
|
14
14
|
'premajor',
|
|
15
15
|
'major',
|
|
16
16
|
];
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
|
-
exports.MinChangeType = exports.SortedChangeTypes[0];
|
|
17
|
+
/** `'none'` change type (smallest weight) */
|
|
18
|
+
exports.MinChangeType = 'none';
|
|
21
19
|
/**
|
|
22
20
|
* Change type weights.
|
|
23
21
|
* Note: the order in which this is defined is IMPORTANT.
|
|
@@ -26,12 +24,17 @@ const ChangeTypeWeights = Object.fromEntries(exports.SortedChangeTypes.map((t, i
|
|
|
26
24
|
/**
|
|
27
25
|
* Get initial package change types based on the greatest change type set for each package in any
|
|
28
26
|
* change file, accounting for any disallowed change types or nonexistent packages.
|
|
27
|
+
* Anything with change type "none" will be ignored.
|
|
29
28
|
*/
|
|
30
29
|
function initializePackageChangeTypes(changeSet) {
|
|
31
30
|
const pkgChangeTypes = {};
|
|
32
31
|
for (const { change } of changeSet) {
|
|
33
|
-
const { packageName: pkg
|
|
34
|
-
|
|
32
|
+
const { packageName: pkg } = change;
|
|
33
|
+
const changeType = getMaxChangeType(change.type, pkgChangeTypes[pkg]);
|
|
34
|
+
// It's best to totally ignore "none" changes to do a bit less processing.
|
|
35
|
+
if (changeType !== 'none') {
|
|
36
|
+
pkgChangeTypes[pkg] = changeType;
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
return pkgChangeTypes;
|
|
37
40
|
}
|
|
@@ -52,13 +55,11 @@ function getAllowedChangeType(changeType, disallowedChangeTypes) {
|
|
|
52
55
|
* (the greatest allowed change type).
|
|
53
56
|
*/
|
|
54
57
|
function getMaxChangeType(a, b, disallowedChangeTypes) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
a = getAllowedChangeType(a, disallowedChangeTypes);
|
|
59
|
-
b = getAllowedChangeType(b, disallowedChangeTypes);
|
|
58
|
+
if (disallowedChangeTypes?.length) {
|
|
59
|
+
a = a && getAllowedChangeType(a, disallowedChangeTypes);
|
|
60
|
+
b = b && getAllowedChangeType(b, disallowedChangeTypes);
|
|
60
61
|
}
|
|
61
|
-
return ChangeTypeWeights[a] > ChangeTypeWeights[b] ? a : b;
|
|
62
|
+
return a && b ? (ChangeTypeWeights[a] > ChangeTypeWeights[b] ? a : b) : a || b || 'none';
|
|
62
63
|
}
|
|
63
64
|
exports.getMaxChangeType = getMaxChangeType;
|
|
64
65
|
//# sourceMappingURL=changeTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeTypes.js","sourceRoot":"","sources":["../../src/changefile/changeTypes.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"changeTypes.js","sourceRoot":"","sources":["../../src/changefile/changeTypes.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACU,QAAA,iBAAiB,GAAG;IAC/B,MAAM;IACN,YAAY;IACZ,UAAU;IACV,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,OAAO;CACiC,CAAC;AAE3C,6CAA6C;AAChC,QAAA,aAAa,GAAe,MAAM,CAAC;AAEhD;;;GAGG;AACH,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,yBAAiB,CAAC,GAAG,CAAC,CAAC,CA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,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;AAC3F,CAAC;AAXD,4CAWC"}
|
|
@@ -32,9 +32,14 @@ export interface RepoOptions {
|
|
|
32
32
|
* The target branch. In the repo or CLI config, this can be specified without a remote name
|
|
33
33
|
* as long as `repository` is set in `package.json` to allow inferring the correct remote.
|
|
34
34
|
*
|
|
35
|
+
* This defaults to the default branch of the default remote.
|
|
36
|
+
* - The default remote is the one matching `repository` in `package.json`, falling back to
|
|
37
|
+
* `upstream` if defined, the first defined remote, or `origin`.
|
|
38
|
+
* - The default branch is the remote's default branch if defined, falling back to
|
|
39
|
+
* `git config init.defaultBranch` or `master`.
|
|
40
|
+
*
|
|
35
41
|
* (In the resolved config used internally, the remote name should *usually* be included,
|
|
36
42
|
* unless neither a remote name nor `package.json` `repository` was specified.)
|
|
37
|
-
* @default 'origin/master'
|
|
38
43
|
*/
|
|
39
44
|
branch: string;
|
|
40
45
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BeachballOptions.d.ts","sourceRoot":"","sources":["../../src/types/BeachballOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,CAAC;AAEzE,MAAM,WAAW,UACf,SAAQ,IAAI,CACV,WAAW,EACT,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,QAAQ,GACR,aAAa,GACb,OAAO,GACP,uBAAuB,GACvB,4BAA4B,GAC5B,OAAO,GACP,SAAS,GACT,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,SAAS,GACT,KAAK,GACL,MAAM,GACN,kBAAkB,GAClB,SAAS,GACT,MAAM,GACN,UAAU,GACV,SAAS,GACT,OAAO,GACP,KAAK,GACL,SAAS,CACZ;IACD,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;CAId;AAED,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAC;IAChC
|
|
1
|
+
{"version":3,"file":"BeachballOptions.d.ts","sourceRoot":"","sources":["../../src/types/BeachballOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,O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AC,KACjC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,CACZ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,KACjC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvF;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,CACT,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,KACjC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CACZ,UAAU,EAAE,UAAU,GAAG,kBAAkB,EAC3C,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE;QACP,mLAAmL;QACnL,OAAO,EAAE,MAAM,CAAC;KACjB,KACE,UAAU,CAAC;CACjB"}
|
package/lib/types/BumpInfo.d.ts
CHANGED
|
@@ -2,14 +2,22 @@ import type { ChangeSet, ChangeType } from './ChangeInfo';
|
|
|
2
2
|
import type { DeepReadonly } from './DeepReadonly';
|
|
3
3
|
import type { PackageInfos, PackageGroups } from './PackageInfo';
|
|
4
4
|
export type BumpInfo = {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Changes coming from the change files.
|
|
7
|
+
* `readChangeFiles` ensures that this will only contain changes for packages that exist.
|
|
8
|
+
*/
|
|
6
9
|
changeFileChangeInfos: DeepReadonly<ChangeSet>;
|
|
7
10
|
/**
|
|
8
11
|
* Cached version of package info (e.g. package.json, package path).
|
|
9
12
|
* This will be updated to reflect the bumped versions and dependencies.
|
|
10
13
|
*/
|
|
11
14
|
packageInfos: PackageInfos;
|
|
12
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Mapping from package name to change type.
|
|
17
|
+
*
|
|
18
|
+
* Initially (after `gatherBumpInfo`), this just has change types based on the change files.
|
|
19
|
+
* It's updated by the early steps of `bumpInPlace` to consider groups and `disallowedChangeTypes`.
|
|
20
|
+
*/
|
|
13
21
|
calculatedChangeTypes: {
|
|
14
22
|
[pkgName: string]: ChangeType;
|
|
15
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BumpInfo.d.ts","sourceRoot":"","sources":["../../src/types/BumpInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,MAAM,QAAQ,GAAG;IACrB
|
|
1
|
+
{"version":3,"file":"BumpInfo.d.ts","sourceRoot":"","sources":["../../src/types/BumpInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,MAAM,QAAQ,GAAG;IACrB;;;OAGG;IACH,qBAAqB,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAE/C;;;OAGG;IACH,YAAY,EAAE,YAAY,CAAC;IAE3B;;;;;OAKG;IACH,qBAAqB,EAAE;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;IAEzD,uBAAuB;IACvB,aAAa,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;IAE3C,6CAA6C;IAC7C,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAE9B,+EAA+E;IAC/E,kBAAkB,EAAE;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IAEvD,sDAAsD;IACtD,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACrC,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAEtF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACrC,CAAC"}
|
|
@@ -31,8 +31,12 @@ export interface ChangeInfoMultiple {
|
|
|
31
31
|
/**
|
|
32
32
|
* List of change file infos (not actually a set).
|
|
33
33
|
*/
|
|
34
|
-
export type ChangeSet = {
|
|
35
|
-
changeFile: string;
|
|
34
|
+
export type ChangeSet = Array<{
|
|
36
35
|
change: ChangeFileInfo;
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Filename the change came from (under `BeachballOptions.changeDir`).
|
|
38
|
+
* Multiple entries in the array might have come from the same file.
|
|
39
|
+
*/
|
|
40
|
+
changeFile: string;
|
|
41
|
+
}>;
|
|
38
42
|
//# sourceMappingURL=ChangeInfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChangeInfo.d.ts","sourceRoot":"","sources":["../../src/types/ChangeInfo.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W,UAAW,SAAQ,cAAc;IAChD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { ChangeType } from '../types/ChangeInfo';
|
|
2
|
+
/**
|
|
3
|
+
* Returns whether `dependentChangeType` is valid and not disallowed.
|
|
4
|
+
* Note that `'patch'` is always allowed.
|
|
5
|
+
*/
|
|
2
6
|
export declare function isValidDependentChangeType(dependentChangeType: ChangeType, disallowedChangeTypes: ChangeType[] | null): boolean;
|
|
3
7
|
//# sourceMappingURL=isValidDependentChangeType.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isValidDependentChangeType.d.ts","sourceRoot":"","sources":["../../src/validation/isValidDependentChangeType.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isValidDependentChangeType.d.ts","sourceRoot":"","sources":["../../src/validation/isValidDependentChangeType.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,mBAAmB,EAAE,UAAU,EAC/B,qBAAqB,EAAE,UAAU,EAAE,GAAG,IAAI,GACzC,OAAO,CAOT"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isValidDependentChangeType = void 0;
|
|
4
|
+
const changeTypes_1 = require("../changefile/changeTypes");
|
|
5
|
+
/**
|
|
6
|
+
* Returns whether `dependentChangeType` is valid and not disallowed.
|
|
7
|
+
* Note that `'patch'` is always allowed.
|
|
8
|
+
*/
|
|
4
9
|
function isValidDependentChangeType(dependentChangeType, disallowedChangeTypes) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
if (dependentChangeType === 'patch') {
|
|
11
|
+
// patch is always allowed as a dependentChangeType
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return changeTypes_1.SortedChangeTypes.includes(dependentChangeType) && !disallowedChangeTypes?.includes(dependentChangeType);
|
|
8
15
|
}
|
|
9
16
|
exports.isValidDependentChangeType = isValidDependentChangeType;
|
|
10
17
|
//# sourceMappingURL=isValidDependentChangeType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isValidDependentChangeType.js","sourceRoot":"","sources":["../../src/validation/isValidDependentChangeType.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"isValidDependentChangeType.js","sourceRoot":"","sources":["../../src/validation/isValidDependentChangeType.ts"],"names":[],"mappings":";;;AAAA,2DAA8D;AAG9D;;;GAGG;AACH,SAAgB,0BAA0B,CACxC,mBAA+B,EAC/B,qBAA0C;IAE1C,IAAI,mBAAmB,KAAK,OAAO,EAAE;QACnC,mDAAmD;QACnD,OAAO,IAAI,CAAC;KACb;IAED,OAAO,+BAAiB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAClH,CAAC;AAVD,gEAUC"}
|