Skip to content

Commit

Permalink
Merge branch 'wr/twinning' of github.com:salesforcecli/cli into wr/tw…
Browse files Browse the repository at this point in the history
…inning
  • Loading branch information
WillieRuemmele committed Dec 9, 2022
2 parents 376d897 + 6f3772b commit f37a6c5
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 139 deletions.
52 changes: 27 additions & 25 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,18 @@

## Plugin Architecture

The Salesforce CLI is built using [oclif](oclif.io), which is an open source CLI framework owned and maintained by Salesforce. The primary benefit of using oclif is that it allows us to develop CLI plugins for specific feature areas. Some plugins are bundled with every CLI installation, while others can be installed if and when a user chooses.
The Salesforce CLI is built using [oclif](https://oclif.io/), which is an open source CLI framework owned and maintained by Salesforce. The primary benefit of using oclif is that it allows us to develop CLI plugins for specific feature areas. Some plugins are bundled with every CLI installation, while others can be installed if and when a user chooses.

This architecture allows us to empower internal teams and external contributors (aka plugin providers) to own and maintain their CLI commands, without having to create an entirely new CLI. It also allows plugin providers to keep their changes isolated from other plugins and it allows customers to preview features and fixes by manually installing a plugin before it's shipped in the CLI.

We write most of our logic inside of NPM libraries that plugins can consume. This allows the command to be a light wrapper around the library and enables other consumers to use the exact same functionality - for example, both [@salesforce/plugin-deploy-retrieve](https://github.com/salesforcecli/plugin-deploy-retrieve) and the [Salesforce Extension pack for VsCode](https://developer.salesforce.com/tools/vscode) use the [source-deploy-retrieve](https://github.com/forcedotcom/source-deploy-retrieve/) library to interact with Salesforce metadata.
We write most of our business logic inside of NPM libraries that plugins can consume. This allows the commands in a plugin to be a light wrapper around the library and also enables other consumers to use the exact same functionality - for example, both [@salesforce/plugin-deploy-retrieve](https://github.com/salesforcecli/plugin-deploy-retrieve) and the [Salesforce Extension pack for VsCode](https://developer.salesforce.com/tools/vscode) use the [source-deploy-retrieve](https://github.com/forcedotcom/source-deploy-retrieve/) library to interact with Salesforce metadata.

![sf plugins and dependencies](images/sf-plugins-and-deps.jpg 'Salesforce CLI Plugins and Dependencies')

## Typical Salesforce Plugin

Plugins are npm packages written in Typescript and are hosted in the public npm registry. These are the dependencies that are typical amongst all Salesforce plugins:

### dependencies

- [@oclif/core](https://github.com/oclif/core)
- [@salesforce/kit](https://github.com/forcedotom/kit)
- [@salesforce/core](https://github.com/forcedotcom//core)
- [@salesforce/ts-types](https://github.com/forcedotcom/ts-types)
- [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core)
- [@salesforce/source-deploy-retrieve](https://github.com/forcedotcom/source-deploy-retrieve)
- [@salesforce/source-tracking](https://github.com/forcedotcom/source-tracking)

### dev dependencies

- [@salesforce/cli-plugins-testkit](https://github.com/salesforcecli/cli-plugins-testkit)
- [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
- [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)
- [@salesforce/prettier-config](https://github.com/forcedotcom/prettier-config)
- [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon)
- [eslint-config-salesforce](https://github.com/forcedotcom/eslint-config-salesforce)
- [eslint-config-salesforce-license](https://github.com/forcedotcom/-eslint-config-salesforce-license)
- [eslint-config-salesforce-typescript](https://github.com/forcedotcom/-eslint-config-salesforce-typescript)

### Salesforce plugins

- [plugin-deploy-retrieve](https://github.com/salesforcecli/plugin-deploy-retrieve)
Expand All @@ -44,19 +23,42 @@ Plugins are npm packages written in Typescript and are hosted in the public npm
- [plugin-login](https://github.com/salesforcecli/plugin-login)
- [plugin-settings](https://github.com/salesforcecli/plugin-settings)
- [plugin-telemetry](https://github.com/salesforcecli/plugin-telemetry)
- [plugin-info](https://github.com/salesforcecli/plugin-info)
- [plugin-sobject](https://github.com/salesforcecli/plugin-sobject)

### oclif plugins

- [plugin-autocomplete](https://github.com/oclif/plugin-autocomplete)
- [plugin-commands](https://github.com/oclif/plugin-commands)
- [plugin-help](https://github.com/oclif/plugin-help)
- [plugin-not-found](https://github.com/oclif/plugin-not)
- [plugin-not-found](https://github.com/oclif/plugin-not-found)
- [plugin-plugins](https://github.com/oclif/plugin-plugins)
- [plugin-update](https://github.com/oclif/plugin-update)
- [plugin-warn-if-update-available](https://github.com/oclif/plugin-plugin-warn-if-update-available)
- [plugin-warn-if-update-available](https://github.com/oclif/plugin-warn-if-update-available)
- [plugin-which](https://github.com/oclif/plugin-which)
- [plugin-version](https://github.com/oclif/plugin-version)

### dependencies

- [@oclif/core](https://github.com/oclif/core)
- [@salesforce/kit](https://github.com/forcedotcom/kit)
- [@salesforce/core](https://github.com/forcedotcom/sfdx-core/tree/v3)
- [@salesforce/ts-types](https://github.com/forcedotcom/ts-types)
- [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core)
- [@salesforce/source-deploy-retrieve](https://github.com/forcedotcom/source-deploy-retrieve)
- [@salesforce/source-tracking](https://github.com/forcedotcom/source-tracking)

### dev dependencies

- [@salesforce/cli-plugins-testkit](https://github.com/salesforcecli/cli-plugins-testkit)
- [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
- [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)
- [@salesforce/prettier-config](https://github.com/forcedotcom/prettier-config)
- [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon)
- [eslint-config-salesforce](https://github.com/forcedotcom/eslint-config-salesforce)
- [eslint-config-salesforce-license](https://github.com/forcedotcom/eslint-config-salesforce-license)
- [eslint-config-salesforce-typescript](https://github.com/forcedotcom/eslint-config-salesforce-typescript)

![sf typical plugin](images/sf-typical-plugin.jpg 'Salesforce CLI Typical Plugin')

## Command Execution
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/cli",
"description": "The Salesforce CLI",
"version": "1.57.0",
"version": "1.58.1",
"author": "Salesforce",
"bin": {
"sf": "./bin/run"
Expand Down Expand Up @@ -95,7 +95,7 @@
]
},
"dependencies": {
"@oclif/core": "^1.20.0",
"@oclif/core": "^1.21.0",
"@oclif/plugin-autocomplete": "^1.3.6",
"@oclif/plugin-commands": "^2.2.1",
"@oclif/plugin-help": "^5.1.19",
Expand All @@ -107,19 +107,19 @@
"@oclif/plugin-warn-if-update-available": "^2.0.15",
"@oclif/plugin-which": "^2.2.2",
"@salesforce/core": "3.32.8",
"@salesforce/sf-plugins-core": "^1.19.1",
"@salesforce/sf-plugins-core": "^1.19.3",
"@sf/deploy-retrieve": "npm:@salesforce/[email protected]",
"@sf/env": "npm:@salesforce/[email protected].13",
"@sf/env": "npm:@salesforce/[email protected].14",
"@sf/functions": "npm:@salesforce/[email protected]",
"@sf/gen": "npm:@salesforce/[email protected].32",
"@sf/info": "npm:@salesforce/[email protected].10",
"@sf/login": "npm:@salesforce/[email protected].11",
"@sf/gen": "npm:@salesforce/[email protected].33",
"@sf/info": "npm:@salesforce/[email protected].11",
"@sf/login": "npm:@salesforce/[email protected].12",
"@sf/settings": "npm:@salesforce/[email protected]",
"@sf/sobject": "npm:@salesforce/[email protected]",
"@sf/telemetry": "npm:@salesforce/[email protected]",
"@sf/trust": "npm:@salesforce/[email protected]",
"semver": "^7.3.8",
"tslib": "^2.4.0"
"tslib": "^2.4.1"
},
"pinnedDependencies": [
"@salesforce/core",
Expand All @@ -134,9 +134,9 @@
"@sf/trust"
],
"resolutions": {
"@oclif/core": "1.20.4",
"@oclif/core": "1.21.0",
"@salesforce/schemas": "1.4.0",
"@salesforce/sf-plugins-core": "1.19.1",
"@salesforce/sf-plugins-core": "1.19.3",
"@salesforce/templates": "55.1.0"
},
"repository": "salesforcecli/cli",
Expand Down Expand Up @@ -184,11 +184,11 @@
"@salesforce/plugin-release-management": "^3.6.0",
"@salesforce/prettier-config": "^0.0.2",
"@salesforce/ts-sinon": "^1.4.2",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"aws-sdk": "^2.1267.0",
"@typescript-eslint/eslint-plugin": "^5.45.1",
"@typescript-eslint/parser": "^5.45.1",
"aws-sdk": "^2.1269.0",
"chai": "^4.3.7",
"eslint": "^8.28.0",
"eslint": "^8.29.0",
"eslint-config-oclif": "^3.1",
"eslint-config-oclif-typescript": "^0.2.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -202,8 +202,8 @@
"husky": "^7.0.4",
"mocha": "^9.2.2",
"nyc": "^15.1.0",
"oclif": "^3.4.1",
"prettier": "^2.8.0",
"oclif": "^3.4.2",
"prettier": "^2.8.1",
"pretty-quick": "^3.1.3",
"sinon": "^11.1.2",
"ts-node": "^10.9.1",
Expand Down
Loading

0 comments on commit f37a6c5

Please sign in to comment.