@salesforce/plugin-info 2.6.51 → 3.0.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/README.md +15 -15
- package/lib/commands/doctor.d.ts +6 -6
- package/lib/commands/doctor.js +62 -65
- package/lib/commands/doctor.js.map +1 -1
- package/lib/commands/info/releasenotes/display.d.ts +3 -3
- package/lib/commands/info/releasenotes/display.js +41 -45
- package/lib/commands/info/releasenotes/display.js.map +1 -1
- package/lib/constants.js +1 -4
- package/lib/constants.js.map +1 -1
- package/lib/diagnostics.d.ts +1 -1
- package/lib/diagnostics.js +15 -14
- package/lib/diagnostics.js.map +1 -1
- package/lib/doctor.d.ts +1 -1
- package/lib/doctor.js +30 -27
- package/lib/doctor.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -7
- package/lib/index.js.map +1 -1
- package/lib/shared/getDistTagVersion.d.ts +5 -2
- package/lib/shared/getDistTagVersion.js +10 -10
- package/lib/shared/getDistTagVersion.js.map +1 -1
- package/lib/shared/getInfoConfig.d.ts +8 -5
- package/lib/shared/getInfoConfig.js +6 -9
- package/lib/shared/getInfoConfig.js.map +1 -1
- package/lib/shared/getReleaseNotes.d.ts +5 -2
- package/lib/shared/getReleaseNotes.js +11 -14
- package/lib/shared/getReleaseNotes.js.map +1 -1
- package/lib/shared/index.d.ts +7 -0
- package/lib/shared/index.js +17 -0
- package/lib/shared/index.js.map +1 -0
- package/lib/shared/parseReleaseNotes.d.ts +5 -2
- package/lib/shared/parseReleaseNotes.js +10 -13
- package/lib/shared/parseReleaseNotes.js.map +1 -1
- package/messages/doctor.md +2 -6
- package/oclif.lock +8534 -0
- package/oclif.manifest.json +100 -57
- package/package.json +31 -53
- package/lib/hooks/init/init_doctor.d.ts +0 -3
- package/lib/hooks/init/init_doctor.js +0 -23
- package/lib/hooks/init/init_doctor.js.map +0 -1
package/README.md
CHANGED
|
@@ -76,16 +76,16 @@ sfdx plugins
|
|
|
76
76
|
|
|
77
77
|
<!-- commands -->
|
|
78
78
|
|
|
79
|
-
- [`
|
|
80
|
-
- [`
|
|
79
|
+
- [`sf doctor`](#sf-doctor)
|
|
80
|
+
- [`sf info releasenotes display`](#sf-info-releasenotes-display)
|
|
81
81
|
|
|
82
|
-
## `
|
|
82
|
+
## `sf doctor`
|
|
83
83
|
|
|
84
84
|
Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.
|
|
85
85
|
|
|
86
86
|
```
|
|
87
87
|
USAGE
|
|
88
|
-
$
|
|
88
|
+
$ sf doctor [--json] [-c <value>] [-p <value>] [-d <value>] [-i]
|
|
89
89
|
|
|
90
90
|
FLAGS
|
|
91
91
|
-c, --command=<value> Command to run in debug mode; results are written to a log file.
|
|
@@ -113,26 +113,26 @@ DESCRIPTION
|
|
|
113
113
|
EXAMPLES
|
|
114
114
|
Run CLI doctor diagnostics:
|
|
115
115
|
|
|
116
|
-
$
|
|
116
|
+
$ sf doctor
|
|
117
117
|
|
|
118
118
|
Run CLI doctor diagnostics and the specified command, and write the debug output to a file:
|
|
119
119
|
|
|
120
|
-
$
|
|
120
|
+
$ sf doctor --command "force:org:list --all"
|
|
121
121
|
|
|
122
122
|
Run CLI doctor diagnostics for a specific plugin:
|
|
123
123
|
|
|
124
|
-
$
|
|
124
|
+
$ sf doctor --plugin @salesforce/plugin-source
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
_See code: [src/commands/doctor.ts](https://github.com/salesforcecli/plugin-info/blob/2.6.
|
|
127
|
+
_See code: [src/commands/doctor.ts](https://github.com/salesforcecli/plugin-info/blob/2.6.53/src/commands/doctor.ts)_
|
|
128
128
|
|
|
129
|
-
## `
|
|
129
|
+
## `sf info releasenotes display`
|
|
130
130
|
|
|
131
131
|
Display Salesforce CLI release notes on the command line.
|
|
132
132
|
|
|
133
133
|
```
|
|
134
134
|
USAGE
|
|
135
|
-
$
|
|
135
|
+
$ sf info releasenotes display [--json] [-v <value>]
|
|
136
136
|
|
|
137
137
|
FLAGS
|
|
138
138
|
-v, --version=<value> CLI version or tag for which to display release notes.
|
|
@@ -147,22 +147,22 @@ DESCRIPTION
|
|
|
147
147
|
--version flag to view release notes for a different release.
|
|
148
148
|
|
|
149
149
|
ALIASES
|
|
150
|
-
$
|
|
150
|
+
$ sf whatsnew
|
|
151
151
|
|
|
152
152
|
EXAMPLES
|
|
153
153
|
Display release notes for the currently installed CLI version:
|
|
154
154
|
|
|
155
|
-
$
|
|
155
|
+
$ sf info releasenotes display stable, stable-rc, latest, latest-rc, rc
|
|
156
156
|
|
|
157
157
|
Display release notes for CLI version 7.120.0:
|
|
158
158
|
|
|
159
|
-
$
|
|
159
|
+
$ sf info releasenotes display --version 7.120.0 stable, stable-rc, latest, latest-rc, rc
|
|
160
160
|
|
|
161
161
|
Display release notes for the CLI version that corresponds to a tag (stable, stable-rc, latest, latest-rc, rc):
|
|
162
162
|
|
|
163
|
-
$
|
|
163
|
+
$ sf info releasenotes display --version latest
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/2.6.
|
|
166
|
+
_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/2.6.53/src/commands/info/releasenotes/display.ts)_
|
|
167
167
|
|
|
168
168
|
<!-- commandsstop -->
|
package/lib/commands/doctor.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { SfDoctorDiagnosis } from '../doctor';
|
|
2
|
+
import { SfDoctorDiagnosis } from '../doctor.js';
|
|
3
3
|
export default class Doctor extends SfCommand<SfDoctorDiagnosis> {
|
|
4
4
|
static readonly summary: string;
|
|
5
5
|
static readonly description: string;
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
command: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
-
plugin: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
-
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
-
'create-issue': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
command: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
plugin: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
'output-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
'create-issue': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
12
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
13
|
};
|
|
14
14
|
private tasks;
|
|
15
15
|
private doctor;
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1,37 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const messages =
|
|
20
|
-
class Doctor extends
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
import { EOL } from 'node:os';
|
|
8
|
+
import { dirname, resolve as pathResolve, join } from 'node:path';
|
|
9
|
+
import { spawn } from 'node:child_process';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
import { Flags, loglevel, SfCommand } from '@salesforce/sf-plugins-core';
|
|
12
|
+
import { Lifecycle, Messages, SfError } from '@salesforce/core';
|
|
13
|
+
import open from 'open';
|
|
14
|
+
import got from 'got';
|
|
15
|
+
import { ProxyAgent } from 'proxy-agent';
|
|
16
|
+
import { Doctor as SFDoctor } from '../doctor.js';
|
|
17
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
18
|
+
const messages = Messages.loadMessages('@salesforce/plugin-info', 'doctor');
|
|
19
|
+
export default class Doctor extends SfCommand {
|
|
20
|
+
static summary = messages.getMessage('summary');
|
|
21
|
+
static description = messages.getMessage('description');
|
|
22
|
+
static examples = messages.getMessages('examples');
|
|
23
|
+
static flags = {
|
|
24
|
+
command: Flags.string({
|
|
25
|
+
char: 'c',
|
|
26
|
+
summary: messages.getMessage('flags.command.summary'),
|
|
27
|
+
}),
|
|
28
|
+
plugin: Flags.string({
|
|
29
|
+
char: 'p',
|
|
30
|
+
summary: messages.getMessage('flags.plugin.summary'),
|
|
31
|
+
}),
|
|
32
|
+
'output-dir': Flags.directory({
|
|
33
|
+
char: 'd',
|
|
34
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
35
|
+
aliases: ['outputdir', 'o'],
|
|
36
|
+
}),
|
|
37
|
+
'create-issue': Flags.boolean({
|
|
38
|
+
char: 'i',
|
|
39
|
+
summary: messages.getMessage('flags.create-issue.summary'),
|
|
40
|
+
default: false,
|
|
41
|
+
aliases: ['createissue'],
|
|
42
|
+
}),
|
|
43
|
+
loglevel,
|
|
44
|
+
};
|
|
45
|
+
// Array of promises that are various doctor tasks to perform
|
|
46
|
+
// such as running a command and running diagnostics.
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
tasks = [];
|
|
49
|
+
doctor;
|
|
50
|
+
outputDir = process.cwd();
|
|
51
|
+
filesWrittenMsgs = [];
|
|
30
52
|
async run() {
|
|
31
53
|
const { flags } = await this.parse(Doctor);
|
|
32
|
-
this.doctor =
|
|
33
|
-
|
|
34
|
-
|
|
54
|
+
// this.doctor = SFDoctor.getInstance();
|
|
55
|
+
this.doctor = SFDoctor.init(this.config);
|
|
56
|
+
const lifecycle = Lifecycle.getInstance();
|
|
57
|
+
this.outputDir = pathResolve(flags['output-dir'] ?? process.cwd());
|
|
35
58
|
lifecycle.on('Doctor:diagnostic', async (data) => {
|
|
36
59
|
this.log(`${data.status} - ${data.testName}`);
|
|
37
60
|
return Promise.resolve(this.doctor.addDiagnosticStatus(data));
|
|
@@ -54,7 +77,7 @@ class Doctor extends sf_plugins_core_1.SfCommand {
|
|
|
54
77
|
}
|
|
55
78
|
}
|
|
56
79
|
else {
|
|
57
|
-
throw new
|
|
80
|
+
throw new SfError(messages.getMessage('pluginNotInstalledError', [flags.plugin]), 'UnknownPluginError');
|
|
58
81
|
}
|
|
59
82
|
}
|
|
60
83
|
else {
|
|
@@ -70,7 +93,7 @@ class Doctor extends sf_plugins_core_1.SfCommand {
|
|
|
70
93
|
}
|
|
71
94
|
await Promise.all(this.tasks);
|
|
72
95
|
const diagnosis = this.doctor.getDiagnosis();
|
|
73
|
-
const diagnosisLocation = this.doctor.writeFileSync(
|
|
96
|
+
const diagnosisLocation = this.doctor.writeFileSync(join(this.outputDir, 'diagnosis.json'), JSON.stringify(diagnosis, null, 2));
|
|
74
97
|
this.filesWrittenMsgs.push(`Wrote doctor diagnosis to: ${diagnosisLocation}`);
|
|
75
98
|
this.log();
|
|
76
99
|
this.filesWrittenMsgs.forEach((msg) => this.log(msg));
|
|
@@ -79,9 +102,9 @@ class Doctor extends sf_plugins_core_1.SfCommand {
|
|
|
79
102
|
diagnosis.suggestions.forEach((s) => this.log(` * ${s}`));
|
|
80
103
|
if (flags['create-issue']) {
|
|
81
104
|
const raw = 'https://raw.githubusercontent.com/forcedotcom/cli/main/.github/ISSUE_TEMPLATE/bug_report.md';
|
|
82
|
-
const ghIssue = await (
|
|
105
|
+
const ghIssue = await got(raw, {
|
|
83
106
|
throwHttpErrors: false,
|
|
84
|
-
agent: { https: new
|
|
107
|
+
agent: { https: new ProxyAgent() },
|
|
85
108
|
});
|
|
86
109
|
const title = (await this.prompt({
|
|
87
110
|
type: 'input',
|
|
@@ -106,13 +129,13 @@ class Doctor extends sf_plugins_core_1.SfCommand {
|
|
|
106
129
|
const info = `
|
|
107
130
|
\`\`\`
|
|
108
131
|
${diagnosis.cliConfig.userAgent}
|
|
109
|
-
${(diagnosis.versionDetail.pluginVersions ?? []).join(
|
|
132
|
+
${(diagnosis.versionDetail.pluginVersions ?? []).join(EOL)}
|
|
110
133
|
\`\`\`
|
|
111
134
|
${diagnosis.sfdxEnvVars.length
|
|
112
135
|
? `
|
|
113
136
|
\`\`\`
|
|
114
137
|
SFDX ENV. VARS.
|
|
115
|
-
${diagnosis.sfdxEnvVars.join(
|
|
138
|
+
${diagnosis.sfdxEnvVars.join(EOL)}
|
|
116
139
|
\`\`\`
|
|
117
140
|
`
|
|
118
141
|
: ''}
|
|
@@ -121,7 +144,7 @@ ${diagnosis.sfEnvVars.length
|
|
|
121
144
|
? `
|
|
122
145
|
\`\`\`
|
|
123
146
|
SF ENV. VARS.
|
|
124
|
-
${diagnosis.sfEnvVars.join(
|
|
147
|
+
${diagnosis.sfEnvVars.join(EOL)}
|
|
125
148
|
\`\`\`
|
|
126
149
|
`
|
|
127
150
|
: ''}
|
|
@@ -136,11 +159,11 @@ ${diagnosis.cliConfig.userAgent}
|
|
|
136
159
|
${this.doctor
|
|
137
160
|
.getDiagnosis()
|
|
138
161
|
.diagnosticResults.map((res) => `${res.status === 'pass' ? ':white_check_mark:' : ':x:'} ${res.status} - ${res.testName}`)
|
|
139
|
-
.join(
|
|
162
|
+
.join(EOL)}
|
|
140
163
|
`;
|
|
141
164
|
return body
|
|
142
|
-
.replace(new RegExp(`---(.|${
|
|
143
|
-
.replace(new RegExp(`${
|
|
165
|
+
.replace(new RegExp(`---(.|${EOL})*---${EOL}${EOL}`), '')
|
|
166
|
+
.replace(new RegExp(`${EOL}- Which shell/terminal (.|${EOL})*- Paste the output here`), info);
|
|
144
167
|
}
|
|
145
168
|
// Takes the command flag and:
|
|
146
169
|
// 1. ensures it begins with `${config.bin}`; typically "sfdx" or "sf"
|
|
@@ -164,11 +187,11 @@ ${this.doctor
|
|
|
164
187
|
this.log(`${cmdString}\n`);
|
|
165
188
|
this.doctor.addCommandName(cmdString);
|
|
166
189
|
const execPromise = new Promise((resolve) => {
|
|
167
|
-
const stdoutLogLocation = this.doctor.getDoctoredFilePath(
|
|
168
|
-
const debugLogLocation = this.doctor.getDoctoredFilePath(
|
|
190
|
+
const stdoutLogLocation = this.doctor.getDoctoredFilePath(join(this.outputDir, 'command-stdout.log'));
|
|
191
|
+
const debugLogLocation = this.doctor.getDoctoredFilePath(join(this.outputDir, 'command-debug.log'));
|
|
169
192
|
this.doctor.createStdoutWriteStream(stdoutLogLocation);
|
|
170
193
|
this.doctor.createStderrWriteStream(debugLogLocation);
|
|
171
|
-
const cp =
|
|
194
|
+
const cp = spawn(cmdString, [], { shell: true, env: Object.assign({}, process.env) });
|
|
172
195
|
cp.on('error', (err) => {
|
|
173
196
|
this.log(`Error executing command: ${err.message}`);
|
|
174
197
|
// no-op
|
|
@@ -195,30 +218,4 @@ ${this.doctor
|
|
|
195
218
|
this.tasks.push(execPromise);
|
|
196
219
|
}
|
|
197
220
|
}
|
|
198
|
-
exports.default = Doctor;
|
|
199
|
-
Doctor.summary = messages.getMessage('summary');
|
|
200
|
-
Doctor.description = messages.getMessage('description');
|
|
201
|
-
Doctor.examples = messages.getMessages('examples');
|
|
202
|
-
Doctor.flags = {
|
|
203
|
-
command: sf_plugins_core_1.Flags.string({
|
|
204
|
-
char: 'c',
|
|
205
|
-
summary: messages.getMessage('flags.command'),
|
|
206
|
-
}),
|
|
207
|
-
plugin: sf_plugins_core_1.Flags.string({
|
|
208
|
-
char: 'p',
|
|
209
|
-
summary: messages.getMessage('flags.plugin'),
|
|
210
|
-
}),
|
|
211
|
-
'output-dir': sf_plugins_core_1.Flags.directory({
|
|
212
|
-
char: 'd',
|
|
213
|
-
summary: messages.getMessage('flags.output-dir.summary'),
|
|
214
|
-
aliases: ['outputdir', 'o'],
|
|
215
|
-
}),
|
|
216
|
-
'create-issue': sf_plugins_core_1.Flags.boolean({
|
|
217
|
-
char: 'i',
|
|
218
|
-
summary: messages.getMessage('flags.create-issue.summary'),
|
|
219
|
-
default: false,
|
|
220
|
-
aliases: ['createissue'],
|
|
221
|
-
}),
|
|
222
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
223
|
-
};
|
|
224
221
|
//# sourceMappingURL=doctor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,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,EAAE;gBAC1C,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;YACH,kEAAkE;YAClE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBAC3B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;gBACnC,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,wBAAwB,IAAI,IAAI,CAAC,CAAC;gBAChE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC1B,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;gBAC1B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,gCAAgC,iBAAiB,EAAE,CAAC,CAAC;gBAChF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,+BAA+B,gBAAgB,EAAE,CAAC,CAAC;gBAC9E,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC"}
|
|
@@ -5,9 +5,9 @@ export default class Display extends SfCommand<DisplayOutput | undefined> {
|
|
|
5
5
|
static readonly aliases: string[];
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
-
version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
-
hook: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
version: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
hook: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
|
+
loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<DisplayOutput | undefined>;
|
|
13
13
|
}
|
|
@@ -1,70 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const getDistTagVersion_1 = require("../../../shared/getDistTagVersion");
|
|
18
|
-
const parseReleaseNotes_1 = require("../../../shared/parseReleaseNotes");
|
|
7
|
+
import { EOL } from 'node:os';
|
|
8
|
+
import { dirname } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { marked } from 'marked';
|
|
11
|
+
import TerminalRenderer from 'marked-terminal';
|
|
12
|
+
import { Env } from '@salesforce/kit';
|
|
13
|
+
import { Flags, SfCommand, loglevel } from '@salesforce/sf-plugins-core';
|
|
14
|
+
import { Lifecycle, Logger, Messages } from '@salesforce/core';
|
|
15
|
+
import shared from '../../../shared/index.js';
|
|
19
16
|
// Initialize Messages with the current plugin directory
|
|
20
|
-
|
|
17
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
21
18
|
const helpers = ['stable', 'stable-rc', 'latest', 'latest-rc', 'rc'];
|
|
22
19
|
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
|
|
23
20
|
// or any library that is using the messages framework can also be loaded this way.
|
|
24
|
-
const messages =
|
|
25
|
-
class Display extends
|
|
21
|
+
const messages = Messages.loadMessages('@salesforce/plugin-info', 'display');
|
|
22
|
+
export default class Display extends SfCommand {
|
|
23
|
+
static summary = messages.getMessage('summary');
|
|
24
|
+
static description = messages.getMessage('description');
|
|
25
|
+
static aliases = ['whatsnew'];
|
|
26
|
+
static examples = messages.getMessages('examples', [helpers.join(', ')]);
|
|
27
|
+
static flags = {
|
|
28
|
+
version: Flags.string({
|
|
29
|
+
char: 'v',
|
|
30
|
+
summary: messages.getMessage('flags.version.summary'),
|
|
31
|
+
}),
|
|
32
|
+
hook: Flags.boolean({
|
|
33
|
+
hidden: true,
|
|
34
|
+
summary: messages.getMessage('flags.hook.summary'),
|
|
35
|
+
}),
|
|
36
|
+
loglevel,
|
|
37
|
+
};
|
|
26
38
|
async run() {
|
|
27
39
|
const HIDE_NOTES = this.config.bin === 'sf' ? 'SF_HIDE_RELEASE_NOTES' : 'SFDX_HIDE_RELEASE_NOTES';
|
|
28
40
|
const HIDE_FOOTER = this.config.bin === 'sf' ? 'SF_HIDE_RELEASE_NOTES_FOOTER' : 'SFDX_HIDE_RELEASE_NOTES_FOOTER';
|
|
29
|
-
const logger =
|
|
41
|
+
const logger = Logger.childFromRoot(this.constructor.name);
|
|
30
42
|
const { flags } = await this.parse(Display);
|
|
31
|
-
const env = new
|
|
43
|
+
const env = new Env();
|
|
32
44
|
if (env.getBoolean(HIDE_NOTES) && flags.hook) {
|
|
33
45
|
// We don't ever want to exit the process for info:releasenotes:display (whatsnew)
|
|
34
46
|
// In most cases we will log a message, but here we only trace log in case someone using stdout of the update command
|
|
35
47
|
logger.trace(`release notes disabled via env var: ${HIDE_NOTES}`);
|
|
36
48
|
logger.trace('exiting');
|
|
37
|
-
await
|
|
49
|
+
await Lifecycle.getInstance().emitTelemetry({ eventName: 'NOTES_HIDDEN' });
|
|
38
50
|
return;
|
|
39
51
|
}
|
|
40
52
|
try {
|
|
41
53
|
const installedVersion = this.config.pjson.version;
|
|
42
|
-
const infoConfig = await
|
|
54
|
+
const infoConfig = await shared.getInfoConfig(this.config.root);
|
|
43
55
|
const { distTagUrl, releaseNotesPath, releaseNotesFilename } = infoConfig.releasenotes;
|
|
44
56
|
let version = flags.version ?? installedVersion;
|
|
45
57
|
if (helpers.includes(version)) {
|
|
46
|
-
version = await
|
|
58
|
+
version = await shared.getDistTagVersion(distTagUrl, version);
|
|
47
59
|
}
|
|
48
|
-
const releaseNotes = await
|
|
49
|
-
const tokens =
|
|
50
|
-
|
|
60
|
+
const releaseNotes = await shared.getReleaseNotes(releaseNotesPath, releaseNotesFilename, version);
|
|
61
|
+
const tokens = shared.parseReleaseNotes(releaseNotes, version, releaseNotesPath);
|
|
62
|
+
marked.setOptions({
|
|
51
63
|
renderer: new TerminalRenderer({ emoji: false }),
|
|
52
64
|
});
|
|
53
|
-
tokens.unshift(
|
|
65
|
+
tokens.unshift(marked.lexer(`# Release notes for '${this.config.bin}':`)[0]);
|
|
54
66
|
if (flags.json) {
|
|
55
|
-
const body = tokens.map((token) => token.raw).join(
|
|
67
|
+
const body = tokens.map((token) => token.raw).join(EOL);
|
|
56
68
|
return { body, url: releaseNotesPath };
|
|
57
69
|
}
|
|
58
70
|
else {
|
|
59
|
-
this.log(
|
|
71
|
+
this.log(marked.parser(tokens));
|
|
60
72
|
}
|
|
61
73
|
if (flags.hook) {
|
|
62
74
|
if (env.getBoolean(HIDE_FOOTER)) {
|
|
63
|
-
await
|
|
75
|
+
await Lifecycle.getInstance().emitTelemetry({ eventName: 'FOOTER_HIDDEN' });
|
|
64
76
|
}
|
|
65
77
|
else {
|
|
66
78
|
const footer = messages.getMessage('footer', [this.config.bin, releaseNotesPath, HIDE_NOTES, HIDE_FOOTER]);
|
|
67
|
-
this.log(
|
|
79
|
+
this.log(marked.parse(footer));
|
|
68
80
|
}
|
|
69
81
|
}
|
|
70
82
|
}
|
|
@@ -75,7 +87,7 @@ class Display extends sf_plugins_core_1.SfCommand {
|
|
|
75
87
|
const { message, stack, name } = err;
|
|
76
88
|
this.warn(`${this.id} failed: ${message}`);
|
|
77
89
|
logger.trace(stack);
|
|
78
|
-
await
|
|
90
|
+
await Lifecycle.getInstance().emitTelemetry({
|
|
79
91
|
eventName: 'COMMAND_ERROR',
|
|
80
92
|
type: 'EXCEPTION',
|
|
81
93
|
errorName: name,
|
|
@@ -92,20 +104,4 @@ class Display extends sf_plugins_core_1.SfCommand {
|
|
|
92
104
|
}
|
|
93
105
|
}
|
|
94
106
|
}
|
|
95
|
-
exports.default = Display;
|
|
96
|
-
Display.summary = messages.getMessage('summary');
|
|
97
|
-
Display.description = messages.getMessage('description');
|
|
98
|
-
Display.aliases = ['whatsnew'];
|
|
99
|
-
Display.examples = messages.getMessages('examples', [helpers.join(', ')]);
|
|
100
|
-
Display.flags = {
|
|
101
|
-
version: sf_plugins_core_1.Flags.string({
|
|
102
|
-
char: 'v',
|
|
103
|
-
summary: messages.getMessage('flags.version.summary'),
|
|
104
|
-
}),
|
|
105
|
-
hook: sf_plugins_core_1.Flags.boolean({
|
|
106
|
-
hidden: true,
|
|
107
|
-
summary: messages.getMessage('flags.hook.summary'),
|
|
108
|
-
}),
|
|
109
|
-
loglevel: sf_plugins_core_1.loglevel,
|
|
110
|
-
};
|
|
111
107
|
//# sourceMappingURL=display.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../src/commands/info/releasenotes/display.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../src/commands/info/releasenotes/display.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,gBAAg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IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;oBAC3G,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;iBAChC;aACF;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,KAAK,CAAC,IAAI,EAAE;gBACd,oFAAoF;gBACpF,sDAAsD;gBACtD,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,GAAY,CAAC;gBAE9C,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,YAAY,OAAO,EAAE,CAAC,CAAC;gBAE3C,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACpB,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC;oBAC1C,SAAS,EAAE,eAAe;oBAC1B,IAAI,EAAE,WAAW;oBACjB,SAAS,EAAE,IAAI;oBACf,YAAY,EAAE,OAAO;oBACrB,KAAK,EAAE,MAAM,CAAC,MAAM,CAClB;wBACE,IAAI;wBACJ,OAAO;wBACP,KAAK;qBACK,EACZ,GAAG,CACO;iBACb,CAAC,CAAC;gBAEH,OAAO;aACR;YAED,MAAM,GAAG,CAAC;SACX;IACH,CAAC"}
|
package/lib/constants.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
exports.SFDX_RELEASE_NOTES_TIMEOUT = void 0;
|
|
10
|
-
exports.SFDX_RELEASE_NOTES_TIMEOUT = (process.env.SFDX_RELEASE_NOTES_TIMEOUT ?? 3000);
|
|
7
|
+
export const SFDX_RELEASE_NOTES_TIMEOUT = (process.env.SFDX_RELEASE_NOTES_TIMEOUT ?? 3000);
|
|
11
8
|
//# sourceMappingURL=constants.js.map
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,IAAI,CAAW,CAAC"}
|
package/lib/diagnostics.d.ts
CHANGED
package/lib/diagnostics.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const messages =
|
|
7
|
+
import childProcess from 'node:child_process';
|
|
8
|
+
import { dirname } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { Lifecycle, Messages } from '@salesforce/core';
|
|
11
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
12
|
+
const messages = Messages.loadMessages('@salesforce/plugin-info', 'diagnostics');
|
|
14
13
|
/**
|
|
15
14
|
* Diagnostics are all the tests that ensure a known, clean CLI configuration
|
|
16
15
|
* and a way to run them asynchronously. Typically this is used only by the
|
|
@@ -20,7 +19,10 @@ const messages = core_1.Messages.loadMessages('@salesforce/plugin-info', 'diagno
|
|
|
20
19
|
* appending "Check" to the name. Emit a "Doctor:diagnostic" event with a
|
|
21
20
|
* `DiagnosticStatus` payload so the CLI can report on the diagnostic result.
|
|
22
21
|
*/
|
|
23
|
-
class Diagnostics {
|
|
22
|
+
export class Diagnostics {
|
|
23
|
+
doctor;
|
|
24
|
+
config;
|
|
25
|
+
diagnosis;
|
|
24
26
|
constructor(doctor, config) {
|
|
25
27
|
this.doctor = doctor;
|
|
26
28
|
this.config = config;
|
|
@@ -65,7 +67,7 @@ class Diagnostics {
|
|
|
65
67
|
else {
|
|
66
68
|
this.doctor.addSuggestion(messages.getMessage('latestCliVersionError', [stderr]));
|
|
67
69
|
}
|
|
68
|
-
void
|
|
70
|
+
void Lifecycle.getInstance()
|
|
69
71
|
.emit('Doctor:diagnostic', { testName, status })
|
|
70
72
|
.then(() => resolve());
|
|
71
73
|
});
|
|
@@ -78,11 +80,11 @@ class Diagnostics {
|
|
|
78
80
|
const cliName = this.config.name;
|
|
79
81
|
const cliVersion = this.config.version;
|
|
80
82
|
if (cliName === 'sfdx-cli' && cliVersion.startsWith('7.')) {
|
|
81
|
-
await
|
|
83
|
+
await Lifecycle.getInstance().emit('Doctor:diagnostic', { testName: 'using sfdx-cli version 7', status: 'fail' });
|
|
82
84
|
this.doctor.addSuggestion(messages.getMessage('uninstallSuggestion', [cliName, cliVersion]));
|
|
83
85
|
}
|
|
84
86
|
if (cliName === '@salesforce/cli' && cliVersion.startsWith('1.')) {
|
|
85
|
-
await
|
|
87
|
+
await Lifecycle.getInstance().emit('Doctor:diagnostic', {
|
|
86
88
|
testName: 'using @salesforce/cli version 1',
|
|
87
89
|
status: 'fail',
|
|
88
90
|
});
|
|
@@ -102,7 +104,7 @@ class Diagnostics {
|
|
|
102
104
|
const bin = this.diagnosis.cliConfig.bin;
|
|
103
105
|
this.doctor.addSuggestion(messages.getMessage('salesforceDxPluginDetected', [bin]));
|
|
104
106
|
}
|
|
105
|
-
await
|
|
107
|
+
await Lifecycle.getInstance().emit('Doctor:diagnostic', { testName, status });
|
|
106
108
|
}
|
|
107
109
|
/**
|
|
108
110
|
* Checks and warns if any plugins are linked.
|
|
@@ -116,8 +118,7 @@ class Diagnostics {
|
|
|
116
118
|
status = 'fail';
|
|
117
119
|
this.doctor.addSuggestion(messages.getMessage('linkedPluginWarning', [lp.name]));
|
|
118
120
|
});
|
|
119
|
-
await
|
|
121
|
+
await Lifecycle.getInstance().emit('Doctor:diagnostic', { testName, status });
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
|
-
exports.Diagnostics = Diagnostics;
|
|
123
124
|
//# sourceMappingURL=diagnostics.js.map
|