sf-decomposer 4.1.0 → 4.1.2
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/README.md +8 -7
- package/lib/helpers/constants.d.ts +1 -1
- package/lib/helpers/constants.js +1 -1
- package/lib/helpers/constants.js.map +1 -1
- package/oclif.lock +8 -8
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/sf-decomposer) [](https://npmjs.org/package/sf-decomposer) [](https://raw.githubusercontent.com/mcarvin8/sf-decomposer/main/LICENSE.md)
|
|
4
4
|
|
|
5
|
-
The `sf-decomposer` is a Salesforce plugin to read the original metadata files (XML) and create smaller, more manageable files for version control. The inverse function (`recompose`) will recreate metadata files for deployments.
|
|
5
|
+
The `sf-decomposer` is a Salesforce plugin to read the original metadata files (XML) and create smaller, more manageable files for version control. The inverse function (`recompose`) will recreate metadata files for deployments. This plugin is intended for users who deploy their Salesforce codebase from a git repository that follows the Salesforce DX Project Configuration (`sfdx-project.json` file).
|
|
6
6
|
|
|
7
7
|
This plugin requires [git](https://git-scm.com/downloads) to be installed and that it can be called using the command `git`.
|
|
8
8
|
|
|
@@ -16,6 +16,7 @@ The decomposed file format can be XML, JSON, or YAML. Based on testing, XML and
|
|
|
16
16
|
|
|
17
17
|
**DISCLAIMERS:**
|
|
18
18
|
|
|
19
|
+
- Due to a bug with running in sub-directories, **you must run this plugin from the root folder of your git repository.**
|
|
19
20
|
- You must update the `.forceignore` to have the Salesforce CLI ignore the decomposed files created by this plugin. See section `Ignore Files`. Updates to the `.gitignore` are optional and can be updated based on what you want staged in your repo.
|
|
20
21
|
- It is highly recommended that you extensively test this plugin in a sandbox environment on the metadata types you wish to use this tool for.
|
|
21
22
|
- Do not change your production/QA pipelines until you have tested this and are happy with the results.
|
|
@@ -34,7 +35,7 @@ The `sf-decomposer` supports 2 commands:
|
|
|
34
35
|
- `sf decomposer decompose`
|
|
35
36
|
- `sf decomposer recompose`
|
|
36
37
|
|
|
37
|
-
Both commands need to be ran
|
|
38
|
+
Both commands need to be ran in the root folder of your Salesforce DX git repository. This plugin will read the `sfdx-project.json` file and it will process all package directories listed in the file.
|
|
38
39
|
|
|
39
40
|
## `sf decomposer decompose`
|
|
40
41
|
|
|
@@ -227,16 +228,16 @@ General debugging statements in the log file will look like:
|
|
|
227
228
|
|
|
228
229
|
Recommend adding the `disassemble.log` to your `.gitignore` file.
|
|
229
230
|
|
|
230
|
-
## Ignore
|
|
231
|
+
## Ignore Files when Decomposing
|
|
231
232
|
|
|
232
|
-
If you wish, you can create an ignore file in the root of your repository named `.
|
|
233
|
+
If you wish, you can create an ignore file in the root of your repository named `.sfdecomposerignore` to ignore specific XMLs when running the decompose command.
|
|
233
234
|
|
|
234
235
|
The ignore file should follow [.gitignore spec 2.22.1](https://git-scm.com/docs/gitignore).
|
|
235
236
|
|
|
236
|
-
When the decompose command is ran with the `--debug` flag and it processes a file that matches an entry in `.
|
|
237
|
+
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`:
|
|
237
238
|
|
|
238
239
|
```
|
|
239
|
-
[2024-05-22T09:32:12.078] [WARN] default - File ignored by .
|
|
240
|
+
[2024-05-22T09:32:12.078] [WARN] default - File ignored by .sfdecomposerignore: C:\Users\matth\Documents\sf-decomposer\test\baselines\bots\Assessment_Bot\v1.botVersion-meta.xml
|
|
240
241
|
```
|
|
241
242
|
|
|
242
243
|
The ignore file is not read by the recompose command.
|
|
@@ -247,7 +248,7 @@ A post-retrieve hook (for the decompose command) and a pre-run hook (for the rec
|
|
|
247
248
|
|
|
248
249
|
The post-retrieve hook will automatically decompose the desired metadata types after every Salesforce CLI retrieval (`sf project retrieve start` command).
|
|
249
250
|
|
|
250
|
-
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).
|
|
251
|
+
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). **You must run the Salesforce CLI commands from the root folder of your repository in order for the hooks to execute correctly.**
|
|
251
252
|
|
|
252
253
|
Both hooks require you to create this file in the root of your repo: `.sfdecomposer.config.json`
|
|
253
254
|
|
|
@@ -3,4 +3,4 @@ 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 IGNORE_FILE = ".
|
|
6
|
+
export declare const IGNORE_FILE = ".sfdecomposerignore";
|
package/lib/helpers/constants.js
CHANGED
|
@@ -4,5 +4,5 @@ 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'];
|
|
7
|
-
export const IGNORE_FILE = '.
|
|
7
|
+
export const IGNORE_FILE = '.sfdecomposerignore';
|
|
8
8
|
//# sourceMappingURL=constants.js.map
|
|
@@ -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,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG,
|
|
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,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC"}
|
package/oclif.lock
CHANGED
|
@@ -11634,10 +11634,10 @@ xml2js@^0.6.2:
|
|
|
11634
11634
|
sax ">=0.6.0"
|
|
11635
11635
|
xmlbuilder "~11.0.0"
|
|
11636
11636
|
|
|
11637
|
-
xml2json-disassembler@^1.1.
|
|
11638
|
-
version "1.1.
|
|
11639
|
-
resolved "https://registry.yarnpkg.com/xml2json-disassembler/-/xml2json-disassembler-1.1.
|
|
11640
|
-
integrity sha512-
|
|
11637
|
+
xml2json-disassembler@^1.1.1:
|
|
11638
|
+
version "1.1.1"
|
|
11639
|
+
resolved "https://registry.yarnpkg.com/xml2json-disassembler/-/xml2json-disassembler-1.1.1.tgz#5af69ef0caa99241c5f72d64083e51dd20c49a49"
|
|
11640
|
+
integrity sha512-w11ykQFDyny+4iE5u/0uON4ZQQwrGNyCGaVMgmQgecscsFE979yF5/uaqN7/lqyfZnZEqerMygtdfrj9mmRoJQ==
|
|
11641
11641
|
dependencies:
|
|
11642
11642
|
fast-xml-parser "^4.3.4"
|
|
11643
11643
|
ignore "^5.3.1"
|
|
@@ -11645,10 +11645,10 @@ xml2json-disassembler@^1.1.0:
|
|
|
11645
11645
|
tslib "^2.6.2"
|
|
11646
11646
|
xml-disassembler "^1.3.1"
|
|
11647
11647
|
|
|
11648
|
-
xml2yaml-disassembler@^1.1.
|
|
11649
|
-
version "1.1.
|
|
11650
|
-
resolved "https://registry.yarnpkg.com/xml2yaml-disassembler/-/xml2yaml-disassembler-1.1.
|
|
11651
|
-
integrity sha512-
|
|
11648
|
+
xml2yaml-disassembler@^1.1.1:
|
|
11649
|
+
version "1.1.1"
|
|
11650
|
+
resolved "https://registry.yarnpkg.com/xml2yaml-disassembler/-/xml2yaml-disassembler-1.1.1.tgz#9920fcf64725282447d228791d19a42e6b022449"
|
|
11651
|
+
integrity sha512-yjzQi/3EHww2NbZDjDwLzdr/ETS4ATTLa5o7Iqf66ED/HKKyNYj9OzjVY/m41T2r0uVA2Ef7V9j/r20Bjz+8Ng==
|
|
11652
11652
|
dependencies:
|
|
11653
11653
|
fast-xml-parser "^4.3.4"
|
|
11654
11654
|
ignore "^5.3.1"
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sf-decomposer",
|
|
3
3
|
"description": "Decomposes Salesforce metadata into more manageable files.",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.2",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@oclif/core": "^3.26.0",
|
|
7
7
|
"@salesforce/core": "^6.5.3",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"fs-extra": "^11.2.0",
|
|
11
11
|
"simple-git": "^3.24.0",
|
|
12
12
|
"xml-disassembler": "^1.3.1",
|
|
13
|
-
"xml2json-disassembler": "^1.1.
|
|
14
|
-
"xml2yaml-disassembler": "^1.1.
|
|
13
|
+
"xml2json-disassembler": "^1.1.1",
|
|
14
|
+
"xml2yaml-disassembler": "^1.1.1"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@commitlint/cli": "^18.6.1",
|