sfdx-git-delta 5.17.1 → 5.18.1
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 +19 -3
- package/LICENSE.md +1 -0
- package/README.md +26 -24
- package/lib/metadata/a48.json +549 -121
- package/lib/metadata/metadataManager.d.ts +3 -0
- package/lib/metadata/metadataManager.js +21 -0
- package/lib/metadata/metadataManager.js.map +1 -1
- package/lib/metadata/v46.json +549 -113
- package/lib/metadata/v47.json +549 -121
- package/lib/metadata/v49.json +549 -121
- package/lib/metadata/v50.json +549 -121
- package/lib/metadata/v51.json +549 -121
- package/lib/metadata/v52.json +549 -121
- package/lib/metadata/v53.json +549 -121
- package/lib/metadata/v54.json +549 -121
- package/lib/metadata/v55.json +549 -121
- package/lib/metadata/v56.json +549 -121
- package/lib/metadata/v57.json +549 -121
- package/lib/post-processor/flowTranslationProcessor.d.ts +14 -3
- package/lib/post-processor/flowTranslationProcessor.js +47 -20
- package/lib/post-processor/flowTranslationProcessor.js.map +1 -1
- package/lib/post-processor/packageGenerator.js +1 -1
- package/lib/post-processor/packageGenerator.js.map +1 -1
- package/lib/service/ObjectTranslationHandler.d.ts +6 -0
- package/lib/service/ObjectTranslationHandler.js +31 -0
- package/lib/service/ObjectTranslationHandler.js.map +1 -0
- package/lib/service/botHandler.d.ts +2 -2
- package/lib/service/botHandler.js +2 -2
- package/lib/service/botHandler.js.map +1 -1
- package/lib/service/customObjectHandler.js +1 -0
- package/lib/service/customObjectHandler.js.map +1 -1
- package/lib/service/inBundleHandler.js +1 -1
- package/lib/service/inBundleHandler.js.map +1 -1
- package/lib/service/inFileHandler.d.ts +3 -3
- package/lib/service/inFileHandler.js +26 -17
- package/lib/service/inFileHandler.js.map +1 -1
- package/lib/service/inResourceHandler.js +1 -6
- package/lib/service/inResourceHandler.js.map +1 -1
- package/lib/service/lwcHandler.d.ts +4 -0
- package/lib/service/lwcHandler.js +11 -0
- package/lib/service/lwcHandler.js.map +1 -0
- package/lib/service/sharedFolderHandler.d.ts +6 -0
- package/lib/service/{waveHandler.js → sharedFolderHandler.js} +7 -9
- package/lib/service/sharedFolderHandler.js.map +1 -0
- package/lib/service/standardHandler.js +3 -3
- package/lib/service/standardHandler.js.map +1 -1
- package/lib/service/subCustomObjectHandler.js +2 -1
- package/lib/service/subCustomObjectHandler.js.map +1 -1
- package/lib/service/typeHandlerFactory.js +17 -7
- package/lib/service/typeHandlerFactory.js.map +1 -1
- package/lib/utils/cliHelper.js +2 -2
- package/lib/utils/cliHelper.js.map +1 -1
- package/lib/utils/fsHelper.js +5 -1
- package/lib/utils/fsHelper.js.map +1 -1
- package/lib/utils/fxpHelper.d.ts +1 -0
- package/lib/utils/fxpHelper.js +6 -2
- package/lib/utils/fxpHelper.js.map +1 -1
- package/lib/utils/metadataConstants.d.ts +4 -3
- package/lib/utils/metadataConstants.js +7 -5
- package/lib/utils/metadataConstants.js.map +1 -1
- package/lib/utils/{fileGitDiff.d.ts → metadataDiff.d.ts} +7 -6
- package/lib/utils/metadataDiff.js +91 -0
- package/lib/utils/metadataDiff.js.map +1 -0
- package/lib/utils/packageHelper.d.ts +2 -9
- package/lib/utils/packageHelper.js +6 -15
- package/lib/utils/packageHelper.js.map +1 -1
- package/messages/delta.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +23 -25
- package/lib/service/inTranslationHandler.d.ts +0 -5
- package/lib/service/inTranslationHandler.js +0 -19
- package/lib/service/inTranslationHandler.js.map +0 -1
- package/lib/service/waveHandler.d.ts +0 -4
- package/lib/service/waveHandler.js.map +0 -1
- package/lib/utils/fileGitDiff.js +0 -102
- package/lib/utils/fileGitDiff.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
<!-- markdownlint-disable MD024 MD025 -->
|
|
2
|
+
<!-- markdown-link-check-disable -->
|
|
1
3
|
# Changelog
|
|
2
4
|
|
|
3
5
|
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.
|
|
4
6
|
|
|
7
|
+
## [5.18.1](https://github.com/scolladon/sfdx-git-delta/compare/v5.18.0...v5.18.1) (2023-05-11)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* handle `ModerationRule` and `KeywordList` with shared folder type ([#594](https://github.com/scolladon/sfdx-git-delta/issues/594)) ([770b1ba](https://github.com/scolladon/sfdx-git-delta/commit/770b1bab2a3cfcbcfb84223d427ac3679e851035))
|
|
13
|
+
|
|
14
|
+
## [5.18.0](https://github.com/scolladon/sfdx-git-delta/compare/v5.17.1...v5.18.0) (2023-04-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* extend metadata content pruning to more eligible types ([#533](https://github.com/scolladon/sfdx-git-delta/issues/533)) ([2576cf7](https://github.com/scolladon/sfdx-git-delta/commit/2576cf7e53f3a961b05267f11976a3146e51498a))
|
|
20
|
+
|
|
5
21
|
## [5.17.1](https://github.com/scolladon/sfdx-git-delta/compare/v5.17.0...v5.17.1) (2023-04-04)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -39,7 +55,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
39
55
|
|
|
40
56
|
### Bug Fixes
|
|
41
57
|
|
|
42
|
-
* keep
|
|
58
|
+
* keep attributes not subject to comparison ([#539](https://github.com/scolladon/sfdx-git-delta/issues/539)) ([08cf667](https://github.com/scolladon/sfdx-git-delta/commit/08cf6677b71d0b7f41d56e1ab8b437650d758dd1))
|
|
43
59
|
|
|
44
60
|
## [5.14.0](https://github.com/scolladon/sfdx-git-delta/compare/v5.13.3...v5.14.0) (2023-03-14)
|
|
45
61
|
|
|
@@ -318,7 +334,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
318
334
|
|
|
319
335
|
### Bug Fixes
|
|
320
336
|
|
|
321
|
-
* ignore white space parameter `--ignore-
|
|
337
|
+
* ignore white space parameter `--ignore-whitespace, -W` ([#267](https://github.com/scolladon/sfdx-git-delta/issues/267)) ([d9f560e](https://github.com/scolladon/sfdx-git-delta/commit/d9f560eb1af28b749c08af4018dd626fe4720222))
|
|
322
338
|
|
|
323
339
|
### [5.0.2](https://github.com/scolladon/sfdx-git-delta/compare/v5.0.1...v5.0.2) (2022-03-16)
|
|
324
340
|
|
|
@@ -338,7 +354,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
338
354
|
|
|
339
355
|
### Features
|
|
340
356
|
|
|
341
|
-
*
|
|
357
|
+
* decommission sgd ([#221](https://github.com/scolladon/sfdx-git-delta/issues/221)) ([ecd146f](https://github.com/scolladon/sfdx-git-delta/commit/ecd146f0e6480f68bbf08362e3a535c7f0fe24ba))
|
|
342
358
|
|
|
343
359
|
|
|
344
360
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- markdownlint-disable MD040 MD041 -->
|
|
1
2
|

|
|
2
3
|
[](https://badgen.net/npm/v/sfdx-git-delta)
|
|
3
4
|
[](https://codeclimate.com/github/scolladon/sfdx-git-delta/maintainability)
|
|
@@ -38,12 +39,12 @@
|
|
|
38
39
|
- [Walkthrough](#walkthrough)
|
|
39
40
|
- [Execute sgd](#execute-sgd)
|
|
40
41
|
- [Deploy the delta metadata](#deploy-the-delta-metadata)
|
|
41
|
-
- [Advanced use-cases
|
|
42
|
-
- [Generate a folder containing only the added/modified sources
|
|
43
|
-
- [Exclude some metadata only from destructiveChanges.xml
|
|
44
|
-
- [Explicitly including specific files for inclusion or destruction regardless of diff
|
|
42
|
+
- [Advanced use-cases](#advanced-use-cases)
|
|
43
|
+
- [Generate a folder containing only the added/modified sources](#generate-a-folder-containing-only-the-addedmodified-sources)
|
|
44
|
+
- [Exclude some metadata only from destructiveChanges.xml](#exclude-some-metadata-only-from-destructivechangesxml)
|
|
45
|
+
- [Explicitly including specific files for inclusion or destruction regardless of diff](#explicitly-including-specific-files-for-inclusion-or-destruction-regardless-of-diff)
|
|
45
46
|
- [Scoping delta generation to a specific folder](#scoping-delta-generation-to-a-specific-folder)
|
|
46
|
-
- [Generate a comma-separated list of the added and modified Apex classes
|
|
47
|
+
- [Generate a comma-separated list of the added and modified Apex classes](#generate-a-comma-separated-list-of-the-added-and-modified-apex-classes)
|
|
47
48
|
- [Condition deployment on package.xml and destructiveChange content](#condition-deployment-on-packagexml-and-destructivechange-content)
|
|
48
49
|
- [Use the module in your own node application](#use-the-module-in-your-own-node-application)
|
|
49
50
|
- [Changelog](#changelog)
|
|
@@ -78,7 +79,7 @@ sfdx force:source:deploy -x package/package.xml --postdestructivechanges destruc
|
|
|
78
79
|
|
|
79
80
|
Have a look at this post on the Salesforce Developers Blog to dive into it: [Optimizing Unpackaged Deployments Using a Delta Generation Tool](https://developer.salesforce.com/blogs/2021/01/optimizing-unpackaged-deployments-using-a-delta-generation-tool.html).
|
|
80
81
|
|
|
81
|
-

|
|
82
83
|
|
|
83
84
|
## Is SGD for you?
|
|
84
85
|
|
|
@@ -153,7 +154,7 @@ OPTIONS
|
|
|
153
154
|
|
|
154
155
|
-a, --api-version=api-version salesforce metadata API version,
|
|
155
156
|
default to sfdx-project.json
|
|
156
|
-
"sourceApiVersion"
|
|
157
|
+
"sourceApiVersion" attribute or
|
|
157
158
|
latest version
|
|
158
159
|
|
|
159
160
|
-d, --generate-delta generate delta files in [--output]
|
|
@@ -187,7 +188,7 @@ OPTIONS
|
|
|
187
188
|
this command invocation
|
|
188
189
|
```
|
|
189
190
|
|
|
190
|
-
_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/v5.
|
|
191
|
+
_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/v5.18.1/src/commands/sgd/source/delta.ts)_
|
|
191
192
|
<!-- commandsstop -->
|
|
192
193
|
|
|
193
194
|
### Windows users
|
|
@@ -209,7 +210,7 @@ sfdx sgd:source:delta --from "HEAD~1" # right git shortcut with windows because
|
|
|
209
210
|
### CI/CD specificity
|
|
210
211
|
|
|
211
212
|
In CI/CD pipelines, for most of the CI/CD providers, the checkout operation fetch only the last commit of the branch currently evaluated.
|
|
212
|
-
You need to fetch all the needed commits, as the plugin needs to have the branch to compare from as well,
|
|
213
|
+
You need to fetch all the needed commits, as the plugin needs to have the branch to compare from as well,
|
|
213
214
|
Example for Github action checkout [here](https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches).
|
|
214
215
|
|
|
215
216
|
In CI/CD pipelines, branches are not checked out locally when the repository is cloned, so you must specify the remote prefix.
|
|
@@ -240,21 +241,21 @@ Here are examples of how to compare the content of different branches:
|
|
|
240
241
|
- **Comparing between commits in different branches**
|
|
241
242
|
For example, if you have commit `fbc3ade6` in branch `develop` and commit `61f235b1` in branch `main`:
|
|
242
243
|
|
|
243
|
-
```
|
|
244
|
+
```sh
|
|
244
245
|
sfdx sgd:source:delta --to fbc3ade6 --from 61f235b1 --output .
|
|
245
246
|
```
|
|
246
247
|
|
|
247
248
|
- **Comparing branches (all changes)**
|
|
248
249
|
Comparing all changes between the `develop` branch and the `main` branch:
|
|
249
250
|
|
|
250
|
-
```
|
|
251
|
+
```sh
|
|
251
252
|
sfdx sgd:source:delta --to develop --from main --output .
|
|
252
253
|
```
|
|
253
254
|
|
|
254
255
|
- **Comparing branches (from a common ancestor)**
|
|
255
256
|
To compare the `develop` branch since its common ancestor with the `main` branch (i.e. ignoring the changes performed in the `main` branch after `develop` creation):
|
|
256
257
|
|
|
257
|
-
```
|
|
258
|
+
```sh
|
|
258
259
|
sfdx sgd:source:delta --to develop --from $(git merge-base develop main) --output .
|
|
259
260
|
```
|
|
260
261
|
|
|
@@ -271,7 +272,7 @@ In our example, the latest commit to main is composed of:
|
|
|
271
272
|
- _Apex Class modified:_ TestDataFactory
|
|
272
273
|
- _Apex Class deleted:_ AnotherTriggerFramework
|
|
273
274
|
|
|
274
|
-

|
|
275
276
|
|
|
276
277
|
In this situation, we would expect the CI pipeline to:
|
|
277
278
|
|
|
@@ -297,12 +298,12 @@ The `sfdx sgd:source:delta` command produces 2 useful artifacts:
|
|
|
297
298
|
**1) A `package.xml` file, inside a `package` folder.** This `package.xml` file contains just the added/changed metadata to deploy to the target org.
|
|
298
299
|
|
|
299
300
|
_Content of the `package.xml` file in our scenario:_
|
|
300
|
-

|
|
301
302
|
|
|
302
303
|
**2) A `destructiveChanges.xml` file, inside a `destructiveChanges` folder.** This `destructiveChanges.xml` file contains just the removed/renamed metadata to delete from the target org. Note: the `destructiveChanges` folder also contains a minimal package.xml file, because deploying destructive changes requires a package.xml (even an empty one).
|
|
303
304
|
|
|
304
305
|
_Content of the `destructiveChanges.xml` file in our scenario:_
|
|
305
|
-

|
|
306
307
|
|
|
307
308
|
Note: it is also possible to generate a **source** folder containing added/changed metadata with the [`--generate-delta (-d)`](#scoping-delta-generation-to-a-specific-folder) parameter. See the "Advanced use-cases" section for more examples.
|
|
308
309
|
|
|
@@ -340,9 +341,9 @@ echo "--- Deleting removed metadata ---"
|
|
|
340
341
|
sfdx force:mdapi:deploy -d destructiveChanges --ignorewarnings
|
|
341
342
|
```
|
|
342
343
|
|
|
343
|
-
## Advanced use-cases
|
|
344
|
+
## Advanced use-cases
|
|
344
345
|
|
|
345
|
-
### Generate a folder containing only the added/modified sources
|
|
346
|
+
### Generate a folder containing only the added/modified sources
|
|
346
347
|
|
|
347
348
|
Using a package.xml for deployment is the simplest approach to delta deployments. But in some cases you may want to have only the actual recently changed source files.
|
|
348
349
|
|
|
@@ -361,7 +362,7 @@ It generates the `package` and `destructiveChanges` folders, and copies added/ch
|
|
|
361
362
|
|
|
362
363
|
_Content of the output folder when using the --generate-delta option, with the same scenario as above:_
|
|
363
364
|
|
|
364
|
-

|
|
365
366
|
|
|
366
367
|
> ⚠️ Use `--generate-delta (-d)` when `--to (-t)` value is set to "HEAD" or to the "HEAD commit SHA".
|
|
367
368
|
> If you need to use it with `--to (-t)` pointing to another commit than "HEAD", checkout that commit first. Example:
|
|
@@ -379,7 +380,7 @@ Then it is possible to deploy the `change-sources` folder using `force:source:de
|
|
|
379
380
|
sfdx force:source:deploy -p change-sources
|
|
380
381
|
```
|
|
381
382
|
|
|
382
|
-
### Exclude some metadata only from destructiveChanges.xml
|
|
383
|
+
### Exclude some metadata only from destructiveChanges.xml
|
|
383
384
|
|
|
384
385
|
The `--ignore [-i]` parameter allows you to specify an [ignore file](https://git-scm.com/docs/gitignore) to filter the
|
|
385
386
|
element on the diff to ignore. SGD ignores every diff line matching the pattern from the ignore file specified in the `--ignore [-i]`. `package.xml` generation, `destructiveChanges.xml` generation and `--delta-generate` will ignore those lines.
|
|
@@ -404,7 +405,7 @@ $ sfdx sgd:source:delta --from commit --ignore-destructive destructiveignore
|
|
|
404
405
|
|
|
405
406
|
Note: when only using the `--ignore [-i]` parameter (and not `--ignore-destructive [-D]`) the plugin will apply it to added/changed/deleted elements.
|
|
406
407
|
|
|
407
|
-
### Explicitly including specific files for inclusion or destruction regardless of diff
|
|
408
|
+
### Explicitly including specific files for inclusion or destruction regardless of diff
|
|
408
409
|
|
|
409
410
|
The `--include [-n]` parameter allows you to specify a file based on [micromatch glob matching](https://github.com/micromatch/micromatch) to include specific files. Regardless whether they appears in the diff or not.
|
|
410
411
|
Like the `--ignore` flag, this file defines a list of glob file matchers to always include `git` aware files in the `package.xml` package.
|
|
@@ -454,9 +455,9 @@ $ sfdx sgd:source:delta --from commit --source force-app/unpackaged
|
|
|
454
455
|
```
|
|
455
456
|
|
|
456
457
|
> The ignored patterns specified using `--ignore [-i]` and `--ignore-destructive [-D]` still apply.
|
|
457
|
-
> The `--source` path
|
|
458
|
+
> The `--source` path must be relative to the `--repo` path
|
|
458
459
|
|
|
459
|
-
### Generate a comma-separated list of the added and modified Apex classes
|
|
460
|
+
### Generate a comma-separated list of the added and modified Apex classes
|
|
460
461
|
|
|
461
462
|
Depending on your testing strategy, [you may want to generate a comma-separated list of the added and modified Apex classes](https://github.com/scolladon/sfdx-git-delta/issues/126). This list can feed the `sfdx force:source:deploy --testlevel RunSpecifiedTests` command, for example.
|
|
462
463
|
To cover this need, parse the content of the package.xml file produced by SGD using [yq](https://github.com/kislyuk/yq):
|
|
@@ -512,7 +513,7 @@ console.log(JSON.stringify(work))
|
|
|
512
513
|
|
|
513
514
|
## Changelog
|
|
514
515
|
|
|
515
|
-
[changelog.md](
|
|
516
|
+
[changelog.md](CHANGELOG.md) is available for consultation.
|
|
516
517
|
|
|
517
518
|
## Built With
|
|
518
519
|
|
|
@@ -522,6 +523,7 @@ console.log(JSON.stringify(work))
|
|
|
522
523
|
- [lodash](https://github.com/lodash/lodash) - A modern JavaScript utility library delivering modularity, performance & extras.
|
|
523
524
|
- [micromatch](https://github.com/micromatch/micromatch) - a file glob matcher utility
|
|
524
525
|
- [xmlbuilder2](https://github.com/oozcitak/xmlbuilder2) - An XML builder for node.js.
|
|
526
|
+
- [MegaLinter](https://megalinter.io) - Open-Source tool for CI/CD workflows that analyzes the consistency of your code, IAC, configuration, and scripts
|
|
525
527
|
|
|
526
528
|
## Versioning
|
|
527
529
|
|
|
@@ -536,7 +538,7 @@ Versioning follows [SemVer](http://semver.org/) specification.
|
|
|
536
538
|
|
|
537
539
|
Contributions are what make the trailblazer community such an amazing place. I regard this component as a way to inspire and learn from others. Any contributions you make are **appreciated**.
|
|
538
540
|
|
|
539
|
-
See [contributing.md](
|
|
541
|
+
See [contributing.md](CONTRIBUTING.md) for sgd contribution principles.
|
|
540
542
|
|
|
541
543
|
## License
|
|
542
544
|
|