Skip to content

Commit

Permalink
fix: include namespace in combined package
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarvin8 committed Nov 10, 2024
1 parent 3cd72d4 commit c6ae896
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A Salesforce CLI plugin to combine multiple manifest files (package.xml) into 1 file that can be used for deployments.

**NOTE:** When the packages are combined, the `<name>` tags with the metadata name will be converted to lower-case, ex: `<name>customobject</name>`. This ensures that multiple members of the same metadata name are grouped together in the combined package. The `<name>` tags are case insensitive when read by the Salesforce CLI. However, the `<members>` tags are case sensitive and must match the cases to match their API names in Salesforce. This tool will not convert the `<members>` cases, just the `<name`> tags.
When the packages are combined, the `<name>` tags with the metadata name will be converted to lower-case, ex: `<name>customobject</name>`. This ensures that multiple members of the same metadata name are grouped together in the combined package. The `<name>` tags are case insensitive when read by the Salesforce CLI. However, the `<members>` tags are case sensitive and must match the cases to match their API names in Salesforce. This tool will not convert the `<members>` cases, just the `<name>` tags.

The combined package.xml will use the maximum `<version>` tag found in all packages. If none of the packages provided have `<version>`, it will omit this from the combined package.xml. When you deploy a package.xml without an API version, it will check the `sfdx-project.json` file for the `sourceApiVersion`. If both files do not have an API version, it will default to the max API version available in the target org.

Expand All @@ -31,12 +31,13 @@ USAGE
FLAGS
-f, --package-file=<value> The path to an existing package.xml file. This flag can be specified multiple times.
-c, --combined-package=<value> The path to save the combined package.xml to.
Default name is "combinedPackage.xml" in the running directory.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Combine multiple package files into 1 singular package file.
Combine multiple package files into 1 file.
EXAMPLES
Combine pack1.xml and pack2.xml into package.xml
Expand Down
4 changes: 3 additions & 1 deletion src/commands/sfpc/combine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ export default class SfpcCombine extends SfCommand<SfpcCombineResult> {
}
}

const root = create({ version: '1.0', encoding: 'UTF-8' }).ele('Package');
const root = create({ version: '1.0', encoding: 'UTF-8' }).ele('Package', {
xmlns: 'http://soap.sforce.com/2006/04/metadata',
});

// Create <types> for each type, properly formatting the XML
mergedPackage.Package.types.forEach((type) => {
Expand Down
2 changes: 1 addition & 1 deletion test/samples/combinedPackage.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Account</members>
<members>Case</members>
Expand Down

0 comments on commit c6ae896

Please sign in to comment.