sf-decomposer 5.3.12 → 5.3.13

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,14 @@
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.3.13](https://github.com/mcarvin8/sf-decomposer/compare/v5.3.12...v5.3.13) (2025-03-05)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** bump @salesforce/source-deploy-retrieve ([2146e58](https://github.com/mcarvin8/sf-decomposer/commit/2146e5881e0307d44c092a942c3380d7c441ecd4))
14
+ * **deps:** bump the xml-disassemblers group with 3 updates ([3b5c37f](https://github.com/mcarvin8/sf-decomposer/commit/3b5c37f6cceaedd913df75351b25d05e633b8e5d))
15
+
8
16
  ## [5.3.12](https://github.com/mcarvin8/sf-decomposer/compare/v5.3.11...v5.3.12) (2025-02-27)
9
17
 
10
18
 
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <details>
7
7
  <summary>Table of Contents</summary>
8
8
 
9
- - [Install](#install)
9
+ - [Quick Start](#quick-start)
10
10
  - [Why SF Decomposer](#why-sf-decomposer)
11
11
  - [Commands](#commands)
12
12
  - [`sf decomposer decompose`](#sf-decomposer-decompose)
@@ -14,34 +14,60 @@
14
14
  - [Decompose Structure](#decompose-structure)
15
15
  - [Supported Metadata](#supported-metadata)
16
16
  - [Metadata Exceptions](#metadata-exceptions)
17
- - [Debugging](#debugging)
17
+ - [Troubleshooting](#troubleshooting)
18
18
  - [Hooks](#hooks)
19
19
  - [Ignore Files](#ignore-files)
20
20
  - [`.forceignore`](#.forceignore)
21
21
  - [`.sfdecomposerignore`](#.sfdecomposerignore)
22
22
  - [`.gitignore`](#.gitignore)
23
- - [Contributing](#contributing)
24
23
  - [Issues](#issues)
24
+ - [Contributing](#contributing)
25
25
  - [License](#license)
26
26
  </details>
27
27
 
28
- A Salesforce CLI plugin to break down large metadata files into smaller, more manageable files for version control and then recreate deployment-compatible files.
28
+ Break down large Salesforce metadata files into smaller, more manageable files for version control and then recreate deployment-compatible files.
29
29
 
30
- ## Install
30
+ ## Quick Start
31
+ 1. Install plugin using `sf`
31
32
 
32
33
  ```bash
33
34
  sf plugins install sf-decomposer@x.y.z
34
35
  ```
35
36
 
37
+ 2. Decompose the metadata type(s) in your Salesforce DX project
38
+
39
+ ```bash
40
+ sf decomposer decompose -m "flow" -m "labels"
41
+ ```
42
+
43
+ 3. Add decomposed files to `.forceignore`
44
+
45
+ > This is **REQUIRED** to avoid errors when running `sf`commands. See [Ignore Files](#ignore-files) section.
46
+
47
+ 4. Stage files in version control
48
+
49
+ 5. Recompose the metadata type(s)
50
+
51
+ ```bash
52
+ sf decomposer recompose -m "flow" -m "labels"
53
+ ```
54
+
55
+ 6. Deploy recomposed metadata
56
+
36
57
  ## Why SF Decomposer
37
58
 
38
59
  Why should you consider using `sf-decomposer` over Salesforce's decomposition?
39
60
 
40
- - Salesforce's decomposition betas are evaluated for each metadata type before they are considered. `sf-decomposer` supports the vast majority of Salesforce metadata types available from the Metadata API.
41
- - Salesforce's decomposition is all or nothing for each metadata type. Meaning, if you want to decompose workflows, all of your workflows will need to be decomposed to work with Salesforce's approach. `sf-decomposer` allows you to selectively decompose for each metadata type.
61
+ - **Broad Metadata Support**: Unlike Salesforce's decomposition, `sf-decomposer` supports most metadata types available in the Metadata API.
62
+ - **Selective Decomposition**: `sf-decomposer` allows you to decompose only the metadata you need instead of Salesforce's all-or-nothing approach.
42
63
  - See [.sfdecomposerignore](#.sfdecomposerignore)
43
- - Some metadata types may only be partially decomposed by Salesforce such as permission sets based on what designs are picked. `sf-decomposer` will allow for total decomposition. So if a user wants to fully decompose permission sets, they can use this plugin.
44
- - When `sf-decomposer` recomposes the decomposed files, it will sort the elements consistently compared to native Salesforce files.
64
+ - **Complete Decomposition**: Partially decomposed metadata types (e.g., Salesforce's `decomposePermissionSetBeta2`) can be fully decomposed by `sf-decomposer`.
65
+ - **Consistent Sorting**: `sf-decomposer` recomposition ensures elements are always sorted consistently for better version control.
66
+
67
+ In general, `sf-decomposer` helps Salesforce Admins do a few things with their source deployments:
68
+
69
+ - Enhance peer reviews of large metadata in CI/CD platforms like GitHub, i.e. easier-to-review diffs in pull requests
70
+ - Make deployments safer by ensuring only the intended changes are deployed, improving the overall version control process
45
71
 
46
72
  ## Commands
47
73
 
@@ -167,7 +193,7 @@ When custom labels are decomposed, each custom label will have its own file in t
167
193
 
168
194
  ## Supported Metadata
169
195
 
170
- All metadata types imported from this plugin's version of `@salesforce/source-deploy-retrieve` (SDR) toolkit are supported except for certain types.
196
+ All parent metadata types imported from this plugin's version of `@salesforce/source-deploy-retrieve` (SDR) toolkit are supported except for certain types.
171
197
 
172
198
  The `--metadata-type`/`-m` flag should be the metadata's `suffix` value as listed in the [metadataRegistry.json](https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json).
173
199
 
@@ -189,7 +215,7 @@ Here are some examples:
189
215
  ```
190
216
  Error (1): `botVersion` suffix should not be used. Please use `bot` to decompose/recompose bot and bot version files.
191
217
  ```
192
- - Custom Objects are not supported by this plugin.
218
+ - Custom Objects are not supported by this plugin as they already are decomposed by default.
193
219
  ```
194
220
  Error (1): Custom Objects are not supported by this plugin.
195
221
  ```
@@ -202,7 +228,7 @@ Here are some examples:
202
228
  Error (1): Metadata type not found for the given suffix: field.
203
229
  ```
204
230
 
205
- ## Debugging
231
+ ## Troubleshooting
206
232
 
207
233
  `sf-decomposer` searches the current working directory for the `sfdx-project.json`, and if it's not found in the current working directory, it will search upwards for it until it hits your root drive. If the `sfdx-project.json` file isn't found, the plugin will fail with:
208
234
 
@@ -226,11 +252,9 @@ Recommend adding the `disassemble.log` to your `.gitignore` file if you are usin
226
252
 
227
253
  ## Hooks
228
254
 
229
- > **NOTE:** In order to avoid errors during the retrieval, you must configure your `.forceignore` file to have the Salesforce CLI ignore the decomposed files. See [Ignore Files](#ignore-files) section.
255
+ > **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) section.
230
256
 
231
- A post-retrieve hook (for the decompose command) and a pre-run hook (for the recompose command) have been configured if you elect to use them. The post-retrieve hook will automatically decompose the desired metadata types after every Salesforce CLI retrieval (`sf project retrieve start` command). The pre-run hook will automatically recompose the desired metadata types before every Salesforce CLI deployment/validation (`sf project deploy start` and `sf project deploy validate` commands).
232
-
233
- Both hooks require you to create this file in the root of your repo: `.sfdecomposer.config.json`. You can use the sample [.sfdecomposer.config.json](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/samples/.sfdecomposer.config.json) provided. Update the file as such:
257
+ To automate decomposing and recomposing, create `.sfdecomposer.config.json` in the root of your Salesforce DX project. You can copy and update the sample [.sfdecomposer.config.json](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/samples/.sfdecomposer.config.json) provided.
234
258
 
235
259
  - `metadataSuffixes` is required and should be a comma-separated string of metadata suffixes to decompose automatically after retrievals.
236
260
  - `ignorePackageDirectories` is optional and should be a comma-separated string of package directories to ignore.
@@ -238,7 +262,12 @@ Both hooks require you to create this file in the root of your repo: `.sfdecompo
238
262
  - `postPurge` is optional and should be a boolean. If true, this will delete the retrieval file after decomposing it or delete the decomposed files after recomposing them. If you do not provide this, the default will be `false`.
239
263
  - `decomposedFormat` is optional and should be either `xml`, `json`, or `yaml`, depending on what file format you want the decomposed files created as. If you do not provide this, the default will be `xml`.
240
264
 
241
- If the `.sfdecomposer.config.json` file isn't found, the hooks will be skipped.
265
+ If `.sfdecomposer.config.json` is found, the hooks will fire:
266
+
267
+ - the decompose command after a `sf project retrieve start` command completes successfully (post-run)
268
+ - the recompose command before a `sf project deploy start` or `sf project deploy validate` command starts (pre-run)
269
+
270
+ If `.sfdecomposer.config.json` isn't found, the hooks will be skipped.
242
271
 
243
272
  ## Ignore Files
244
273
 
@@ -250,7 +279,7 @@ You can use the sample [.forceignore](https://raw.githubusercontent.com/mcarvin8
250
279
 
251
280
  ### `.sfdecomposerignore`
252
281
 
253
- If you wish, you can create a `.sfdecomposerignore` file in the root of your repository to ignore specific XMLs when running the decompose command. The `.sfdecomposerignore` file should follow [.gitignore spec 2.22.1](https://git-scm.com/docs/gitignore).
282
+ If you wish, you can create a `.sfdecomposerignore` file in the root of your Salesforce DX project to ignore specific XMLs when running the decompose command. The `.sfdecomposerignore` file should follow [.gitignore spec 2.22.1](https://git-scm.com/docs/gitignore).
254
283
 
255
284
  When the decompose command is ran with the `--debug` flag and it processes a file that matches an entry in `.sfdecomposerignore`, a warning will be printed to the `disassemble.log`:
256
285
 
@@ -262,18 +291,18 @@ When the decompose command is ran with the `--debug` flag and it processes a fil
262
291
 
263
292
  ### `.gitignore`
264
293
 
265
- Optionally, Git (or whatever version control system you are using) can ignore the recomposed files so you don't stage those in your repositories. You can also have git ignore the `disassemble.log` created by the `xml-disassembler` package.
294
+ Optionally, git can ignore the recomposed files so you don't stage those in your repositories. You can also have git ignore the `disassemble.log` created by the `xml-disassembler` package.
266
295
 
267
296
  You can use the sample [.gitignore](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/samples/.gitignore) provided.
268
297
 
269
- ## Contributing
270
-
271
- Contributions are welcome! See [Contributing](https://github.com/mcarvin8/sf-decomposer/blob/main/CONTRIBUTING.md).
272
-
273
298
  ## Issues
274
299
 
275
300
  If you encounter any bugs or would like to request features, please create an [issue](https://github.com/mcarvin8/sf-decomposer/issues).
276
301
 
302
+ ## Contributing
303
+
304
+ Contributions are welcome! See [Contributing](https://github.com/mcarvin8/sf-decomposer/blob/main/CONTRIBUTING.md).
305
+
277
306
  ## License
278
307
 
279
308
  This project is licensed under the MIT license. Please see the [LICENSE](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/LICENSE.md) file for details.
package/oclif.lock CHANGED
@@ -1596,17 +1596,17 @@
1596
1596
  string-width "^7.2.0"
1597
1597
  terminal-link "^3.0.0"
1598
1598
 
1599
- "@salesforce/source-deploy-retrieve@^12.16.0":
1600
- version "12.16.0"
1601
- resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-12.16.0.tgz#6c0338a5cd83b87161414ae4a326669d81884f60"
1602
- integrity sha512-vKBoefk1bHzs945e7PFhBJd21jLYJY2QrrNCwQpmHf6C3Lbu9+kzOnZVLPuDM4lGxXyhhQ89Nx3TtPCyndhmfg==
1599
+ "@salesforce/source-deploy-retrieve@^12.16.3":
1600
+ version "12.16.3"
1601
+ resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-12.16.3.tgz#a299d85b29715303764cafda2ff743a2acb8d3b6"
1602
+ integrity sha512-xGZd45VSEE72AP/5Zl1g6gm2w2ITz2zWDmcyq16PsBPbQv7fOB44BF8wH41zUqww0d1KWOdQLZ/du+I/Ew5Lmg==
1603
1603
  dependencies:
1604
1604
  "@salesforce/core" "^8.8.3"
1605
1605
  "@salesforce/kit" "^3.2.3"
1606
1606
  "@salesforce/ts-types" "^2.0.12"
1607
1607
  "@salesforce/types" "^1.3.0"
1608
1608
  fast-levenshtein "^3.0.0"
1609
- fast-xml-parser "^4.5.1"
1609
+ fast-xml-parser "^4.5.3"
1610
1610
  got "^11.8.6"
1611
1611
  graceful-fs "^4.2.11"
1612
1612
  ignore "^5.3.2"
@@ -4111,19 +4111,19 @@ fast-xml-parser@4.2.5:
4111
4111
  dependencies:
4112
4112
  strnum "^1.0.5"
4113
4113
 
4114
- fast-xml-parser@^4.5.1:
4115
- version "4.5.1"
4116
- resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz#a7e665ff79b7919100a5202f23984b6150f9b31e"
4117
- integrity sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==
4114
+ fast-xml-parser@^4.5.3:
4115
+ version "4.5.3"
4116
+ resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz#c54d6b35aa0f23dc1ea60b6c884340c006dc6efb"
4117
+ integrity sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==
4118
4118
  dependencies:
4119
- strnum "^1.0.5"
4119
+ strnum "^1.1.1"
4120
4120
 
4121
- fast-xml-parser@^5.0.6:
4122
- version "5.0.6"
4123
- resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.0.6.tgz#3531c630ea334bd67b91f236117fbf439a19b21f"
4124
- integrity sha512-5zIl0jWsewL5LdneswG6aJXx1YH1FXQ02UVIe/CZI3wXhI3SqP62bjcIYRNOgU43/MnN1t/MCpH6UoOtBrDNug==
4121
+ fast-xml-parser@^5.0.8:
4122
+ version "5.0.8"
4123
+ resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.0.8.tgz#cb84ca077c0c5c45906051c13c4075ed44d3f271"
4124
+ integrity sha512-qY8NiI5L8ff00F2giyICiJxSSKHO52tC36LJqx2JtvGyAd5ZfehC/l4iUVVHpmpIa6sM9N5mneSLHQG2INGoHA==
4125
4125
  dependencies:
4126
- strnum "^2.0.4"
4126
+ strnum "^2.0.5"
4127
4127
 
4128
4128
  fastest-levenshtein@^1.0.7:
4129
4129
  version "1.0.16"
@@ -7236,10 +7236,15 @@ strnum@^1.0.5:
7236
7236
  resolved "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz"
7237
7237
  integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==
7238
7238
 
7239
- strnum@^2.0.4:
7240
- version "2.0.4"
7241
- resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.0.4.tgz#7b2ace8a55d8c92a41c2d339ddb1bc306f337820"
7242
- integrity sha512-qrXhLMohxtEPKMlajtNaOp5zvAQUo6L3fNcdiJKzWH98kGfklqGwmxhFjM7DzxsuoVM7rJeiYr+lEcu4Jlu9UQ==
7239
+ strnum@^1.1.1:
7240
+ version "1.1.2"
7241
+ resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.1.2.tgz#57bca4fbaa6f271081715dbc9ed7cee5493e28e4"
7242
+ integrity sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==
7243
+
7244
+ strnum@^2.0.5:
7245
+ version "2.0.5"
7246
+ resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.0.5.tgz#40700b1b5bf956acdc755e98e90005d7657aaaea"
7247
+ integrity sha512-YAT3K/sgpCUxhxNMrrdhtod3jckkpYwH6JAuwmUdXZsmzH1wUyzTMrrK2wYCEEqlKwrWDd35NeuUkbBy/1iK+Q==
7243
7248
 
7244
7249
  supports-color@^5.3.0:
7245
7250
  version "5.5.0"
@@ -7809,12 +7814,12 @@ write-file-atomic@^3.0.0:
7809
7814
  signal-exit "^3.0.2"
7810
7815
  typedarray-to-buffer "^3.1.5"
7811
7816
 
7812
- xml-disassembler@^1.3.12:
7813
- version "1.3.12"
7814
- resolved "https://registry.yarnpkg.com/xml-disassembler/-/xml-disassembler-1.3.12.tgz#f3fa2ea6573e815c20e6ca2e7a758dfe68a7b807"
7815
- integrity sha512-P/aApcGRfq568GHwNBQDqdsKq686rwX03ZusyDugbokxd7CDPB5AXBP79bdrJWdKV4k6l/dHBfRwMzJ/kgcNbg==
7817
+ xml-disassembler@^1.3.13:
7818
+ version "1.3.13"
7819
+ resolved "https://registry.yarnpkg.com/xml-disassembler/-/xml-disassembler-1.3.13.tgz#fade68d62add9992340b94b6e4537bc040333c87"
7820
+ integrity sha512-qjfNcTNSAXbLDErLw6hlckpm9ARQDQDJ+CMDFPV2LrheMUhlDF3Z4vZKSNBWyTrb+4PgUOTpGXnXRpgFPtcO9Q==
7816
7821
  dependencies:
7817
- fast-xml-parser "^5.0.6"
7822
+ fast-xml-parser "^5.0.8"
7818
7823
  ignore "^5.3.1"
7819
7824
  log4js "^6.9.1"
7820
7825
  tslib "^2.6.2"
@@ -7827,21 +7832,21 @@ xml2js@^0.6.2:
7827
7832
  sax ">=0.6.0"
7828
7833
  xmlbuilder "~11.0.0"
7829
7834
 
7830
- xml2json-disassembler@^1.1.12:
7831
- version "1.1.12"
7832
- resolved "https://registry.yarnpkg.com/xml2json-disassembler/-/xml2json-disassembler-1.1.12.tgz#b7feba01bd575f9d68e1fc0341ab0b3f5d09b4fc"
7833
- integrity sha512-YQJd7XPdq8pxLZK++Ld6GGOowQalZsarg3UXh2GA4RwM6yPL4vpKPW6kFE3aa9llsHDgpBVZH3TYoirtfAWvUA==
7835
+ xml2json-disassembler@^1.1.13:
7836
+ version "1.1.13"
7837
+ resolved "https://registry.yarnpkg.com/xml2json-disassembler/-/xml2json-disassembler-1.1.13.tgz#04f8577fda4bbcbf5c167d5320b6ed88e46f75c7"
7838
+ integrity sha512-YWIybFAJ59yiuUbQ+DgeJ/aOd5ACfVquCmZNbMlqJGlqVhON3IUCJ8SPyhfRJwuuJScAbBBbi+kXrhI8KMRz7w==
7834
7839
  dependencies:
7835
7840
  tslib "^2.6.2"
7836
- xml-disassembler "^1.3.12"
7841
+ xml-disassembler "^1.3.13"
7837
7842
 
7838
- xml2yaml-disassembler@^1.1.12:
7839
- version "1.1.12"
7840
- resolved "https://registry.yarnpkg.com/xml2yaml-disassembler/-/xml2yaml-disassembler-1.1.12.tgz#3f933b33a4f6a30b19e43277890be7914fa6b096"
7841
- integrity sha512-BpTbiJsECMWxDme/ZwkVsDkDQuGXb14YswViajIWkNOMnzH6/8ITUqLMUsL0GGajufhM9a3+xNiZF0k/9Kzk5A==
7843
+ xml2yaml-disassembler@^1.1.13:
7844
+ version "1.1.13"
7845
+ resolved "https://registry.yarnpkg.com/xml2yaml-disassembler/-/xml2yaml-disassembler-1.1.13.tgz#8c524cacce2f6741691e2958c3fab25fa4479195"
7846
+ integrity sha512-itP9OrE77LRNqWbsU0Fs6rJJT59R1k0lqY6+ycm4IZKITMSvnCVFznbCaZ6EUv+GvDZd73+hreO4so6vcqDRDw==
7842
7847
  dependencies:
7843
7848
  tslib "^2.6.2"
7844
- xml-disassembler "^1.3.12"
7849
+ xml-disassembler "^1.3.13"
7845
7850
  yaml "^2.7.0"
7846
7851
 
7847
7852
  xmlbuilder@~11.0.0:
@@ -198,5 +198,5 @@
198
198
  ]
199
199
  }
200
200
  },
201
- "version": "5.3.12"
201
+ "version": "5.3.13"
202
202
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
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.3.12",
4
+ "version": "5.3.13",
5
5
  "dependencies": {
6
6
  "@oclif/core": "^4",
7
7
  "@salesforce/core": "^8.2.1",
8
8
  "@salesforce/sf-plugins-core": "^11.2.1",
9
- "@salesforce/source-deploy-retrieve": "^12.16.0",
9
+ "@salesforce/source-deploy-retrieve": "^12.16.3",
10
10
  "fs-extra": "^11.2.0",
11
- "xml-disassembler": "^1.3.12",
12
- "xml2json-disassembler": "^1.1.12",
13
- "xml2yaml-disassembler": "^1.1.12"
11
+ "xml-disassembler": "^1.3.13",
12
+ "xml2json-disassembler": "^1.1.13",
13
+ "xml2yaml-disassembler": "^1.1.13"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@commitlint/cli": "^18.6.1",