Skip to content

Commit

Permalink
feat: plugin to sf parity
Browse files Browse the repository at this point in the history
@W-12084133@
  • Loading branch information
peternhale committed Dec 28, 2022
1 parent 34b79a4 commit 2c804dc
Show file tree
Hide file tree
Showing 14 changed files with 299 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license'],
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license', 'plugin:sf-plugin/recommended'],
};
57 changes: 45 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,38 +76,71 @@ sfdx plugins

<!-- commands -->

- [`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)
- [`sfdx doctor`](#sfdx-doctor)
- [`sfdx info:releasenotes:display`](#sfdx-inforeleasenotesdisplay)

## `sfdx info:releasenotes:display [-v <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
## `sfdx doctor`

Display Salesforce CLI release notes on the command line.
Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.

```
USAGE
$ sfdx info:releasenotes:display [-v <string>] [--json] [--loglevel
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
$ sfdx doctor
OPTIONS
-v, --version=version CLI version or tag for which to
display release notes.
-c, --command=command
-d, --output-dir=output-dir
-i, --create-issue
-p, --plugin=plugin
--json Format output as json.
DESCRIPTION
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.
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.
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.
EXAMPLES
- Run CLI doctor diagnostics:
$ sfdx doctor
Run CLI doctor diagnostics and the specified command, and write the debug output to a file:
$ sfdx doctor --command "force:org:list --all"
Run CLI doctor diagnostics for a specific plugin:
$ sfdx doctor --plugin @salesforce/plugin-source
```

_See code: [src/commands/doctor.ts](https://github.com/salesforcecli/plugin-info/blob/v2.2.14-t.0/src/commands/doctor.ts)_

--json format output as json
## `sfdx info:releasenotes:display`

--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
this command invocation
Display Salesforce CLI release notes on the command line.

```
USAGE
$ sfdx info:releasenotes:display
OPTIONS
-v, --version=version CLI version or tag for which to display release notes.
--json Format output as json.
ALIASES
$ sfdx whatsnew
EXAMPLES
Display release notes for the currently installed CLI version:
- Display release notes for the currently installed CLI version:
$ sfdx info:releasenotes:display
Display release notes for CLI version 7.120.0:
$ sfdx info:releasenotes:display --version 7.120.0
Display release notes for the CLI version that corresponds to a tag (stable, stable-rc, latest, latest-rc, rc):
$ sfdx info:releasenotes:display --version latest
```

_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/v2.0.1/src/commands/info/releasenotes/display.ts)_
_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)_

<!-- commandsstop -->
2 changes: 1 addition & 1 deletion command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"command": "doctor",
"plugin": "@salesforce/plugin-info",
"flags": ["command", "createissue", "json", "loglevel", "outputdir", "plugin"],
"flags": ["command", "create-issue", "json", "loglevel", "output-dir", "plugin"],
"alias": []
},
{
Expand Down
22 changes: 0 additions & 22 deletions messages/display.js

This file was deleted.

39 changes: 39 additions & 0 deletions messages/display.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# commandDescription

Display Salesforce CLI release notes on the command line.

# flags.version.summary

CLI version or tag for which to display release notes.

# flags.version.description

CLI version or tag for which to display release notes.

# flags.hook.summary

This hidden parameter is used in post install or update hooks.

# flags.hook.description

This hidden parameter is used in post install or update hooks.

# 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 (%s):
$ <%= config.bin %> <%= command.id %> --version latest

# footer

---

- Run `%s whatsnew` to manually view the current release notes.
- You can also view them on GitHub by visiting the [forcedotcom/cli](%s) repo.
- Silence notes by setting the `%s` env var to `true`.
- Hide this footer by setting the `%s` env var to `true`.

---
33 changes: 0 additions & 33 deletions messages/doctor.js

This file was deleted.

54 changes: 54 additions & 0 deletions messages/doctor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# commandDescription

Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.

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.

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.

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.

# flags.command

command to run in debug mode ; results are written to a log file

# flags.plugin

specific plugin on which to run diagnostics

# flags.output-dir.summary

directory to save all created files rather than the current working directory

# flags.create-issue.summary

create a new issue on our GitHub repo and attach all diagnostic results

# 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

# pinnedSuggestions.checkGitHubIssues

Check https://github.com/forcedotcom/cli/issues for CLI issues posted by the community.

# pinnedSuggestions.checkSfdcStatus

Check http://status.salesforce.com for general Salesforce availability and performance.

# doctorNotInitializedError

Must first initialize a new SfDoctor.

# doctorAlreadyInitializedError

SfDoctor has already been initialized.

# pluginNotInstalledError

Specified plugin [%s] isn't installed. Install it, correct the name, or choose another plugin.
22 changes: 0 additions & 22 deletions messages/messages.json

This file was deleted.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"bugs": "https://github.com/forcedotcom/cli/issues",
"main": "lib/index.js",
"dependencies": {
"@oclif/core": "^1.20.0",
"@salesforce/command": "^5.2.27",
"@salesforce/core": "^3.30.12",
"@salesforce/kit": "^1.6.1",
"@oclif/core": "^1.23.0",
"@salesforce/core": "^3.32.12",
"@salesforce/kit": "^1.8.0",
"@salesforce/sf-plugins-core": "^1.21.3",
"got": "^11.8.6",
"marked": "^4.2.4",
"marked-terminal": "^4.2.0",
Expand Down Expand Up @@ -45,6 +45,7 @@
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.4",
"eslint-plugin-sf-plugin": "^1.3.1",
"husky": "^7.0.4",
"mocha": "^9.1.3",
"nyc": "^15.1.0",
Expand Down Expand Up @@ -118,10 +119,11 @@
"test": "sf-test",
"test:command-reference": "./bin/dev commandreference:generate --erroronwarnings",
"test:deprecation-policy": "./bin/dev snapshot:compare",
"test:json-schema": "./bin/dev schema:compare",
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
"version": "oclif-dev readme"
},
"publishConfig": {
"access": "public"
}
}
}
Loading

0 comments on commit 2c804dc

Please sign in to comment.