npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mo-dx-plugin

v0.3.2

Published

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.

Downloads

76

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

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 [email protected] -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 staticresource folder (It zips it up) as well individual files in staticresource 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/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