beachball 2.28.0 → 2.30.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/gatherBumpInfo.d.ts.map +1 -1
- package/lib/bump/gatherBumpInfo.js +2 -24
- package/lib/bump/gatherBumpInfo.js.map +1 -1
- package/lib/bump/performBump.d.ts.map +1 -1
- package/lib/bump/performBump.js +29 -44
- package/lib/bump/performBump.js.map +1 -1
- package/lib/bump/updateRelatedChangeType.js.map +1 -1
- package/lib/changefile/getChangedPackages.d.ts.map +1 -1
- package/lib/changefile/getChangedPackages.js +66 -29
- package/lib/changefile/getChangedPackages.js.map +1 -1
- package/lib/changefile/getPackageChangeTypes.js +4 -1
- package/lib/changefile/getPackageChangeTypes.js.map +1 -1
- package/lib/changefile/promptForChange.js +96 -102
- package/lib/changefile/promptForChange.js.map +1 -1
- package/lib/changefile/readChangeFiles.d.ts +11 -0
- package/lib/changefile/readChangeFiles.d.ts.map +1 -1
- package/lib/changefile/readChangeFiles.js +38 -21
- package/lib/changefile/readChangeFiles.js.map +1 -1
- package/lib/changelog/getPackageChangelogs.js +9 -13
- package/lib/changelog/getPackageChangelogs.js.map +1 -1
- package/lib/changelog/renderChangelog.js +38 -46
- package/lib/changelog/renderChangelog.js.map +1 -1
- package/lib/changelog/renderPackageChangelog.js +50 -73
- package/lib/changelog/renderPackageChangelog.js.map +1 -1
- package/lib/changelog/writeChangelog.js +91 -106
- package/lib/changelog/writeChangelog.js.map +1 -1
- package/lib/cli.js +6 -15
- package/lib/cli.js.map +1 -1
- package/lib/commands/bump.js +3 -14
- package/lib/commands/bump.js.map +1 -1
- package/lib/commands/canary.js +25 -36
- package/lib/commands/canary.js.map +1 -1
- package/lib/commands/change.js +10 -21
- package/lib/commands/change.js.map +1 -1
- package/lib/commands/init.d.ts.map +1 -1
- package/lib/commands/init.js +25 -38
- package/lib/commands/init.js.map +1 -1
- package/lib/commands/publish.d.ts.map +1 -1
- package/lib/commands/publish.js +70 -78
- package/lib/commands/publish.js.map +1 -1
- package/lib/commands/sync.js +18 -29
- package/lib/commands/sync.js.map +1 -1
- package/lib/monorepo/getPackageGroups.js +2 -2
- package/lib/monorepo/getPackageGroups.js.map +1 -1
- package/lib/monorepo/getScopedPackages.js +2 -2
- package/lib/monorepo/getScopedPackages.js.map +1 -1
- package/lib/monorepo/{utils.d.ts → isPathIncluded.d.ts} +1 -1
- package/lib/monorepo/isPathIncluded.d.ts.map +1 -0
- package/lib/monorepo/{utils.js → isPathIncluded.js} +1 -1
- package/lib/monorepo/isPathIncluded.js.map +1 -0
- package/lib/options/getCliOptions.js +11 -13
- package/lib/options/getCliOptions.js.map +1 -1
- package/lib/options/getOptions.js +1 -1
- package/lib/options/getOptions.js.map +1 -1
- package/lib/options/getPackageOptions.js +6 -1
- package/lib/options/getPackageOptions.js.map +1 -1
- package/lib/packageManager/listPackageVersions.js +37 -52
- package/lib/packageManager/listPackageVersions.js.map +1 -1
- package/lib/packageManager/npm.d.ts +6 -2
- package/lib/packageManager/npm.d.ts.map +1 -1
- package/lib/packageManager/npm.js +23 -22
- package/lib/packageManager/npm.js.map +1 -1
- package/lib/packageManager/packagePublish.d.ts +3 -1
- package/lib/packageManager/packagePublish.d.ts.map +1 -1
- package/lib/packageManager/packagePublish.js +1 -1
- package/lib/packageManager/packagePublish.js.map +1 -1
- package/lib/publish/bumpAndPush.d.ts.map +1 -1
- package/lib/publish/bumpAndPush.js +56 -68
- package/lib/publish/bumpAndPush.js.map +1 -1
- package/lib/publish/displayManualRecovery.d.ts.map +1 -1
- package/lib/publish/displayManualRecovery.js +8 -8
- package/lib/publish/displayManualRecovery.js.map +1 -1
- package/lib/publish/getNewPackages.js +14 -25
- package/lib/publish/getNewPackages.js.map +1 -1
- package/lib/publish/performPublishOverrides.js +1 -1
- package/lib/publish/publishToRegistry.d.ts.map +1 -1
- package/lib/publish/publishToRegistry.js +79 -79
- package/lib/publish/publishToRegistry.js.map +1 -1
- package/lib/publish/validatePackageDependencies.js +2 -2
- package/lib/publish/validatePackageDependencies.js.map +1 -1
- package/lib/publish/validatePackageVersions.js +21 -32
- package/lib/publish/validatePackageVersions.js.map +1 -1
- package/lib/types/BeachballOptions.d.ts +5 -0
- package/lib/types/BeachballOptions.d.ts.map +1 -1
- package/lib/validation/areChangeFilesDeleted.js +1 -1
- package/lib/validation/areChangeFilesDeleted.js.map +1 -1
- package/lib/validation/validate.js.map +1 -1
- package/package.json +8 -7
- package/CHANGELOG.json +0 -3071
- package/CHANGELOG.md +0 -1405
- package/lib/monorepo/utils.d.ts.map +0 -1
- package/lib/monorepo/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatherBumpInfo.d.ts","sourceRoot":"","sources":["../../src/bump/gatherBumpInfo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"gatherBumpInfo.d.ts","sourceRoot":"","sources":["../../src/bump/gatherBumpInfo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA+BpD,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,GAAG,QAAQ,CAK9F"}
|
|
@@ -1,39 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.gatherBumpInfo = void 0;
|
|
7
4
|
const getPackageChangeTypes_1 = require("../changefile/getPackageChangeTypes");
|
|
8
5
|
const readChangeFiles_1 = require("../changefile/readChangeFiles");
|
|
9
6
|
const bumpInPlace_1 = require("./bumpInPlace");
|
|
10
7
|
const getScopedPackages_1 = require("../monorepo/getScopedPackages");
|
|
11
|
-
const paths_1 = require("../paths");
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
8
|
function gatherPreBumpInfo(options, packageInfos) {
|
|
14
|
-
const { path: cwd } = options;
|
|
15
9
|
// Collate the changes per package
|
|
16
10
|
const changes = readChangeFiles_1.readChangeFiles(options, packageInfos);
|
|
17
|
-
const changePath = paths_1.getChangePath(cwd);
|
|
18
11
|
// const dependentChangeTypes: BumpInfo['dependentChangeTypes'] = {};
|
|
19
12
|
const groupOptions = {};
|
|
20
|
-
// Clear changes for non-existent and accidental private packages
|
|
21
|
-
// NOTE: likely these are from the same PR that deleted or modified the private flag
|
|
22
|
-
const filteredChanges = changes.filter(({ changeFile, change }) => {
|
|
23
|
-
const errorType = !packageInfos[change.packageName]
|
|
24
|
-
? 'nonexistent'
|
|
25
|
-
: packageInfos[change.packageName].private
|
|
26
|
-
? 'private'
|
|
27
|
-
: undefined;
|
|
28
|
-
if (errorType) {
|
|
29
|
-
const resolution = options.groupChanges ? 'remove the entry from this file' : 'delete this file';
|
|
30
|
-
console.warn(`Change detected for ${errorType} package ${change.packageName}; ${resolution}: "${path_1.default.resolve(changePath, changeFile)}"`);
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
});
|
|
35
13
|
// Clear non-existent packages from changefiles infos
|
|
36
|
-
const calculatedChangeTypes = getPackageChangeTypes_1.initializePackageChangeInfo(
|
|
14
|
+
const calculatedChangeTypes = getPackageChangeTypes_1.initializePackageChangeInfo(changes);
|
|
37
15
|
Object.keys(calculatedChangeTypes).forEach(packageName => {
|
|
38
16
|
if (!packageInfos[packageName]) {
|
|
39
17
|
delete calculatedChangeTypes[packageName];
|
|
@@ -43,7 +21,7 @@ function gatherPreBumpInfo(options, packageInfos) {
|
|
|
43
21
|
calculatedChangeTypes,
|
|
44
22
|
packageInfos,
|
|
45
23
|
packageGroups: {},
|
|
46
|
-
changeFileChangeInfos:
|
|
24
|
+
changeFileChangeInfos: changes,
|
|
47
25
|
modifiedPackages: new Set(),
|
|
48
26
|
newPackages: new Set(),
|
|
49
27
|
scopedPackages: new Set(getScopedPackages_1.getScopedPackages(options, packageInfos)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatherBumpInfo.js","sourceRoot":"","sources":["../../src/bump/gatherBumpInfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gatherBumpInfo.js","sourceRoot":"","sources":["../../src/bump/gatherBumpInfo.ts"],"names":[],"mappings":";;;AAAA,+EAAkH;AAClH,mEAAgE;AAEhE,+CAA4C;AAE5C,qEAAkE;AAGlE,SAAS,iBAAiB,CAAC,OAAyB,EAAE,YAA0B;IAC9E,kCAAkC;IAClC,MAAM,OAAO,GAAG,iCAAe,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAEvD,qEAAqE;IACrE,MAAM,YAAY,GAAG,EAAE,CAAC;IAExB,qDAAqD;IACrD,MAAM,qBAAqB,GAAG,mDAA4B,CAAC,OAAO,CAAC,CAAC;IACpE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACvD,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YAC9B,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,qBAAqB;QACrB,YAAY;QACZ,aAAa,EAAE,EAAE;QACjB,qBAAqB,EAAE,OAAO;QAC9B,gBAAgB,EAAE,IAAI,GAAG,EAAU;QACnC,WAAW,EAAE,IAAI,GAAG,EAAU;QAC9B,cAAc,EAAE,IAAI,GAAG,CAAC,qCAAiB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACjE,kBAAkB,EAAE,EAAE;QACtB,YAAY;QACZ,UAAU,EAAE,EAAE;KACf,CAAC;AACJ,CAAC;AAED,SAAgB,cAAc,CAAC,OAAyB,EAAE,YAA0B;IAClF,MAAM,QAAQ,GAAG,iBAAiB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAE1D,yBAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC;AAClB,CAAC;AALD,wCAKC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performBump.d.ts","sourceRoot":"","sources":["../../src/bump/performBump.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"performBump.d.ts","sourceRoot":"","sources":["../../src/bump/performBump.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAgB,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAe,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIjE,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,YAAY,QA0BzF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,QAS5C;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,qBAqB9E"}
|
package/lib/bump/performBump.js
CHANGED
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
6
|
exports.performBump = exports.updatePackageLock = exports.writePackageJson = void 0;
|
|
16
|
-
const child_process_1 = require("child_process");
|
|
17
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
18
|
-
const os_1 = __importDefault(require("os"));
|
|
19
8
|
const path_1 = __importDefault(require("path"));
|
|
20
9
|
const unlinkChangeFiles_1 = require("../changefile/unlinkChangeFiles");
|
|
21
10
|
const writeChangelog_1 = require("../changelog/writeChangelog");
|
|
22
11
|
const workspace_tools_1 = require("workspace-tools");
|
|
12
|
+
const npm_1 = require("../packageManager/npm");
|
|
23
13
|
function writePackageJson(modifiedPackages, packageInfos) {
|
|
24
14
|
for (const pkgName of modifiedPackages) {
|
|
25
15
|
const info = packageInfos[pkgName];
|
|
@@ -51,9 +41,8 @@ function updatePackageLock(cwd) {
|
|
|
51
41
|
const root = workspace_tools_1.findProjectRoot(cwd);
|
|
52
42
|
if (root && fs_extra_1.default.existsSync(path_1.default.join(root, 'package-lock.json'))) {
|
|
53
43
|
console.log('Updating package-lock.json after bumping packages');
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
if (res.status !== 0) {
|
|
44
|
+
const res = npm_1.npm(['install', '--package-lock-only'], { stdio: 'inherit' });
|
|
45
|
+
if (!res.success) {
|
|
57
46
|
console.warn('Updating package-lock.json failed. Continuing...');
|
|
58
47
|
}
|
|
59
48
|
}
|
|
@@ -64,42 +53,38 @@ exports.updatePackageLock = updatePackageLock;
|
|
|
64
53
|
*
|
|
65
54
|
* deletes change files, update package.json, and changelogs
|
|
66
55
|
*/
|
|
67
|
-
function performBump(bumpInfo, options) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return bumpInfo;
|
|
83
|
-
});
|
|
56
|
+
async function performBump(bumpInfo, options) {
|
|
57
|
+
const { modifiedPackages, packageInfos, changeFileChangeInfos, dependentChangedBy, calculatedChangeTypes } = bumpInfo;
|
|
58
|
+
await callHook('prebump', bumpInfo, options);
|
|
59
|
+
writePackageJson(modifiedPackages, packageInfos);
|
|
60
|
+
updatePackageLock(options.path);
|
|
61
|
+
if (options.generateChangelog) {
|
|
62
|
+
// Generate changelog
|
|
63
|
+
await writeChangelog_1.writeChangelog(options, changeFileChangeInfos, calculatedChangeTypes, dependentChangedBy, packageInfos);
|
|
64
|
+
}
|
|
65
|
+
if (!options.keepChangeFiles) {
|
|
66
|
+
// Unlink changelogs
|
|
67
|
+
unlinkChangeFiles_1.unlinkChangeFiles(changeFileChangeInfos, packageInfos, options.path);
|
|
68
|
+
}
|
|
69
|
+
await callHook('postbump', bumpInfo, options);
|
|
70
|
+
return bumpInfo;
|
|
84
71
|
}
|
|
85
72
|
exports.performBump = performBump;
|
|
86
73
|
/**
|
|
87
74
|
* Calls a specified hook for each package being bumped
|
|
88
75
|
*/
|
|
89
|
-
function callHook(hookName, bumpInfo, options) {
|
|
76
|
+
async function callHook(hookName, bumpInfo, options) {
|
|
90
77
|
var _a;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
yield hookRet;
|
|
101
|
-
}
|
|
78
|
+
const hook = (_a = options.hooks) === null || _a === void 0 ? void 0 : _a[hookName];
|
|
79
|
+
if (!hook) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
for (const packageName of bumpInfo.modifiedPackages) {
|
|
83
|
+
const packageInfo = bumpInfo.packageInfos[packageName];
|
|
84
|
+
const hookRet = hook(path_1.default.dirname(packageInfo.packageJsonPath), packageName, packageInfo.version);
|
|
85
|
+
if (hookRet instanceof Promise) {
|
|
86
|
+
await hookRet;
|
|
102
87
|
}
|
|
103
|
-
}
|
|
88
|
+
}
|
|
104
89
|
}
|
|
105
90
|
//# sourceMappingURL=performBump.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performBump.js","sourceRoot":"","sources":["../../src/bump/performBump.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"performBump.js","sourceRoot":"","sources":["../../src/bump/performBump.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA0B;AAC1B,gDAAwB;AACxB,uEAAoE;AACpE,gEAA6D;AAI7D,qDAAkD;AAClD,+CAA4C;AAE5C,SAAgB,gBAAgB,CAAC,gBAA6B,EAAE,YAA0B;IACxF,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE;QACtC,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,WAAW,GAAG,kBAAE,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAE1D,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAEnC,CAAC,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACxE,mGAAmG;YACnG,MAAM,mBAAmB,GAA6B,IAAY,CAAC,OAAO,CAAC,CAAC;YAC5E,IAAI,mBAAmB,EAAE;gBACvB,wFAAwF;gBACxF,2FAA2F;gBAC3F,qCAAqC;gBACrC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,E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;SACF;KACF;IAED,SAAS,gBAAgB,CAAC,GAAW,EAAE,UAAsB,EAAE,qBAAmC;QAChG,MAAM,aAAa,GAAG,wCAAgB,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,qBAAqB,CAAC,CAAC;QACtG,qBAAqB,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC;QAE3C,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC;AApFD,0DAoFC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChangedPackages.d.ts","sourceRoot":"","sources":["../../src/changefile/getChangedPackages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getChangedPackages.d.ts","sourceRoot":"","sources":["../../src/changefile/getChangedPackages.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAe,MAAM,sBAAsB,CAAC;AAyFjE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,YAsDvF"}
|
|
@@ -4,45 +4,82 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getChangedPackages = void 0;
|
|
7
|
-
const paths_1 = require("../paths");
|
|
8
|
-
const workspace_tools_1 = require("workspace-tools");
|
|
9
7
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
8
|
const path_1 = __importDefault(require("path"));
|
|
11
9
|
const minimatch_1 = __importDefault(require("minimatch"));
|
|
10
|
+
const paths_1 = require("../paths");
|
|
11
|
+
const workspace_tools_1 = require("workspace-tools");
|
|
12
12
|
const getScopedPackages_1 = require("../monorepo/getScopedPackages");
|
|
13
|
+
function getMatchingPackageInfo(file, cwd, packageInfosByPath) {
|
|
14
|
+
// Normalize all the paths before comparing (the packageInfosByPath entries should also be normalized)
|
|
15
|
+
// to ensure ensure that this doesn't break on Windows if any input paths have forward slashes
|
|
16
|
+
cwd = path_1.default.normalize(cwd);
|
|
17
|
+
const absFile = path_1.default.normalize(path_1.default.join(cwd, file));
|
|
18
|
+
let absDir = '';
|
|
19
|
+
do {
|
|
20
|
+
absDir = path_1.default.dirname(absDir || absFile);
|
|
21
|
+
if (packageInfosByPath[absDir]) {
|
|
22
|
+
return packageInfosByPath[absDir];
|
|
23
|
+
}
|
|
24
|
+
} while (absDir !== cwd);
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
13
27
|
/**
|
|
14
|
-
* Gets all the changed
|
|
28
|
+
* Gets all the changed package names, regardless of the change files
|
|
15
29
|
*/
|
|
16
30
|
function getAllChangedPackages(options, packageInfos) {
|
|
17
|
-
const { branch, path: cwd } = options;
|
|
31
|
+
const { branch, path: cwd, verbose } = options;
|
|
32
|
+
const verboseLog = (msg) => verbose && console.log(msg);
|
|
33
|
+
const logIgnored = (file, reason) => verboseLog(` - ~~${file}~~ (${reason})`);
|
|
34
|
+
const logIncluded = (file) => verboseLog(` - ${file}`);
|
|
18
35
|
const changes = [...(workspace_tools_1.getChanges(branch, cwd) || []), ...(workspace_tools_1.getStagedChanges(cwd) || [])];
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
verboseLog(`Found ${changes.length} changed files in branch "${branch}" (before filtering)`);
|
|
37
|
+
if (!changes.length) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
// Filter out changed files which are ignored by ignorePatterns.
|
|
41
|
+
// Also ignore the CHANGELOG files because they're generated by beachball.
|
|
21
42
|
const ignorePatterns = [...(options.ignorePatterns || []), 'CHANGELOG.md', 'CHANGELOG.json'];
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
const nonIgnoredChanges = changes.filter(moddedFile => {
|
|
44
|
+
const ignorePattern = ignorePatterns.find(pattern => minimatch_1.default(moddedFile, pattern, { matchBase: true }));
|
|
45
|
+
ignorePattern && logIgnored(moddedFile, `ignored by pattern "${ignorePattern}"`);
|
|
46
|
+
return !ignorePattern;
|
|
47
|
+
});
|
|
48
|
+
if (!nonIgnoredChanges.length) {
|
|
49
|
+
verboseLog('All files were ignored');
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
// Determine which package each changed file came from (using packageInfos[x].packageJsonPath),
|
|
53
|
+
// and whether that package is in scope and not private
|
|
54
|
+
const includedPackages = new Set();
|
|
55
|
+
let fileCount = 0;
|
|
56
|
+
const scopedPackages = getScopedPackages_1.getScopedPackages(options, packageInfos);
|
|
57
|
+
const packageInfosByPath = {};
|
|
58
|
+
for (const info of Object.values(packageInfos)) {
|
|
59
|
+
packageInfosByPath[path_1.default.normalize(path_1.default.dirname(info.packageJsonPath))] = info;
|
|
60
|
+
}
|
|
61
|
+
for (const moddedFile of nonIgnoredChanges) {
|
|
62
|
+
const packageInfo = getMatchingPackageInfo(moddedFile, cwd, packageInfosByPath);
|
|
63
|
+
const omitReason = !packageInfo
|
|
64
|
+
? 'no corresponding package found'
|
|
65
|
+
: packageInfo.private
|
|
66
|
+
? `${packageInfo.name} is private`
|
|
67
|
+
: packageInfo.combinedOptions.shouldPublish === false
|
|
68
|
+
? `${packageInfo.name} has beachball.shouldPublish=false`
|
|
69
|
+
: !scopedPackages.includes(packageInfo.name)
|
|
70
|
+
? `${packageInfo.name} is out of scope`
|
|
71
|
+
: ''; // not ignored
|
|
72
|
+
if (omitReason) {
|
|
73
|
+
logIgnored(moddedFile, omitReason);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
includedPackages.add(packageInfo.name);
|
|
77
|
+
fileCount++;
|
|
78
|
+
logIncluded(moddedFile);
|
|
79
|
+
}
|
|
44
80
|
}
|
|
45
|
-
|
|
81
|
+
verboseLog(`Found ${fileCount} files in ${includedPackages.size} packages that should be published`);
|
|
82
|
+
return [...includedPackages];
|
|
46
83
|
}
|
|
47
84
|
/**
|
|
48
85
|
* Gets all the changed packages, accounting for change files
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChangedPackages.js","sourceRoot":"","sources":["../../src/changefile/getChangedPackages.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"getChangedPackages.js","sourceRoot":"","sources":["../../src/changefile/getChangedPackages.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA0B;AAC1B,gDAAwB;AACxB,0DAAkC;AAElC,oCAAyC;AACzC,qDAA0G;AAC1G,qEAAkE;AAIlE,SAAS,sBAAsB,CAC7B,IAAY,EACZ,GAAW,EACX,kBAAuE;IAEvE,sGAAsG;IACtG,8FAA8F;IAC9F,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;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,OAAyB,EAAE,YAA0B;IAClF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,CA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gF;IAChF,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACzB,IAAI;YACF,MAAM,UAAU,GAAwC,kBAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAE9E,IAAI,SAAS,IAAI,UAAU,EAAE;gBAC3B,KAAK,MAAM,MAAM,IAAK,UAAiC,CAAC,OAAO,EAAE;oBAC/D,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;iBAC9C;aACF;iBAAM;gBACL,oBAAoB,CAAC,GAAG,CAAE,UAA6B,CAAC,WAAW,CAAC,CAAC;aACtE;SACF;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,IAAI,CAAC,wCAAwC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;SACpE;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,oBAAoB,CAAC,IAAI,GAAG,CAAC,EAAE;QACjC,OAAO,CAAC,GAAG,CACT,oEAAoE;YAClE,CAAC,GAAG,oBAAoB,CAAC;iBACtB,IAAI,EAAE;iBACN,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC;iBACxB,IAAI,CAAC,EAAE,CAAC,CACd,CAAC;KACH;IAED,OAAO,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/E,CAAC;AAtDD,gDAsDC"}
|
|
@@ -52,7 +52,10 @@ function getAllowedChangeType(changeType, disallowedChangeTypes) {
|
|
|
52
52
|
}
|
|
53
53
|
exports.getAllowedChangeType = getAllowedChangeType;
|
|
54
54
|
function updateChangeInfoWithMaxType(changeInfo, inputA, inputB, disallowedChangeTypes) {
|
|
55
|
-
return
|
|
55
|
+
return {
|
|
56
|
+
...changeInfo,
|
|
57
|
+
type: getMaxChangeType(inputA, inputB, disallowedChangeTypes),
|
|
58
|
+
};
|
|
56
59
|
}
|
|
57
60
|
exports.updateChangeInfoWithMaxType = updateChangeInfoWithMaxType;
|
|
58
61
|
function getMaxChangeType(inputA, inputB, disallowedChangeTypes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPackageChangeTypes.js","sourceRoot":"","sources":["../../src/changefile/getPackageChangeTypes.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACU,QAAA,iBAAiB,GAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEjG;;GAEG;AACU,QAAA,aAAa,GAAG,yBAAiB,CAAC,CAAC,CAAC,CAAC;AAElD;;;GAGG;AACH,MAAM,iBAAiB,GAAkC,yBAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE;IAC/G,OAAO,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;IAC5B,OAAO,OAAO,CAAC;AACjB,CAAC,EAAE,EAAmC,CAAC,CAAC;AAExC,SAAgB,2BAA2B,CAAC,SAAoB;IAC9D,MAAM,gBAAgB,GAElB,EAAE,CAAC;IAEP,KAAK,IAAI,EAAE,MAAM,EAAE,IAAI,SAAS,EAAE;QAChC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAE/B,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,IAAI,mBAAmB,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC,EAAE;YACrG,gBAAgB,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;SAC7C;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAdD,kEAcC;AAED,SAAgB,mBAAmB,CAAC,CAAa,EAAE,CAAa;IAC9D,IAAI,iBAAiB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAAE;QAC/C,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAO,KAAK,CAA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C;IAC9D,MAAM,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAE9D,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAED,IAAI,CAAC,CAAC,EAAE;QACN,OAAO,CAAC,CAAC;KACV;IAED,IAAI,CAAC,CAAC,EAAE;QACN,OAAO,CAAC,CAAC;KACV;IAED,IAAI,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;QAC7B,OAAO,CAAC,CAAC;KACV;SAAM;QACL,OAAO,CAAC,CAAC;KACV;AACH,CAAC;AArBD,4CAqBC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -24,107 +15,110 @@ const getDisallowedChangeTypes_1 = require("./getDisallowedChangeTypes");
|
|
|
24
15
|
/**
|
|
25
16
|
* Uses `prompts` package to prompt for change type and description, fills in git user.email and scope
|
|
26
17
|
*/
|
|
27
|
-
function promptForChange(options) {
|
|
18
|
+
async function promptForChange(options) {
|
|
28
19
|
var _a, _b;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
const { branch, path: cwd } = options;
|
|
21
|
+
let { package: specificPackage } = options;
|
|
22
|
+
if (specificPackage && !Array.isArray(specificPackage)) {
|
|
23
|
+
specificPackage = [specificPackage];
|
|
24
|
+
}
|
|
25
|
+
const packageInfos = getPackageInfos_1.getPackageInfos(cwd);
|
|
26
|
+
const changedPackages = specificPackage || getChangedPackages_1.getChangedPackages(options, packageInfos);
|
|
27
|
+
const recentMessages = workspace_tools_1.getRecentCommitMessages(branch, cwd) || [];
|
|
28
|
+
const packageChangeInfo = [];
|
|
29
|
+
const packageGroups = getPackageGroups_1.getPackageGroups(packageInfos, options.path, options.groups);
|
|
30
|
+
for (let pkg of changedPackages) {
|
|
31
|
+
console.log('');
|
|
32
|
+
console.log(`Please describe the changes for: ${pkg}`);
|
|
33
|
+
const disallowedChangeTypes = getDisallowedChangeTypes_1.getDisallowedChangeTypes(pkg, packageInfos, packageGroups);
|
|
34
|
+
const packageInfo = packageInfos[pkg];
|
|
35
|
+
const showPrereleaseOption = semver_1.prerelease(packageInfo.version);
|
|
36
|
+
const changeTypePrompt = {
|
|
37
|
+
type: 'select',
|
|
38
|
+
name: 'type',
|
|
39
|
+
message: 'Change type',
|
|
40
|
+
choices: [
|
|
41
|
+
...(showPrereleaseOption ? [{ value: 'prerelease', title: ' [1mPrerelease[22m - bump prerelease version' }] : []),
|
|
42
|
+
{ value: 'patch', title: ' [1mPatch[22m - bug fixes; no API changes.' },
|
|
43
|
+
{ value: 'minor', title: ' [1mMinor[22m - small feature; backwards compatible API changes.' },
|
|
44
|
+
{
|
|
45
|
+
value: 'none',
|
|
46
|
+
title: ' [1mNone[22m - this change does not affect the published package in any way.',
|
|
47
|
+
},
|
|
48
|
+
{ value: 'major', title: ' [1mMajor[22m - major feature; breaking changes.' },
|
|
49
|
+
].filter(choice => !(disallowedChangeTypes === null || disallowedChangeTypes === void 0 ? void 0 : disallowedChangeTypes.includes(choice.value))),
|
|
50
|
+
};
|
|
51
|
+
if (changeTypePrompt.choices.length === 0) {
|
|
52
|
+
console.log('No valid changeTypes available, aborting');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (options.type && (disallowedChangeTypes === null || disallowedChangeTypes === void 0 ? void 0 : disallowedChangeTypes.includes(options.type))) {
|
|
56
|
+
console.log(`${options.type} type is not allowed, aborting`);
|
|
57
|
+
return;
|
|
34
58
|
}
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const descriptionPrompt = {
|
|
60
|
+
type: 'autocomplete',
|
|
61
|
+
name: 'comment',
|
|
62
|
+
message: 'Describe changes (type or choose one)',
|
|
63
|
+
suggest: input => {
|
|
64
|
+
return Promise.resolve([...recentMessages.filter(msg => msg.startsWith(input)), input]);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
const showChangeTypePrompt = !options.type && changeTypePrompt.choices.length > 1;
|
|
68
|
+
const defaultPrompt = {
|
|
69
|
+
changeType: showChangeTypePrompt ? changeTypePrompt : undefined,
|
|
70
|
+
description: !options.message ? descriptionPrompt : undefined,
|
|
71
|
+
};
|
|
72
|
+
let questions = [defaultPrompt.changeType, defaultPrompt.description];
|
|
73
|
+
if ((_a = packageInfo.combinedOptions.changeFilePrompt) === null || _a === void 0 ? void 0 : _a.changePrompt) {
|
|
74
|
+
/**
|
|
75
|
+
* We are providing the package name also as the parameter so
|
|
76
|
+
* that the custom changelog can be specified at the package level
|
|
77
|
+
*/
|
|
78
|
+
questions = (_b = packageInfo.combinedOptions.changeFilePrompt) === null || _b === void 0 ? void 0 : _b.changePrompt(defaultPrompt, pkg);
|
|
79
|
+
}
|
|
80
|
+
questions = questions.filter(q => !!q);
|
|
81
|
+
let response = {
|
|
82
|
+
type: options.type || 'none',
|
|
83
|
+
comment: options.message || '',
|
|
84
|
+
};
|
|
85
|
+
if (questions.length > 0) {
|
|
86
|
+
response = (await prompts_1.default(questions));
|
|
87
|
+
if (Object.keys(response).length === 0) {
|
|
88
|
+
console.log('Cancelled, no change files are written');
|
|
63
89
|
return;
|
|
64
90
|
}
|
|
65
|
-
if
|
|
66
|
-
|
|
67
|
-
|
|
91
|
+
// if type is absent in the user input, there are two possiblities for
|
|
92
|
+
// proceeding next:
|
|
93
|
+
// 1) if options.type is defined, use that
|
|
94
|
+
// 2) otherwise, we hit the edge case when options.type is undefined
|
|
95
|
+
// and there was only one possible ChangeType to display, 'none'
|
|
96
|
+
// but we didn't display it due to showChangeTypePrompt === false;
|
|
97
|
+
// so set the type to 'none'
|
|
98
|
+
if (!response.type) {
|
|
99
|
+
if (!options.type) {
|
|
100
|
+
console.log("WARN: change type 'none' assumed by default");
|
|
101
|
+
console.log('(Not what you intended? Check the repo-level and package-level beachball configs.)');
|
|
102
|
+
}
|
|
103
|
+
response = { ...response, type: options.type || 'none' };
|
|
68
104
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
message: 'Describe changes (type or choose one)',
|
|
73
|
-
suggest: input => {
|
|
74
|
-
return Promise.resolve([...recentMessages.filter(msg => msg.startsWith(input)), input]);
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
const showChangeTypePrompt = !options.type && changeTypePrompt.choices.length > 1;
|
|
78
|
-
const defaultPrompt = {
|
|
79
|
-
changeType: showChangeTypePrompt ? changeTypePrompt : undefined,
|
|
80
|
-
description: !options.message ? descriptionPrompt : undefined,
|
|
81
|
-
};
|
|
82
|
-
let questions = [defaultPrompt.changeType, defaultPrompt.description];
|
|
83
|
-
if ((_a = packageInfo.combinedOptions.changeFilePrompt) === null || _a === void 0 ? void 0 : _a.changePrompt) {
|
|
84
|
-
/**
|
|
85
|
-
* We are providing the package name also as the parameter so
|
|
86
|
-
* that the custom changelog can be specified at the package level
|
|
87
|
-
*/
|
|
88
|
-
questions = (_b = packageInfo.combinedOptions.changeFilePrompt) === null || _b === void 0 ? void 0 : _b.changePrompt(defaultPrompt, pkg);
|
|
105
|
+
// fallback to the options.message if message is absent in the user input
|
|
106
|
+
if (!response.comment && options.message) {
|
|
107
|
+
response = { ...response, comment: options.message };
|
|
89
108
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
comment: options.message || '',
|
|
94
|
-
};
|
|
95
|
-
if (questions.length > 0) {
|
|
96
|
-
response = (yield prompts_1.default(questions));
|
|
97
|
-
if (Object.keys(response).length === 0) {
|
|
98
|
-
console.log('Cancelled, no change files are written');
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
// if type is absent in the user input, there are two possiblities for
|
|
102
|
-
// proceeding next:
|
|
103
|
-
// 1) if options.type is defined, use that
|
|
104
|
-
// 2) otherwise, we hit the edge case when options.type is undefined
|
|
105
|
-
// and there was only one possible ChangeType to display, 'none'
|
|
106
|
-
// but we didn't display it due to showChangeTypePrompt === false;
|
|
107
|
-
// so set the type to 'none'
|
|
108
|
-
if (!response.type) {
|
|
109
|
-
if (!options.type) {
|
|
110
|
-
console.log("WARN: change type 'none' assumed by default");
|
|
111
|
-
console.log('(Not what you intended? Check the repo-level and package-level beachball configs.)');
|
|
112
|
-
}
|
|
113
|
-
response = Object.assign(Object.assign({}, response), { type: options.type || 'none' });
|
|
114
|
-
}
|
|
115
|
-
// fallback to the options.message if message is absent in the user input
|
|
116
|
-
if (!response.comment && options.message) {
|
|
117
|
-
response = Object.assign(Object.assign({}, response), { comment: options.message });
|
|
118
|
-
}
|
|
119
|
-
if (!isValidChangeType_1.isValidChangeType(response.type)) {
|
|
120
|
-
console.error('Prompt response contains invalid change type.');
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
109
|
+
if (!isValidChangeType_1.isValidChangeType(response.type)) {
|
|
110
|
+
console.error('Prompt response contains invalid change type.');
|
|
111
|
+
return;
|
|
123
112
|
}
|
|
124
|
-
packageChangeInfo.push(Object.assign(Object.assign({}, response), { packageName: pkg, email: workspace_tools_1.getUserEmail(cwd) || 'email not defined', dependentChangeType: options.dependentChangeType || (response.type === 'none' ? 'none' : 'patch') }));
|
|
125
113
|
}
|
|
126
|
-
|
|
127
|
-
|
|
114
|
+
packageChangeInfo.push({
|
|
115
|
+
...response,
|
|
116
|
+
packageName: pkg,
|
|
117
|
+
email: workspace_tools_1.getUserEmail(cwd) || 'email not defined',
|
|
118
|
+
dependentChangeType: options.dependentChangeType || (response.type === 'none' ? 'none' : 'patch'),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return packageChangeInfo;
|
|
128
122
|
}
|
|
129
123
|
exports.promptForChange = promptForChange;
|
|
130
124
|
//# sourceMappingURL=promptForChange.js.map
|