sfdx-git-delta 7.1.0 → 7.2.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.
Files changed (119) hide show
  1. package/README.md +11 -2
  2. package/lib/adapter/GitAdapter.d.ts +10 -2
  3. package/lib/adapter/GitAdapter.js +62 -84
  4. package/lib/adapter/GitAdapter.js.map +1 -1
  5. package/lib/adapter/ioExecutor.d.ts +1 -1
  6. package/lib/adapter/ioExecutor.js.map +1 -1
  7. package/lib/adapter/pathMatching.d.ts +9 -0
  8. package/lib/adapter/pathMatching.js +83 -0
  9. package/lib/adapter/pathMatching.js.map +1 -0
  10. package/lib/commands/sgd/source/delta.js.map +1 -1
  11. package/lib/main.d.ts +2 -2
  12. package/lib/main.js +63 -34
  13. package/lib/main.js.map +1 -1
  14. package/lib/post-processor/baseProcessor.d.ts +9 -6
  15. package/lib/post-processor/baseProcessor.js +5 -6
  16. package/lib/post-processor/baseProcessor.js.map +1 -1
  17. package/lib/post-processor/changesManifestProcessor.d.ts +3 -2
  18. package/lib/post-processor/changesManifestProcessor.js +5 -4
  19. package/lib/post-processor/changesManifestProcessor.js.map +1 -1
  20. package/lib/post-processor/flowTranslationProcessor.d.ts +8 -7
  21. package/lib/post-processor/flowTranslationProcessor.js +19 -17
  22. package/lib/post-processor/flowTranslationProcessor.js.map +1 -1
  23. package/lib/post-processor/includeProcessor.d.ts +6 -5
  24. package/lib/post-processor/includeProcessor.js +7 -6
  25. package/lib/post-processor/includeProcessor.js.map +1 -1
  26. package/lib/post-processor/packageGenerator.d.ts +3 -2
  27. package/lib/post-processor/packageGenerator.js +5 -4
  28. package/lib/post-processor/packageGenerator.js.map +1 -1
  29. package/lib/post-processor/postProcessorManager.d.ts +5 -7
  30. package/lib/post-processor/postProcessorManager.js +23 -31
  31. package/lib/post-processor/postProcessorManager.js.map +1 -1
  32. package/lib/service/botHandler.d.ts +1 -2
  33. package/lib/service/botHandler.js +17 -10
  34. package/lib/service/botHandler.js.map +1 -1
  35. package/lib/service/containedDecomposedHandler.d.ts +4 -5
  36. package/lib/service/containedDecomposedHandler.js +13 -12
  37. package/lib/service/containedDecomposedHandler.js.map +1 -1
  38. package/lib/service/customFieldHandler.d.ts +1 -2
  39. package/lib/service/customFieldHandler.js +7 -6
  40. package/lib/service/customFieldHandler.js.map +1 -1
  41. package/lib/service/customLabelHandler.d.ts +1 -2
  42. package/lib/service/customLabelHandler.js +3 -3
  43. package/lib/service/customLabelHandler.js.map +1 -1
  44. package/lib/service/customObjectHandler.d.ts +3 -4
  45. package/lib/service/customObjectHandler.js +10 -9
  46. package/lib/service/customObjectHandler.js.map +1 -1
  47. package/lib/service/decomposedHandler.d.ts +3 -4
  48. package/lib/service/decomposedHandler.js +5 -4
  49. package/lib/service/decomposedHandler.js.map +1 -1
  50. package/lib/service/diffLineInterpreter.d.ts +3 -3
  51. package/lib/service/diffLineInterpreter.js +18 -14
  52. package/lib/service/diffLineInterpreter.js.map +1 -1
  53. package/lib/service/flowHandler.d.ts +1 -2
  54. package/lib/service/flowHandler.js +9 -4
  55. package/lib/service/flowHandler.js.map +1 -1
  56. package/lib/service/inFileHandler.d.ts +8 -9
  57. package/lib/service/inFileHandler.js +24 -24
  58. package/lib/service/inFileHandler.js.map +1 -1
  59. package/lib/service/inFolderHandler.d.ts +4 -5
  60. package/lib/service/inFolderHandler.js +6 -5
  61. package/lib/service/inFolderHandler.js.map +1 -1
  62. package/lib/service/inResourceHandler.d.ts +4 -5
  63. package/lib/service/inResourceHandler.js +8 -7
  64. package/lib/service/inResourceHandler.js.map +1 -1
  65. package/lib/service/objectTranslationHandler.d.ts +1 -2
  66. package/lib/service/objectTranslationHandler.js +6 -5
  67. package/lib/service/objectTranslationHandler.js.map +1 -1
  68. package/lib/service/reportingFolderHandler.d.ts +6 -7
  69. package/lib/service/reportingFolderHandler.js +6 -6
  70. package/lib/service/reportingFolderHandler.js.map +1 -1
  71. package/lib/service/sharedFolderHandler.d.ts +4 -5
  72. package/lib/service/sharedFolderHandler.js +6 -6
  73. package/lib/service/sharedFolderHandler.js.map +1 -1
  74. package/lib/service/standardHandler.d.ts +5 -9
  75. package/lib/service/standardHandler.js +28 -35
  76. package/lib/service/standardHandler.js.map +1 -1
  77. package/lib/service/typeHandlerFactory.d.ts +3 -3
  78. package/lib/service/typeHandlerFactory.js +6 -6
  79. package/lib/service/typeHandlerFactory.js.map +1 -1
  80. package/lib/types/config.d.ts +5 -1
  81. package/lib/types/handlerResult.d.ts +7 -7
  82. package/lib/types/handlerResult.js +10 -1
  83. package/lib/types/handlerResult.js.map +1 -1
  84. package/lib/types/work.d.ts +1 -1
  85. package/lib/utils/arrayUtils.d.ts +1 -1
  86. package/lib/utils/arrayUtils.js.map +1 -1
  87. package/lib/utils/bundleRollup.d.ts +6 -0
  88. package/lib/utils/bundleRollup.js +62 -0
  89. package/lib/utils/bundleRollup.js.map +1 -0
  90. package/lib/utils/changeSet.d.ts +12 -15
  91. package/lib/utils/changeSet.js +23 -120
  92. package/lib/utils/changeSet.js.map +1 -1
  93. package/lib/utils/changesAssembly.d.ts +8 -0
  94. package/lib/utils/changesAssembly.js +21 -0
  95. package/lib/utils/changesAssembly.js.map +1 -0
  96. package/lib/utils/configValidator.d.ts +7 -6
  97. package/lib/utils/configValidator.js +32 -11
  98. package/lib/utils/configValidator.js.map +1 -1
  99. package/lib/utils/fsHelper.d.ts +2 -1
  100. package/lib/utils/fsHelper.js +7 -3
  101. package/lib/utils/fsHelper.js.map +1 -1
  102. package/lib/utils/messageSanitizer.d.ts +1 -0
  103. package/lib/utils/messageSanitizer.js +48 -0
  104. package/lib/utils/messageSanitizer.js.map +1 -0
  105. package/lib/utils/pathspec.d.ts +15 -0
  106. package/lib/utils/pathspec.js +71 -0
  107. package/lib/utils/pathspec.js.map +1 -0
  108. package/lib/utils/renameResolver.d.ts +6 -6
  109. package/lib/utils/renameResolver.js +10 -9
  110. package/lib/utils/renameResolver.js.map +1 -1
  111. package/lib/utils/repoGitDiff.d.ts +2 -0
  112. package/lib/utils/repoGitDiff.js +14 -1
  113. package/lib/utils/repoGitDiff.js.map +1 -1
  114. package/messages/delta.md +26 -0
  115. package/oclif.manifest.json +2 -2
  116. package/package.json +16 -15
  117. package/lib/post-processor/bundleRollupProcessor.d.ts +0 -7
  118. package/lib/post-processor/bundleRollupProcessor.js +0 -81
  119. package/lib/post-processor/bundleRollupProcessor.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfdx-git-delta",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "Generate the sfdx content in source format and destructive change from two git commits",
5
5
  "keywords": [
6
6
  "salesforce",
@@ -14,12 +14,12 @@
14
14
  "sf-plugin"
15
15
  ],
16
16
  "engines": {
17
- "node": ">=22.22.1"
17
+ "node": ">=22.22.1",
18
+ "npm": ">=12"
18
19
  },
19
20
  "files": [
20
21
  "/lib",
21
22
  "/messages",
22
- "/npm-shrinkwrap.json",
23
23
  "/oclif.lock",
24
24
  "/oclif.manifest.json"
25
25
  ],
@@ -48,32 +48,33 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@oclif/core": "4.13.2",
52
- "@salesforce/core": "^9.1.0",
51
+ "@oclif/core": "4.13.3",
52
+ "@salesforce/core": "9.1.0",
53
53
  "@salesforce/sf-plugins-core": "13.0.0",
54
54
  "@salesforce/source-deploy-retrieve": "13.0.1",
55
- "@scolladon/tsgit": "^3.2.1",
55
+ "@scolladon/tsgit": "3.2.1",
56
56
  "ignore": "7.0.6",
57
57
  "txml": "6.0.0",
58
58
  "zod": "4.4.3"
59
59
  },
60
60
  "devDependencies": {
61
- "@biomejs/biome": "2.5.6",
61
+ "@biomejs/biome": "2.5.7",
62
62
  "@commitlint/cli": "21.2.1",
63
63
  "@commitlint/config-conventional": "21.2.0",
64
64
  "@ls-lint/ls-lint": "2.3.1",
65
- "@oclif/plugin-help": "6.2.55",
66
- "@salesforce/cli-plugins-testkit": "5.3.64",
65
+ "@oclif/plugin-help": "6.2.56",
66
+ "@salesforce/cli-plugins-testkit": "5.3.65",
67
67
  "@salesforce/dev-config": "4.3.3",
68
68
  "@stryker-mutator/core": "9.6.1",
69
69
  "@stryker-mutator/vitest-runner": "9.6.1",
70
70
  "@types/node": "26.1.2",
71
71
  "@vitest/coverage-v8": "4.1.10",
72
72
  "husky": "9.1.7",
73
- "knip": "6.31.0",
73
+ "knip": "6.32.0",
74
74
  "lint-staged": "17.3.0",
75
75
  "ls-engines": "0.10.1",
76
- "oclif": "4.23.29",
76
+ "oclif": "4.23.30",
77
+ "pkg-pr-new": "0.0.87",
77
78
  "shx": "0.4.0",
78
79
  "ts-node": "10.9.2",
79
80
  "typescript": "7.0.2",
@@ -87,6 +88,9 @@
87
88
  },
88
89
  "filelist": {
89
90
  "minimatch": "^10.1.2"
91
+ },
92
+ "typed-rest-client": {
93
+ "qs": "^6.15.3"
90
94
  }
91
95
  },
92
96
  "scripts": {
@@ -96,9 +100,6 @@
96
100
  "clean:package-manager": "wireit",
97
101
  "dependencies:reinstall": "npm install",
98
102
  "dependencies:upgrade": "npx npm-check-updates -u ; npm install ; npm audit fix",
99
- "devops:cleanup:dev-tag": "./tooling/devops-cleanup.sh",
100
- "devops:cleanup:dev-tag:all": "./tooling/devops-cleanup-all.sh",
101
- "devops:move-tag": "./tooling/devops-movetag.sh",
102
103
  "lint:dependencies": "wireit",
103
104
  "lint:engine": "wireit",
104
105
  "lint:fs": "wireit",
@@ -107,7 +108,7 @@
107
108
  "postpack": "shx rm -f oclif.manifest.json && shx sed -i 'blob/v[^/]*/' 'blob/main/' README.md",
108
109
  "prepack": "wireit",
109
110
  "prepare": "husky",
110
- "prepublishOnly": "shx cp package-lock.json npm-shrinkwrap.json",
111
+ "preview:publish": "pkg-pr-new publish --comment=off",
111
112
  "sync:registry": "TS_NODE_COMPILER_OPTIONS='{\"rootDir\":\".\"}' node --loader ts-node/esm tooling/syncInternalRegistryWithSdr.ts",
112
113
  "test:build": "wireit",
113
114
  "test:functional": "wireit",
@@ -1,7 +0,0 @@
1
- import BaseProcessor from './baseProcessor.js';
2
- export default class BundleRollupProcessor extends BaseProcessor {
3
- process(): Promise<void>;
4
- private _collectBundleMembers;
5
- private _isCoveredByBundle;
6
- private _warnBundleDeletions;
7
- }
@@ -1,81 +0,0 @@
1
- 'use strict';
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- import { DOT } from '../constant/fsConstants.js';
9
- import { DIGITAL_EXPERIENCE_BUNDLE_TYPE, DIGITAL_EXPERIENCE_TYPE, } from '../constant/metadataConstants.js';
10
- import { ManifestTarget } from '../types/handlerResult.js';
11
- import { log } from '../utils/LoggingDecorator.js';
12
- import { MessageService } from '../utils/MessageService.js';
13
- import BaseProcessor from './baseProcessor.js';
14
- // Generic shape (one concrete pair today): a parent metadata type whose
15
- // member subsumes every child of the same site/bundle in the deploy contract.
16
- // For DigitalExperienceBundle → DigitalExperience, a DEB member deploys (or
17
- // deletes) every DE child, so DE entries covered by a same-manifest DEB are
18
- // redundant. This processor collapses them per manifest and — because a
19
- // whole-bundle deletion is org-gated — warns when a DEB lands in
20
- // destructiveChanges. When a second parent/child pair appears, generalize to
21
- // a `BundleRollupProcessor` that takes a list of (parentType, childType,
22
- // parentMemberOf) configs; until then we keep the implementation focused on
23
- // the only pair we have empirical deploy semantics for.
24
- export default class BundleRollupProcessor extends BaseProcessor {
25
- async process() {
26
- const elements = this.work.changes.toElements();
27
- const bundleMembersByTarget = this._collectBundleMembers(elements);
28
- for (const element of elements) {
29
- if (
30
- // Stryker disable next-line ConditionalExpression -- equivalent: flipping the type guard to `true` would also attempt to remove non-DE elements covered by a same-prefix bundle member, but `ChangeSet.removeMember` is a no-op for non-shrinkable types — so the post-process manifest is byte-identical to the original.
31
- element.type === DIGITAL_EXPERIENCE_TYPE &&
32
- this._isCoveredByBundle(element, bundleMembersByTarget)) {
33
- this.work.changes.removeMember(element.target, element.type, element.member);
34
- }
35
- }
36
- this._warnBundleDeletions(bundleMembersByTarget.get(ManifestTarget.DestructiveChanges));
37
- }
38
- _collectBundleMembers(elements) {
39
- const bundleMembersByTarget = new Map();
40
- for (const { target, type, member } of elements) {
41
- if (type !== DIGITAL_EXPERIENCE_BUNDLE_TYPE)
42
- continue;
43
- let members = bundleMembersByTarget.get(target);
44
- if (!members) {
45
- members = new Set();
46
- bundleMembersByTarget.set(target, members);
47
- }
48
- members.add(member);
49
- }
50
- return bundleMembersByTarget;
51
- }
52
- _isCoveredByBundle(element, bundleMembersByTarget) {
53
- const bundleMembers = bundleMembersByTarget.get(element.target);
54
- if (!bundleMembers)
55
- return false;
56
- // A canonical `DigitalExperience` member is `<base>/<space>.<ct>/<cn>` and
57
- // `<space>` (a Salesforce API name) cannot contain `.`, so the first `.`
58
- // delimits the parent bundle's member exactly. One Set lookup vs. an
59
- // `O(B)` linear `startsWith` scan over `bundleMembers`.
60
- const dotIdx = element.member.indexOf(DOT);
61
- // Stryker disable next-line ConditionalExpression,EqualityOperator,BlockStatement,BooleanLiteral -- equivalent/defensive: `BundleHandler.getElementDescriptor` constructs every `DigitalExperience` member as `<base>/<space>.<ct>/<cn>`, so a dotless member cannot reach this branch from the production pipeline.
62
- /* v8 ignore next -- defensive: a DigitalExperience member without `.` is unreachable in production */
63
- if (dotIdx < 0)
64
- return false;
65
- return bundleMembers.has(element.member.slice(0, dotIdx));
66
- }
67
- _warnBundleDeletions(bundleMembers) {
68
- if (!bundleMembers)
69
- return;
70
- const message = new MessageService();
71
- for (const bundleMember of bundleMembers) {
72
- this.work.warnings.push(new Error(message.getMessage('warning.DigitalExperienceBundleDeletion', [
73
- bundleMember,
74
- ])));
75
- }
76
- }
77
- }
78
- __decorate([
79
- log
80
- ], BundleRollupProcessor.prototype, "process", null);
81
- //# sourceMappingURL=bundleRollupProcessor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundleRollupProcessor.js","sourceRoot":"","sources":["../../src/post-processor/bundleRollupProcessor.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;AAEZ,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAA;AAChD,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3D,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,wEAAwE;AACxE,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,wEAAwE;AACxE,iEAAiE;AACjE,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,wDAAwD;AACxD,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,aAAa;IAExC,AAAN,KAAK,CAAC,OAAO;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;QAC/C,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAA;QAElE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B;YACE,2TAA2T;YAC3T,OAAO,CAAC,IAAI,KAAK,uBAAuB;gBACxC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,CAAC,EACvD,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY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