mo-dx-plugin
A plugin for Salesforce DX CLI that provides ability to save Apex Classes, Apex Triggers, Visualforce Page, Visualforce Components and AuraBundle(Lightning Components) to Salesforce org (Scratch/Non-Scratch orgs) using Tooling API.
Last updated 10 days ago by msrivastav13 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mo-dx-plugin 
SYNC missed versions from official npm registry.

mo-dx-plugin

A plugin for Salesforce DX CLI that provides ability to save Apex Classes, Apex Triggers, Visualforce Page, Visualforce Components and AuraBundle(Lightning Components) to Salesforce org (Scratch/Non-Scratch orgs) using Tooling API.

Plugin also provides a retrieve command that can retrieve metadata in salesforceDx source format from salesforce using 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 git@github.com:msrivastav13/mo-dx-plugin.git

  3. Install npm modules: npm install

  4. Link the plugin: sfdx plugins:link .

Commands

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:dxsource

OPTIONS
  -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 <package/changeset> // Default authorized org is used as username or org alias
  $ sfdx retrieve:dxsource -u myOrg@example.com -n <package/changeset> -p <[pathName]>

See code: 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:pkgsource

OPTIONS
  -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 <package/changeset> // Default authorized org is used as username or org alias

See code: src/commands/retrieve/pkgsource.ts

sfdx deploy:apex

Deploys apex code to the Salesforce Org using Tooling API.

USAGE
  $ sfdx deploy:apex

OPTIONS
  --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 <pathname> // 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

sfdx deploy:trigger

Deploys apex trigger code to the Salesforce Org using Tooling API.

USAGE
  $ sfdx deploy:trigger

OPTIONS
  --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 easily

EXAMPLES
  $ sfdx deploy:trigger -p <pathname> // Default authorized org is used for the deploy

See code: src/commands/deploy/trigger.ts

sfdx deploy:vf

Deploys visualforce page to the Salesforce Org using Tooling API.

USAGE
  $ sfdx deploy:vf

OPTIONS
  --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 <pathname> // Default authorized org is used for the deploy

See code: src/commands/deploy/vf.ts

sfdx deploy:vfcomponent

Deploys visualforce components to the Salesforce Org using Tooling API.

USAGE
  $ sfdx deploy:vfcomponent

OPTIONS
  --p, --pathname=pathname                   (required) the file path of the vf component you want to save

EXAMPLES
  $ sfdx deploy:vfcomponent -p <pathname> // file path used to save the component to Salesforce.

See code: 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:aura

OPTIONS
  --p, --pathname=pathname                   (required) the file path of the aura bundle you want to save to Salesforce.

EXAMPLES
  $ sfdx deploy:aura -p <pathname> // Default authorized org is used for the deploy

See code: 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:lwc

OPTIONS
  --p, --pathname=pathname                   (required) the file path of the lightning web components bundle you want to save to Salesforce.

EXAMPLES
  $ sfdx deploy:lwc -p <pathname> // Default authorized org is used for the deploy

See code: src/commands/deploy/lwc.ts

sfdx deploy:staticresource

Deploys Static Resources to the Salesforce Org using Tooling API.

Supports deploying sttaic resource folder (It zips it up) as well individual files in static resource folder.

USAGE
  $ sfdx deploy:staticresource

OPTIONS
  --p, --pathname=pathname                   (required) the file path of the lightning web components bundle you want to save to Salesforce.

EXAMPLES
  $ sfdx deploy:staticresource -p <pathname> // Default authorized org is used for the deploy
  $ sfdx deploy:staticresource -p <pathname> --resourcefolder <name of the folder where you have app>' // Default authorized org is used for the deploy
  $ sfdx deploy:staticresource -p <pathname> --resourcefolder <name of the folder where you have app>' --cachecontrol public //makes the cache control of static resource public

See code: 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:rename

OPTIONS
  -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 <metadatatype> -n <newname> -o <oldname>',
    '$ 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/deploy/staticresource.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 do not loose anything

Current Tags

  • 0.2.5                                ...           latest (10 days ago)

28 Versions

  • 0.2.5                                ...           10 days ago
  • 0.2.4                                ...           24 days ago
  • 0.2.3                                ...           a month ago
  • 0.2.12                                ...           2 months ago
  • 0.2.1                                ...           2 months ago
  • 0.2.0                                ...           4 months ago
  • 0.1.11                                ...           4 months ago
  • 0.1.10                                ...           7 months ago
  • 0.1.9                                ...           7 months ago
  • 0.1.8                                ...           7 months ago
  • 0.1.7                                ...           7 months ago
  • 0.1.6                                ...           8 months ago
  • 0.1.5                                ...           8 months ago
  • 0.1.4                                ...           9 months ago
  • 0.1.3                                ...           9 months ago
  • 0.1.2                                ...           9 months ago
  • 0.1.1                                ...           9 months ago
  • 0.1.0                                ...           9 months ago
  • 0.0.9                                ...           9 months ago
  • 0.0.8                                ...           9 months ago
  • 0.0.7                                ...           9 months ago
  • 0.0.6                                ...           9 months ago
  • 0.0.5                                ...           9 months ago
  • 0.0.4                                ...           10 months ago
  • 0.0.3                                ...           10 months ago
  • 0.0.2                                ...           10 months ago
  • 0.0.1                                ...           10 months ago
  • 0.0.0                                ...           10 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 47
Last Day 0
Last Week 47
Last Month 59
Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |