sfdx-essentials
Tools to cover the lacks of missing required functions of SFDX
Last updated 3 months ago by nvuillam .
GPL-3.0-or-later · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sfdx-essentials 
SYNC missed versions from official npm registry.

Salesforce DX Essentials

Version Downloads/week License

PLUGIN

Sometimes ... Salesforce tools are delivered without the mandatory capabilities allowing the advanced developments of partners and clients to survive.

Sometimes ... Salesforce R&D team shows some understanding, but sometimes ... not at all, even when a new SFDC Platform version prevents to generate a managed package.

So after the third plugin I needed to create during a few weeks (not for fun, but to allow our managed package to survive!) , I decided to join them on a single plugin: SFDX Essentials , and to publish it as open source , by solidarity with fellow victims of savage platform upgrades :)

Command list

Command Description
essentials:filter-metadatas Filter metadatas generated from a SFDX Project in order to be able to deploy only part of them on an org
essentials:filter-xml-content Filter content of metadatas (XML) in order to be able to deploy only part of them on an org
essentials:change-dependency-version Replace other managed packages dependency version number ( very useful when you build a managed package over another managed package, like Financial Services Cloud )
essentials:fix-lightning-attributes-names Replace reserved lightning attribute names in lightning components and apex classes ( if you named a lightning attribute like a custom apex class, since Summer 18 you simply can not generate a managed package again)
essentials:uncomment Uncomment lines in sfdx/md files (useful to manage @Deprecated annotations with managed packages)
essentials:check-sfdx-project-consistency Check consistency between a SFDX project files and package.xml files

Please contribute :)

INSTALLATION

    sfdx plugins:install sfdx-essentials
  • Windows users: sfdx plugin generator is bugged on windows (hardcode call of linux rm instruction) , so you may use Git Bash to run this code ( at least while it installs the plugin dependencies )

UPGRADE

Its seems that sfdx plugins:update and sfdx update does not always work, in that case , uninstall then reinstall the plugin

    sfdx plugins:uninstall sfdx-essentials
    sfdx plugins:install sfdx-essentials

COMMANDS

essentials:filter-metadatas

Allows to filter metadatas folder generated by sfdx force:source:convert , using your own package.xml file

This can help if you need to deploy only part of the result of sfdx force:source:convert into a org, by filtering the result (usually in mdapi_output_dir) to keep only the items referenced in your own package.xml file

WARNING: This version does not support all the metadata types yet, please contribute if you are in a hurry :)

USAGE
  $ sfdx essentials:filter-metadatas OPTIONS

OPTIONS
  -i, --inputfolder=inputfolder    Input folder (default: "." )
  -o, --outputfolder=outputfolder  Output folder (default: filteredMetadatas)
  -p, --packagexml=packagexml      package.xml file path

DESCRIPTION
  
     Package.xml types currently managed:

     - ApexClass
     - ApexComponent
     - ApexPage
     - ApexTrigger
     - AuraDefinitionBundle
     - BusinessProcess
     - ContentAsset
     - CustomApplication
     - CustomField
     - CustomLabel
     - CustomMetadata
     - CustomObject
     - CustomObjectTranslation
     - CustomSite
     - CustomTab
     - Document
     - EmailTemplate
     - EscalationRules
     - FlexiPage
     - GlobalValueSet
     - GlobalValueSetTranslation
     - HomePageLayout
     - ListView
     - Layout
     - NamedCredential
     - Network
     - PermissionSet
     - Profile
     - QuickAction
     - RecordType
     - RemoteSiteSetting
     - Report
     - SiteDotCom
     - StandardValueSet
     - StandardValueSetTranslation
     - StaticResource
     - Translations
     - WebLink
     - Workflow

See conversion tables

EXAMPLES

  $ sfdx essentials:filter-metadatas -p myPackage.xml

  $ sfdx essentials:filter-metadatas -i md_api_output_dir -p myPackage.xml -o md_api_filtered_output_dir

  $ sfdx force:source:convert -d tmp/deployDemoQuali/
  $ sfdx essentials:filter-metadatas -i tmp/deployDemoQuali/ -p myPackage.xml -o tmp/deployDemoQualiFiltered/
  $ sfdx force:mdapi:deploy -d tmp/deployDemoQualiFiltered/ -w 60 -u DemoQuali

See code: src/commands/essentials/filter-metadatas.ts

essentials:filter-xml-content

When you perform deployments from one org to another, the features activated in the target org may not fit the content of the sfdx/metadata files extracted from the source org.

You may need to filter some elements in the XML files, for example in the Profiles

This script requires a filter-config.json file following this example

{
	"filters" : [
		{
			"name" : "ProfileFiltering",
			"description" :"Remove unwanted stuff in profiles",
			"folders": 		[
				"profiles"
			],
			"file_extensions":   [
				"profile"
			],
			"exclude_list" : [
				{ 
					"type_tag":"userPermissions",
					"identifier_tag" : "name",
					"values" : [
							"AllowUniversalSearch",
							"EnableNotifications"
					]
				},
				{
					"type_tag":"tabVisibilities",
					"identifier_tag" : "tab",
					"values" : [
							"TabExportScripts",
							"TabInstallScripts"
					]
				}
			]
		}
	]
}
USAGE
  $ sfdx essentials:filter-xml-content OPTIONS

OPTIONS
  -i, --inputfolder=inputfolder    Input folder (default: "." )
  -o, --outputfolder=outputfolder  Output folder (default: Input Folder + _xml_content_filtered)
  -p, --configFile=configFile      JSON file containing configuration. Default: filter-config.json

EXAMPLE
  $ sfdx essentials:filter-xml-content -i "retrieveUnpackaged" 

See code: src/commands/essentials/filter-xml-content.ts

essentials:change-dependency-version

Allows to change an external package dependency version

USAGE
  $ sfdx essentials:change-dependency-version OPTIONS

OPTIONS
  -f, --folder=folder              SFDX project folder containing files
  -j, --majorversion=majorversion  Major version
  -m, --minorversion=minorversion  Minor version
  -n, --namespace=namespace        Namespace of the managed package

EXAMPLE
  $ sfdx essentials:change-dependency-version -n FinServ -j 214 -m 7

See code: src/commands/essentials/change-dependency-version.ts

essentials:fix-lightning-attributes-names

If you named a lightning attribute like a custom apex class, since Summer 18 you simply can not generate a managed package again.

This command lists all custom apex classes and custom objects names , then replaces all their references in lightning components and also in apex classes with their camelCase version.

Ex : MyClass_x attribute would be renamed myClassX

USAGE
  $ sfdx essentials:fix-lightning-attributes-names OPTIONS

OPTIONS
  -f, --folder=folder              SFDX project folder containing files (usually 'force-app/main/default'). Default : '.'

EXAMPLE
  $ sfdx essentials:fix-lightning-attributes-names 

See code: src/commands/essentials/fix-lightning-attributes-names.ts

essentials:uncomment

Once you flagged a packaged method as @Deprecated , you can not deploy it in an org not used for generating a managed package

This commands allows to uncomment desired lines just before making a deployment

Before :

// @Deprecated SFDX_ESSENTIALS_UNCOMMENT
global static List<OrgDebugOption__c> setDebugOption() {
	return null;
}

After :

@Deprecated // Uncommented by sfdx essentials:uncomment (https://github.com/nvuillam/sfdx-essentials)
global static List<OrgDebugOption__c> setDebugOption() {
	return null;
}
USAGE
  $ sfdx essentials:uncomment OPTIONS

OPTIONS
  -f, --folder=folder              SFDX project folder containing files (usually 'force-app/main/default'). Default : '.'
  -k, --uncommentKey=someString              Uncomment key. Default : 'SFDX_ESSENTIALS_UNCOMMENT'


EXAMPLE
  $ sfdx essentials:uncomment --folder "./Projects/DevRootSource/tmp/deployPackagingDxcDevFiltered" --uncommentKey "SFDX_ESSENTIALS_UNCOMMENT_DxcDev_"

See code: src/commands/essentials/uncomment.ts

essentials:check-sfdx-project-consistency

Allows to compare the content of a SFDX and the content of one or several package.xml files ( append, if several )

USAGE
  $ sfdx essentials:check-sfdx-project-consistency OPTIONS

OPTIONS
  -p, --folder=folder              List of package.xml files path
  -i, --inputfolder=someString              SFDX Project folder . Default : '.'

EXAMPLE
  $  sfdx essentials:check-sfdx-project-consistency -p "./Config/packageXml/package_DevRoot_Managed.xml,./Config/packageXml/package_DevRoot_xDemo.xml" -i "./Projects/DevRootSource/force-app/main/default"

See code: src/commands/essentials/check-sfdx-project-consistency.ts

Current Tags

  • 0.4.5                                ...           latest (3 months ago)

28 Versions

  • 0.4.5                                ...           3 months ago
  • 0.4.4                                ...           3 months ago
  • 0.4.3                                ...           3 months ago
  • 0.4.2                                ...           3 months ago
  • 0.4.11                                ...           4 months ago
  • 0.4.1                                ...           4 months ago
  • 0.4.0                                ...           4 months ago
  • 0.3.1                                ...           4 months ago
  • 0.3.0                                ...           5 months ago
  • 0.2.81                                ...           5 months ago
  • 0.2.8                                ...           5 months ago
  • 0.2.6                                ...           8 months ago
  • 0.2.5                                ...           8 months ago
  • 0.2.4                                ...           8 months ago
  • 0.2.3                                ...           10 months ago
  • 0.2.2                                ...           10 months ago
  • 0.2.1                                ...           10 months ago
  • 0.2.0                                ...           10 months ago
  • 0.1.6                                ...           10 months ago
  • 0.1.5                                ...           10 months ago
  • 0.1.4                                ...           10 months ago
  • 0.1.1                                ...           10 months ago
  • 0.1.0                                ...           10 months ago
  • 0.0.5                                ...           10 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
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 30
Last Day 1
Last Week 29
Last Month 28
Dependencies (13)
Dev Dependencies (15)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |