|
1 | 1 | **NOTE: This template for sf plugins is not yet official. Please consult with the Platform CLI team before using this template.** |
2 | 2 |
|
3 | | -# plugin-orchestrator |
| 3 | +# Salesforce Orchestrator Plugin |
4 | 4 |
|
5 | | -[](https://www.npmjs.com/package/@salesforce/plugin-orchestrator) [](https://npmjs.org/package/@salesforce/plugin-orchestrator) [](https://raw.githubusercontent.com/salesforcecli/plugin-orchestrator/main/LICENSE.txt) |
| 5 | +[](https://raw.githubusercontent.com/salesforcecli/plugin-orchestrator/main/LICENSE.txt) |
6 | 6 |
|
7 | | -## Using the template |
| 7 | +A Salesforce CLI plugin for working with AppFramework apps, templates, assets, and services. |
8 | 8 |
|
9 | | -This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin: |
| 9 | +## Installation |
10 | 10 |
|
11 | | -1. Please get in touch with the Platform CLI team. We want to help you develop your plugin. |
12 | | -2. Generate your plugin: |
| 11 | +If you want to contribute to the plugin or run it from source: |
13 | 12 |
|
14 | | - ``` |
15 | | - sf plugins install dev |
16 | | - sf dev generate plugin |
17 | | -
|
18 | | - git init -b main |
19 | | - git add . && git commit -m "chore: initial commit" |
20 | | - ``` |
21 | | - |
22 | | -3. Create your plugin's repo in the salesforcecli github org |
23 | | -4. When you're ready, replace the contents of this README with the information you want. |
| 13 | +```bash |
| 14 | +# Clone the repository |
| 15 | +git clone https://github.com/salesforcecli/plugin-orchestrator.git |
| 16 | +cd plugin-orchestrator |
24 | 17 |
|
25 | | -## Learn about `sf` plugins |
| 18 | +# Install dependencies |
| 19 | +yarn install |
26 | 20 |
|
27 | | -Salesforce CLI plugins are based on the [oclif plugin framework](https://oclif.io/docs/introduction). 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. |
| 21 | +# Build the plugin |
| 22 | +yarn build |
28 | 23 |
|
29 | | -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. There is also a default circleci config using the [release management orb](https://github.com/forcedotcom/npm-release-management-orb) standards. |
| 24 | +# Link to your local SF CLI |
| 25 | +sf plugins link . |
| 26 | +``` |
30 | 27 |
|
31 | | -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. |
| 28 | +## Running Locally for Development |
32 | 29 |
|
33 | | -### Tooling |
| 30 | +When developing the plugin, you can run it in several ways: |
34 | 31 |
|
35 | | -- [@salesforce/core](https://github.com/forcedotcom/sfdx-core) |
36 | | -- [@salesforce/kit](https://github.com/forcedotcom/kit) |
37 | | -- [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core) |
38 | | -- [@salesforce/ts-types](https://github.com/forcedotcom/ts-types) |
39 | | -- [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon) |
40 | | -- [@salesforce/dev-config](https://github.com/forcedotcom/dev-config) |
41 | | -- [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts) |
| 32 | +### Using the local run file |
42 | 33 |
|
43 | | -# Everything past here is only a suggestion as to what should be in your specific plugin's description |
| 34 | +```bash |
| 35 | +# Run a command using the local development script |
| 36 | +./bin/dev.js orchestrator template list --help |
| 37 | +``` |
44 | 38 |
|
45 | | -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). |
| 39 | +### Using the linked plugin |
46 | 40 |
|
47 | | -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. |
48 | | - |
49 | | -## Install |
| 41 | +After linking the plugin with `sf plugins link .`, you can run commands normally: |
50 | 42 |
|
51 | 43 | ```bash |
52 | | -sf plugins install @salesforce/[email protected] |
| 44 | +sf orchestrator template list --help |
53 | 45 | ``` |
54 | 46 |
|
55 | | -## Issues |
| 47 | +### Running Tests |
56 | 48 |
|
57 | | -Please report any issues at https://github.com/forcedotcom/cli/issues |
| 49 | +```bash |
| 50 | +# Run all tests |
| 51 | +yarn test |
58 | 52 |
|
59 | | -## Contributing |
| 53 | +# Run unit tests only |
| 54 | +yarn test:only |
60 | 55 |
|
61 | | -1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md) |
62 | | -2. Create a new issue before starting your project so that we can keep track of |
63 | | - what you are trying to add/fix. That way, we can also offer suggestions or |
64 | | - let you know if there is already an effort in progress. |
65 | | -3. Fork this repository. |
66 | | -4. [Build the plugin locally](#build) |
67 | | -5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork. |
68 | | -6. Edit the code in your fork. |
69 | | -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. |
70 | | -8. Sign CLA (see [CLA](#cla) below). |
71 | | -9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in. |
72 | | - |
73 | | -### CLA |
| 56 | +# Run NUTs (Node Unit Tests) |
| 57 | +yarn test:nuts |
| 58 | +``` |
74 | 59 |
|
75 | | -External contributors will be required to sign a Contributor's License |
76 | | -Agreement. You can do so by going to https://cla.salesforce.com/sign-cla. |
| 60 | +## Commands |
77 | 61 |
|
78 | | -### Build |
| 62 | +The plugin provides commands for working with AppFramework templates and applications. |
79 | 63 |
|
80 | | -To build the plugin locally, make sure to have yarn installed and run the following commands: |
| 64 | +### Template Commands |
81 | 65 |
|
82 | 66 | ```bash |
83 | | -# Clone the repository |
84 | | -git clone [email protected]:salesforcecli/plugin-orchestrator |
| 67 | +# List templates in an org |
| 68 | +sf orchestrator template list -o <target-org> |
85 | 69 |
|
86 | | -# Install the dependencies and compile |
87 | | -yarn && yarn build |
88 | | -``` |
| 70 | +# Display details of a specific template |
| 71 | +sf orchestrator template display -o <target-org> --template-id <id> |
89 | 72 |
|
90 | | -To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file. |
| 73 | +# Create a new template |
| 74 | +sf orchestrator template create -o <target-org> --name <template-name> [--label <label>] [--type <type>] |
91 | 75 |
|
92 | | -```bash |
93 | | -# Run using local run file. |
94 | | -./bin/dev hello world |
| 76 | +# Update an existing template |
| 77 | +sf orchestrator template update -o <target-org> --template-id <id> [--label <new-label>] [--description <text>] |
| 78 | + |
| 79 | +# Delete a template |
| 80 | +sf orchestrator template delete -o <target-org> --template-id <id> |
95 | 81 | ``` |
96 | 82 |
|
97 | | -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. |
| 83 | +### App Commands |
98 | 84 |
|
99 | 85 | ```bash |
100 | | -# Link your plugin to the sf cli |
101 | | -sf plugins link . |
102 | | -# To verify |
103 | | -sf plugins |
104 | | -``` |
| 86 | +# List apps in an org |
| 87 | +sf orchestrator list app -o <target-org> |
105 | 88 |
|
106 | | -## Commands |
| 89 | +# Display details of a specific app |
| 90 | +sf orchestrator display app -o <target-org> --app-id <id> |
107 | 91 |
|
108 | | -<!-- commands --> |
| 92 | +# Create a new app |
| 93 | +sf orchestrator create app -o <target-org> --name <app-name> [--label <label>] [--template-id <template-id>] |
109 | 94 |
|
110 | | -- [`sf hello world`](#sf-hello-world) |
| 95 | +# Update an existing app |
| 96 | +sf orchestrator update app -o <target-org> --app-id <id> [--label <new-label>] [--description <text>] |
111 | 97 |
|
112 | | -## `sf hello world` |
| 98 | +# Delete an app |
| 99 | +sf orchestrator delete app -o <target-org> --app-id <id> |
| 100 | +``` |
113 | 101 |
|
114 | | -Say hello. |
| 102 | +## Issues |
115 | 103 |
|
116 | | -``` |
117 | | -USAGE |
118 | | - $ sf hello world [--json] [--flags-dir <value>] [-n <value>] |
| 104 | +Please report any issues at https://github.com/salesforcecli/plugin-orchestrator/issues |
119 | 105 |
|
120 | | -FLAGS |
121 | | - -n, --name=<value> [default: World] The name of the person you'd like to say hello to. |
| 106 | +## Contributing |
122 | 107 |
|
123 | | -GLOBAL FLAGS |
124 | | - --flags-dir=<value> Import flag values from a directory. |
125 | | - --json Format output as json. |
| 108 | +1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md) |
| 109 | +2. Create a new issue before starting your project so that we can keep track of |
| 110 | + what you are trying to add/fix. That way, we can also offer suggestions or |
| 111 | + let you know if there is already an effort in progress. |
| 112 | +3. Fork this repository. |
| 113 | +4. [Build the plugin locally](#installation) |
| 114 | +5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork. |
| 115 | +6. Edit the code in your fork. |
| 116 | +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. |
| 117 | +8. Sign CLA (see [CLA](#cla) below). |
| 118 | +9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in. |
126 | 119 |
|
127 | | -DESCRIPTION |
128 | | - Say hello. |
| 120 | +### CLA |
129 | 121 |
|
130 | | - Say hello either to the world or someone you know. |
| 122 | +External contributors will be required to sign a Contributor's License |
| 123 | +Agreement. You can do so by going to https://cla.salesforce.com/sign-cla. |
131 | 124 |
|
132 | | -EXAMPLES |
133 | | - Say hello to the world: |
| 125 | +## Learn about `sf` plugins |
134 | 126 |
|
135 | | - $ sf hello world |
| 127 | +Salesforce CLI plugins are based on the [oclif plugin framework](https://oclif.io/docs/introduction). 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. |
136 | 128 |
|
137 | | - Say hello to someone you know: |
| 129 | +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. |
138 | 130 |
|
139 | | - $ sf hello world --name Astro |
| 131 | +Additionally, there are some 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. |
140 | 132 |
|
141 | | -FLAG DESCRIPTIONS |
142 | | - -n, --name=<value> The name of the person you'd like to say hello to. |
| 133 | +### Tooling |
143 | 134 |
|
144 | | - This person can be anyone in the world! |
145 | | -``` |
| 135 | +- [@salesforce/core](https://github.com/forcedotcom/sfdx-core) |
| 136 | +- [@salesforce/kit](https://github.com/forcedotcom/kit) |
| 137 | +- [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core) |
| 138 | +- [@salesforce/ts-types](https://github.com/forcedotcom/ts-types) |
| 139 | +- [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon) |
| 140 | +- [@salesforce/dev-config](https://github.com/forcedotcom/dev-config) |
| 141 | +- [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts) |
146 | 142 |
|
147 | | -_See code: [src/commands/hello/world.ts](https://github.com/salesforcecli/plugin-orchestrator/blob/1.1.38/src/commands/hello/world.ts)_ |
| 143 | +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). |
148 | 144 |
|
149 | | -<!-- commandsstop --> |
| 145 | +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. |
0 commit comments