@salesforce/plugin-info 2.2.15 → 2.3.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 +45 -12
- package/lib/commands/doctor.d.ts +11 -9
- package/lib/commands/doctor.js +43 -38
- package/lib/commands/doctor.js.map +1 -1
- package/lib/commands/info/releasenotes/display.d.ts +10 -9
- package/lib/commands/info/releasenotes/display.js +22 -16
- package/lib/commands/info/releasenotes/display.js.map +1 -1
- package/messages/display.md +39 -0
- package/messages/doctor.md +58 -0
- package/oclif.manifest.json +1 -1
- package/package.json +10 -8
- package/messages/display.js +0 -22
- package/messages/doctor.js +0 -33
- package/messages/messages.json +0 -22
package/README.md
CHANGED
|
@@ -76,31 +76,64 @@ sfdx plugins
|
|
|
76
76
|
|
|
77
77
|
<!-- commands -->
|
|
78
78
|
|
|
79
|
-
- [`sfdx
|
|
79
|
+
- [`sfdx doctor`](#sfdx-doctor)
|
|
80
|
+
- [`sfdx info:releasenotes:display`](#sfdx-inforeleasenotesdisplay)
|
|
80
81
|
|
|
81
|
-
## `sfdx
|
|
82
|
+
## `sfdx doctor`
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.
|
|
84
85
|
|
|
85
86
|
```
|
|
86
87
|
USAGE
|
|
87
|
-
$ sfdx
|
|
88
|
-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
88
|
+
$ sfdx doctor
|
|
89
89
|
|
|
90
90
|
OPTIONS
|
|
91
|
-
-
|
|
92
|
-
|
|
91
|
+
-c, --command=command
|
|
92
|
+
-d, --output-dir=output-dir
|
|
93
|
+
-i, --create-issue
|
|
94
|
+
-p, --plugin=plugin
|
|
95
|
+
--json Format output as json.
|
|
96
|
+
|
|
97
|
+
DESCRIPTION
|
|
98
|
+
When you run the doctor command without parameters, it first displays a diagnostic overview of your environment. It
|
|
99
|
+
then writes a detailed diagnosis to a JSON file in the current directory. Use the --outputdir to specify a different
|
|
100
|
+
directory. To run diagnostic tests on a specific plugin, use the --plugin parameter. If the plugin isn't listening to
|
|
101
|
+
the doctor, then you get a warning.
|
|
102
|
+
|
|
103
|
+
Use the --command parameter to run a specific command in debug mode; the doctor writes both stdout and stderr to *.log
|
|
104
|
+
files that you can provide to Salesforce Customer Support or attach to a GitHub issue.
|
|
105
|
+
|
|
106
|
+
Plugin providers can also implement their own doctor diagnostic tests by listening to the "sf-doctor" event and
|
|
107
|
+
running plugin specific tests that are then included in the doctor diagnostics log.
|
|
108
|
+
|
|
109
|
+
EXAMPLES
|
|
110
|
+
- Run CLI doctor diagnostics:
|
|
111
|
+
$ sfdx doctor
|
|
112
|
+
Run CLI doctor diagnostics and the specified command, and write the debug output to a file:
|
|
113
|
+
$ sfdx doctor --command "force:org:list --all"
|
|
114
|
+
Run CLI doctor diagnostics for a specific plugin:
|
|
115
|
+
$ sfdx doctor --plugin @salesforce/plugin-source
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
_See code: [src/commands/doctor.ts](https://github.com/salesforcecli/plugin-info/blob/v2.2.14-t.0/src/commands/doctor.ts)_
|
|
93
119
|
|
|
94
|
-
|
|
120
|
+
## `sfdx info:releasenotes:display`
|
|
95
121
|
|
|
96
|
-
|
|
97
|
-
|
|
122
|
+
Display Salesforce CLI release notes on the command line.
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
USAGE
|
|
126
|
+
$ sfdx info:releasenotes:display
|
|
127
|
+
|
|
128
|
+
OPTIONS
|
|
129
|
+
-v, --version=version CLI version or tag for which to display release notes.
|
|
130
|
+
--json Format output as json.
|
|
98
131
|
|
|
99
132
|
ALIASES
|
|
100
133
|
$ sfdx whatsnew
|
|
101
134
|
|
|
102
135
|
EXAMPLES
|
|
103
|
-
Display release notes for the currently installed CLI version:
|
|
136
|
+
- Display release notes for the currently installed CLI version:
|
|
104
137
|
$ sfdx info:releasenotes:display
|
|
105
138
|
Display release notes for CLI version 7.120.0:
|
|
106
139
|
$ sfdx info:releasenotes:display --version 7.120.0
|
|
@@ -108,6 +141,6 @@ EXAMPLES
|
|
|
108
141
|
$ sfdx info:releasenotes:display --version latest
|
|
109
142
|
```
|
|
110
143
|
|
|
111
|
-
_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/v2.0
|
|
144
|
+
_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/v2.2.14-t.0/src/commands/info/releasenotes/display.ts)_
|
|
112
145
|
|
|
113
146
|
<!-- commandsstop -->
|
package/lib/commands/doctor.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { SfDoctorDiagnosis } from '../doctor';
|
|
3
|
-
export default class Doctor extends
|
|
4
|
-
static
|
|
5
|
-
static
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
export default class Doctor extends SfCommand<SfDoctorDiagnosis> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
command: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
9
|
+
plugin: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
10
|
+
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
11
|
+
'create-issue': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
11
13
|
};
|
|
12
14
|
private tasks;
|
|
13
15
|
private doctor;
|
package/lib/commands/doctor.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const os = require("os");
|
|
10
10
|
const path = require("path");
|
|
11
11
|
const child_process_1 = require("child_process");
|
|
12
|
-
const
|
|
12
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
13
13
|
const core_1 = require("@salesforce/core");
|
|
14
14
|
const open = require("open");
|
|
15
15
|
const got_1 = require("got");
|
|
@@ -18,7 +18,7 @@ const proxy_from_env_1 = require("proxy-from-env");
|
|
|
18
18
|
const doctor_1 = require("../doctor");
|
|
19
19
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
20
20
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-info', 'doctor');
|
|
21
|
-
class Doctor extends
|
|
21
|
+
class Doctor extends sf_plugins_core_1.SfCommand {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
24
|
// Array of promises that are various doctor tasks to perform
|
|
@@ -28,41 +28,38 @@ class Doctor extends command_1.SfdxCommand {
|
|
|
28
28
|
this.filesWrittenMsgs = [];
|
|
29
29
|
}
|
|
30
30
|
async run() {
|
|
31
|
+
const { flags } = await this.parse(Doctor);
|
|
31
32
|
this.doctor = doctor_1.Doctor.getInstance();
|
|
32
33
|
const lifecycle = core_1.Lifecycle.getInstance();
|
|
33
|
-
|
|
34
|
-
const commandFlag = this.flags.command;
|
|
35
|
-
const outputdirFlag = this.flags.outputdir;
|
|
36
|
-
const createissueFlag = this.flags.createissue;
|
|
37
|
-
this.outputDir = path.resolve(outputdirFlag ?? process.cwd());
|
|
34
|
+
this.outputDir = path.resolve(flags['output-dir'] ?? process.cwd());
|
|
38
35
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
39
36
|
lifecycle.on('Doctor:diagnostic', async (data) => {
|
|
40
|
-
this.
|
|
37
|
+
this.log(`${data.status} - ${data.testName}`);
|
|
41
38
|
this.doctor.addDiagnosticStatus(data);
|
|
42
39
|
});
|
|
43
|
-
if (
|
|
44
|
-
this.setupCommandExecution(
|
|
40
|
+
if (flags.command) {
|
|
41
|
+
this.setupCommandExecution(flags.command);
|
|
45
42
|
}
|
|
46
|
-
if (
|
|
43
|
+
if (flags.plugin) {
|
|
47
44
|
// verify the plugin flag matches an installed plugin
|
|
48
|
-
const plugin = this.config.plugins.find((p) => p.name ===
|
|
45
|
+
const plugin = this.config.plugins.find((p) => p.name === flags.plugin);
|
|
49
46
|
if (plugin) {
|
|
50
|
-
const eventName = `sf-doctor-${
|
|
47
|
+
const eventName = `sf-doctor-${flags.plugin}`;
|
|
51
48
|
const hasDoctorHook = plugin.hooks && Object.keys(plugin.hooks).some((hook) => hook === eventName);
|
|
52
49
|
if (hasDoctorHook) {
|
|
53
|
-
this.
|
|
50
|
+
this.styledHeader(`Running diagnostics for plugin: ${flags.plugin}`);
|
|
54
51
|
this.tasks.push(this.config.runHook(eventName, { doctor: this.doctor }));
|
|
55
52
|
}
|
|
56
53
|
else {
|
|
57
|
-
this.
|
|
54
|
+
this.log(`${flags.plugin} doesn't have diagnostic tests to run.`);
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
57
|
else {
|
|
61
|
-
throw new core_1.SfError(messages.getMessage('pluginNotInstalledError', [
|
|
58
|
+
throw new core_1.SfError(messages.getMessage('pluginNotInstalledError', [flags.plugin]), 'UnknownPluginError');
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
else {
|
|
65
|
-
this.
|
|
62
|
+
this.styledHeader('Running all diagnostics');
|
|
66
63
|
// Fire events for plugins that have sf-doctor hooks
|
|
67
64
|
this.config.plugins.forEach((plugin) => {
|
|
68
65
|
const eventName = `sf-doctor-${plugin.name}`;
|
|
@@ -76,18 +73,22 @@ class Doctor extends command_1.SfdxCommand {
|
|
|
76
73
|
const diagnosis = this.doctor.getDiagnosis();
|
|
77
74
|
const diagnosisLocation = this.doctor.writeFileSync(path.join(this.outputDir, 'diagnosis.json'), JSON.stringify(diagnosis, null, 2));
|
|
78
75
|
this.filesWrittenMsgs.push(`Wrote doctor diagnosis to: ${diagnosisLocation}`);
|
|
79
|
-
this.
|
|
80
|
-
this.filesWrittenMsgs.forEach((msg) => this.
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
83
|
-
diagnosis.suggestions.forEach((s) => this.
|
|
84
|
-
if (
|
|
76
|
+
this.log();
|
|
77
|
+
this.filesWrittenMsgs.forEach((msg) => this.log(msg));
|
|
78
|
+
this.log();
|
|
79
|
+
this.styledHeader('Suggestions');
|
|
80
|
+
diagnosis.suggestions.forEach((s) => this.log(` * ${s}`));
|
|
81
|
+
if (flags['create-issue']) {
|
|
85
82
|
const raw = 'https://raw.githubusercontent.com/forcedotcom/cli/main/.github/ISSUE_TEMPLATE/bug_report.md';
|
|
86
83
|
const ghIssue = await (0, got_1.default)(raw, {
|
|
87
84
|
throwHttpErrors: false,
|
|
88
85
|
agent: { https: ProxyAgent((0, proxy_from_env_1.getProxyForUrl)(raw)) },
|
|
89
86
|
});
|
|
90
|
-
const title = await this.
|
|
87
|
+
const title = (await this.prompt({
|
|
88
|
+
type: 'input',
|
|
89
|
+
name: 'title',
|
|
90
|
+
message: 'Enter a title for your new issue',
|
|
91
|
+
})).title;
|
|
91
92
|
const url = encodeURI(`https://github.com/forcedotcom/cli/issues/new?title=${title}&body=${this.generateIssueMarkdown(ghIssue.body, diagnosis)}&labels=doctor,investigating,${this.config.bin}`);
|
|
92
93
|
await this.openUrl(url);
|
|
93
94
|
}
|
|
@@ -106,7 +107,7 @@ class Doctor extends command_1.SfdxCommand {
|
|
|
106
107
|
const info = `
|
|
107
108
|
\`\`\`
|
|
108
109
|
${diagnosis.cliConfig.userAgent}
|
|
109
|
-
${diagnosis.versionDetail.pluginVersions
|
|
110
|
+
${diagnosis.versionDetail.pluginVersions?.join(os.EOL)}
|
|
110
111
|
\`\`\`
|
|
111
112
|
${diagnosis.sfdxEnvVars.length
|
|
112
113
|
? `
|
|
@@ -160,8 +161,8 @@ ${this.doctor
|
|
|
160
161
|
// in the current or specified directory.
|
|
161
162
|
setupCommandExecution(command) {
|
|
162
163
|
const cmdString = this.parseCommand(command);
|
|
163
|
-
this.
|
|
164
|
-
this.
|
|
164
|
+
this.styledHeader('Running command with debugging');
|
|
165
|
+
this.log(`${cmdString}\n`);
|
|
165
166
|
this.doctor.addCommandName(cmdString);
|
|
166
167
|
const execPromise = new Promise((resolve) => {
|
|
167
168
|
const execOptions = {
|
|
@@ -181,25 +182,29 @@ ${this.doctor
|
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
exports.default = Doctor;
|
|
184
|
-
Doctor.
|
|
185
|
+
Doctor.summary = messages.getMessage('summary');
|
|
186
|
+
Doctor.description = messages.getMessage('description');
|
|
185
187
|
Doctor.examples = messages.getMessage('examples').split(os.EOL);
|
|
186
|
-
Doctor.
|
|
187
|
-
command:
|
|
188
|
+
Doctor.flags = {
|
|
189
|
+
command: sf_plugins_core_1.Flags.string({
|
|
188
190
|
char: 'c',
|
|
189
|
-
|
|
191
|
+
summary: messages.getMessage('flags.command'),
|
|
190
192
|
}),
|
|
191
|
-
plugin:
|
|
193
|
+
plugin: sf_plugins_core_1.Flags.string({
|
|
192
194
|
char: 'p',
|
|
193
|
-
|
|
195
|
+
summary: messages.getMessage('flags.plugin'),
|
|
194
196
|
}),
|
|
195
|
-
|
|
196
|
-
char: '
|
|
197
|
-
|
|
197
|
+
'output-dir': sf_plugins_core_1.Flags.directory({
|
|
198
|
+
char: 'd',
|
|
199
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
200
|
+
aliases: ['outputdir', 'o'],
|
|
198
201
|
}),
|
|
199
|
-
|
|
202
|
+
'create-issue': sf_plugins_core_1.Flags.boolean({
|
|
200
203
|
char: 'i',
|
|
201
|
-
|
|
204
|
+
summary: messages.getMessage('flags.create-issue.summary'),
|
|
202
205
|
default: false,
|
|
206
|
+
aliases: ['createissue'],
|
|
203
207
|
}),
|
|
208
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
204
209
|
};
|
|
205
210
|
//# sourceMappingURL=doctor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/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AAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class Display extends
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export default class Display extends SfCommand<DisplayOutput> {
|
|
3
3
|
private static helpers;
|
|
4
|
-
static
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
5
6
|
static aliases: string[];
|
|
6
|
-
static examples: string[];
|
|
7
|
-
|
|
8
|
-
version:
|
|
9
|
-
hook:
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
version: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
10
|
+
hook: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
10
12
|
};
|
|
11
13
|
run(): Promise<DisplayOutput>;
|
|
12
14
|
}
|
|
13
|
-
interface DisplayOutput {
|
|
15
|
+
export interface DisplayOutput {
|
|
14
16
|
body: string;
|
|
15
17
|
url: string;
|
|
16
18
|
}
|
|
17
|
-
export {};
|
|
@@ -12,7 +12,7 @@ const os = require("os");
|
|
|
12
12
|
const marked_1 = require("marked");
|
|
13
13
|
const TerminalRenderer = require("marked-terminal");
|
|
14
14
|
const kit_1 = require("@salesforce/kit");
|
|
15
|
-
const
|
|
15
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
16
16
|
const core_1 = require("@salesforce/core");
|
|
17
17
|
const getInfoConfig_1 = require("../../../shared/getInfoConfig");
|
|
18
18
|
const getReleaseNotes_1 = require("../../../shared/getReleaseNotes");
|
|
@@ -25,15 +25,17 @@ const HIDE_FOOTER = 'SFDX_HIDE_RELEASE_NOTES_FOOTER';
|
|
|
25
25
|
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
|
|
26
26
|
// or any library that is using the messages framework can also be loaded this way.
|
|
27
27
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-info', 'display');
|
|
28
|
-
class Display extends
|
|
28
|
+
class Display extends sf_plugins_core_1.SfCommand {
|
|
29
29
|
async run() {
|
|
30
|
+
const logger = core_1.Logger.childFromRoot(this.constructor.name);
|
|
31
|
+
const { flags } = await this.parse(Display);
|
|
30
32
|
const env = new kit_1.Env();
|
|
31
|
-
const isHook = !!
|
|
33
|
+
const isHook = !!flags.hook;
|
|
32
34
|
if (env.getBoolean(HIDE_NOTES) && isHook) {
|
|
33
35
|
// We don't ever want to exit the process for info:releasenotes:display (whatsnew)
|
|
34
36
|
// In most cases we will log a message, but here we only trace log in case someone using stdout of the update command
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
logger.trace(`release notes disabled via env var: ${HIDE_NOTES}`);
|
|
38
|
+
logger.trace('exiting');
|
|
37
39
|
await core_1.Lifecycle.getInstance().emitTelemetry({ eventName: 'NOTES_HIDDEN' });
|
|
38
40
|
return;
|
|
39
41
|
}
|
|
@@ -41,7 +43,7 @@ class Display extends command_1.SfdxCommand {
|
|
|
41
43
|
const installedVersion = this.config.pjson.version;
|
|
42
44
|
const infoConfig = await (0, getInfoConfig_1.getInfoConfig)(this.config.root);
|
|
43
45
|
const { distTagUrl, releaseNotesPath, releaseNotesFilename } = infoConfig.releasenotes;
|
|
44
|
-
let version =
|
|
46
|
+
let version = flags.version ?? installedVersion;
|
|
45
47
|
if (Display.helpers.includes(version)) {
|
|
46
48
|
version = await (0, getDistTagVersion_1.getDistTagVersion)(distTagUrl, version);
|
|
47
49
|
}
|
|
@@ -51,12 +53,12 @@ class Display extends command_1.SfdxCommand {
|
|
|
51
53
|
renderer: new TerminalRenderer({ emoji: false }),
|
|
52
54
|
});
|
|
53
55
|
tokens.unshift(marked_1.marked.lexer(`# Release notes for '${this.config.bin}':`)[0]);
|
|
54
|
-
if (
|
|
56
|
+
if (flags.json) {
|
|
55
57
|
const body = tokens.map((token) => token.raw).join(os.EOL);
|
|
56
58
|
return { body, url: releaseNotesPath };
|
|
57
59
|
}
|
|
58
60
|
else {
|
|
59
|
-
this.
|
|
61
|
+
this.log(marked_1.marked.parser(tokens));
|
|
60
62
|
}
|
|
61
63
|
if (isHook) {
|
|
62
64
|
if (env.getBoolean(HIDE_FOOTER)) {
|
|
@@ -64,7 +66,7 @@ class Display extends command_1.SfdxCommand {
|
|
|
64
66
|
}
|
|
65
67
|
else {
|
|
66
68
|
const footer = messages.getMessage('footer', [this.config.bin, releaseNotesPath, HIDE_NOTES, HIDE_FOOTER]);
|
|
67
|
-
this.
|
|
69
|
+
this.log(marked_1.marked.parse(footer));
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -73,8 +75,8 @@ class Display extends command_1.SfdxCommand {
|
|
|
73
75
|
// Do not throw error if --hook is passed, just warn so we don't exit any processes.
|
|
74
76
|
// --hook is passed in the post install/update scripts
|
|
75
77
|
const { message, stack, name } = err;
|
|
76
|
-
this.
|
|
77
|
-
|
|
78
|
+
this.warn(`${this.id} failed: ${message}`);
|
|
79
|
+
logger.trace(stack);
|
|
78
80
|
await core_1.Lifecycle.getInstance().emitTelemetry({
|
|
79
81
|
eventName: 'COMMAND_ERROR',
|
|
80
82
|
type: 'EXCEPTION',
|
|
@@ -94,17 +96,21 @@ class Display extends command_1.SfdxCommand {
|
|
|
94
96
|
}
|
|
95
97
|
exports.default = Display;
|
|
96
98
|
Display.helpers = ['stable', 'stable-rc', 'latest', 'latest-rc', 'rc'];
|
|
99
|
+
Display.summary = messages.getMessage('commandDescription');
|
|
97
100
|
Display.description = messages.getMessage('commandDescription');
|
|
98
101
|
Display.aliases = ['whatsnew'];
|
|
99
102
|
Display.examples = messages.getMessage('examples', [Display.helpers.join(', ')]).split(os.EOL);
|
|
100
|
-
Display.
|
|
101
|
-
version:
|
|
103
|
+
Display.flags = {
|
|
104
|
+
version: sf_plugins_core_1.Flags.string({
|
|
102
105
|
char: 'v',
|
|
103
|
-
|
|
106
|
+
summary: messages.getMessage('flags.version.summary'),
|
|
107
|
+
description: messages.getMessage('flags.version.description'),
|
|
104
108
|
}),
|
|
105
|
-
hook:
|
|
109
|
+
hook: sf_plugins_core_1.Flags.boolean({
|
|
106
110
|
hidden: true,
|
|
107
|
-
|
|
111
|
+
summary: messages.getMessage('flags.hook.summary'),
|
|
112
|
+
description: messages.getMessage('flags.hook.description'),
|
|
108
113
|
}),
|
|
114
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
109
115
|
};
|
|
110
116
|
//# sourceMappingURL=display.js.map
|
|
@@ -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,mCAAgC;AAChC,oDAAoD;AACpD,yCAAsC;AACtC,
|
|
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,mCAAgC;AAChC,oDAAoD;AACpD,yCAAsC;AACtC,iEAAyE;AACzE,2CAA+D;AAE/D,iEAA8D;AAC9D,qEAAkE;AAClE,yEAAsE;AACtE,yEAAsE;AAEtE,wDAAwD;AACxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,MAAM,UAAU,GAAG,yBAAyB,CAAC;AAC7C,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD,iGAAiG;AACjG,mFAAmF;AACnF,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;AAE7E,MAAqB,OAAQ,SAAQ,2BAAwB;IAwBpD,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,aAAM,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3D,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AC,wBAAwB,CAAC;KAC3D,CAAC;IACF,QAAQ,EAAR,0BAAQ;CACT,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# commandDescription
|
|
2
|
+
|
|
3
|
+
Display Salesforce CLI release notes on the command line.
|
|
4
|
+
|
|
5
|
+
# flags.version.summary
|
|
6
|
+
|
|
7
|
+
CLI version or tag for which to display release notes.
|
|
8
|
+
|
|
9
|
+
# flags.version.description
|
|
10
|
+
|
|
11
|
+
CLI version or tag for which to display release notes.
|
|
12
|
+
|
|
13
|
+
# flags.hook.summary
|
|
14
|
+
|
|
15
|
+
This hidden parameter is used in post install or update hooks.
|
|
16
|
+
|
|
17
|
+
# flags.hook.description
|
|
18
|
+
|
|
19
|
+
This hidden parameter is used in post install or update hooks.
|
|
20
|
+
|
|
21
|
+
# examples
|
|
22
|
+
|
|
23
|
+
- Display release notes for the currently installed CLI version:
|
|
24
|
+
$ <%= config.bin %> <%= command.id %>
|
|
25
|
+
Display release notes for CLI version 7.120.0:
|
|
26
|
+
$ <%= config.bin %> <%= command.id %> --version 7.120.0
|
|
27
|
+
Display release notes for the CLI version that corresponds to a tag (%s):
|
|
28
|
+
$ <%= config.bin %> <%= command.id %> --version latest
|
|
29
|
+
|
|
30
|
+
# footer
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
- Run `%s whatsnew` to manually view the current release notes.
|
|
35
|
+
- You can also view them on GitHub by visiting the [forcedotcom/cli](%s) repo.
|
|
36
|
+
- Silence notes by setting the `%s` env var to `true`.
|
|
37
|
+
- Hide this footer by setting the `%s` env var to `true`.
|
|
38
|
+
|
|
39
|
+
---
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.
|
|
8
|
+
|
|
9
|
+
When you run the doctor command without parameters, it first displays a diagnostic overview of your environment. It then writes a detailed diagnosis to a JSON file in the current directory. Use the --outputdir to specify a different directory. To run diagnostic tests on a specific plugin, use the --plugin parameter. If the plugin isn't listening to the doctor, then you get a warning.
|
|
10
|
+
|
|
11
|
+
Use the --command parameter to run a specific command in debug mode; the doctor writes both stdout and stderr to \*.log files that you can provide to Salesforce Customer Support or attach to a GitHub issue.
|
|
12
|
+
|
|
13
|
+
Plugin providers can also implement their own doctor diagnostic tests by listening to the "sf-doctor" event and running plugin specific tests that are then included in the doctor diagnostics log.
|
|
14
|
+
|
|
15
|
+
# flags.command
|
|
16
|
+
|
|
17
|
+
command to run in debug mode ; results are written to a log file
|
|
18
|
+
|
|
19
|
+
# flags.plugin
|
|
20
|
+
|
|
21
|
+
specific plugin on which to run diagnostics
|
|
22
|
+
|
|
23
|
+
# flags.output-dir.summary
|
|
24
|
+
|
|
25
|
+
directory to save all created files rather than the current working directory
|
|
26
|
+
|
|
27
|
+
# flags.create-issue.summary
|
|
28
|
+
|
|
29
|
+
create a new issue on our GitHub repo and attach all diagnostic results
|
|
30
|
+
|
|
31
|
+
# examples
|
|
32
|
+
|
|
33
|
+
- Run CLI doctor diagnostics:
|
|
34
|
+
$ <%= config.bin %> doctor
|
|
35
|
+
Run CLI doctor diagnostics and the specified command, and write the debug output to a file:
|
|
36
|
+
$ <%= config.bin %> doctor --command "force:org:list --all"
|
|
37
|
+
Run CLI doctor diagnostics for a specific plugin:
|
|
38
|
+
$ <%= config.bin %> doctor --plugin @salesforce/plugin-source
|
|
39
|
+
|
|
40
|
+
# pinnedSuggestions.checkGitHubIssues
|
|
41
|
+
|
|
42
|
+
Check https://github.com/forcedotcom/cli/issues for CLI issues posted by the community.
|
|
43
|
+
|
|
44
|
+
# pinnedSuggestions.checkSfdcStatus
|
|
45
|
+
|
|
46
|
+
Check http://status.salesforce.com for general Salesforce availability and performance.
|
|
47
|
+
|
|
48
|
+
# doctorNotInitializedError
|
|
49
|
+
|
|
50
|
+
Must first initialize a new SfDoctor.
|
|
51
|
+
|
|
52
|
+
# doctorAlreadyInitializedError
|
|
53
|
+
|
|
54
|
+
SfDoctor has already been initialized.
|
|
55
|
+
|
|
56
|
+
# pluginNotInstalledError
|
|
57
|
+
|
|
58
|
+
Specified plugin [%s] isn't installed. Install it, correct the name, or choose another plugin.
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.
|
|
1
|
+
{"version":"2.3.1","commands":{"doctor":{"id":"doctor","summary":"Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.","description":"Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.\n\nWhen you run the doctor command without parameters, it first displays a diagnostic overview of your environment. It then writes a detailed diagnosis to a JSON file in the current directory. Use the --outputdir to specify a different directory. To run diagnostic tests on a specific plugin, use the --plugin parameter. If the plugin isn't listening to the doctor, then you get a warning.\n\nUse the --command parameter to run a specific command in debug mode; the doctor writes both stdout and stderr to \\*.log files that you can provide to Salesforce Customer Support or attach to a GitHub issue.\n\nPlugin providers can also implement their own doctor diagnostic tests by listening to the \"sf-doctor\" event and running plugin specific tests that are then included in the doctor diagnostics log.","strict":true,"pluginName":"@salesforce/plugin-info","pluginAlias":"@salesforce/plugin-info","pluginType":"core","aliases":[],"examples":["Run CLI doctor diagnostics:","$ <%= config.bin %> doctor","Run CLI doctor diagnostics and the specified command, and write the debug output to a file:","$ <%= config.bin %> doctor --command \"force:org:list --all\"","Run CLI doctor diagnostics for a specific plugin:","$ <%= config.bin %> doctor --plugin @salesforce/plugin-source"],"flags":{"json":{"name":"json","type":"boolean","description":"Format output as json.","helpGroup":"GLOBAL","allowNo":false},"command":{"name":"command","type":"option","char":"c","summary":"command to run in debug mode ; results are written to a log file","multiple":false},"plugin":{"name":"plugin","type":"option","char":"p","summary":"specific plugin on which to run diagnostics","multiple":false},"output-dir":{"name":"output-dir","type":"option","char":"d","summary":"directory to save all created files rather than the current working directory","multiple":false,"aliases":["outputdir","o"]},"create-issue":{"name":"create-issue","type":"boolean","char":"i","summary":"create a new issue on our GitHub repo and attach all diagnostic results","allowNo":false,"aliases":["createissue"]},"loglevel":{"name":"loglevel","type":"option","hidden":true,"multiple":false,"deprecated":{"message":"The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."}}},"args":[]},"info:releasenotes:display":{"id":"info:releasenotes:display","summary":"Display Salesforce CLI release notes on the command line.","description":"Display Salesforce CLI release notes on the command line.","strict":true,"pluginName":"@salesforce/plugin-info","pluginAlias":"@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.","helpGroup":"GLOBAL","allowNo":false},"version":{"name":"version","type":"option","char":"v","summary":"CLI version or tag for which to display release notes.","description":"CLI version or tag for which to display release notes.","multiple":false},"hook":{"name":"hook","type":"boolean","summary":"This hidden parameter is used in post install or update hooks.","description":"This hidden parameter is used in post install or update hooks.","hidden":true,"allowNo":false},"loglevel":{"name":"loglevel","type":"option","hidden":true,"multiple":false,"deprecated":{"message":"The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."}}},"args":[],"helpers":["stable","stable-rc","latest","latest-rc","rc"]}}}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-info",
|
|
3
3
|
"description": "Plugin for accessing cli info from the command line",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.1",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@oclif/core": "^1.
|
|
10
|
-
"@salesforce/
|
|
11
|
-
"@salesforce/
|
|
12
|
-
"@salesforce/
|
|
9
|
+
"@oclif/core": "^1.23.0",
|
|
10
|
+
"@salesforce/core": "^3.32.12",
|
|
11
|
+
"@salesforce/kit": "^1.8.0",
|
|
12
|
+
"@salesforce/sf-plugins-core": "^1.21.3",
|
|
13
13
|
"got": "^11.8.6",
|
|
14
14
|
"marked": "^4.2.5",
|
|
15
15
|
"marked-terminal": "^4.2.0",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@salesforce/cli-plugins-testkit": "^3.2.15",
|
|
26
26
|
"@salesforce/dev-config": "^3.1.0",
|
|
27
27
|
"@salesforce/dev-scripts": "^3.1.0",
|
|
28
|
-
"@salesforce/plugin-command-reference": "^1.5.
|
|
28
|
+
"@salesforce/plugin-command-reference": "^1.5.10",
|
|
29
29
|
"@salesforce/prettier-config": "^0.0.2",
|
|
30
30
|
"@salesforce/ts-sinon": "1.4.2",
|
|
31
31
|
"@swc/core": "^1.3.24",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"eslint-plugin-header": "^3.1.1",
|
|
46
46
|
"eslint-plugin-import": "^2.26.0",
|
|
47
47
|
"eslint-plugin-jsdoc": "^39.6.4",
|
|
48
|
+
"eslint-plugin-sf-plugin": "^1.3.1",
|
|
48
49
|
"husky": "^7.0.4",
|
|
49
50
|
"mocha": "^9.1.3",
|
|
50
51
|
"nyc": "^15.1.0",
|
|
@@ -118,6 +119,7 @@
|
|
|
118
119
|
"test": "sf-test",
|
|
119
120
|
"test:command-reference": "./bin/dev commandreference:generate --erroronwarnings",
|
|
120
121
|
"test:deprecation-policy": "./bin/dev snapshot:compare",
|
|
122
|
+
"test:json-schema": "./bin/dev schema:compare",
|
|
121
123
|
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
|
|
122
124
|
"version": "oclif-dev readme"
|
|
123
125
|
},
|
|
@@ -125,7 +127,7 @@
|
|
|
125
127
|
"access": "public"
|
|
126
128
|
},
|
|
127
129
|
"sfdx": {
|
|
128
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-info/2.
|
|
129
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-info/2.
|
|
130
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-info/2.3.1.crt",
|
|
131
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-info/2.3.1.sig"
|
|
130
132
|
}
|
|
131
133
|
}
|
package/messages/display.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
commandDescription: 'Display Salesforce CLI release notes on the command line.',
|
|
3
|
-
flags: {
|
|
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
|
-
},
|
|
7
|
-
examples: [
|
|
8
|
-
`Display release notes for the currently installed CLI version:
|
|
9
|
-
$ <%= config.bin %> <%= command.id %>
|
|
10
|
-
Display release notes for CLI version 7.120.0:
|
|
11
|
-
$ <%= config.bin %> <%= command.id %> --version 7.120.0
|
|
12
|
-
Display release notes for the CLI version that corresponds to a tag (%s):
|
|
13
|
-
$ <%= config.bin %> <%= command.id %> --version latest
|
|
14
|
-
`,
|
|
15
|
-
],
|
|
16
|
-
footer: `---
|
|
17
|
-
- Run \`%s whatsnew\` to manually view the current release notes.
|
|
18
|
-
- You can also view them on GitHub by visiting the [forcedotcom/cli](%s) repo.
|
|
19
|
-
- Silence notes by setting the \`%s\` env var to \`true\`.
|
|
20
|
-
- Hide this footer by setting the \`%s\` env var to \`true\`.
|
|
21
|
-
---`,
|
|
22
|
-
};
|
package/messages/doctor.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
commandDescription: `Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.
|
|
3
|
-
|
|
4
|
-
When you run the doctor command without parameters, it first displays a diagnostic overview of your environment. It then writes a detailed diagnosis to a JSON file in the current directory. Use the --outputdir to specify a different directory. To run diagnostic tests on a specific plugin, use the --plugin parameter. If the plugin isn't listening to the doctor, then you get a warning.
|
|
5
|
-
|
|
6
|
-
Use the --command parameter to run a specific command in debug mode; the doctor writes both stdout and stderr to *.log files that you can provide to Salesforce Customer Support or attach to a GitHub issue.
|
|
7
|
-
|
|
8
|
-
Plugin providers can also implement their own doctor diagnostic tests by listening to the "sf-doctor" event and running plugin specific tests that are then included in the doctor diagnostics log.
|
|
9
|
-
`,
|
|
10
|
-
flags: {
|
|
11
|
-
command: 'command to run in debug mode ; results are written to a log file',
|
|
12
|
-
newissue: 'create a new GitHub issue and attach all diagnostic results',
|
|
13
|
-
plugin: 'specific plugin on which to run diagnostics ',
|
|
14
|
-
outputdir: 'directory to save all created files rather than the current working directory',
|
|
15
|
-
createissue: 'create a new issue on our GitHub repo and attach all diagnostic results',
|
|
16
|
-
},
|
|
17
|
-
examples: [
|
|
18
|
-
`Run CLI doctor diagnostics:
|
|
19
|
-
$ <%= config.bin %> doctor
|
|
20
|
-
Run CLI doctor diagnostics and the specified command, and write the debug output to a file:
|
|
21
|
-
$ <%= config.bin %> doctor --command "force:org:list --all"
|
|
22
|
-
Run CLI doctor diagnostics for a specific plugin:
|
|
23
|
-
$ <%= config.bin %> doctor --plugin @salesforce/plugin-source`,
|
|
24
|
-
],
|
|
25
|
-
pinnedSuggestions: {
|
|
26
|
-
checkGitHubIssues: 'Check https://github.com/forcedotcom/cli/issues for CLI issues posted by the community.',
|
|
27
|
-
checkSfdcStatus: 'Check http://status.salesforce.com for general Salesforce availability and performance.',
|
|
28
|
-
},
|
|
29
|
-
doctorNotInitializedError: 'Must first initialize a new SfDoctor.',
|
|
30
|
-
doctorAlreadyInitializedError: 'SfDoctor has already been initialized.',
|
|
31
|
-
pluginNotInstalledError:
|
|
32
|
-
"Specified plugin [%s] isn't installed. Install it, correct the name, or choose another plugin.",
|
|
33
|
-
};
|
package/messages/messages.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"HelpDefaults": "If not supplied, the apiversion, template, and outputdir use default values.\n",
|
|
3
|
-
"HelpOutputDirRelative": "The outputdir can be an absolute path or relative to the current working directory.\n",
|
|
4
|
-
"HelpOutputDirRelativeLightning": "If you don’t specify an outputdir, we create a subfolder in your current working directory with the name of your bundle. For example, if the current working directory is force-app and your Lightning bundle is called myBundle, we create force-app/myBundle/ to store the files in the bundle.\n",
|
|
5
|
-
"HelpExamplesTitle": "\nExamples:\n",
|
|
6
|
-
"OutputDirFlagDescription": "folder for saving the created files",
|
|
7
|
-
"OutputDirFlagLongDescription": "The directory to store the newly created files. The location can be an absolute path or relative to the current working directory. The default is the current directory.",
|
|
8
|
-
"TemplateFlagDescription": "template to use for file creation",
|
|
9
|
-
"TemplateFlagLongDescription": "The template to use to create the file. Supplied parameter values or default values are filled into a copy of the template.",
|
|
10
|
-
"TargetDirOutput": "target dir = %s",
|
|
11
|
-
"App": "app",
|
|
12
|
-
"Event": "event",
|
|
13
|
-
"Interface": "interface",
|
|
14
|
-
"Test": "test",
|
|
15
|
-
"Component": "component",
|
|
16
|
-
"Page": "page",
|
|
17
|
-
|
|
18
|
-
"AlphaNumericNameError": "Name must contain only alphanumeric characters.",
|
|
19
|
-
"NameMustStartWithLetterError": "Name must start with a letter.",
|
|
20
|
-
"EndWithUnderscoreError": "Name can't end with an underscore.",
|
|
21
|
-
"DoubleUnderscoreError": "Name can't contain 2 consecutive underscores."
|
|
22
|
-
}
|