generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from salesforcecli/wr/addCommands
fix: add command, test, config/readme housekeeping
- Loading branch information
Showing
19 changed files
with
1,967 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,30 @@ | ||
## Commands | ||
|
||
A list of the available commands | ||
validate a digital signature for a npm package | ||
|
||
- [`sfdx hello:org [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-helloorg--n-string--f--v-string--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
- [`sfdx plugins:trust:verify -n <string> [-r <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`] | ||
|
||
## `sfdx hello:org [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` | ||
## `sfdx plugins:trust:verify -n <string> [-r <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` | ||
|
||
print a greeting and your org IDs | ||
|
||
``` | ||
USAGE | ||
$ sfdx hello:org [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel | ||
```USAGE | ||
$ sfdx plugins:trust:verify -n <string> [-r <string>] [--json] [--loglevel | ||
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] | ||
OPTIONS | ||
-f, --force example boolean flag | ||
-n, --name=name name to print | ||
-u, --targetusername=targetusername username or alias for the target | ||
org; overrides default target org | ||
-n, --npm=npm (required) Specify the npm | ||
name. This can include a | ||
tag/version | ||
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub | ||
org; overrides default dev hub org | ||
--apiversion=apiversion override the api version used for | ||
api requests made by this command | ||
-r, --registry=registry The registry name. the | ||
behavior is the same as npm | ||
--json format output as json | ||
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for | ||
this command invocation | ||
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging | ||
level for this command | ||
invocation | ||
EXAMPLES | ||
$ sfdx hello:org --targetusername [email protected] --targetdevhubusername [email protected] | ||
Hello world! This is org: MyOrg and I will be around until Tue Mar 20 2018! | ||
My hub org id is: 00Dxx000000001234 | ||
$ sfdx hello:org --name myname --targetusername [email protected] | ||
Hello myname! This is org: MyOrg and I will be around until Tue Mar 20 2018! | ||
sfdx plugins:trust:verify --npm @scope/npmName --registry http://my.repo.org:4874 | ||
sfdx plugins:trust:verify --npm @scope/npmName | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,6 @@ | ||
# plugin-<REPLACE ME> | ||
# plugin-trust | ||
|
||
Change above to <REPLACE_ME> before finalizing | ||
|
||
<REPLACE ME DESCRIPTION START> | ||
|
||
This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin: | ||
|
||
1. Clone this repo | ||
2. Delete the .git folder | ||
3. Replace filler values | ||
a) Every instance of `<REPLACE_ME>` can be directly substitued for the name of the new plugin. However beware, things like github paths are for the salesforcecli Github organization | ||
b) Search for case-matching `REPLACE` to find other filler values, such as for the plugin description | ||
4. Use `git init` to set up the desired git information | ||
5. Follow the getting started steps below until the `sfdx hello:org` commmand is functioning | ||
6. In order to prevent build failures on the intial build, you will need to do the following: | ||
1. `npm publish` | ||
2. `git tag v1.0.0 ; git push origin v1.0.0` | ||
|
||
<REPLACE ME DESCRIPTION END> | ||
|
||
### Everything past here is only a suggestion as to what should be in your specific plugin's descsription. | ||
commands to verify the authenticity of a plugin | ||
|
||
## Getting Started | ||
|
||
|
@@ -28,8 +9,8 @@ To use, install the [Salesforce CLI](https://developer.salesforce.com/tools/sfdx | |
``` | ||
Verify the CLI is installed | ||
$ sfdx (-v | --version) | ||
Install the <REPLACE_ME> plugin | ||
$ sfdx plugins:install <REPLACE_ME> | ||
Install the plugin-trust plugin | ||
$ sfdx plugins:install plugin-trust | ||
To run a command | ||
$ sfdx [command] | ||
``` | ||
|
@@ -38,7 +19,7 @@ To build the plugin locally, make sure to have yarn installed and run the follow | |
|
||
``` | ||
Clone the repository | ||
$ git clone [email protected]:salesforcecli/plugin-<REPLACE_ME> | ||
$ git clone [email protected]:salesforcecli/plugin-trust | ||
Install the dependencies and compile | ||
$ yarn install | ||
$ yarn prepack | ||
|
@@ -52,7 +33,7 @@ To verify | |
|
||
We recommend using the Visual Studio Code (VS Code) IDE for your plugin development. Included in the `.vscode` directory of this plugin is a `launch.json` config file, which allows you to attach a debugger to the node process when running your commands. | ||
|
||
To debug the `hello:org` command: | ||
To debug the `plugins:trust:verify` command: | ||
|
||
If you linked your plugin to the sfdx cli, call your command with the `dev-suspend` switch: | ||
|
||
|
@@ -63,53 +44,44 @@ $ sfdx hello:org -u [email protected] --dev-suspend | |
Alternatively, to call your command using the `bin/run` script, set the `NODE_OPTIONS` environment variable to `--inspect-brk` when starting the debugger: | ||
|
||
```sh-session | ||
$ NODE_OPTIONS=--inspect-brk bin/run hello:org -u [email protected] | ||
$ NODE_OPTIONS=--inspect-brk bin/run plugins:trust:verify | ||
``` | ||
|
||
2. Set some breakpoints in your command code | ||
3. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view. | ||
4. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen. | ||
5. Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program. | ||
6. Hit the green play button at the top middle of VS Code (this play button will be to the right of the play button that you clicked in step #5). | ||
<br><img src=".images/vscodeScreenshot.png" width="480" height="278"><br> | ||
![how to debug](./.images/vscodeScreenshot.png) | ||
Congrats, you are debugging! | ||
|
||
## Commands | ||
|
||
- [`sfdx hello:org [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-helloorg--n-string--f--v-string--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) | ||
validate a digital signature for a npm package | ||
|
||
## `sfdx hello:org [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` | ||
- [`sfdx plugins:trust:verify -n <string> [-r <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`] | ||
|
||
print a greeting and your org IDs | ||
## `sfdx plugins:trust:verify -n <string> [-r <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` | ||
|
||
``` | ||
USAGE | ||
$ sfdx hello:org [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel | ||
```USAGE | ||
$ sfdx plugins:trust:verify -n <string> [-r <string>] [--json] [--loglevel | ||
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] | ||
OPTIONS | ||
-f, --force example boolean flag | ||
-n, --name=name name to print | ||
-u, --targetusername=targetusername username or alias for the target | ||
org; overrides default target org | ||
-n, --npm=npm (required) Specify the npm | ||
name. This can include a | ||
tag/version | ||
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub | ||
org; overrides default dev hub org | ||
--apiversion=apiversion override the api version used for | ||
api requests made by this command | ||
-r, --registry=registry The registry name. the | ||
behavior is the same as npm | ||
--json format output as json | ||
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for | ||
this command invocation | ||
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging | ||
level for this command | ||
invocation | ||
EXAMPLES | ||
$ sfdx hello:org --targetusername [email protected] --targetdevhubusername [email protected] | ||
Hello world! This is org: MyOrg and I will be around until Tue Mar 20 2018! | ||
My hub org id is: 00Dxx000000001234 | ||
$ sfdx hello:org --name myname --targetusername [email protected] | ||
Hello myname! This is org: MyOrg and I will be around until Tue Mar 20 2018! | ||
sfdx plugins:trust:verify --npm @scope/npmName --registry http://my.repo.org:4874 | ||
sfdx plugins:trust:verify --npm @scope/npmName | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"description": "validate a digital signature for a npm package", | ||
"examples": [ | ||
"sfdx plugins:trust:verify --npm @scope/npmName --registry http://my.repo.org:4874", | ||
"sfdx plugins:trust:verify --npm @scope/npmName" | ||
], | ||
"flags": { | ||
"npm": "Specify the npm name. This can include a tag/version", | ||
"registry": "The registry name. the behavior is the same as npm" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.