package-xml
Build a Salesforce Package.xml file from a src directory
Last updated 5 months ago by mattlabbe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install package-xml 
SYNC missed versions from official npm registry.

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"
}

Current Tags

  • 2.4.19                                ...           latest (5 months ago)

44 Versions

  • 2.4.19                                ...           5 months ago
  • 2.4.18                                ...           a year ago
  • 2.4.17                                ...           a year ago
  • 2.4.15                                ...           2 years ago
  • 2.4.14                                ...           2 years ago
  • 2.4.13                                ...           2 years ago
  • 2.4.12                                ...           2 years ago
  • 2.4.11                                ...           2 years ago
  • 2.4.10                                ...           2 years ago
  • 2.4.9                                ...           2 years ago
  • 2.4.8                                ...           3 years ago
  • 2.4.7                                ...           3 years ago
  • 2.4.6                                ...           3 years ago
  • 2.4.5                                ...           3 years ago
  • 2.4.4                                ...           3 years ago
  • 2.4.3                                ...           3 years ago
  • 2.4.2                                ...           3 years ago
  • 2.4.1                                ...           3 years ago
  • 2.4.0                                ...           3 years ago
  • 2.3.2                                ...           3 years ago
  • 2.3.1                                ...           3 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.6                                ...           4 years ago
  • 2.1.5                                ...           4 years ago
  • 2.1.4                                ...           4 years ago
  • 2.1.3                                ...           4 years ago
  • 2.1.2                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |