From c6ae896e1ef870259c47a09b6fd84a2cb2d7653e Mon Sep 17 00:00:00 2001 From: Matt Carvin <90224411+mcarvin8@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:43:07 -0500 Subject: [PATCH] fix: include namespace in combined package --- README.md | 5 +++-- src/commands/sfpc/combine.ts | 4 +++- test/samples/combinedPackage.xml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 55f2863..df8cea0 100644 --- a/README.md +++ b/README.md @@ -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 `` tags with the metadata name will be converted to lower-case, ex: `customobject`. This ensures that multiple members of the same metadata name are grouped together in the combined package. The `` tags are case insensitive when read by the Salesforce CLI. However, the `` tags are case sensitive and must match the cases to match their API names in Salesforce. This tool will not convert the `` cases, just the ` tags. +When the packages are combined, the `` tags with the metadata name will be converted to lower-case, ex: `customobject`. This ensures that multiple members of the same metadata name are grouped together in the combined package. The `` tags are case insensitive when read by the Salesforce CLI. However, the `` tags are case sensitive and must match the cases to match their API names in Salesforce. This tool will not convert the `` cases, just the `` tags. The combined package.xml will use the maximum `` tag found in all packages. If none of the packages provided have ``, 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. @@ -31,12 +31,13 @@ USAGE FLAGS -f, --package-file= The path to an existing package.xml file. This flag can be specified multiple times. -c, --combined-package= 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 diff --git a/src/commands/sfpc/combine.ts b/src/commands/sfpc/combine.ts index d06dc8c..b88f2d8 100644 --- a/src/commands/sfpc/combine.ts +++ b/src/commands/sfpc/combine.ts @@ -87,7 +87,9 @@ export default class SfpcCombine extends SfCommand { } } - 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 for each type, properly formatting the XML mergedPackage.Package.types.forEach((type) => { diff --git a/test/samples/combinedPackage.xml b/test/samples/combinedPackage.xml index 1ee6a84..dd1fac1 100644 --- a/test/samples/combinedPackage.xml +++ b/test/samples/combinedPackage.xml @@ -1,5 +1,5 @@ - + Account Case