From 07d76fcc0c747572d8c84b312b3ffa3c1f643054 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 25 Mar 2024 12:46:34 -0600 Subject: [PATCH 1/2] feat: bump sf-plugins-core --- README.md | 92 +++++++++++++++++++++++++++++++++++++++++-- command-snapshot.json | 16 ++++---- package.json | 2 +- yarn.lock | 12 +++--- 4 files changed, 104 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 2bc5ecdb..751f4113 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,95 @@ sfdx plugins -# Command Topics +- [`sf doctor`](#sf-doctor) +- [`sf info releasenotes display`](#sf-info-releasenotes-display) -- [`sf doctor`](docs/doctor.md) - Tools for diagnosing problems with Salesforce CLI. -- [`sf info`](docs/info.md) - Access Salesforce CLI information from the command line. +## `sf doctor` + +Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment. + +``` +USAGE + $ sf doctor [--json] [--flags-dir ] [-c ] [-p ] [-d ] [-i] + +FLAGS + -c, --command= Command to run in debug mode; results are written to a log file. + -d, --output-dir= Directory to save all created files rather than the current working directory. + -i, --create-issue Create a new issue on our GitHub repo and attach all diagnostic results. + -p, --plugin= Specific plugin on which to run diagnostics. + +GLOBAL FLAGS + --flags-dir= Import flag values from a directory. + --json Format output as json. + +DESCRIPTION + 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. + +EXAMPLES + Run CLI doctor diagnostics: + + $ sf doctor + + Run CLI doctor diagnostics and the specified command, and write the debug output to a file: + + $ sf doctor --command "force:org:list --all" + + Run CLI doctor diagnostics for a specific plugin: + + $ sf doctor --plugin @salesforce/plugin-source +``` + +_See code: [src/commands/doctor.ts](https://github.com/salesforcecli/plugin-info/blob/3.0.34/src/commands/doctor.ts)_ + +## `sf info releasenotes display` + +Display Salesforce CLI release notes on the command line. + +``` +USAGE + $ sf info releasenotes display [--json] [--flags-dir ] [-v ] + +FLAGS + -v, --version= CLI version or tag for which to display release notes. + +GLOBAL FLAGS + --flags-dir= Import flag values from a directory. + --json Format output as json. + +DESCRIPTION + Display Salesforce CLI release notes on the command line. + + By default, this command displays release notes for the currently installed CLI version on your computer. Use the + --version flag to view release notes for a different release. + +ALIASES + $ sf whatsnew + +EXAMPLES + Display release notes for the currently installed CLI version: + + $ sf info releasenotes display stable, stable-rc, latest, latest-rc, rc + + Display release notes for CLI version 7.120.0: + + $ sf info releasenotes display --version 7.120.0 stable, stable-rc, latest, latest-rc, rc + + Display release notes for the CLI version that corresponds to a tag (stable, stable-rc, latest, latest-rc, rc): + + $ sf info releasenotes display --version latest +``` + +_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/3.0.34/src/commands/info/releasenotes/display.ts)_ diff --git a/command-snapshot.json b/command-snapshot.json index b696f316..13f281bc 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -1,18 +1,18 @@ [ { - "command": "doctor", - "plugin": "@salesforce/plugin-info", - "flags": ["command", "create-issue", "json", "loglevel", "output-dir", "plugin"], "alias": [], + "command": "doctor", + "flagAliases": ["createissue", "o", "outputdir"], "flagChars": ["c", "d", "i", "p"], - "flagAliases": ["createissue", "o", "outputdir"] + "flags": ["command", "create-issue", "flags-dir", "json", "loglevel", "output-dir", "plugin"], + "plugin": "@salesforce/plugin-info" }, { - "command": "info:releasenotes:display", - "plugin": "@salesforce/plugin-info", - "flags": ["hook", "json", "loglevel", "version"], "alias": ["whatsnew"], + "command": "info:releasenotes:display", + "flagAliases": [], "flagChars": ["v"], - "flagAliases": [] + "flags": ["flags-dir", "hook", "json", "loglevel", "version"], + "plugin": "@salesforce/plugin-info" } ] diff --git a/package.json b/package.json index 22fc36bd..ac4ef02f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@oclif/core": "^3.23.0", "@salesforce/core": "^6.7.1", "@salesforce/kit": "^3.0.15", - "@salesforce/sf-plugins-core": "^7.1.16", + "@salesforce/sf-plugins-core": "^8.0.1", "got": "^13.0.0", "marked": "^4.3.0", "marked-terminal": "^4.2.0", diff --git a/yarn.lock b/yarn.lock index b95210d0..1bec9bd3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1416,7 +1416,7 @@ strip-ansi "6.0.1" ts-retry-promise "^0.8.0" -"@salesforce/core@^6.4.1", "@salesforce/core@^6.5.3", "@salesforce/core@^6.6.0", "@salesforce/core@^6.7.0", "@salesforce/core@^6.7.1": +"@salesforce/core@^6.4.1", "@salesforce/core@^6.5.3", "@salesforce/core@^6.7.0", "@salesforce/core@^6.7.1", "@salesforce/core@^6.7.3": version "6.7.3" resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-6.7.3.tgz#5d8f30c40ac3cebb898c8e845fe9a067bc729268" integrity sha512-uU+PuZZGXxByhvnXLH1V3eY5P1caw401dIZ/QvhzYxoP/alPLk7dpChnZNJYH5Rw3dc/AhSPw+eg0cvUyjhP1Q== @@ -1522,15 +1522,15 @@ chalk "^4" inquirer "^8.2.5" -"@salesforce/sf-plugins-core@^7.1.16": - version "7.1.16" - resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-7.1.16.tgz#a68673560f01421ac18a0bc1d4687abc35e11234" - integrity sha512-v135A7TG1n97eFoh0j96kbHKbivXbbd7M5url3L0I5lJsCGGF+mMSL2Tpm8FNUN8DCLOGkvymR1s2QmNzMR7Tw== +"@salesforce/sf-plugins-core@^8.0.1": + version "8.0.1" + resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-8.0.1.tgz#f155cddfd7695aab0d8264848b634b2a91cdbf2c" + integrity sha512-R6SqJ1XqSINSWdZruKtC2SKGnLBh7KbFI7+qS0FYlyPU4IlWoa+AZkGwWvlczuSOumqnlhT95rNKwZTS5rJugA== dependencies: "@inquirer/confirm" "^2.0.17" "@inquirer/password" "^1.1.16" "@oclif/core" "^3.23.0" - "@salesforce/core" "^6.6.0" + "@salesforce/core" "^6.7.3" "@salesforce/kit" "^3.0.15" "@salesforce/ts-types" "^2.0.9" chalk "^5.3.0" From 4698a8f343abe7b4367c151180bbff5840daa585 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 25 Mar 2024 13:41:48 -0600 Subject: [PATCH 2/2] chore: format --- src/commands/info/releasenotes/display.ts | 3 +-- src/diagnostics.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/commands/info/releasenotes/display.ts b/src/commands/info/releasenotes/display.ts index 606f10fc..8573d517 100644 --- a/src/commands/info/releasenotes/display.ts +++ b/src/commands/info/releasenotes/display.ts @@ -7,7 +7,6 @@ import { EOL } from 'node:os'; - import { marked } from 'marked'; import TerminalRenderer from 'marked-terminal'; import { Env } from '@salesforce/kit'; @@ -17,7 +16,7 @@ import type { AnyJson, JsonMap } from '@salesforce/ts-types'; import shared from '../../../shared/index.js'; // Initialize Messages with the current plugin directory -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const helpers = ['stable', 'stable-rc', 'latest', 'latest-rc', 'rc']; diff --git a/src/diagnostics.ts b/src/diagnostics.ts index 68aac76e..2176fd0d 100644 --- a/src/diagnostics.ts +++ b/src/diagnostics.ts @@ -7,7 +7,6 @@ import childProcess from 'node:child_process'; - import { Interfaces } from '@oclif/core'; import { Lifecycle, Messages } from '@salesforce/core'; import { SfDoctor, SfDoctorDiagnosis } from './doctor.js'; @@ -24,7 +23,7 @@ export interface DiagnosticStatus { status: 'pass' | 'fail' | 'warn' | 'unknown'; } -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-info', 'diagnostics'); /**