Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

package-xml

Package Overview
Dependencies
Maintainers
4
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

package-xml

Build a Salesforce Package.xml file from a src directory

  • 2.4.19
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
106
decreased by-27.89%
Maintainers
4
Weekly downloads
 
Created
Source

Package.xml generator in JavaScript

npm install package-xml -g

change directories to you project directory, which contains your src folder and run

package-xml

or, the long version...

package-xml -D "./src" -n "Package Name" -v "43.0" -m -c -i "InstallScriptHandler"

Options: (No options are required)

  • If no directory is provided, it will default to ./src
  • If there is no version, it will use version 37 (Summer 16)
  • If no name is provided, the package will not have a name
Options:
  -D, --dir           The path to the source directory containing your SFDC
                      files and metadata.  Your package.xml file will end up
                      here.               [string] [required] [default: "./src"]
  -v, --version       The Saleforce API Version you wish to target with this
                      package.                                          [string]
  -n, --name          The name of the package.                          [string]
  -i, --installScript The name the install handler class                [string]
  -m, --managed       Include Managed Package Fields. [boolean] [default: false]
  -c, --clean         Clean the Metadata files        [boolean] [default: false]
  -C, --clean-config  Clean the Metadata files from a provided configuration
                      file                                [string] [default: ""]
  -h                  Show help                                        [boolean]

Clean Metadata

The Clean Metadata option is available as of version 2.1 This option will clean out boilerplate metadata that can sometimes cause problems with deploying between different orgs. Also, if some metadata is not valid, visible, or enabled, then it shouldn't go in the package, hence we need to clean up the metadata.

Below is the standard configuration for cleaning files. When using the "clean" option, this is the configuration that will be used.

But we all know you will probably want a custom clean config. In that case, copy the config below and customize it. The selectors you see are simple xml path selectors. The xmlns namespace is required on element selectors, so if you create a custom configuration, be sure to include that on any element selectors. For tips on how to write selectors, you can go to w3c at http://www.w3schools.com/xml/xml_syntax.asp All options are optional, so you probably don't need to inlcude the namespace option unless you're doing something very unexpected

{
    "selectors": [
        "./xmlns:packageVersions",
        "./xmlns:applicationVisibilities[xmlns:visible = 'false']",
        "./xmlns:classAccesses[xmlns:enabled = 'false']",
        "./xmlns:fieldPermissions[xmlns:editable = 'false' and xmlns:readable = 'false']",
        "./xmlns:objectPermissions[xmlns:allowCreate = 'false' and xmlns:allowDelete = 'false' and xmlns:allowEdit = 'false' and xmlns:allowRead = 'false' and xmlns:modifyAllRecords = 'false' and xmlns:viewAllRecords = 'false']",
        "./xmlns:pageAccesses[xmlns:enabled = 'false']",
        "./xmlns:userPermissions[xmlns:enabled = 'false']",
        "./xmlns:recordTypeVisibilities[xmlns:visible = 'false']",
        "./xmlns:tabSettings[xmlns:visibility = 'None']"
    ],
    "extensions": [
        "-meta.xml",
        ".profile",
        ".permissionset"
    ],
    "namespace": "http://soap.sforce.com/2006/04/metadata"
}

Keywords

FAQs

Package last updated on 05 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc