@salesforce/plugin-info 1.1.2 → 1.2.1
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/CHANGELOG.md +32 -4
- package/LICENSE.txt +1 -1
- package/README.md +11 -10
- package/lib/commands/info/releasenotes/display.js +2 -1
- package/lib/commands/info/releasenotes/display.js.map +1 -1
- package/lib/shared/getDistTagVersion.js +3 -1
- package/lib/shared/getDistTagVersion.js.map +1 -1
- package/lib/shared/getReleaseNotes.js +3 -0
- package/lib/shared/getReleaseNotes.js.map +1 -1
- package/lib/shared/parseReleaseNotes.js +33 -17
- package/lib/shared/parseReleaseNotes.js.map +1 -1
- package/messages/display.js +3 -5
- package/oclif.manifest.json +1 -1
- package/package.json +12 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,14 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.1
|
|
5
|
+
### [1.2.1](https://github.com/salesforcecli/plugin-info/compare/v1.2.0...v1.2.1) (2022-02-10)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- proxy support for got ([#75](https://github.com/salesforcecli/plugin-info/issues/75)) ([2d9abef](https://github.com/salesforcecli/plugin-info/commit/2d9abefe045d9fcfde9c79df416e5b809b5461d6))
|
|
10
|
+
|
|
11
|
+
## [1.2.0](https://github.com/salesforcecli/plugin-info/compare/v1.1.4...v1.2.0) (2022-01-05)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- find close version fallback ([f1b2edc](https://github.com/salesforcecli/plugin-info/commit/f1b2edcb26057b1eef10656a8c7fb255f1e4dd08))
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
6
18
|
|
|
19
|
+
- type and typos ([75d46c6](https://github.com/salesforcecli/plugin-info/commit/75d46c66b1b22c74b1d8dfeb56da727c1e51ea51))
|
|
20
|
+
|
|
21
|
+
### [1.1.4](https://github.com/salesforcecli/plugin-info/compare/v1.1.3...v1.1.4) (2021-12-07)
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
- update help message to make the CLI Command Ref work ([268a7b5](https://github.com/salesforcecli/plugin-info/commit/268a7b551fd05d3358691e98cb04ad70df2cef95))
|
|
26
|
+
|
|
27
|
+
### [1.1.3](https://github.com/salesforcecli/plugin-info/compare/v1.1.2...v1.1.3) (2021-12-07)
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
- disable emoji ([b4edbae](https://github.com/salesforcecli/plugin-info/commit/b4edbae03f308198c8fa6a90323a3c69c1e9efc5))
|
|
32
|
+
- emoji test ([10229c4](https://github.com/salesforcecli/plugin-info/commit/10229c40da67b6ea65577ddd53f685d0ce79c0ea))
|
|
33
|
+
|
|
34
|
+
### [1.1.2](https://github.com/salesforcecli/plugin-info/compare/v1.1.1...v1.1.2) (2021-12-01)
|
|
7
35
|
|
|
8
36
|
### Bug Fixes
|
|
9
37
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
38
|
+
- always show notes when running directly ([a0cd11e](https://github.com/salesforcecli/plugin-info/commit/a0cd11ec3777eb91adcfcac180d85b442b34b52a))
|
|
39
|
+
- merge conflict ([e4f7103](https://github.com/salesforcecli/plugin-info/commit/e4f7103b04f23cc9f66fa02f18286166be819812))
|
|
40
|
+
- whitespace conflict ([605d782](https://github.com/salesforcecli/plugin-info/commit/605d782be93a060e0eda69441806fe0cb76193d5))
|
|
13
41
|
|
|
14
42
|
### [1.1.1](https://github.com/salesforcecli/plugin-info/compare/v1.1.0...v1.1.1) (2021-11-30)
|
|
15
43
|
|
package/LICENSE.txt
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# plugin-info
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@salesforce/plugin-info) [](https://circleci.com/gh/salesforcecli/plugin-info/tree/main) [](https://npmjs.org/package/@salesforce/plugin-info) [](https://raw.githubusercontent.com/salesforcecli/plugin-info/main/LICENSE.txt)
|
|
4
|
+
|
|
4
5
|
## Learn about the plugin-info
|
|
5
6
|
|
|
6
7
|
Salesforce CLI plugins are based on the [oclif plugin framework](<(https://oclif.io/docs/introduction.html)>). Read the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm) to learn about Salesforce CLI plugin development.
|
|
@@ -74,20 +75,21 @@ sfdx plugins
|
|
|
74
75
|
## Commands
|
|
75
76
|
|
|
76
77
|
<!-- commands -->
|
|
77
|
-
|
|
78
|
+
|
|
79
|
+
- [`sfdx info:releasenotes:display [-v <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-inforeleasenotesdisplay--v-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
78
80
|
|
|
79
81
|
## `sfdx info:releasenotes:display [-v <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
80
82
|
|
|
81
|
-
|
|
83
|
+
Display Salesforce CLI release notes on the command line.
|
|
82
84
|
|
|
83
85
|
```
|
|
84
86
|
USAGE
|
|
85
|
-
$ sfdx info:releasenotes:display [-v <string>] [--json] [--loglevel
|
|
87
|
+
$ sfdx info:releasenotes:display [-v <string>] [--json] [--loglevel
|
|
86
88
|
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
87
89
|
|
|
88
90
|
OPTIONS
|
|
89
91
|
-v, --version=version CLI version or tag for which to
|
|
90
|
-
display release notes
|
|
92
|
+
display release notes.
|
|
91
93
|
|
|
92
94
|
--json format output as json
|
|
93
95
|
|
|
@@ -99,14 +101,13 @@ ALIASES
|
|
|
99
101
|
|
|
100
102
|
EXAMPLES
|
|
101
103
|
Display release notes for the currently installed CLI version:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
sfdx info:releasenotes:display
|
|
104
105
|
Display release notes for CLI version 7.120.0:
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
sfdx info:releasenotes:display --version 7.120.0
|
|
107
107
|
Display release notes for the CLI version that corresponds to a tag (stable, stable-rc, latest, latest-rc, rc):
|
|
108
|
-
|
|
108
|
+
sfdx info:releasenotes:display --version latest
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/v1.
|
|
111
|
+
_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/v1.2.0/src/commands/info/releasenotes/display.ts)_
|
|
112
|
+
|
|
112
113
|
<!-- commandsstop -->
|
|
@@ -49,8 +49,9 @@ class Display extends command_1.SfdxCommand {
|
|
|
49
49
|
const releaseNotes = await (0, getReleaseNotes_1.getReleaseNotes)(releaseNotesPath, releaseNotesFilename, version);
|
|
50
50
|
const tokens = (0, parseReleaseNotes_1.parseReleaseNotes)(releaseNotes, version, releaseNotesPath);
|
|
51
51
|
marked_1.marked.setOptions({
|
|
52
|
-
renderer: new TerminalRenderer(),
|
|
52
|
+
renderer: new TerminalRenderer({ emoji: false }),
|
|
53
53
|
});
|
|
54
|
+
tokens.unshift(marked_1.marked.lexer(`# Release notes for '${this.config.bin}':`)[0]);
|
|
54
55
|
this.ux.log(marked_1.marked.parser(tokens));
|
|
55
56
|
if (isHook) {
|
|
56
57
|
if (env.getBoolean(HIDE_FOOTER)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../src/commands/info/releasenotes/display.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,4EAA4E;AAC5E,uDAAuD;AAEvD,yBAAyB;AACzB,m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GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AAEhE,mBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAExD,eAAO,GAAG,CAAC,UAAU,CAAC,CAAC;AAEvB,gBAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAEpF,mBAAW,GAAG;IAC7B,OAAO,EAAE,eAAK,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC;KAClD,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,OAAO,CAAC;QAClB,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC;KAC/C,CAAC;CACH,CAAC"}
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.getDistTagVersion = void 0;
|
|
10
10
|
const got_1 = require("got");
|
|
11
|
+
const ProxyAgent = require("proxy-agent");
|
|
12
|
+
const proxy_from_env_1 = require("proxy-from-env");
|
|
11
13
|
const constants_1 = require("../constants");
|
|
12
14
|
const getDistTagVersion = async (url, distTag) => {
|
|
13
15
|
// TODO: Could use npm instead here. That way private cli repos could auth with .npmrc
|
|
14
16
|
// -- could utilize this: https://github.com/salesforcecli/plugin-trust/blob/0393b906a30e8858816625517eda5db69377c178/src/lib/npmCommand.ts
|
|
15
|
-
const options = { timeout: constants_1.SFDX_RELEASE_NOTES_TIMEOUT };
|
|
17
|
+
const options = { timeout: constants_1.SFDX_RELEASE_NOTES_TIMEOUT, agent: { https: ProxyAgent((0, proxy_from_env_1.getProxyForUrl)(url)) } };
|
|
16
18
|
const body = await (0, got_1.default)(url, options).json();
|
|
17
19
|
// We are only interested in latest and latest-rc, could update this if other tags are desired
|
|
18
20
|
return distTag.includes('rc') ? body['latest-rc'] : body['latest'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDistTagVersion.js","sourceRoot":"","sources":["../../src/shared/getDistTagVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAsB;AACtB,4CAA0D;AAO1D,MAAM,iBAAiB,GAAG,KAAK,EAAE,GAAW,EAAE,OAAe,EAAmB,EAAE;IAChF,sFAAsF;IACtF,2IAA2I;IAC3I,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,sCAA0B,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"getDistTagVersion.js","sourceRoot":"","sources":["../../src/shared/getDistTagVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAsB;AACtB,0CAA0C;AAC1C,mDAAgD;AAChD,4CAA0D;AAO1D,MAAM,iBAAiB,GAAG,KAAK,EAAE,GAAW,EAAE,OAAe,EAAmB,EAAE;IAChF,sFAAsF;IACtF,2IAA2I;IAC3I,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,sCAA0B,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,IAAA,+BAAc,EAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;IAE3G,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,EAAe,CAAC;IAEzD,8FAA8F;IAC9F,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrE,CAAC,CAAC;AAEO,8CAAiB"}
|
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.getReleaseNotes = void 0;
|
|
10
10
|
const got_1 = require("got");
|
|
11
11
|
const semver_1 = require("semver");
|
|
12
|
+
const proxy_from_env_1 = require("proxy-from-env");
|
|
13
|
+
const ProxyAgent = require("proxy-agent");
|
|
12
14
|
const constants_1 = require("../constants");
|
|
13
15
|
const getReleaseNotes = async (base, filename, version) => {
|
|
14
16
|
const majorVersion = (0, semver_1.major)(version);
|
|
@@ -16,6 +18,7 @@ const getReleaseNotes = async (base, filename, version) => {
|
|
|
16
18
|
const options = {
|
|
17
19
|
timeout: constants_1.SFDX_RELEASE_NOTES_TIMEOUT,
|
|
18
20
|
throwHttpErrors: false,
|
|
21
|
+
agent: { https: ProxyAgent((0, proxy_from_env_1.getProxyForUrl)(rawBase)) },
|
|
19
22
|
};
|
|
20
23
|
const getPromises = [
|
|
21
24
|
(0, got_1.default)(`${rawBase}/v${majorVersion}.md`, options),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getReleaseNotes.js","sourceRoot":"","sources":["../../src/shared/getReleaseNotes.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAsB;AACtB,mCAA+B;AAC/B,4CAA0D;AAE1D,MAAM,eAAe,GAAG,KAAK,EAAE,IAAY,EAAE,QAAgB,EAAE,OAAe,EAAmB,EAAE;IACjG,MAAM,YAAY,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,2BAA2B,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAEtH,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,sCAA0B;QACnC,eAAe,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"getReleaseNotes.js","sourceRoot":"","sources":["../../src/shared/getReleaseNotes.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6BAAsB;AACtB,mCAA+B;AAC/B,mDAAgD;AAChD,0CAA0C;AAC1C,4CAA0D;AAE1D,MAAM,eAAe,GAAG,KAAK,EAAE,IAAY,EAAE,QAAgB,EAAE,OAAe,EAAmB,EAAE;IACjG,MAAM,YAAY,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,2BAA2B,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAEtH,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,sCAA0B;QACnC,eAAe,EAAE,KAAK;QACtB,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,IAAA,+BAAc,EAAC,OAAO,CAAC,CAAC,EAAE;KACtD,CAAC;IAEF,MAAM,WAAW,GAAG;QAClB,IAAA,aAAG,EAAC,GAAG,OAAO,KAAK,YAAY,KAAK,EAAE,OAAO,CAAC;QAC9C,IAAA,aAAG,EAAC,GAAG,OAAO,IAAI,QAAQ,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;KACrE,CAAC;IAEF,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE3D,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IAEnE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEO,0CAAe"}
|
|
@@ -8,29 +8,41 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.parseReleaseNotes = void 0;
|
|
10
10
|
const marked_1 = require("marked");
|
|
11
|
+
const semver = require("semver");
|
|
11
12
|
const parseReleaseNotes = (notes, version, baseUrl) => {
|
|
12
13
|
let found = false;
|
|
14
|
+
let closestVersion;
|
|
15
|
+
let versions;
|
|
13
16
|
const parsed = marked_1.marked.lexer(notes);
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
let tokens;
|
|
18
|
+
const findVersion = (desiredVersion) => {
|
|
19
|
+
versions = [];
|
|
20
|
+
tokens = parsed.filter((token) => {
|
|
21
|
+
// TODO: Could make header depth (2) a setting in oclif.info.releasenotes
|
|
22
|
+
if (token.type === 'heading' && token.depth === 2) {
|
|
23
|
+
const coercedVersion = semver.coerce(token.text).version;
|
|
24
|
+
// We will use this to find the closest patch if passed version is not found
|
|
25
|
+
versions.push(coercedVersion);
|
|
26
|
+
if (coercedVersion === desiredVersion) {
|
|
27
|
+
found = true;
|
|
28
|
+
return token;
|
|
29
|
+
}
|
|
30
|
+
found = false;
|
|
31
|
+
}
|
|
32
|
+
else if (found === true) {
|
|
24
33
|
return token;
|
|
25
34
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return token;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
findVersion(version);
|
|
32
38
|
if (!tokens.length) {
|
|
33
|
-
|
|
39
|
+
// If version was not found, try again with the closest patch version
|
|
40
|
+
const semverRange = `${semver.major(version)}.${semver.minor(version)}.x`;
|
|
41
|
+
closestVersion = semver.maxSatisfying(versions, semverRange);
|
|
42
|
+
findVersion(closestVersion);
|
|
43
|
+
if (!tokens.length) {
|
|
44
|
+
throw new Error(`Didn't find version '${version}'. View release notes online at: ${baseUrl}`);
|
|
45
|
+
}
|
|
34
46
|
}
|
|
35
47
|
const fixRelativeLinks = (token) => {
|
|
36
48
|
// If link is relative, add the baseurl. https://regex101.com/r/h802kJ/1
|
|
@@ -40,6 +52,10 @@ const parseReleaseNotes = (notes, version, baseUrl) => {
|
|
|
40
52
|
}
|
|
41
53
|
};
|
|
42
54
|
marked_1.marked.walkTokens(tokens, fixRelativeLinks);
|
|
55
|
+
if (closestVersion !== undefined) {
|
|
56
|
+
const warning = marked_1.marked.lexer(`# ATTENTION: Version ${version} was not found. Showing notes for closest patch version ${closestVersion}.`)[0];
|
|
57
|
+
tokens.unshift(warning);
|
|
58
|
+
}
|
|
43
59
|
return tokens;
|
|
44
60
|
};
|
|
45
61
|
exports.parseReleaseNotes = parseReleaseNotes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseReleaseNotes.js","sourceRoot":"","sources":["../../src/shared/parseReleaseNotes.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAAgC;
|
|
1
|
+
{"version":3,"file":"parseReleaseNotes.js","sourceRoot":"","sources":["../../src/shared/parseReleaseNotes.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAAgC;AAChC,iCAAiC;AAEjC,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,OAAe,EAAE,OAAe,EAAkB,EAAE;IAC5F,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,IAAI,cAAsB,CAAC;IAC3B,IAAI,QAAkB,CAAC;IAEvB,MAAM,MAAM,GAAG,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEnC,IAAI,MAAsB,CAAC;IAE3B,MAAM,WAAW,GAAG,CAAC,cAAsB,EAAQ,EAAE;QACnD,QAAQ,GAAG,EAAE,CAAC;QAEd,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YAC/B,yEAAyE;YACzE,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,CAAC,EAAE;gBACjD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,C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wB,OAAO,2DAA2D,cAAc,GAAG,CAC5G,CAAC,CAAC,CAAC,CAAC;QAEL,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;KACzB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEO,8CAAiB"}
|
package/messages/display.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
commandDescription: '
|
|
2
|
+
commandDescription: 'Display Salesforce CLI release notes on the command line.',
|
|
3
3
|
flags: {
|
|
4
|
-
version: 'CLI version or tag for which to display release notes',
|
|
5
|
-
hook: '
|
|
4
|
+
version: 'CLI version or tag for which to display release notes.',
|
|
5
|
+
hook: 'This hidden parameter is used in post install or update hooks.',
|
|
6
6
|
},
|
|
7
7
|
examples: [
|
|
8
8
|
`Display release notes for the currently installed CLI version:
|
|
9
9
|
<%= config.bin %> <%= command.id %>
|
|
10
|
-
|
|
11
10
|
Display release notes for CLI version 7.120.0:
|
|
12
11
|
<%= config.bin %> <%= command.id %> --version 7.120.0
|
|
13
|
-
|
|
14
12
|
Display release notes for the CLI version that corresponds to a tag (%s):
|
|
15
13
|
<%= config.bin %> <%= command.id %> --version latest
|
|
16
14
|
`,
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.1
|
|
1
|
+
{"version":"1.2.1","commands":{"info:releasenotes:display":{"id":"info:releasenotes:display","description":"Display Salesforce CLI release notes on the command line.","usage":"<%= command.id %> [-v <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@salesforce/plugin-info","pluginType":"core","aliases":["whatsnew"],"examples":["Display release notes for the currently installed CLI version:"," <%= config.bin %> <%= command.id %>","Display release notes for CLI version 7.120.0:"," <%= config.bin %> <%= command.id %> --version 7.120.0","Display release notes for the CLI version that corresponds to a tag (stable, stable-rc, latest, latest-rc, rc):"," <%= config.bin %> <%= command.id %> --version latest"," "],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"version":{"name":"version","type":"option","char":"v","description":"CLI version or tag for which to display release notes."},"hook":{"name":"hook","type":"boolean","description":"This hidden parameter is used in post install or update hooks.","hidden":true,"allowNo":false}},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-info",
|
|
3
3
|
"description": "Plugin for accessing cli info from the command line",
|
|
4
|
-
"version": "1.1
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -12,22 +12,24 @@
|
|
|
12
12
|
"got": "^11.8.2",
|
|
13
13
|
"marked": "^4.0.1",
|
|
14
14
|
"marked-terminal": "^4.2.0",
|
|
15
|
+
"proxy-agent": "^5.0.0",
|
|
16
|
+
"proxy-from-env": "^1.1.0",
|
|
15
17
|
"semver": "^7.3.5",
|
|
16
|
-
"sinon-chai": "^3.7.0",
|
|
17
18
|
"tslib": "^2"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"@oclif/dev-cli": "^1",
|
|
21
22
|
"@oclif/plugin-command-snapshot": "^2.2.2",
|
|
22
23
|
"@salesforce/cli-plugins-testkit": "^1.4.17",
|
|
23
|
-
"@salesforce/dev-config": "^
|
|
24
|
-
"@salesforce/dev-scripts": "^0.
|
|
24
|
+
"@salesforce/dev-config": "^3.0.0",
|
|
25
|
+
"@salesforce/dev-scripts": "^2.0.0",
|
|
25
26
|
"@salesforce/plugin-command-reference": "^1.3.17",
|
|
26
27
|
"@salesforce/prettier-config": "^0.0.2",
|
|
27
28
|
"@salesforce/ts-sinon": "1.3.21",
|
|
28
29
|
"@types/fs-extra": "^9.0.13",
|
|
29
30
|
"@types/marked": "^4.0.0",
|
|
30
31
|
"@types/marked-terminal": "^3.1.3",
|
|
32
|
+
"@types/proxy-from-env": "^1.0.1",
|
|
31
33
|
"@types/semver": "^7.3.8",
|
|
32
34
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
33
35
|
"@typescript-eslint/parser": "^4.33.0",
|
|
@@ -42,14 +44,15 @@
|
|
|
42
44
|
"eslint-plugin-import": "^2.25.3",
|
|
43
45
|
"eslint-plugin-jsdoc": "^35.5.1",
|
|
44
46
|
"eslint-plugin-prettier": "^3.4.1",
|
|
45
|
-
"husky": "^
|
|
47
|
+
"husky": "^7.0.4",
|
|
46
48
|
"lint-staged": "^11.2.6",
|
|
47
|
-
"mocha": "^
|
|
49
|
+
"mocha": "^9.1.3",
|
|
48
50
|
"nyc": "^15.1.0",
|
|
49
51
|
"prettier": "^2.4.1",
|
|
50
52
|
"pretty-quick": "^3.1.0",
|
|
51
|
-
"shx": "0.3.
|
|
53
|
+
"shx": "0.3.4",
|
|
52
54
|
"sinon": "^11.1.1",
|
|
55
|
+
"sinon-chai": "^3.7.0",
|
|
53
56
|
"ts-node": "^10.4.0",
|
|
54
57
|
"typescript": "^4.5.2"
|
|
55
58
|
},
|
|
@@ -115,18 +118,11 @@
|
|
|
115
118
|
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
|
|
116
119
|
"version": "oclif-dev readme"
|
|
117
120
|
},
|
|
118
|
-
"husky": {
|
|
119
|
-
"hooks": {
|
|
120
|
-
"pre-commit": "sf-husky-pre-commit",
|
|
121
|
-
"commit-msg": "sf-husky-commit-msg",
|
|
122
|
-
"pre-push": "sf-husky-pre-push"
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
121
|
"publishConfig": {
|
|
126
122
|
"access": "public"
|
|
127
123
|
},
|
|
128
124
|
"sfdx": {
|
|
129
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-info/1.1.
|
|
130
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-info/1.1.
|
|
125
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-info/1.2.1.crt",
|
|
126
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-info/1.2.1.sig"
|
|
131
127
|
}
|
|
132
128
|
}
|