sf-decomposer 5.5.0 → 5.7.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,26 @@
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.7.0](https://github.com/mcarvin8/sf-decomposer/compare/v5.6.0...v5.7.0) (2025-04-12)
9
+
10
+
11
+ ### Features
12
+
13
+ * add ini as a decomposed file format ([572a8a2](https://github.com/mcarvin8/sf-decomposer/commit/572a8a2bfa1b4ef81180fa8ef2034d6229f1dad2))
14
+
15
+ ## [5.6.0](https://github.com/mcarvin8/sf-decomposer/compare/v5.5.0...v5.6.0) (2025-04-12)
16
+
17
+
18
+ ### Features
19
+
20
+ * add toml support ([37f61fb](https://github.com/mcarvin8/sf-decomposer/commit/37f61fbbf67e2a92625d90ca2642696cd1a35662))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **deps:** bump @salesforce/core from 8.8.7 to 8.9.0 ([c5b654d](https://github.com/mcarvin8/sf-decomposer/commit/c5b654d44dfc302d698654b7279a9f17a355afc5))
26
+ * **deps:** bump xml-disassembler from 1.5.0 to 1.5.1 ([bd8a4cf](https://github.com/mcarvin8/sf-decomposer/commit/bd8a4cf2a91b75ca55353ef6e5349535d5914102))
27
+
8
28
  ## [5.5.0](https://github.com/mcarvin8/sf-decomposer/compare/v5.4.6...v5.5.0) (2025-04-11)
9
29
 
10
30
 
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  - [`sf decomposer recompose`](#sf-decomposer-recompose)
14
14
  - [Decompose Structure](#decompose-structure)
15
15
  - [Supported Metadata](#supported-metadata)
16
- - [Metadata Exceptions](#metadata-exceptions)
16
+ - [Exceptions](#exceptions)
17
17
  - [Troubleshooting](#troubleshooting)
18
18
  - [Hooks](#hooks)
19
19
  - [Ignore Files](#ignore-files)
@@ -26,7 +26,7 @@
26
26
  - [License](#license)
27
27
  </details>
28
28
 
29
- Break down large Salesforce metadata files (XML) into smaller, more manageable files (XML/JSON/YAML/JSON5) for version control and then recreate deployment-compatible files.
29
+ Break down large Salesforce metadata files (XML) into smaller, more manageable files (XML/JSON/YAML/TOML/JSON5/INI) for version control and then recreate deployment-compatible files.
30
30
 
31
31
  ## Quick Start
32
32
 
@@ -67,7 +67,8 @@ Salesforce's built-in decomposition has limitations. `sf-decomposer` offers more
67
67
  - See [.sfdecomposerignore](#.sfdecomposerignore)
68
68
  - **Fully Decomposes Metadata** – Ensures complete decomposition for types that Salesforce only partially decomposes (e.g., `decomposePermissionSetBeta2`).
69
69
  - **Consistent Sorting** – Keeps elements in a predictable order to reduce unnecessary version control noise.
70
- - **Multiple Output Formats** Supports XML, JSON, JSON5, and YAML for greater flexibility.
70
+ > DISCLAIMER: If you use "toml" or "ini" format for decomposed files, the element sorting will vary compared to the other formats
71
+ - **Multiple Output Formats** – Supports XML, JSON, JSON5, TOML, INI, and YAML for greater flexibility.
71
72
  - **CI/CD Integration** – Hooks enable seamless decomposition and recomposition in automated workflows.
72
73
  - **Improved Version Control** – Smaller, structured files make pull requests easier to review and reduce merge conflicts.
73
74
 
@@ -95,7 +96,7 @@ FLAGS
95
96
  -m, --metadata-type=<value> The metadata suffix to process, such as 'flow', 'labels', etc.
96
97
  Can be declared multiple times.
97
98
  -f, --format=<value> The file type for the decomposed files.
98
- Options: ['xml', 'yaml', 'json', 'json5']
99
+ Options: ['xml', 'yaml', 'json', 'toml', 'ini', 'json5']
99
100
  [default: 'xml']
100
101
  -i, --ignore-package-directory=<value> Package directory to ignore.
101
102
  Should be as they appear in the "sfdx-project.json".
@@ -164,22 +165,23 @@ When the original metadata files are decomposed, this structure is followed for
164
165
 
165
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.
166
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.
167
- - If unique ID elements are found, the decomposed nested files will be named using them.
168
- - Otherwise, the decomposed nested files will be named with the SHA-256 hash of the element contents.
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
169
  - See [Contributing](#contributing) for more information on unique ID elements.
170
170
 
171
- <img src="https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-perm-set.png">
172
- <p><em>Decomposed Permission Sets named using unique ID elements</em></p>
171
+ **Decomposed Permission Set Example**
173
172
 
174
- <br>
175
-
176
- <img src="https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-apps-hashes.png">
177
- <p><em>Decomposed Application named using SHA-256 hashes of elements</em></p>
173
+ | Format | Example |
174
+ | --------- | --------------------------------------------------------------------------------------------------------------- |
175
+ | **XML** | ![XML](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-xml.png)<br> |
176
+ | **YAML** | ![YAML](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-yaml.png)<br> |
177
+ | **JSON** | ![JSON](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-json.png)<br> |
178
+ | **JSON5** | ![JSON5](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-json5.png)<br> |
179
+ | **TOML** | ![TOML](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-toml.png)<br> |
180
+ | **INI** | ![INI](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-ini.png)<br> |
178
181
 
179
182
  When custom labels are decomposed, each custom label will have its own file in the original labels directory.
180
183
 
181
- <img src="https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-labels.png" alt="Description">
182
- <p><em>Decomposed Custom Labels</em></p>
184
+ ![Decomposed Custom Labels](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/.github/images/decomposed-labels.png)<br>
183
185
 
184
186
  ## Supported Metadata
185
187
 
@@ -189,33 +191,25 @@ The `--metadata-type`/`-m` flag should be the metadata's `suffix` value as liste
189
191
 
190
192
  Here are some examples:
191
193
 
192
- - Custom Labels (`--metadata-type "labels"`)
193
- - Workflows (`--metadata-type "workflow"`)
194
- - Profiles (`--metadata-type "profile"`)
195
- - Permission Sets (`--metadata-type "permissionset"`)
196
- - AI Scoring Model Definition (`--metadata-type "aiScoringModelDefinition"`)
197
- - Decision Matrix Definition (`--metadata-type "decisionMatrixDefinition"`)
198
- - Bot (`--metadata-type "bot"`)
199
- - Marketing App Extension (`--metadata-type "marketingappextension"`)
200
-
201
- ### Metadata Exceptions
202
-
203
- - `botVersion` is blocked from being ran directly. Please use the `bot` meta suffix to decompose and recompose bots and bot versions.
204
- ```
205
- Error (1): `botVersion` suffix should not be used. Please use `bot` to decompose/recompose bot and bot version files.
206
- ```
207
- - Custom Objects are not supported by this plugin as they already are decomposed by default.
208
- ```
209
- Error (1): Custom Objects are not supported by this plugin.
210
- ```
211
- - Metadata types such as Apex Classes, Apex Components, Triggers, etc. with certain SDR adapter strategies (`matchingContentFile`, `digitalExperience`, `mixedContent`, `bundle`) are not supported by this plugin.
212
- ```
213
- Error (1): Metadata types with [matchingContentFile, digitalExperience, mixedContent, bundle] strategies are not supported by this plugin.
214
- ```
215
- - Children metadata types (i.e. custom fields) are not supported and will result in this general error:
216
- ```
217
- Error (1): Metadata type not found for the given suffix: field.
218
- ```
194
+ | Metadata Type | CLI Option |
195
+ | --------------------------- | -------------------------------------------- |
196
+ | Custom Labels | `--metadata-type "labels"` |
197
+ | Workflows | `--metadata-type "workflow"` |
198
+ | Profiles | `--metadata-type "profile"` |
199
+ | Permission Sets | `--metadata-type "permissionset"` |
200
+ | AI Scoring Model Definition | `--metadata-type "aiScoringModelDefinition"` |
201
+ | Decision Matrix Definition | `--metadata-type "decisionMatrixDefinition"` |
202
+ | Bot | `--metadata-type "bot"` |
203
+ | Marketing App Extension | `--metadata-type "marketingappextension"` |
204
+
205
+ ### Exceptions
206
+
207
+ | Scenario | Message |
208
+ | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
209
+ | `botVersion` is blocked from being run directly | `Error (1): botVersion suffix should not be used. Please use bot to decompose/recompose bot and bot version files.` |
210
+ | Custom Objects not supported | `Error (1): Custom Objects are not supported by this plugin.` |
211
+ | Unsupported SDR adapter strategies (e.g., `matchingContentFile`, `digitalExperience`, `mixedContent`, `bundle`) | `Error (1): Metadata types with [matchingContentFile, digitalExperience, mixedContent, bundle] strategies are not supported by this plugin.` |
212
+ | Children metadata types (e.g., custom fields) and invalid suffixes | `Error (1): Metadata type not found for the given suffix: field.` |
219
213
 
220
214
  ## Troubleshooting
221
215
 
@@ -247,18 +241,18 @@ To add debugging to the log, provide the `--debug` flag to the decompose or reco
247
241
 
248
242
  You can copy and update the sample [.sfdecomposer.config.json](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/samples/.sfdecomposer.config.json).
249
243
 
250
- - `metadataSuffixes` is required and should be a comma-separated string of metadata suffixes to decompose and recompose based on the CLI command.
251
- - `ignorePackageDirectories` is optional and should be a comma-separated string of package directories to ignore.
252
- - `prePurge` is optional and should be `true` or `false`. If true, this will delete any existing decomposed files before decomposing the files. This defauls to `false`.
253
- - `postPurge` is optional and should be `true` or `false`. If true, this will delete the retrieval file after decomposing it or delete the decomposed files after recomposing them. This defauls to `false`.
254
- - `decomposedFormat` is optional and should be either `xml`, `json`, `json5`, or `yaml`, depending on the decomposed file format. This defaults to `xml`.
244
+ | Configuration Option | Required | Description |
245
+ | -------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
246
+ | `metadataSuffixes` | Yes | Comma-separated string of metadata suffixes to decompose and recompose based on the CLI command. |
247
+ | `ignorePackageDirectories` | No | Comma-separated string of package directories to ignore. |
248
+ | `prePurge` | No | `true` or `false`. If `true`, deletes existing decomposed files before decomposing. Defaults to `false`. |
249
+ | `postPurge` | No | `true` or `false`. If `true`, deletes the retrieval file after decomposing or deletes decomposed files after recomposing. Defaults to `false`. |
250
+ | `decomposedFormat` | No | Format of decomposed files: `xml`, `json`, `json5`, `toml`, `ini`, or `yaml`. Defaults to `xml`. |
255
251
 
256
252
  If `.sfdecomposer.config.json` is found, the hooks will run:
257
253
 
258
- - the decompose command **after** a `sf project retrieve start` command completes successfully (post-run)
259
- - the recompose command **before** a `sf project deploy [start/validate]` command starts (pre-run)
260
-
261
- If `.sfdecomposer.config.json` isn't found, the hooks will be skipped.
254
+ - the decompose command **after** a `sf project retrieve start` command completes successfully
255
+ - the recompose command **before** a `sf project deploy [start/validate]` command starts
262
256
 
263
257
  ## Ignore Files
264
258
 
@@ -266,7 +260,7 @@ If `.sfdecomposer.config.json` isn't found, the hooks will be skipped.
266
260
 
267
261
  The Salesforce CLI **must** ignore the decomposed files and allow the recomposed files.
268
262
 
269
- You can use the sample [.forceignore](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/samples/.forceignore). Update the decomposed file extensions based on what format you're using (`.xml`, `.json`, `.json5`, or `.yaml`).
263
+ You can use the sample [.forceignore](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/samples/.forceignore). Update the decomposed file extensions based on what format you're using (`.xml`, `.json`, `.json5`, `.toml`, `.ini`, or `.yaml`).
270
264
 
271
265
  ### `.sfdecomposerignore`
272
266
 
@@ -3,7 +3,7 @@ export const SFDX_PROJECT_FILE_NAME = 'sfdx-project.json';
3
3
  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
- export const DECOMPOSED_FILE_TYPES = ['xml', 'json', 'yaml', 'json5'];
6
+ export const DECOMPOSED_FILE_TYPES = ['xml', 'json', 'yaml', 'json5', 'toml', 'ini'];
7
7
  export const IGNORE_FILE = '.sfdecomposerignore';
8
8
  export const WORKFLOW_SUFFIX_MAPPING = {
9
9
  'alerts-meta.xml': 'workflowAlert-meta.xml',
@@ -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,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AACjD,MAAM,CAAC,MAAM,uBAAuB,GAA8B;IAChE,iBAAiB,EAAE,wBAAwB;IAC3C,uBAAuB,EAAE,8BAA8B;IACvD,sBAAsB,EAAE,6BAA6B;IACrD,6BAA6B,EAAE,mCAAmC;IAClE,2BAA2B,EAAE,kCAAkC;IAC/D,gBAAgB,EAAE,uBAAuB;IACzC,gBAAgB,EAAE,uBAAuB;IACzC,eAAe,EAAE,uBAAuB;CACzC,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC"}
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,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/F,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AACjD,MAAM,CAAC,MAAM,uBAAuB,GAA8B;IAChE,iBAAiB,EAAE,wBAAwB;IAC3C,uBAAuB,EAAE,8BAA8B;IACvD,sBAAsB,EAAE,6BAA6B;IACrD,6BAA6B,EAAE,mCAAmC;IAClE,2BAA2B,EAAE,kCAAkC;IAC/D,gBAAgB,EAAE,uBAAuB;IACzC,gBAAgB,EAAE,uBAAuB;IACzC,eAAe,EAAE,uBAAuB;CACzC,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC"}