@salesforce/plugin-release-management 3.5.17 → 3.7.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/README.md +3 -3
- package/bin/dev +7 -3
- package/bin/run +1 -3
- package/lib/amazonS3.d.ts +2 -2
- package/lib/codeSigning/packAndSign.d.ts +2 -2
- package/lib/codeSigning/packAndSign.js +1 -1
- package/lib/codeSigning/packAndSign.js.map +1 -1
- package/lib/commands/channel/promote.d.ts +19 -30
- package/lib/commands/channel/promote.js +133 -132
- package/lib/commands/channel/promote.js.map +1 -1
- package/lib/commands/cli/install/test.d.ts +9 -3
- package/lib/commands/cli/install/test.js +18 -16
- package/lib/commands/cli/install/test.js.map +1 -1
- package/lib/commands/cli/latestrc/build.d.ts +13 -3
- package/lib/commands/cli/latestrc/build.js +37 -36
- package/lib/commands/cli/latestrc/build.js.map +1 -1
- package/lib/commands/cli/releasenotes.d.ts +10 -5
- package/lib/commands/cli/releasenotes.js +23 -21
- package/lib/commands/cli/releasenotes.js.map +1 -1
- package/lib/commands/cli/schemas/collect.d.ts +7 -8
- package/lib/commands/cli/schemas/collect.js +33 -32
- package/lib/commands/cli/schemas/collect.js.map +1 -1
- package/lib/commands/cli/schemas/compare.d.ts +6 -5
- package/lib/commands/cli/schemas/compare.js +14 -16
- package/lib/commands/cli/schemas/compare.js.map +1 -1
- package/lib/commands/cli/tarballs/prepare.d.ts +10 -3
- package/lib/commands/cli/tarballs/prepare.js +15 -12
- package/lib/commands/cli/tarballs/prepare.js.map +1 -1
- package/lib/commands/cli/tarballs/smoke.d.ts +9 -3
- package/lib/commands/cli/tarballs/smoke.js +46 -44
- package/lib/commands/cli/tarballs/smoke.js.map +1 -1
- package/lib/commands/cli/tarballs/verify.d.ts +9 -3
- package/lib/commands/cli/tarballs/verify.js +13 -10
- package/lib/commands/cli/tarballs/verify.js.map +1 -1
- package/lib/commands/cli/versions/inspect.d.ts +17 -7
- package/lib/commands/cli/versions/inspect.js +40 -40
- package/lib/commands/cli/versions/inspect.js.map +1 -1
- package/lib/commands/dependabot/automerge.d.ts +11 -3
- package/lib/commands/dependabot/automerge.js +28 -25
- package/lib/commands/dependabot/automerge.js.map +1 -1
- package/lib/commands/dependabot/consolidate.d.ts +13 -4
- package/lib/commands/dependabot/consolidate.js +28 -31
- package/lib/commands/dependabot/consolidate.js.map +1 -1
- package/lib/commands/npm/dependencies/pin.d.ts +7 -3
- package/lib/commands/npm/dependencies/pin.js +14 -11
- package/lib/commands/npm/dependencies/pin.js.map +1 -1
- package/lib/commands/npm/package/promote.d.ts +8 -3
- package/lib/commands/npm/package/promote.js +15 -13
- package/lib/commands/npm/package/promote.js.map +1 -1
- package/lib/commands/npm/package/release.d.ts +13 -3
- package/lib/commands/npm/package/release.js +46 -41
- package/lib/commands/npm/package/release.js.map +1 -1
- package/lib/commands/npm/release/validate.d.ts +8 -5
- package/lib/commands/npm/release/validate.js +9 -7
- package/lib/commands/npm/release/validate.js.map +1 -1
- package/lib/commands/repositories/index.d.ts +4 -3
- package/lib/commands/repositories/index.js +7 -5
- package/lib/commands/repositories/index.js.map +1 -1
- package/lib/commands/typescript/update.d.ts +9 -3
- package/lib/commands/typescript/update.js +16 -15
- package/lib/commands/typescript/update.js.map +1 -1
- package/lib/dependabot.d.ts +2 -3
- package/lib/dependabot.js +2 -2
- package/lib/dependabot.js.map +1 -1
- package/lib/dependencies.d.ts +3 -3
- package/lib/package.d.ts +7 -5
- package/lib/package.js +2 -2
- package/lib/package.js.map +1 -1
- package/lib/pluginCommand.d.ts +4 -4
- package/lib/repositories.d.ts +3 -3
- package/lib/repository.d.ts +6 -6
- package/lib/repository.js +5 -3
- package/lib/repository.js.map +1 -1
- package/lib/types.d.ts +3 -3
- package/messages/channel.promote.json +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +17 -12
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
*/
|
|
9
9
|
const os = require("os");
|
|
10
10
|
const core_1 = require("@salesforce/core");
|
|
11
|
-
const
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
12
|
const core_2 = require("@octokit/core");
|
|
13
13
|
const kit_1 = require("@salesforce/kit");
|
|
14
14
|
const chalk_1 = require("chalk");
|
|
@@ -17,23 +17,24 @@ const ts_types_1 = require("@salesforce/ts-types");
|
|
|
17
17
|
const dependabot_1 = require("../../dependabot");
|
|
18
18
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
19
19
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'dependabot.consolidate');
|
|
20
|
-
class Consolidate extends
|
|
20
|
+
class Consolidate extends sf_plugins_core_1.SfCommand {
|
|
21
21
|
async run() {
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
22
|
+
const { flags } = await this.parse(Consolidate);
|
|
23
|
+
const baseRepoObject = await (0, dependabot_1.getOwnerAndRepo)(flags.owner, flags.repo);
|
|
24
|
+
const baseBranch = (0, ts_types_1.ensureString)(flags['base-branch']);
|
|
25
|
+
const targetBranch = (0, ts_types_1.ensureString)(flags['target-branch']);
|
|
25
26
|
const auth = (0, ts_types_1.ensureString)(new kit_1.Env().getString('GH_TOKEN'), 'GH_TOKEN is required to be set in the environment');
|
|
26
27
|
const octokit = new core_2.Octokit({ auth });
|
|
27
28
|
const pullRequests = await octokit.request('GET /repos/{owner}/{repo}/pulls', baseRepoObject);
|
|
28
29
|
const dependabotPRs = pullRequests.data.filter((d) => d.state === 'open' &&
|
|
29
30
|
d.user.login === 'dependabot[bot]' &&
|
|
30
|
-
(0, dependabot_1.meetsVersionCriteria)(d.title,
|
|
31
|
-
!
|
|
32
|
-
let prBody = `This PR consolidates all dependabot PRs that are less than or equal to a ${
|
|
31
|
+
(0, dependabot_1.meetsVersionCriteria)(d.title, flags['max-version-bump']) &&
|
|
32
|
+
!flags.ignore.some((i) => d.title.includes(i)));
|
|
33
|
+
let prBody = `This PR consolidates all dependabot PRs that are less than or equal to a ${flags['max-version-bump']} version bump${os.EOL}${os.EOL}`;
|
|
33
34
|
for (const pr of dependabotPRs) {
|
|
34
35
|
prBody += `Closes #${pr.number}${os.EOL}`;
|
|
35
36
|
}
|
|
36
|
-
const prTitle = `Consolidate ${
|
|
37
|
+
const prTitle = `Consolidate ${flags['max-version-bump']} dependabot PRs`;
|
|
37
38
|
this.log((0, chalk_1.bold)('PR Title:'));
|
|
38
39
|
this.log(prTitle);
|
|
39
40
|
this.log((0, chalk_1.bold)('PR Body:'));
|
|
@@ -42,7 +43,7 @@ class Consolidate extends command_1.SfdxCommand {
|
|
|
42
43
|
for (const pr of dependabotPRs) {
|
|
43
44
|
this.log(` ${(0, chalk_1.cyan)(pr.head.sha)} [#${pr.number} ${pr.title}]`);
|
|
44
45
|
}
|
|
45
|
-
if (!
|
|
46
|
+
if (!flags.dryrun) {
|
|
46
47
|
try {
|
|
47
48
|
this.exec('git fetch origin');
|
|
48
49
|
this.exec('git fetch -p');
|
|
@@ -53,7 +54,7 @@ class Consolidate extends command_1.SfdxCommand {
|
|
|
53
54
|
for (const sha of shas) {
|
|
54
55
|
this.exec(`git cherry-pick ${sha} --strategy-option=theirs`);
|
|
55
56
|
}
|
|
56
|
-
if (!
|
|
57
|
+
if (!flags['no-pr']) {
|
|
57
58
|
this.exec(`git push -u origin ${targetBranch} --no-verify`);
|
|
58
59
|
const response = await octokit.request('POST /repos/{owner}/{repo}/pulls', {
|
|
59
60
|
...baseRepoObject,
|
|
@@ -75,51 +76,47 @@ class Consolidate extends command_1.SfdxCommand {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
shouldBeIgnored(title) {
|
|
79
|
-
const ignore = this.flags.ignore;
|
|
80
|
-
return ignore.some((i) => title.includes(i));
|
|
81
|
-
}
|
|
82
79
|
exec(cmd, silent = false) {
|
|
83
80
|
this.log((0, chalk_1.bold)(cmd));
|
|
84
81
|
(0, shelljs_1.exec)(cmd, { silent });
|
|
85
82
|
}
|
|
86
83
|
}
|
|
87
84
|
exports.default = Consolidate;
|
|
85
|
+
Consolidate.summary = messages.getMessage('description');
|
|
88
86
|
Consolidate.description = messages.getMessage('description');
|
|
89
87
|
Consolidate.examples = messages.getMessage('examples').split(os.EOL);
|
|
90
|
-
Consolidate.
|
|
88
|
+
Consolidate.flags = {
|
|
91
89
|
'max-version-bump': dependabot_1.maxVersionBumpFlag,
|
|
92
|
-
'base-branch':
|
|
93
|
-
|
|
90
|
+
'base-branch': sf_plugins_core_1.Flags.string({
|
|
91
|
+
summary: messages.getMessage('baseBranch'),
|
|
94
92
|
char: 'b',
|
|
95
93
|
default: 'main',
|
|
96
94
|
required: true,
|
|
97
95
|
}),
|
|
98
|
-
'target-branch':
|
|
99
|
-
|
|
96
|
+
'target-branch': sf_plugins_core_1.Flags.string({
|
|
97
|
+
summary: messages.getMessage('targetBranch'),
|
|
100
98
|
char: 't',
|
|
101
99
|
default: 'consolidate-dependabot',
|
|
102
100
|
required: true,
|
|
103
101
|
}),
|
|
104
|
-
ignore:
|
|
105
|
-
|
|
106
|
-
default: [],
|
|
102
|
+
ignore: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
103
|
+
summary: messages.getMessage('ignore'),
|
|
107
104
|
}),
|
|
108
|
-
dryrun:
|
|
109
|
-
|
|
105
|
+
dryrun: sf_plugins_core_1.Flags.boolean({
|
|
106
|
+
summary: messages.getMessage('dryrun'),
|
|
110
107
|
char: 'd',
|
|
111
108
|
default: false,
|
|
112
109
|
}),
|
|
113
|
-
'no-pr':
|
|
114
|
-
|
|
110
|
+
'no-pr': sf_plugins_core_1.Flags.boolean({
|
|
111
|
+
summary: messages.getMessage('noPR'),
|
|
115
112
|
default: false,
|
|
116
113
|
}),
|
|
117
|
-
owner:
|
|
118
|
-
|
|
114
|
+
owner: sf_plugins_core_1.Flags.string({
|
|
115
|
+
summary: messages.getMessage('owner'),
|
|
119
116
|
char: 'o',
|
|
120
117
|
}),
|
|
121
|
-
repo:
|
|
122
|
-
|
|
118
|
+
repo: sf_plugins_core_1.Flags.string({
|
|
119
|
+
summary: messages.getMessage('repo'),
|
|
123
120
|
char: 'r',
|
|
124
121
|
dependsOn: ['owner'],
|
|
125
122
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consolidate.js","sourceRoot":"","sources":["../../../src/commands/dependabot/consolidate.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,2CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"consolidate.js","sourceRoot":"","sources":["../../../src/commands/dependabot/consolidate.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,2CAA4C;AAC5C,iEAAqF;AACrF,wCAAwC;AACxC,yCAAsC;AACtC,iCAA0C;AAC1C,qCAA+B;AAC/B,mDAAoD;AACpD,iDAAuG;AAEvG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,uCAAuC,EAAE,wBAAwB,CAAC,CAAC;AAE1G,MAAqB,WAAY,SAAQ,2BAAe;IA0C/C,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,cAAc,GAAG,MAAM,IAAA,4BAAe,EAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,IAAA,uBAAY,EAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACtD,MAAM,YAAY,GAAG,IAAA,uBAAY,EAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;QAC1D,MAAM,IAAI,GAAG,IAAA,uBAAY,EAAC,IAAI,SAAG,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,mDAAmD,CAAC,CAAC;QAEhH,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F,MAAM,EAAE,uBAAK,CAAC,OAAO,CAAC;QACpB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QACtC,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;KACf,CAAC;IACF,OAAO,EAAE,uBAAK,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;QACpC,OAAO,EAAE,KAAK;KACf,CAAC;IACF,KAAK,EAAE,uBAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QACrC,IAAI,EAAE,GAAG;KACV,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;QACpC,IAAI,EAAE,GAAG;QACT,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC;CACH,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { ChangedPackageVersions } from '../../../package';
|
|
3
|
-
export default class Pin extends
|
|
3
|
+
export default class Pin extends SfCommand<ChangedPackageVersions> {
|
|
4
|
+
static readonly summary: string;
|
|
4
5
|
static readonly description: string;
|
|
5
|
-
static readonly
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
dryrun: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
tag: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
9
|
+
};
|
|
6
10
|
run(): Promise<ChangedPackageVersions>;
|
|
7
11
|
}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/*
|
|
4
3
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
5
4
|
* All rights reserved.
|
|
6
5
|
* Licensed under the BSD 3-Clause license.
|
|
7
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
7
|
*/
|
|
9
|
-
|
|
8
|
+
/* eslint-disable sf-plugin/command-example */
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
10
11
|
const core_1 = require("@salesforce/core");
|
|
11
12
|
const package_1 = require("../../../package");
|
|
12
13
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
13
14
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'npm.dependencies.pin');
|
|
14
|
-
class Pin extends
|
|
15
|
+
class Pin extends sf_plugins_core_1.SfCommand {
|
|
15
16
|
async run() {
|
|
17
|
+
const { flags } = await this.parse(Pin);
|
|
16
18
|
const packageJson = await package_1.Package.create();
|
|
17
|
-
const pkg = packageJson.pinDependencyVersions(
|
|
18
|
-
if (
|
|
19
|
+
const pkg = packageJson.pinDependencyVersions(flags.tag);
|
|
20
|
+
if (flags.dryrun) {
|
|
19
21
|
this.warn('Running in --dryrun mode. No changes will be written to the package.json.');
|
|
20
22
|
}
|
|
21
23
|
else {
|
|
22
24
|
packageJson.writePackageJson();
|
|
23
25
|
}
|
|
24
|
-
this.
|
|
26
|
+
this.table(pkg, {
|
|
25
27
|
name: { header: 'Name' },
|
|
26
28
|
version: { header: 'Version' },
|
|
27
29
|
tag: { header: 'Tag' },
|
|
@@ -31,16 +33,17 @@ class Pin extends command_1.SfdxCommand {
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
exports.default = Pin;
|
|
36
|
+
Pin.summary = messages.getMessage('description');
|
|
34
37
|
Pin.description = messages.getMessage('description');
|
|
35
|
-
Pin.
|
|
36
|
-
dryrun:
|
|
38
|
+
Pin.flags = {
|
|
39
|
+
dryrun: sf_plugins_core_1.Flags.boolean({
|
|
37
40
|
char: 'd',
|
|
38
41
|
default: false,
|
|
39
|
-
|
|
42
|
+
summary: messages.getMessage('flags.dryrun'),
|
|
40
43
|
}),
|
|
41
|
-
tag:
|
|
44
|
+
tag: sf_plugins_core_1.Flags.string({
|
|
42
45
|
char: 't',
|
|
43
|
-
|
|
46
|
+
summary: messages.getMessage('flags.tag'),
|
|
44
47
|
default: 'latest',
|
|
45
48
|
}),
|
|
46
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pin.js","sourceRoot":"","sources":["../../../../src/commands/npm/dependencies/pin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pin.js","sourceRoot":"","sources":["../../../../src/commands/npm/dependencies/pin.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,8CAA8C;;AAE9C,iEAA+D;AAC/D,2CAA4C;AAC5C,8CAAmE;AAEnE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,uCAAuC,EAAE,sBAAsB,CAAC,CAAC;AAExG,MAAqB,GAAI,SAAQ,2BAAiC;IAiBzD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,WAAW,GAAG,MAAM,iBAAO,CAAC,MAAM,EAAE,CAAC;QAC3C,MAAM,GAAG,GAAG,WAAW,CAAC,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEzD,IAAI,KAAK,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;SACxF;aAAM;YACL,WAAW,CAAC,gBAAgB,EAAE,CAAC;SAChC;QAED,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YACd,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;YACxB,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;YAC9B,GAAG,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;YACtB,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE;SAC3B,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC;;AApCH,sBAqCC;AApCwB,WAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAC7C,eAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAEjD,SAAK,GAAG;IAC7B,MAAM,EAAE,uBAAK,CAAC,OAAO,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC;KAC7C,CAAC;IACF,GAAG,EAAE,uBAAK,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;QACzC,OAAO,EAAE,QAAQ;KAClB,CAAC;CACH,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class Promote extends
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export default class Promote extends SfCommand<void> {
|
|
3
|
+
static readonly summary: string;
|
|
3
4
|
static readonly description: string;
|
|
4
5
|
static readonly examples: string[];
|
|
5
|
-
static readonly
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
dryrun: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
target: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
9
|
+
candidate: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
10
|
+
};
|
|
6
11
|
run(): Promise<void>;
|
|
7
12
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const os = require("os");
|
|
10
|
-
const
|
|
10
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
11
|
const core_1 = require("@salesforce/core");
|
|
12
12
|
const kit_1 = require("@salesforce/kit");
|
|
13
13
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
@@ -16,9 +16,10 @@ const chalk_1 = require("chalk");
|
|
|
16
16
|
const repository_1 = require("../../../repository");
|
|
17
17
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
18
18
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'npm.package.promote');
|
|
19
|
-
class Promote extends
|
|
19
|
+
class Promote extends sf_plugins_core_1.SfCommand {
|
|
20
20
|
async run() {
|
|
21
|
-
const
|
|
21
|
+
const { flags } = await this.parse(Promote);
|
|
22
|
+
const pkg = await repository_1.PackageRepo.create({ ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }) });
|
|
22
23
|
await pkg.writeNpmToken();
|
|
23
24
|
const token = (0, ts_types_1.ensureString)(new kit_1.Env().getString('NPM_TOKEN'), 'NPM_TOKEN must be set in the environment');
|
|
24
25
|
const tokens = JSON.parse((0, shelljs_1.exec)('npm token list --json', { silent: true }).stdout);
|
|
@@ -29,8 +30,8 @@ class Promote extends command_1.SfdxCommand {
|
|
|
29
30
|
throw new core_1.SfError(messages.getMessage(errType), errType);
|
|
30
31
|
}
|
|
31
32
|
const tags = pkg.package.npmPackage['dist-tags'];
|
|
32
|
-
const candidate = (0, ts_types_1.ensureString)(
|
|
33
|
-
const target = (0, ts_types_1.ensureString)(
|
|
33
|
+
const candidate = (0, ts_types_1.ensureString)(flags.candidate);
|
|
34
|
+
const target = (0, ts_types_1.ensureString)(flags.target);
|
|
34
35
|
if (!tags[candidate]) {
|
|
35
36
|
const errType = 'InvalidTag';
|
|
36
37
|
throw new core_1.SfError(messages.getMessage(errType, [candidate]), errType);
|
|
@@ -40,28 +41,29 @@ class Promote extends command_1.SfdxCommand {
|
|
|
40
41
|
this.warn(`This will overwrite the existing ${target} version: ${tags[target]}`);
|
|
41
42
|
this.log();
|
|
42
43
|
}
|
|
43
|
-
if (!
|
|
44
|
+
if (!flags.dryrun) {
|
|
44
45
|
(0, shelljs_1.exec)(`npm dist-tag add ${pkg.name}@${tags[candidate]} ${target} --json`);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
exports.default = Promote;
|
|
50
|
+
Promote.summary = messages.getMessage('description');
|
|
49
51
|
Promote.description = messages.getMessage('description');
|
|
50
52
|
Promote.examples = messages.getMessage('examples').split(os.EOL);
|
|
51
|
-
Promote.
|
|
52
|
-
dryrun:
|
|
53
|
+
Promote.flags = {
|
|
54
|
+
dryrun: sf_plugins_core_1.Flags.boolean({
|
|
53
55
|
char: 'd',
|
|
54
56
|
default: false,
|
|
55
|
-
|
|
57
|
+
summary: messages.getMessage('dryrun'),
|
|
56
58
|
}),
|
|
57
|
-
target:
|
|
59
|
+
target: sf_plugins_core_1.Flags.string({
|
|
58
60
|
char: 't',
|
|
59
61
|
default: 'latest',
|
|
60
|
-
|
|
62
|
+
summary: messages.getMessage('target'),
|
|
61
63
|
}),
|
|
62
|
-
candidate:
|
|
64
|
+
candidate: sf_plugins_core_1.Flags.string({
|
|
63
65
|
char: 'c',
|
|
64
|
-
|
|
66
|
+
summary: messages.getMessage('candidate'),
|
|
65
67
|
required: true,
|
|
66
68
|
}),
|
|
67
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../../../../src/commands/npm/package/promote.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,yBAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"promote.js","sourceRoot":"","sources":["../../../../src/commands/npm/package/promote.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,yBAAyB;AACzB,iEAAmE;AACnE,2CAAqD;AACrD,yCAAsC;AACtC,mDAAoD;AACpD,qCAA+B;AAC/B,iCAA6B;AAC7B,oDAAkD;AAElD,eAAQ,CAAC,uBAAuB,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OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;KACvC,CAAC;IACF,MAAM,EAAE,uBAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;KACvC,CAAC;IACF,SAAS,EAAE,uBAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;QACzC,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC"}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { PackageInfo } from '../../../repository';
|
|
3
3
|
interface ReleaseResult {
|
|
4
4
|
version: string;
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
export default class Release extends
|
|
7
|
+
export default class Release extends SfCommand<ReleaseResult> {
|
|
8
|
+
static readonly summary: string;
|
|
8
9
|
static readonly description: string;
|
|
9
|
-
static readonly
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
dryrun: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
sign: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
npmtag: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
14
|
+
npmaccess: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
15
|
+
install: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
prerelease: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
17
|
+
verify: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
githubtag: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
19
|
+
};
|
|
10
20
|
run(): Promise<ReleaseResult>;
|
|
11
21
|
protected verifySign(pkgInfo: PackageInfo): void;
|
|
12
22
|
}
|
|
@@ -8,29 +8,33 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const os = require("os");
|
|
10
10
|
const chalk = require("chalk");
|
|
11
|
-
const
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
12
|
const core_1 = require("@salesforce/core");
|
|
13
13
|
const shelljs_1 = require("shelljs");
|
|
14
14
|
const dependencies_1 = require("../../../dependencies");
|
|
15
15
|
const repository_1 = require("../../../repository");
|
|
16
16
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
17
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-release-management', 'npm.package.release');
|
|
18
|
-
class Release extends
|
|
18
|
+
class Release extends sf_plugins_core_1.SfCommand {
|
|
19
19
|
async run() {
|
|
20
|
-
const
|
|
20
|
+
const { flags } = await this.parse(Release);
|
|
21
|
+
const deps = (0, dependencies_1.verifyDependencies)(flags);
|
|
21
22
|
if (deps.failures > 0) {
|
|
22
23
|
const errType = 'MissingDependencies';
|
|
23
24
|
const missing = deps.results.filter((d) => d.passed === false).map((d) => d.message);
|
|
24
25
|
throw new core_1.SfError(messages.getMessage(errType), errType, missing);
|
|
25
26
|
}
|
|
26
|
-
const pkg = await repository_1.PackageRepo.create({
|
|
27
|
+
const pkg = await repository_1.PackageRepo.create({
|
|
28
|
+
ux: new sf_plugins_core_1.Ux({ jsonEnabled: this.jsonEnabled() }),
|
|
29
|
+
useprerelease: flags.prerelease,
|
|
30
|
+
});
|
|
27
31
|
if (!pkg.shouldBePublished) {
|
|
28
|
-
this.
|
|
32
|
+
this.log('Found no commits that warrant a release. Exiting...');
|
|
29
33
|
return;
|
|
30
34
|
}
|
|
31
35
|
await pkg.writeNpmToken();
|
|
32
|
-
if (
|
|
33
|
-
this.
|
|
36
|
+
if (flags.githubtag) {
|
|
37
|
+
this.log(`Using Version: ${pkg.nextVersion}`);
|
|
34
38
|
}
|
|
35
39
|
else {
|
|
36
40
|
pkg.printStage('Validate Next Version');
|
|
@@ -39,22 +43,22 @@ class Release extends command_1.SfdxCommand {
|
|
|
39
43
|
const errType = 'InvalidNextVersion';
|
|
40
44
|
throw new core_1.SfError(messages.getMessage(errType, [pkgValidation.nextVersion]), errType);
|
|
41
45
|
}
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
46
|
+
this.log(`Name: ${pkgValidation.name}`);
|
|
47
|
+
this.log(`Current Version: ${pkgValidation.currentVersion}`);
|
|
48
|
+
this.log(`Next Version: ${pkgValidation.nextVersion}`);
|
|
45
49
|
}
|
|
46
|
-
if (
|
|
50
|
+
if (flags.install) {
|
|
47
51
|
pkg.printStage('Install');
|
|
48
52
|
pkg.install();
|
|
49
53
|
pkg.printStage('Build');
|
|
50
54
|
pkg.build();
|
|
51
55
|
}
|
|
52
|
-
if (!
|
|
56
|
+
if (!flags.githubtag) {
|
|
53
57
|
pkg.printStage('Prepare Release');
|
|
54
|
-
pkg.prepare({ dryrun:
|
|
58
|
+
pkg.prepare({ dryrun: flags.dryrun });
|
|
55
59
|
}
|
|
56
60
|
let signature;
|
|
57
|
-
if (
|
|
61
|
+
if (flags.sign && !flags.dryrun) {
|
|
58
62
|
pkg.printStage('Sign and Upload Security Files');
|
|
59
63
|
signature = await pkg.sign();
|
|
60
64
|
}
|
|
@@ -62,9 +66,9 @@ class Release extends command_1.SfdxCommand {
|
|
|
62
66
|
try {
|
|
63
67
|
await pkg.publish({
|
|
64
68
|
signatures: [signature],
|
|
65
|
-
access:
|
|
66
|
-
tag:
|
|
67
|
-
dryrun:
|
|
69
|
+
access: flags.npmaccess,
|
|
70
|
+
tag: flags.npmtag,
|
|
71
|
+
dryrun: flags.dryrun,
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
74
|
catch (err) {
|
|
@@ -73,26 +77,26 @@ class Release extends command_1.SfdxCommand {
|
|
|
73
77
|
}
|
|
74
78
|
this.error(err, { code: 'NPM_PUBLISH_FAILED', exit: 1 });
|
|
75
79
|
}
|
|
76
|
-
if (!
|
|
80
|
+
if (!flags.dryrun && flags.verify) {
|
|
77
81
|
pkg.printStage('Waiting For Availability');
|
|
78
82
|
const found = await pkg.waitForAvailability();
|
|
79
83
|
if (!found) {
|
|
80
|
-
this.
|
|
84
|
+
this.warn(`Exceeded timeout waiting for ${pkg.name}@${pkg.nextVersion} to become available`);
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
try {
|
|
84
|
-
if (
|
|
88
|
+
if (flags.sign && flags.verify && !flags.dryrun) {
|
|
85
89
|
pkg.printStage('Verify Signed Packaged');
|
|
86
90
|
this.verifySign(pkg.getPkgInfo());
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
finally {
|
|
90
|
-
if (!
|
|
94
|
+
if (!flags.dryrun && !flags.githubtag) {
|
|
91
95
|
pkg.printStage('Push Changes to Git');
|
|
92
96
|
pkg.pushChangesToGit();
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
|
-
this.
|
|
99
|
+
this.log(pkg.getSuccessMessage());
|
|
96
100
|
return {
|
|
97
101
|
version: pkg.nextVersion,
|
|
98
102
|
name: pkg.name,
|
|
@@ -101,12 +105,12 @@ class Release extends command_1.SfdxCommand {
|
|
|
101
105
|
verifySign(pkgInfo) {
|
|
102
106
|
const cmd = 'plugins:trust:verify';
|
|
103
107
|
const argv = `--npm ${pkgInfo.name}@${pkgInfo.nextVersion} ${pkgInfo.registryParam}`;
|
|
104
|
-
this.
|
|
108
|
+
this.log(chalk.dim(`sf-release ${cmd} ${argv}`) + os.EOL);
|
|
105
109
|
try {
|
|
106
110
|
const result = (0, shelljs_1.exec)(`DEBUG=sfdx:* ${this.config.root}/bin/run ${cmd} ${argv}`);
|
|
107
111
|
if (result.code !== 0) {
|
|
108
112
|
const sfdxVerifyCmd = `sfdx plugins:trust:verify ${argv}`;
|
|
109
|
-
this.
|
|
113
|
+
this.warn('Unable to verify the package signature due to:\n\nFailed to find @salesforce/sfdx-scanner@3.1.0 in the registry\n' +
|
|
110
114
|
`\nYou can manually validate the package signature by running:\n\n${sfdxVerifyCmd}\n`);
|
|
111
115
|
}
|
|
112
116
|
}
|
|
@@ -119,43 +123,44 @@ class Release extends command_1.SfdxCommand {
|
|
|
119
123
|
}
|
|
120
124
|
}
|
|
121
125
|
exports.default = Release;
|
|
126
|
+
Release.summary = messages.getMessage('description');
|
|
122
127
|
Release.description = messages.getMessage('description');
|
|
123
|
-
Release.
|
|
124
|
-
dryrun:
|
|
128
|
+
Release.flags = {
|
|
129
|
+
dryrun: sf_plugins_core_1.Flags.boolean({
|
|
125
130
|
char: 'd',
|
|
126
131
|
default: false,
|
|
127
|
-
|
|
132
|
+
summary: messages.getMessage('dryrun'),
|
|
128
133
|
}),
|
|
129
|
-
sign:
|
|
134
|
+
sign: sf_plugins_core_1.Flags.boolean({
|
|
130
135
|
char: 's',
|
|
131
136
|
default: false,
|
|
132
|
-
|
|
137
|
+
summary: messages.getMessage('sign'),
|
|
133
138
|
}),
|
|
134
|
-
npmtag:
|
|
139
|
+
npmtag: sf_plugins_core_1.Flags.string({
|
|
135
140
|
char: 't',
|
|
136
141
|
default: 'latest',
|
|
137
|
-
|
|
142
|
+
summary: messages.getMessage('npmTag'),
|
|
138
143
|
}),
|
|
139
|
-
npmaccess:
|
|
144
|
+
npmaccess: sf_plugins_core_1.Flags.string({
|
|
140
145
|
char: 'a',
|
|
141
146
|
default: 'public',
|
|
142
|
-
|
|
147
|
+
summary: messages.getMessage('npmAccess'),
|
|
143
148
|
}),
|
|
144
|
-
install:
|
|
149
|
+
install: sf_plugins_core_1.Flags.boolean({
|
|
145
150
|
default: true,
|
|
146
|
-
|
|
151
|
+
summary: messages.getMessage('install'),
|
|
147
152
|
allowNo: true,
|
|
148
153
|
}),
|
|
149
|
-
prerelease:
|
|
150
|
-
|
|
154
|
+
prerelease: sf_plugins_core_1.Flags.string({
|
|
155
|
+
summary: messages.getMessage('prerelease'),
|
|
151
156
|
}),
|
|
152
|
-
verify:
|
|
153
|
-
|
|
157
|
+
verify: sf_plugins_core_1.Flags.boolean({
|
|
158
|
+
summary: messages.getMessage('verify'),
|
|
154
159
|
default: true,
|
|
155
160
|
allowNo: true,
|
|
156
161
|
}),
|
|
157
|
-
githubtag:
|
|
158
|
-
|
|
162
|
+
githubtag: sf_plugins_core_1.Flags.string({
|
|
163
|
+
summary: messages.getMessage('githubtag'),
|
|
159
164
|
}),
|
|
160
165
|
};
|
|
161
166
|
//# sourceMappingURL=release.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../../src/commands/npm/package/release.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,yBAAyB;AACzB,+BAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../../src/commands/npm/package/release.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,yBAAyB;AACzB,+BAA+B;AAC/B,iEAAmE;AACnE,2CAAqD;AACrD,qCAA+B;AAE/B,wDAA2D;AAC3D,oDAA0D;AAG1D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,uCAAuC,EAAE,qBAAqB,CAAC,CAAC;AAOvG,MAAqB,OAAQ,SAAQ,2BAAwB;IA2CpD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAA,iCAAkB,EAAC,KAAK,CAAC,CAAC;QACvC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE;YACrB,MAAM,OAAO,GAAG,qBAAqB,CAAC;YACtC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAA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,EAAE,uBAAK,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QACvC,OAAO,EAAE,IAAI;KACd,CAAC;IACF,UAAU,EAAE,uBAAK,CAAC,MAAM,CAAC;QACvB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC;KAC3C,CAAC;IACF,MAAM,EAAE,uBAAK,CAAC,OAAO,CAAC;QACpB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QACtC,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KACd,CAAC;IACF,SAAS,EAAE,uBAAK,CAAC,MAAM,CAAC;QACtB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC;KAC1C,CAAC;CACH,CAAC"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { CommitInspection } from '../../../inspectCommits';
|
|
3
|
-
|
|
3
|
+
type PackageCommits = CommitInspection & {
|
|
4
4
|
name: string;
|
|
5
5
|
currentVersion: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type Response = {
|
|
8
8
|
shouldRelease: boolean;
|
|
9
9
|
majorBump: boolean;
|
|
10
10
|
packages?: PackageCommits[];
|
|
11
11
|
};
|
|
12
|
-
export default class Validate extends
|
|
12
|
+
export default class Validate extends SfCommand<Response> {
|
|
13
|
+
static readonly summary = "inspects the git commits to see if there are any commits that will warrant a new release";
|
|
13
14
|
static readonly description = "inspects the git commits to see if there are any commits that will warrant a new release";
|
|
14
|
-
static readonly
|
|
15
|
+
static readonly flags: {
|
|
16
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
15
18
|
run(): Promise<Response>;
|
|
16
19
|
}
|
|
17
20
|
export {};
|