sf-decomposer 5.7.1 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@
5
5
 
6
6
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
7
7
 
8
+ ## [5.8.0](https://github.com/mcarvin8/sf-decomposer/compare/v5.7.2...v5.8.0) (2025-04-18)
9
+
10
+
11
+ ### Features
12
+
13
+ * add new decompose strategy ([a2b27d9](https://github.com/mcarvin8/sf-decomposer/commit/a2b27d9dc8a76a763946bda9402a7a0cc9f71173))
14
+
15
+ ## [5.7.2](https://github.com/mcarvin8/sf-decomposer/compare/v5.7.1...v5.7.2) (2025-04-12)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * remove extension on bot version suffix renaming ([248f576](https://github.com/mcarvin8/sf-decomposer/commit/248f576a08fc3f0ff0b8fcb6bd0798f01c438129))
21
+
8
22
  ## [5.7.1](https://github.com/mcarvin8/sf-decomposer/compare/v5.7.0...v5.7.1) (2025-04-12)
9
23
 
10
24
 
package/README.md CHANGED
@@ -36,25 +36,27 @@ Break down large Salesforce metadata files (XML) into smaller, more manageable f
36
36
  sf plugins install sf-decomposer@x.y.z
37
37
  ```
38
38
 
39
- 2. [Decompose](#sf-decomposer-decompose) the metadata type(s) in your Salesforce DX project
39
+ 2. Retrieve metadata into your Salesforce DX project
40
+
41
+ 3. [Decompose](#sf-decomposer-decompose) the metadata type(s)
40
42
 
41
43
  ```bash
42
- sf decomposer decompose -m "flow" -m "labels"
44
+ sf decomposer decompose -m "flow" -m "labels" --postpurge
43
45
  ```
44
46
 
45
- 3. Add decomposed files to [`.forceignore`](#.forceignore)
47
+ 4. Add decomposed files to [`.forceignore`](#.forceignore)
46
48
 
47
49
  > This is **REQUIRED** to avoid errors when running `sf`commands
48
50
 
49
- 4. Stage decomposed files in version control
51
+ 5. Stage decomposed files in version control
50
52
 
51
- 5. [Recompose](#sf-decomposer-recompose) the metadata type(s) before deployment
53
+ 6. [Recompose](#sf-decomposer-recompose) the metadata type(s) before deployment
52
54
 
53
55
  ```bash
54
56
  sf decomposer recompose -m "flow" -m "labels"
55
57
  ```
56
58
 
57
- 6. Deploy recomposed metadata
59
+ 7. Deploy recomposed metadata
58
60
 
59
61
  ## Why Choose `sf-decomposer`?
60
62
 
@@ -65,7 +67,11 @@ Salesforce's built-in decomposition has limitations. `sf-decomposer` offers more
65
67
  - **Supports More Metadata** – Works with most Metadata API types, unlike Salesforce’s limited decomposition.
66
68
  - **Selective Decomposition** – Decompose only what you need, avoiding Salesforce’s all-or-nothing approach.
67
69
  - See [.sfdecomposerignore](#.sfdecomposerignore)
68
- - **Fully Decomposes Metadata** – Ensures complete decomposition for types that Salesforce only partially decomposes (e.g., `decomposePermissionSetBeta2`).
70
+ - **Multiple Decomposition Strategies** – Choose between:
71
+ - `unique-id` (default): disassembles each nested element into its own uniquely named file based on XML content or hash.
72
+ - `grouped-by-tag`: groups all nested elements by tag into a single file per tag (e.g., all `<fieldPermissions>` in a permission set into `fieldPermissions.xml`).
73
+ - Both strategies decompose leaf elements into the same file named after the original XML.
74
+ - **Fully Decomposes Metadata** – Allow complete decomposition for types that Salesforce only partially decomposes (e.g., `decomposePermissionSetBeta2`).
69
75
  - **Consistent Sorting** – Keeps elements in a predictable order to reduce unnecessary version control noise.
70
76
  > DISCLAIMER: If you use "toml" or "ini" format for decomposed files, the element sorting will vary compared to the other formats
71
77
  - **Multiple Output Formats** – Supports XML, JSON, JSON5, TOML, INI, and YAML for greater flexibility.
@@ -90,7 +96,7 @@ Decomposes the original metadata files in all local package directories into sma
90
96
 
91
97
  ```
92
98
  USAGE
93
- $ sf decomposer decompose -m <value> -f <value> -i <value> [--prepurge --postpurge --debug --json]
99
+ $ sf decomposer decompose -m <value> -f <value> -i <value> -s <value> [--prepurge --postpurge --debug --json]
94
100
 
95
101
  FLAGS
96
102
  -m, --metadata-type=<value> The metadata suffix to process, such as 'flow', 'labels', etc.
@@ -101,6 +107,9 @@ FLAGS
101
107
  -i, --ignore-package-directory=<value> Package directory to ignore.
102
108
  Should be as they appear in the "sfdx-project.json".
103
109
  Can be declared multiple times.
110
+ -s, --strategy=<value> The decompose strategy to use.
111
+ Options: ['unique-id', 'grouped-by-tag']
112
+ [default: 'unique-id']
104
113
  --prepurge Purgd directories of pre-existing decomposed files.
105
114
  [default: false]
106
115
  --postpurge Purge the original files after decomposing them.
@@ -161,14 +170,15 @@ EXAMPLES
161
170
 
162
171
  ## Decompose Structure
163
172
 
164
- When the original metadata files are decomposed, this structure is followed for all metadata types except for custom labels:
173
+ > Ensure you do not MIX strategies on the same metadata type. If you have previously decomposed metadata with a past verson of `sf-decomposer`, which uses the unique-id strategy, and would like to switch over to the grouped-by-tag strategy, you will need to supply the decompose command with the `--prepurge` flag and `-s "grouped-by-tag"` flag to re-create decomposed files with the new strategy.
174
+
175
+ You can decompose all metadata, except for custom labels, via 1 of 2 strategies:
165
176
 
166
- - Leaf elements (i.e. `<userLicense>Salesforce</userLicense>`) will be decomposed in the same file in the root of the decomposed directory. The leaf file-name will match the original file-name.
167
- - Nested elements will be decomposed into their own files under sub-directories by the element type, i.e. custom permissions in a permission set will have their own decomposed file under a custom permissions sub-folder.
168
- - If unique ID elements are found, the decomposed nested files will be named using them. Otherwise, the decomposed nested files will be named with the SHA-256 hash of the element contents.
169
- - See [Contributing](#contributing) for more information on unique ID elements.
177
+ - **unique-id** (default): Each nested element is written to its own file. File names are derived from specified unique ID elements or hashed content.
178
+ - **grouped-by-tag**: All nested elements with the same tag are grouped into a single file, named after the tag (e.g., `fieldPermissions.xml`).
179
+ - Leaf elements (like `<userLicense>Salesforce</userLicense>`) are always grouped in a file named after the original source XML in both strategies.
170
180
 
171
- **Decomposed Permission Set Example**
181
+ **Decomposed Permission Set Example - Unique ID Strategy**
172
182
 
173
183
  | Format | Example |
174
184
  | --------- | --------------------------------------------------------------------------------------------------------------- |
@@ -179,7 +189,20 @@ When the original metadata files are decomposed, this structure is followed for
179
189
  | **TOML** | ![TOML](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-toml.png)<br> |
180
190
  | **INI** | ![INI](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-ini.png)<br> |
181
191
 
182
- When custom labels are decomposed, each custom label will have its own file in the original labels directory.
192
+ **Decomposed Permission Set Example - Grouped by Tag Strategy**
193
+
194
+ | Format | Example |
195
+ | --------- | -------------------------------------------------------------------------------------------------------------------- |
196
+ | **XML** | ![XML](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-tags-xml.png)<br> |
197
+ | **YAML** | ![YAML](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-tags-yaml.png)<br> |
198
+ | **JSON** | ![JSON](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-tags-json.png)<br> |
199
+ | **JSON5** | ![JSON5](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-tags-json5.png)<br> |
200
+ | **TOML** | ![TOML](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-tags-toml.png)<br> |
201
+ | **INI** | ![INI](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-tags-ini.png)<br> |
202
+
203
+ Custom labels can only be decomposed via the `unique-id` strategy. If you attempt to decompose custom labels with the `grouped-by-tag` strategy, it will warn and skip decomposing custom labels.
204
+
205
+ Custom labels decomposed under the `unique-id` strategy will look like such, each label will have its own file:
183
206
 
184
207
  ![Decomposed Custom Labels](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-labels.png)<br>
185
208
 
@@ -233,6 +256,12 @@ To add debugging to the log, provide the `--debug` flag to the decompose or reco
233
256
  [2024-03-30T14:28:37.959] [DEBUG] default - Created disassembled file: mock\no-nested-elements\HR_Admin\HR_Admin.permissionset-meta.xml
234
257
  ```
235
258
 
259
+ Custom labels can only be decomposed via the `unique-id` strategy. If the other one is provided, it will print this warning and skip to the next metadata entry.
260
+
261
+ ```
262
+ Warning: You cannot decompose custom labels using the grouped-by-tag strategy. Please switch strategies and try again for labels.
263
+ ```
264
+
236
265
  ## Hooks
237
266
 
238
267
  > **NOTE:** In order to avoid errors when running `sf` commands, you must configure your `.forceignore` file to have the Salesforce CLI ignore the decomposed files. See [Ignore Files](#ignore-files).
@@ -11,6 +11,7 @@ export default class DecomposerDecompose extends SfCommand<DecomposerResult> {
11
11
  debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
12
  format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
13
  'ignore-package-directory': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ strategy: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
15
  };
15
16
  run(): Promise<DecomposerResult>;
16
17
  }
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable no-await-in-loop */
3
3
  import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
4
4
  import { Messages } from '@salesforce/core';
5
- import { LOG_FILE, DECOMPOSED_FILE_TYPES } from '../../helpers/constants.js';
5
+ import { LOG_FILE, DECOMPOSED_FILE_TYPES, DECOMPOSED_STRATEGIES } from '../../helpers/constants.js';
6
6
  import { decomposeFileHandler } from '../../service/decomposeFileHandler.js';
7
7
  import { getRegistryValuesBySuffix } from '../../metadata/getRegistryValuesBySuffix.js';
8
8
  import { readOriginalLogFile, checkLogForErrors } from '../../service/checkLogforErrors.js';
@@ -48,6 +48,14 @@ export default class DecomposerDecompose extends SfCommand {
48
48
  required: false,
49
49
  multiple: true,
50
50
  }),
51
+ strategy: Flags.string({
52
+ summary: messages.getMessage('flags.strategy.summary'),
53
+ char: 's',
54
+ required: true,
55
+ multiple: false,
56
+ default: 'unique-id',
57
+ options: DECOMPOSED_STRATEGIES,
58
+ }),
51
59
  };
52
60
  async run() {
53
61
  const { flags } = await this.parse(DecomposerDecompose);
@@ -57,10 +65,15 @@ export default class DecomposerDecompose extends SfCommand {
57
65
  const debug = flags['debug'];
58
66
  const format = flags['format'];
59
67
  const ignoreDirs = flags['ignore-package-directory'];
68
+ const strategy = flags['strategy'];
60
69
  for (const metadataType of metadataTypes) {
61
70
  const { metaAttributes, ignorePath } = await getRegistryValuesBySuffix(metadataType, 'decompose', ignoreDirs);
71
+ if (metadataType === 'labels' && strategy === 'grouped-by-tag') {
72
+ this.warn('You cannot decompose custom labels using the grouped-by-tag strategy. Please switch strategies and try again for labels.');
73
+ continue;
74
+ }
62
75
  const currentLogFile = await readOriginalLogFile(LOG_FILE);
63
- await decomposeFileHandler(metaAttributes, prepurge, postpurge, debug, format, ignorePath);
76
+ await decomposeFileHandler(metaAttributes, prepurge, postpurge, debug, format, ignorePath, strategy);
64
77
  const decomposeErrors = await checkLogForErrors(LOG_FILE, currentLogFile);
65
78
  if (decomposeErrors.length > 0) {
66
79
  decomposeErrors.forEach((error) => {
@@ -1 +1 @@
1
- {"version":3,"file":"decompose.js","sourceRoot":"","sources":["../../../src/commands/decomposer/decompose.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,qCAAqC;AAErC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAG5F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CA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AAC,KAAK,CAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;YACL,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,kEAAkE,YAAY,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,aAAa;SACxB,CAAC;IACJ,CAAC"}
@@ -3,6 +3,7 @@ export declare const CUSTOM_LABELS_FILE = "CustomLabels.labels-meta.xml";
3
3
  export declare const DEFAULT_UNIQUE_ID_ELEMENTS: string;
4
4
  export declare const LOG_FILE = "disassemble.log";
5
5
  export declare const DECOMPOSED_FILE_TYPES: string[];
6
+ export declare const DECOMPOSED_STRATEGIES: string[];
6
7
  export declare const IGNORE_FILE = ".sfdecomposerignore";
7
8
  export declare const WORKFLOW_SUFFIX_MAPPING: {
8
9
  [key: string]: string;
@@ -4,6 +4,7 @@ export const CUSTOM_LABELS_FILE = 'CustomLabels.labels-meta.xml';
4
4
  export const DEFAULT_UNIQUE_ID_ELEMENTS = 'fullName,name';
5
5
  export const LOG_FILE = 'disassemble.log';
6
6
  export const DECOMPOSED_FILE_TYPES = ['xml', 'json', 'yaml', 'json5', 'toml', 'ini'];
7
+ export const DECOMPOSED_STRATEGIES = ['unique-id', 'grouped-by-tag'];
7
8
  export const IGNORE_FILE = '.sfdecomposerignore';
8
9
  export const WORKFLOW_SUFFIX_MAPPING = {
9
10
  'alerts-meta': 'workflowAlert-meta',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,8BAA8B,CAAC;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAW,eAAe,CAAC;AAClE,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAa,CAAC,KAAK,EA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mBAAmB;IACjC,WAAW,EAAE,mBAAmB;CACjC,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC"}
@@ -4,4 +4,4 @@ export declare function decomposeFileHandler(metaAttributes: {
4
4
  strictDirectoryName: boolean;
5
5
  folderType: string;
6
6
  uniqueIdElements: string;
7
- }, prepurge: boolean, postpurge: boolean, debug: boolean, format: string, ignorePath: string): Promise<void>;
7
+ }, prepurge: boolean, postpurge: boolean, debug: boolean, format: string, ignorePath: string, strategy: string): Promise<void>;
@@ -5,13 +5,13 @@ import { readdir, stat, rm, rename } from 'node:fs/promises';
5
5
  import { DisassembleXMLFileHandler, setLogLevel } from 'xml-disassembler';
6
6
  import { CUSTOM_LABELS_FILE, WORKFLOW_SUFFIX_MAPPING } from '../helpers/constants.js';
7
7
  import { moveFiles } from './moveFiles.js';
8
- export async function decomposeFileHandler(metaAttributes, prepurge, postpurge, debug, format, ignorePath) {
8
+ export async function decomposeFileHandler(metaAttributes, prepurge, postpurge, debug, format, ignorePath, strategy) {
9
9
  const { metadataPaths, metaSuffix, strictDirectoryName, folderType, uniqueIdElements } = metaAttributes;
10
10
  if (debug)
11
11
  setLogLevel('debug');
12
12
  for (const metadataPath of metadataPaths) {
13
13
  if (strictDirectoryName || folderType) {
14
- await subDirectoryHandler(metadataPath, uniqueIdElements, prepurge, postpurge, format, ignorePath);
14
+ await subDirectoryHandler(metadataPath, uniqueIdElements, prepurge, postpurge, format, ignorePath, strategy);
15
15
  }
16
16
  else if (metaSuffix === 'labels') {
17
17
  // do not use the prePurge flag in the xml-disassembler package for labels due to file moving
@@ -19,19 +19,19 @@ export async function decomposeFileHandler(metaAttributes, prepurge, postpurge,
19
19
  await prePurgeLabels(metadataPath);
20
20
  const absoluteLabelFilePath = resolve(metadataPath, CUSTOM_LABELS_FILE);
21
21
  const relativeLabelFilePath = relative(process.cwd(), absoluteLabelFilePath);
22
- await disassembleHandler(relativeLabelFilePath, uniqueIdElements, false, postpurge, format, ignorePath);
22
+ await disassembleHandler(relativeLabelFilePath, uniqueIdElements, false, postpurge, format, ignorePath, strategy);
23
23
  // move labels from the directory they are created in
24
24
  await moveAndRenameLabels(metadataPath);
25
25
  }
26
26
  else {
27
- await disassembleHandler(metadataPath, uniqueIdElements, prepurge, postpurge, format, ignorePath);
27
+ await disassembleHandler(metadataPath, uniqueIdElements, prepurge, postpurge, format, ignorePath, strategy);
28
28
  }
29
29
  if (metaSuffix === 'workflow') {
30
30
  await renameWorkflows(metadataPath);
31
31
  }
32
32
  }
33
33
  }
34
- async function disassembleHandler(filePath, uniqueIdElements, prePurge, postPurge, format, ignorePath) {
34
+ async function disassembleHandler(filePath, uniqueIdElements, prePurge, postPurge, format, ignorePath, strategy) {
35
35
  const handler = new DisassembleXMLFileHandler();
36
36
  await handler.disassemble({
37
37
  filePath,
@@ -40,6 +40,7 @@ async function disassembleHandler(filePath, uniqueIdElements, prePurge, postPurg
40
40
  postPurge,
41
41
  ignorePath,
42
42
  format,
43
+ strategy,
43
44
  });
44
45
  }
45
46
  async function prePurgeLabels(metadataPath) {
@@ -66,12 +67,12 @@ async function moveAndRenameLabels(metadataPath) {
66
67
  await moveFiles(sourceDirectory, destinationDirectory, () => true);
67
68
  await rm(join(metadataPath, 'CustomLabels'), { recursive: true });
68
69
  }
69
- async function subDirectoryHandler(metadataPath, uniqueIdElements, prepurge, postpurge, format, ignorePath) {
70
+ async function subDirectoryHandler(metadataPath, uniqueIdElements, prepurge, postpurge, format, ignorePath, strategy) {
70
71
  const subFiles = await readdir(metadataPath);
71
72
  for (const subFile of subFiles) {
72
73
  const subFilePath = join(metadataPath, subFile);
73
74
  if ((await stat(subFilePath)).isDirectory()) {
74
- await disassembleHandler(subFilePath, uniqueIdElements, prepurge, postpurge, format, ignorePath);
75
+ await disassembleHandler(subFilePath, uniqueIdElements, prepurge, postpurge, format, ignorePath, strategy);
75
76
  }
76
77
  }
77
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"decomposeFileHandler.js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BAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;gBACrE,MAAM,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;gBACvC,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -11,7 +11,7 @@ export async function renameBotVersionFile(metadataPath) {
11
11
  const files = await readdir(subDirectoryPath);
12
12
  for (const file of files) {
13
13
  // Check if the bot meta file name contains "v" followed by a number
14
- if (/v\d+\.bot-meta\.xml$/.test(file)) {
14
+ if (/v\d+\.bot-meta(\..+)?$/.test(file)) {
15
15
  const sourcePath = join(subDirectoryPath, file);
16
16
  const destinationPath = join(subDirectoryPath, file.replace('bot-meta', 'botVersion-meta'));
17
17
  await rename(sourcePath, destinationPath);
@@ -1 +1 @@
1
- {"version":3,"file":"renameBotVersionFiles.js","sourceRoot":"","sources":["../../src/service/renameBotVersionFiles.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,qCAAqC;AACrC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,YAAoB;IAC7D,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IACnD,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE,CAAC;QAC1C,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAE1D,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;YAC9C,KAAK,MAAM,IAAI,IAAI,K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,CAAC,CAAC;oBAChD,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;oBAC5F,MAAM,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -37,3 +37,7 @@ File format for the decomposed files.
37
37
  # flags.ignore-package-directory.summary
38
38
 
39
39
  Ignore a package directory.
40
+
41
+ # flags.strategy.summary
42
+
43
+ Strategy to follow when decomposing files.
package/oclif.lock CHANGED
@@ -8273,10 +8273,10 @@ write-file-atomic@^3.0.0:
8273
8273
  signal-exit "^3.0.2"
8274
8274
  typedarray-to-buffer "^3.1.5"
8275
8275
 
8276
- xml-disassembler@^1.7.0:
8277
- version "1.7.0"
8278
- resolved "https://registry.yarnpkg.com/xml-disassembler/-/xml-disassembler-1.7.0.tgz#92d6d6c1b6bdcde08170f487a073f446bf43e2d7"
8279
- integrity sha512-Qh5m4qtILPV+K5XSlJHLc53AASXAZWc9Fi97ayTwjr17o82aoF5OxwvOmP+Hf8tmO/TPx3A2K2RnoJqK6wqjew==
8276
+ xml-disassembler@^1.8.0:
8277
+ version "1.8.0"
8278
+ resolved "https://registry.yarnpkg.com/xml-disassembler/-/xml-disassembler-1.8.0.tgz#285031033213a64eb97b6990289a23945598911d"
8279
+ integrity sha512-17TV3RIWrvPN5MLon/RtBqsHXgKpGJvgWSagnZbTNM6ZIf2Z2/nHaoZA8g9oH1zLN3kscx8tGuoqn33bA8CYiQ==
8280
8280
  dependencies:
8281
8281
  fast-xml-parser "^5.2.0"
8282
8282
  ignore "^7.0.3"
@@ -81,6 +81,20 @@
81
81
  "hasDynamicHelp": false,
82
82
  "multiple": true,
83
83
  "type": "option"
84
+ },
85
+ "strategy": {
86
+ "char": "s",
87
+ "name": "strategy",
88
+ "required": true,
89
+ "summary": "Strategy to follow when decomposing files.",
90
+ "default": "unique-id",
91
+ "hasDynamicHelp": false,
92
+ "multiple": false,
93
+ "options": [
94
+ "unique-id",
95
+ "grouped-by-tag"
96
+ ],
97
+ "type": "option"
84
98
  }
85
99
  },
86
100
  "hasDynamicHelp": false,
@@ -185,5 +199,5 @@
185
199
  ]
186
200
  }
187
201
  },
188
- "version": "5.7.1"
202
+ "version": "5.8.0"
189
203
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "sf-decomposer",
3
3
  "description": "Break down large Salesforce metadata files into smaller, more manageable files for version control and then recreate deployment-compatible files.",
4
- "version": "5.7.1",
4
+ "version": "5.8.0",
5
5
  "dependencies": {
6
6
  "@oclif/core": "^4",
7
7
  "@salesforce/core": "^8.9.0",
8
8
  "@salesforce/sf-plugins-core": "^11.2.1",
9
9
  "@salesforce/source-deploy-retrieve": "^12.19.0",
10
10
  "fs-extra": "^11.3.0",
11
- "xml-disassembler": "^1.7.0"
11
+ "xml-disassembler": "^1.8.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@commitlint/cli": "^19.8.0",