Skip to content

Commit fdc4dd8

Browse files
committed
fix: updating documentation, README and messages
1 parent 9700da6 commit fdc4dd8

4 files changed

Lines changed: 39 additions & 115 deletions

File tree

README.md

Lines changed: 18 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,38 @@
1-
# pubsub
1+
# @pcon/pubsub
22

3-
[![NPM](https://img.shields.io/npm/v/pubsub.svg?label=pubsub)](https://www.npmjs.com/package/pubsub) [![Downloads/week](https://img.shields.io/npm/dw/pubsub.svg)](https://npmjs.org/package/pubsub) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/pubsub/main/LICENSE.txt)
3+
[![NPM](https://img.shields.io/npm/v/@pcon/pubsub.svg?label=sf-cli-pubsub)](https://www.npmjs.com/package/@pcon/sf-cli-pubsub) [![Downloads/week](https://img.shields.io/npm/dw/@pcon/sf-cli-pubsub.svg)](https://npmjs.org/package/@pcon/sf-cli-pubsub)
44

5-
## Using the template
5+
## Setup
66

7-
This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin:
7+
### Install Latest
88

9-
1. Please get in touch with the Platform CLI team. We want to help you develop your plugin.
10-
2. Generate your plugin:
11-
12-
```
13-
sf plugins install dev
14-
sf dev generate plugin
15-
16-
git init -b main
17-
git add . && git commit -m "chore: initial commit"
18-
```
19-
20-
3. Create your plugin's repo in the salesforcecli github org
21-
4. When you're ready, replace the contents of this README with the information you want.
22-
23-
## Learn about `sf` plugins
24-
25-
Salesforce CLI plugins are based on the [oclif plugin framework](<(https://oclif.io/docs/introduction.html)>). Read the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm) to learn about Salesforce CLI plugin development.
26-
27-
This repository contains a lot of additional scripts and tools to help with general Salesforce node development and enforce coding standards. You should familiarize yourself with some of the [node developer packages](#tooling) used by Salesforce.
28-
29-
Additionally, there are some additional tests that the Salesforce CLI will enforce if this plugin is ever bundled with the CLI. These test are included by default under the `posttest` script and it is required to keep these tests active in your plugin if you plan to have it bundled.
30-
31-
### Tooling
32-
33-
- [@salesforce/core](https://github.com/forcedotcom/sfdx-core)
34-
- [@salesforce/kit](https://github.com/forcedotcom/kit)
35-
- [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core)
36-
- [@salesforce/ts-types](https://github.com/forcedotcom/ts-types)
37-
- [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon)
38-
- [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
39-
- [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)
40-
41-
### Hooks
42-
43-
For cross clouds commands, e.g. `sf env list`, we utilize [oclif hooks](https://oclif.io/docs/hooks) to get the relevant information from installed plugins.
44-
45-
This plugin includes sample hooks in the [src/hooks directory](src/hooks). You'll just need to add the appropriate logic. You can also delete any of the hooks if they aren't required for your plugin.
46-
47-
# Everything past here is only a suggestion as to what should be in your specific plugin's description
48-
49-
This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
50-
51-
We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed.
52-
53-
## Install
54-
55-
```bash
56-
sf plugins install pubsub@x.y.z
9+
```
10+
sf plugins install @pcon/sf-cli-pubsub
5711
```
5812

59-
## Issues
60-
61-
Please report any issues at https://github.com/forcedotcom/cli/issues
62-
63-
## Contributing
64-
65-
1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md)
66-
2. Create a new issue before starting your project so that we can keep track of
67-
what you are trying to add/fix. That way, we can also offer suggestions or
68-
let you know if there is already an effort in progress.
69-
3. Fork this repository.
70-
4. [Build the plugin locally](#build)
71-
5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
72-
6. Edit the code in your fork.
73-
7. Write appropriate tests for your changes. Try to achieve at least 95% code coverage on any new code. No pull request will be accepted without unit tests.
74-
8. Sign CLA (see [CLA](#cla) below).
75-
9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.
76-
77-
### CLA
78-
79-
External contributors will be required to sign a Contributor's License
80-
Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
81-
82-
### Build
83-
84-
To build the plugin locally, make sure to have yarn installed and run the following commands:
85-
86-
```bash
87-
# Clone the repository
88-
git clone git@github.com:salesforcecli/pubsub
13+
You will be prompted to confirm that you want to install an unsigned plugin. Choose "yes"
8914

90-
# Install the dependencies and compile
91-
yarn && yarn build
15+
```
16+
This plugin is not digitally signed and its authenticity cannot be verified. Continue installation y/n?: y
9217
```
9318

94-
To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.
19+
To allowlist this plugin, [add an entry for it in $HOME/.config/sfdx/unsignedPluginAllowList.json](https://developer.salesforce.com/blogs/2017/10/salesforce-dx-cli-plugin-update.html).
20+
21+
### Install Older Version
9522

9623
```bash
97-
# Run using local run file.
98-
./bin/dev hello world
24+
sf plugins install @pcon/sf-cli-pubsub@x.y.z
9925
```
10026

101-
There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
27+
## Issues
10228

103-
```bash
104-
# Link your plugin to the sf cli
105-
sf plugins link .
106-
# To verify
107-
sf plugins
108-
```
29+
Please report any issues at https://github.com/pcon/sf-cli-pubsub/issues
10930

11031
## Commands
11132

11233
<!-- commands -->
113-
* [`sf pubsub subscribe`](#sf-pubsub-subscribe)
34+
35+
- [`sf pubsub subscribe`](#sf-pubsub-subscribe)
11436

11537
## `sf pubsub subscribe`
11638

@@ -146,4 +68,5 @@ FLAG DESCRIPTIONS
14668
14769
More information about a flag. Don't repeat the summary.
14870
```
71+
14972
<!-- commandsstop -->

messages/pubsub.subscribe.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
# summary
22

3-
Summary of a command.
3+
Subscribes to one or more topics.
44

55
# description
66

7-
More information about a command. Don't repeat the summary.
7+
Connects to a pub / sub endpoint and logs the message to the console.
88

9-
# flags.name.summary
9+
# flags.count.summary
1010

11-
Description of a flag.
11+
The number of messages to watch for.
1212

13-
# flags.name.description
13+
# flags.count.description
1414

15-
More information about a flag. Don't repeat the summary.
15+
The number of messages to wait for before exiting. Defaults to 100.
1616

17-
# examples
17+
# flags.topic.summary
1818

19-
- <%= config.bin %> <%= command.id %>
19+
The topic to subscribe to.
2020

21-
# flags.count.summary
21+
# flags.topic.description
2222

23-
The number of messages to watch for.
23+
The path to the topic to subscribe too. Typically starts with either "/data/" or "/event/"
2424

25-
# flags.topic.summary
25+
# examples
2626

27-
The topic to subscribe to.
27+
- <%= config.bin %> <%= command.id %> --target-org myTargetOrg --topic "/data/CaseChangeEvent" --topic "/event/My_Event**e" --topic "/data/My_Object**ChangeEvent"

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@
4747
],
4848
"topics": {
4949
"pubsub": {
50-
"description": "description for pubsub"
50+
"description": "A toolchain to help with pubsub related tasks",
51+
"subtopics": {
52+
"subscribe": {
53+
"description": "Subscribe to topics"
54+
}
55+
}
5156
}
5257
},
5358
"flexibleTaxonomy": true
@@ -184,5 +189,7 @@
184189
},
185190
"exports": "./lib/index.js",
186191
"type": "module",
187-
"author": "Patrick Connelly"
192+
"author": "Patrick Connelly",
193+
"bugs": "https://github.com/pcon/sf-cli-pubsub/issues",
194+
"repository": "github:pcon/sf-cli-pubsub"
188195
}

src/commands/pubsub/subscribe.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ export default class PubsubSubscribe extends SfCommand<undefined> {
3030
public static readonly examples = messages.getMessages('examples');
3131

3232
public static readonly flags = {
33-
name: Flags.string({
34-
summary: messages.getMessage('flags.name.summary'),
35-
description: messages.getMessage('flags.name.description'),
36-
char: 'n',
37-
required: false,
38-
}),
3933
'target-org': Flags.requiredOrg(),
4034
count: Flags.integer({
4135
summary: messages.getMessage('flags.count.summary'),

0 commit comments

Comments
 (0)