Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msrivastav13/mo-dx-plugin
Salesforce CLI Plugin that helps to deploy code to salesforce orgs faster using tooling API
https://github.com/msrivastav13/mo-dx-plugin
salesforce-cli salesforce-cli-plugin salesforce-developers
Last synced: about 1 month ago
JSON representation
Salesforce CLI Plugin that helps to deploy code to salesforce orgs faster using tooling API
- Host: GitHub
- URL: https://github.com/msrivastav13/mo-dx-plugin
- Owner: msrivastav13
- License: mit
- Archived: true
- Created: 2018-11-06T18:41:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T10:01:21.000Z (almost 2 years ago)
- Last Synced: 2024-08-02T08:06:49.500Z (5 months ago)
- Topics: salesforce-cli, salesforce-cli-plugin, salesforce-developers
- Language: TypeScript
- Homepage: https://medium.com/@mohitkumarsrivastav
- Size: 968 KB
- Stars: 30
- Watchers: 5
- Forks: 5
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-sfdx-plugins - mo-dx-plugin
README
# mo-dx-plugin
A plugin for Salesforce DX CLI that provides ability to save Apex Classes, Apex Triggers, Visualforce Page, Visualforce Components ,AuraBundle(Lightning Components) and Static Resource to Salesforce org (Scratch/Non-Scratch orgs) using Tooling API.
Plugin also provides a retrieve command that can retrieve metadata in salesforceDx and traditional source format from salesforce unmanaged/managed package or changesets.
The commands in this plugin are used within the **_DX Code Companion extension_** (https://marketplace.visualstudio.com/items?itemName=MohithShrivastava.dx-code-companion).
If you are Visual Studio Code user then recommend installing the extension along with the plugin to avoid having to remember the commands.
## Setup
### **Install as plugin (Recommended approach for Installing)**
Install plugin using command : `sfdx plugins:install mo-dx-plugin`
### **Install from source(Preferred approach for debugging and enhancing the plugin)**
1. Install the SDFX CLI.2. Clone the repository: `git clone [email protected]:msrivastav13/mo-dx-plugin.git`
3. Install using yarn: `yarn install`
4. Link the plugin: `sfdx plugins:link` .
### **Commands**
* [`sfdx retrieve:dxsource`](#sfdx-retrievedxsource)
* [`sfdx retrieve:pkgsource`](#sfdx-retrievepkgsource)
* [`sfdx deploy:apex`](#sfdx-deployapex)
* [`sfdx deploy:trigger`](#sfdx-deploytrigger)
* [`sfdx deploy:vf`](#sfdx-deployvf)
* [`sfdx deploy:vfcomponent`](#sfdx-deployvfcomponent)
* [`sfdx deploy:aura`](#sfdx-deployaura)
* [`sfdx deploy:lwc`](#sfdx-deploylwc)
* [`sfdx deploy:staticresource`](#sfdx-deploystaticresource)
* [`sfdx metadata:rename`](#sfdx-metadatarename)## `sfdx retrieve:dxsource`
Retrieves soure code from Managed/Unmamaged package or Changesets.This command works for only Non-scratch orgs .If you are trying to convert a traditional project in Managed/Unmanaged package , this command can help convert the sourcecode to DX format.
```
USAGE
$ sfdx retrieve:dxsourceOPTIONS
-n, --packagename=packagename (required) the name of the package you want to retrieve.The package parameter value must be enclosed in double quotes.Example if you have a package named HR App the command would be sfdx retrieve:dxsource -n "HR App"-p, --pathname=pathname [default: force-app] where to convert the result to...defaults to
force-app-u, --targetusername=targetusername username or alias for the target org; overrides default target org
-m, --retainmetadata provide a random string to retain the mdapiout folder that has source code in mdapi format
--apiversion=apiversion override the api version used for api requests made by this command
--json format output as json
--loglevel=(trace|debug|info|warn|error|fatal) logging level for this command invocation
EXAMPLES
$ sfdx retrieve:dxsource -n // Default authorized org is used as username or org alias
$ sfdx retrieve:dxsource -u [email protected] -n -p <[pathName]>
```_See code: [src/commands/retrieve/dxsource.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/retrieve/dxsource.ts)_
## `sfdx retrieve:pkgsource`
Retrieves soure code from Managed/Unmamaged package or Changesets.This command works for only Non-scratch orgs.This retrieves metadata in traditional source format.
```
USAGE
$ sfdx retrieve:pkgsourceOPTIONS
-n, --packagename=packagename (required) the name of the package you want to retrieve.The package parameter value must be enclosed in double quotes.Example if you have a package named HR App the command would be sfdx retrieve:pkgsource -n "HR App"EXAMPLES
$ sfdx retrieve:pkgsource -n // Default authorized org is used as username or org alias
```_See code: [src/commands/retrieve/pkgsource.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/retrieve/pkgsource.ts)_
## `sfdx deploy:apex`
Deploys apex code to the Salesforce Org using Tooling API.
```
USAGE
$ sfdx deploy:apexOPTIONS
--p, --pathname=pathname (required) the file path of the apex class you want to save to salesforce. Note you can run pwd command on terminal to obtain the path easily.EXAMPLES
$ sfdx deploy:apex -p // Default authorized org is used for the deploy .The pathname parameter must be enclosed in double quotes. Example if your path is /Users/mohith/Desktop/ForceProjects/TestApp/force-app/main/default/classes/Constants.cls then the command to save this class will be sfdx deploy:apex -p "/Users/mohith/Desktop/ForceProjects/TestApp/force-app/main/default/classes/Constants.cls"
```_See code: [src/commands/deploy/apex.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/deploy/apex.ts)_
## `sfdx deploy:trigger`
Deploys apex trigger code to the Salesforce Org using Tooling API.
```
USAGE
$ sfdx deploy:triggerOPTIONS
--p, --pathname=pathname (required) the file path of the apex trigger you want to save to salesforce. Note you can run pwd command on terminal to obtain the path easilyEXAMPLES
$ sfdx deploy:trigger -p // Default authorized org is used for the deploy
```_See code: [src/commands/deploy/trigger.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/deploy/trigger.ts)_
## `sfdx deploy:vf`
Deploys visualforce page to the Salesforce Org using Tooling API.
```
USAGE
$ sfdx deploy:vfOPTIONS
--p, --pathname=pathname (required) the file path of the vf page you want to save to salesforce . Note you can run pwd command on terminal to obtain the path.EXAMPLES
$ sfdx deploy:vf -p // Default authorized org is used for the deploy
```_See code: [src/commands/deploy/vf.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/deploy/vf.ts)_
## `sfdx deploy:vfcomponent`
Deploys visualforce components to the Salesforce Org using Tooling API.
```
USAGE
$ sfdx deploy:vfcomponentOPTIONS
--p, --pathname=pathname (required) the file path of the vf component you want to saveEXAMPLES
$ sfdx deploy:vfcomponent -p // file path used to save the component to Salesforce.
```_See code: [src/commands/deploy/vfcomponent.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/deploy/vfcomponent.ts)_
## `sfdx deploy:aura`
Deploys aura lightning bundle to the Salesforce Org using Tooling API.
Supports deploying whole aura bundle as well individual files .To deploy the AuraBundle provide the directory path in path(p) parameter
```
USAGE
$ sfdx deploy:auraOPTIONS
--p, --pathname=pathname (required) the file path of the aura bundle you want to save to Salesforce.EXAMPLES
$ sfdx deploy:aura -p // Default authorized org is used for the deploy
```_See code: [src/commands/deploy/aura.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/deploy/aura.ts)_
## `sfdx deploy:lwc`
Deploys lighnting web component bundle to the Salesforce Org using Tooling API.
Supports deploying lwc bundle as well individual files in lwc bundle .To deploy the Lightning Bundle as a whole provide the directory path in path(p) parameter
```
USAGE
$ sfdx deploy:lwcOPTIONS
--p, --pathname=pathname (required) the file path of the lightning web components bundle you want to save to Salesforce.EXAMPLES
$ sfdx deploy:lwc -p // Default authorized org is used for the deploy
```_See code: [src/commands/deploy/lwc.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/deploy/lwc.ts)_
## `sfdx deploy:staticresource`
Deploys Static Resources to the Salesforce Org using Tooling API.
Supports deploying staticresource folder (It zips it up) as well individual files in staticresource folder.
```
USAGE
$ sfdx deploy:staticresourceOPTIONS
--p, --pathname=pathname (required) the file path of the lightning web components bundle you want to save to Salesforce.EXAMPLES
$ sfdx deploy:staticresource -p // Default authorized org is used for the deploy
$ sfdx deploy:staticresource -p --resourcefolder ' // Default authorized org is used for the deploy
$ sfdx deploy:staticresource -p --resourcefolder ' --cachecontrol public //makes the cache control of static resource public
```_See code: [src/commands/deploy/staticresource.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/deploy/staticresource.ts)_
## `sfdx metadata:rename`
Renames a single metadata using the salesforce Metadata API.
Salesforce allows to rename some types of metadata (CRUD based) using the Metadata API.This commands provides sfdx version
```
USAGE
$ sfdx metadata:renameOPTIONS
-t, --metadatatype=metadatatype (required) the type of the metadata (Ex CustomObject for customobject, CustomField for custom field)-o, --oldfullname=oldfullname (required) Full API name of the current component that will be overriden with the new name
-n, --newfullname=newfullname (required) Full API name that will override the existing component name
EXAMPLES
'$ sfdx metadata:rename -t -n -o ',
'$ sfdx metadata:rename -t CustomObject -n MyCustomObject1New__c -o MyCustomObject1__c' // here Custom Object MyCustomObject1__c is renamed to MyCustomObject1New__c
```_See code: [src/commands/metadata/rename.ts](https://github.com/msrivastav13/mo-dx-plugin/blob/master/src/commands/metadata/rename.ts)_
### Important Note When Using these Commands With Non-Scratch Org
**These commands do not maintain history and files are overriden on server .Make sure you have source control for the project setup so you can recover code if you accidently overwrite anything**