sfdx-git-delta 7.4.1 → 7.4.3
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 +15 -2
- package/lib/constant/metadataConstants.d.ts +5 -0
- package/lib/constant/metadataConstants.js +22 -1
- package/lib/constant/metadataConstants.js.map +1 -1
- package/lib/main.js +13 -0
- package/lib/main.js.map +1 -1
- package/lib/post-processor/changesManifestProcessor.js +14 -1
- package/lib/post-processor/changesManifestProcessor.js.map +1 -1
- package/lib/utils/changeSet.d.ts +7 -0
- package/lib/utils/changeSet.js +112 -41
- package/lib/utils/changeSet.js.map +1 -1
- package/lib/utils/ignoreHelper.js +0 -5
- package/lib/utils/ignoreHelper.js.map +1 -1
- package/lib/utils/metadataBoundaryResolver.d.ts +4 -0
- package/lib/utils/metadataBoundaryResolver.js +40 -29
- package/lib/utils/metadataBoundaryResolver.js.map +1 -1
- package/lib/utils/metadataDiff/deepEqualJson.js +51 -44
- package/lib/utils/metadataDiff/deepEqualJson.js.map +1 -1
- package/lib/utils/metadataDiff/xmlEventReader.js +59 -49
- package/lib/utils/metadataDiff/xmlEventReader.js.map +1 -1
- package/lib/utils/renameResolver.d.ts +7 -3
- package/lib/utils/renameResolver.js +19 -7
- package/lib/utils/renameResolver.js.map +1 -1
- package/lib/utils/repoGitDiff.d.ts +3 -0
- package/lib/utils/repoGitDiff.js +66 -53
- package/lib/utils/repoGitDiff.js.map +1 -1
- package/lib/utils/treeIndexScope.js +20 -23
- package/lib/utils/treeIndexScope.js.map +1 -1
- package/messages/delta.md +4 -0
- package/oclif.manifest.json +1 -1
- package/package.json +8 -8
package/lib/utils/repoGitDiff.js
CHANGED
|
@@ -41,69 +41,74 @@ export default class RepoGitDiff {
|
|
|
41
41
|
* getRenamePairs() once iteration completes.
|
|
42
42
|
*/
|
|
43
43
|
async *getLines() {
|
|
44
|
-
this.
|
|
45
|
-
this.diffScopeVerdict.changesSeen = 0;
|
|
46
|
-
this.diffScopeVerdict.linesYielded = 0;
|
|
47
|
-
this.probeFailure = undefined;
|
|
44
|
+
this._resetRunState();
|
|
48
45
|
const ignoreHelper = await buildIgnoreHelper(this.config);
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
const pending = {
|
|
47
|
+
additionNames: new Set(),
|
|
48
|
+
heldAdditionNames: new Set(),
|
|
49
|
+
deferredDeletions: [],
|
|
50
|
+
};
|
|
52
51
|
for await (const rawLine of this.gitAdapter.streamDiffLines({
|
|
53
52
|
spec: this.diffSpec(),
|
|
54
53
|
verdict: this.diffScopeVerdict,
|
|
55
54
|
scopes: this.config.source,
|
|
56
55
|
})) {
|
|
57
56
|
for (const expanded of this._expandRename(rawLine)) {
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
// Stryker disable next-line ConditionalExpression -- equivalent: see v8 ignore — _expandRename emits paths that are routed through the metadata index by the producing test fixtures, so the false-flip (always continue) is unreachable when the test corpus is in use
|
|
62
|
-
/* v8 ignore next -- defensive: upstream RepoGitDiff already filters non-metadata paths via _expandRename, but kept as safety net */
|
|
63
|
-
if (!this.metadata.has(expanded))
|
|
64
|
-
continue;
|
|
65
|
-
const kept = ignoreHelper.keep(expanded);
|
|
66
|
-
if (expanded.startsWith(ADDITION)) {
|
|
67
|
-
const name = this._extractComparisonName(expanded);
|
|
68
|
-
// An ignored addition is held rather than dropped: it may be the
|
|
69
|
-
// destination of a move into the ignore set, which can only be
|
|
70
|
-
// told from a stale copy once the whole diff has been seen.
|
|
71
|
-
if (!kept) {
|
|
72
|
-
heldAdditionNames.add(name);
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
additionNames.add(name);
|
|
76
|
-
yield expanded;
|
|
77
|
-
}
|
|
78
|
-
else if (!kept) {
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
else if (expanded.startsWith(DELETION)) {
|
|
82
|
-
// Defer: the D line might cancel against an A line we haven't
|
|
83
|
-
// seen yet (rename-collapse case).
|
|
84
|
-
deferredDeletions.push({
|
|
85
|
-
line: expanded,
|
|
86
|
-
name: this._extractComparisonName(expanded),
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
yield expanded;
|
|
91
|
-
}
|
|
57
|
+
const streamable = this._routeLine(expanded, ignoreHelper, pending);
|
|
58
|
+
if (streamable !== undefined)
|
|
59
|
+
yield streamable;
|
|
92
60
|
}
|
|
93
61
|
}
|
|
94
|
-
const vouching = await this._vouchingHeldNames(heldAdditionNames, deferredDeletions, additionNames, ignoreHelper);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
// line a debug run cannot explain why a destructive entry is missing.
|
|
98
|
-
Logger.debug(lazy `getLines: held addition(s) '${[...vouching].join("', '")}' survive only under ignored paths at '${this.config.to}', cancelling their deletions`);
|
|
99
|
-
}
|
|
100
|
-
for (const name of vouching)
|
|
101
|
-
additionNames.add(name);
|
|
102
|
-
for (const { line, name } of deferredDeletions) {
|
|
103
|
-
if (!additionNames.has(name))
|
|
62
|
+
const vouching = await this._vouchingHeldNames(pending.heldAdditionNames, pending.deferredDeletions, pending.additionNames, ignoreHelper);
|
|
63
|
+
for (const { line, name } of pending.deferredDeletions) {
|
|
64
|
+
if (!pending.additionNames.has(name) && !vouching.has(name))
|
|
104
65
|
yield line;
|
|
105
66
|
}
|
|
106
67
|
}
|
|
68
|
+
_resetRunState() {
|
|
69
|
+
this.renamePairs = [];
|
|
70
|
+
this.diffScopeVerdict.changesSeen = 0;
|
|
71
|
+
this.diffScopeVerdict.linesYielded = 0;
|
|
72
|
+
this.probeFailure = undefined;
|
|
73
|
+
}
|
|
74
|
+
// Returns the line when it streams right away, and records what the
|
|
75
|
+
// cancellation rule needs into `pending`: every addition name (held when
|
|
76
|
+
// ignored) and every kept deletion. Routing and recording share one pass
|
|
77
|
+
// because the generator must decide per line whether to yield it now.
|
|
78
|
+
_routeLine(expanded, ignoreHelper, pending) {
|
|
79
|
+
// Stryker disable next-line ConditionalExpression -- equivalent: on the false-flip an empty line reaches metadata.has, which rejects it, so the line is dropped (return undefined) either way
|
|
80
|
+
if (!expanded)
|
|
81
|
+
return undefined;
|
|
82
|
+
if (!this.metadata.has(expanded))
|
|
83
|
+
return undefined;
|
|
84
|
+
if (expanded.startsWith(ADDITION)) {
|
|
85
|
+
return this._routeAddition(expanded, ignoreHelper, pending);
|
|
86
|
+
}
|
|
87
|
+
if (!ignoreHelper.keep(expanded))
|
|
88
|
+
return undefined;
|
|
89
|
+
if (!expanded.startsWith(DELETION))
|
|
90
|
+
return expanded;
|
|
91
|
+
// Defer: the D line might cancel against an A line we haven't
|
|
92
|
+
// seen yet (rename-collapse case).
|
|
93
|
+
pending.deferredDeletions.push({
|
|
94
|
+
line: expanded,
|
|
95
|
+
name: this._extractComparisonName(expanded),
|
|
96
|
+
});
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
// An ignored addition is held rather than dropped: it may be the
|
|
100
|
+
// destination of a move into the ignore set, which can only be
|
|
101
|
+
// told from a stale copy once the whole diff has been seen.
|
|
102
|
+
_routeAddition(addition, ignoreHelper, pending) {
|
|
103
|
+
const kept = ignoreHelper.keep(addition);
|
|
104
|
+
const name = this._extractComparisonName(addition);
|
|
105
|
+
if (!kept) {
|
|
106
|
+
pending.heldAdditionNames.add(name);
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
pending.additionNames.add(name);
|
|
110
|
+
return addition;
|
|
111
|
+
}
|
|
107
112
|
getRenamePairs() {
|
|
108
113
|
return this.renamePairs;
|
|
109
114
|
}
|
|
@@ -135,8 +140,10 @@ export default class RepoGitDiff {
|
|
|
135
140
|
yield `${DELETION}${TAB}${fromPath}`;
|
|
136
141
|
yield `${ADDITION}${TAB}${toPath}`;
|
|
137
142
|
}
|
|
143
|
+
// Locale-invariant on purpose: a locale-sensitive fold makes the
|
|
144
|
+
// cancellation key depend on the machine that ran the diff.
|
|
138
145
|
_extractComparisonName(line) {
|
|
139
|
-
return this.metadata.getFullyQualifiedName(line).
|
|
146
|
+
return this.metadata.getFullyQualifiedName(line).toLowerCase();
|
|
140
147
|
}
|
|
141
148
|
// A held name vouches for its component only when nothing of that
|
|
142
149
|
// component is visible at `to`: a component still alive under an
|
|
@@ -152,7 +159,13 @@ export default class RepoGitDiff {
|
|
|
152
159
|
if (candidates.size === 0)
|
|
153
160
|
return candidates;
|
|
154
161
|
const visible = await this._visibleNamesAtTo(candidates, ignoreHelper);
|
|
155
|
-
|
|
162
|
+
const vouching = new Set([...candidates].filter(name => !visible.has(name)));
|
|
163
|
+
if (vouching.size > 0) {
|
|
164
|
+
// A cancelled deletion appears in neither manifest, so without this
|
|
165
|
+
// line a debug run cannot explain why a destructive entry is missing.
|
|
166
|
+
Logger.debug(lazy `getLines: held addition(s) '${[...vouching].join("', '")}' survive only under ignored paths at '${this.config.to}', cancelling their deletions`);
|
|
167
|
+
}
|
|
168
|
+
return vouching;
|
|
156
169
|
}
|
|
157
170
|
// Visibility is decided by the global ignore, never the destructive one:
|
|
158
171
|
// the question is whether sgd would still treat a file of the component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repoGitDiff.js","sourceRoot":"","sources":["../../src/utils/repoGitDiff.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,UAGN,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAIzE,OAAO,EAAE,iBAAiB,EAAqB,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"repoGitDiff.js","sourceRoot":"","sources":["../../src/utils/repoGitDiff.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,UAGN,MAAM,0BAA0B,CAAA;A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|
|
3
3
|
import { GIT_DIFF_TYPE_REGEX } from '../constant/gitConstants.js';
|
|
4
|
-
import { CONTENT_CONTAINER_ADAPTERS } from '../constant/metadataConstants.js';
|
|
4
|
+
import { CONTENT_CONTAINER_ADAPTERS, DASHBOARD_TYPE, OBJECT_TYPE, PERMISSIONSET_TYPE, REPORT_TYPE, } from '../constant/metadataConstants.js';
|
|
5
5
|
const TREE_INDEX_XML_NAMES = new Set([
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
OBJECT_TYPE,
|
|
7
|
+
DASHBOARD_TYPE,
|
|
8
|
+
REPORT_TYPE,
|
|
9
9
|
'AuraDefinitionBundle',
|
|
10
10
|
'LightningComponentBundle',
|
|
11
11
|
'GenAiFunction',
|
|
12
|
-
|
|
12
|
+
PERMISSIONSET_TYPE,
|
|
13
13
|
'Territory2Model',
|
|
14
14
|
]);
|
|
15
15
|
const needsTreeIndex = (type) => {
|
|
@@ -42,28 +42,25 @@ const scopeForType = (parts, type) => {
|
|
|
42
42
|
return null;
|
|
43
43
|
return parts.slice(0, dirIndex + 1).join(PATH_SEP);
|
|
44
44
|
};
|
|
45
|
+
// A child type (parentXmlName) is indexed through its parent: the parent's
|
|
46
|
+
// type directory is the one the index must cover.
|
|
47
|
+
const scopeForLine = (line, metadata, parentIndex) => {
|
|
48
|
+
const path = line.replace(GIT_DIFF_TYPE_REGEX, '');
|
|
49
|
+
const type = metadata.get(path);
|
|
50
|
+
if (!type)
|
|
51
|
+
return null;
|
|
52
|
+
const indexedType = type.parentXmlName
|
|
53
|
+
? parentIndex.get(type.parentXmlName)
|
|
54
|
+
: type;
|
|
55
|
+
if (!indexedType || !needsTreeIndex(indexedType))
|
|
56
|
+
return null;
|
|
57
|
+
return scopeForType(path.split(PATH_SEP), indexedType);
|
|
58
|
+
};
|
|
45
59
|
export const computeTreeIndexScope = (lines, metadata) => {
|
|
46
60
|
const scope = new Set();
|
|
47
61
|
const parentIndex = buildParentIndex(metadata);
|
|
48
62
|
for (const line of lines) {
|
|
49
|
-
const
|
|
50
|
-
const type = metadata.get(path);
|
|
51
|
-
if (!type)
|
|
52
|
-
continue;
|
|
53
|
-
const parts = path.split(PATH_SEP);
|
|
54
|
-
if (type.parentXmlName) {
|
|
55
|
-
const parent = parentIndex.get(type.parentXmlName);
|
|
56
|
-
if (parent && needsTreeIndex(parent)) {
|
|
57
|
-
const result = scopeForType(parts, parent);
|
|
58
|
-
if (result) {
|
|
59
|
-
scope.add(result);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
if (!needsTreeIndex(type))
|
|
65
|
-
continue;
|
|
66
|
-
const result = scopeForType(parts, type);
|
|
63
|
+
const result = scopeForLine(line, metadata, parentIndex);
|
|
67
64
|
if (result) {
|
|
68
65
|
scope.add(result);
|
|
69
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeIndexScope.js","sourceRoot":"","sources":["../../src/utils/treeIndexScope.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"treeIndexScope.js","sourceRoot":"","sources":["../../src/utils/treeIndexScope.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EACL,0BAA0B,EAC1B,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,WAAW,GACZ,MAAM,kCAAkC,CAAA;AAIzC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC;IACnC,WAAW;IACX,cAAc;IACd,WAAW;IACX,sBAAsB;IACtB,0BAA0B;IAC1B,eAAe;IACf,kBAAkB;IAClB,i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C5B,WAAkC,EACnB,EAAE;IACjB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAA;IAClD,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IAEtB,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa;QACpC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC;QACrC,CAAC,CAAC,IAAI,CAAA;IACR,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;QAAE,OAAO,IAAI,CAAA;IAE7D,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAA;AACxD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,KAAuB,EACvB,QAA4B,EACf,EAAE;IACf,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAA;IAC/B,MAAM,WAAW,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IAE9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;QACxD,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
package/messages/delta.md
CHANGED
|
@@ -186,3 +186,7 @@ Could not read the file list at '%s', so %s component(s) moved into an ignored d
|
|
|
186
186
|
# warning.TreeIndexUnavailable
|
|
187
187
|
|
|
188
188
|
Could not build the file tree index for '%s', so components that still exist there may be listed in destructiveChanges.xml as deleted. Check that the commit's tree objects are present locally (a partial clone created with --filter may not have them).
|
|
189
|
+
|
|
190
|
+
# warning.UndeletableComponentsOmitted
|
|
191
|
+
|
|
192
|
+
The Metadata API cannot delete '%s' components, so destructiveChanges.xml omits '%s'. Remove them from the target org manually in Setup.
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sfdx-git-delta",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.3",
|
|
4
4
|
"description": "Generate the sfdx content in source format and destructive change from two git commits",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"salesforce",
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@oclif/core": "5.0.0",
|
|
52
|
-
"@salesforce/core": "9.
|
|
52
|
+
"@salesforce/core": "9.2.0",
|
|
53
53
|
"@salesforce/sf-plugins-core": "13.0.4",
|
|
54
|
-
"@salesforce/source-deploy-retrieve": "13.
|
|
54
|
+
"@salesforce/source-deploy-retrieve": "13.4.0",
|
|
55
55
|
"@scolladon/tsgit": "4.0.0",
|
|
56
56
|
"ignore": "7.0.9",
|
|
57
57
|
"txml": "6.0.3",
|
|
58
58
|
"zod": "4.6.5"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@biomejs/biome": "2.5.
|
|
61
|
+
"@biomejs/biome": "2.5.14",
|
|
62
62
|
"@commitlint/cli": "21.2.2",
|
|
63
63
|
"@commitlint/config-conventional": "21.2.2",
|
|
64
64
|
"@ls-lint/ls-lint": "2.3.1",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"@salesforce/dev-config": "4.3.3",
|
|
68
68
|
"@stryker-mutator/core": "10.0.0",
|
|
69
69
|
"@stryker-mutator/vitest-runner": "10.0.0",
|
|
70
|
-
"@types/node": "26.
|
|
71
|
-
"@vitest/coverage-v8": "5.0.
|
|
70
|
+
"@types/node": "26.6.1",
|
|
71
|
+
"@vitest/coverage-v8": "5.0.1",
|
|
72
72
|
"husky": "9.1.7",
|
|
73
|
-
"knip": "6.
|
|
73
|
+
"knip": "6.37.0",
|
|
74
74
|
"lint-staged": "17.5.1",
|
|
75
75
|
"ls-engines": "0.10.1",
|
|
76
76
|
"oclif": "6.0.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"shx": "0.4.0",
|
|
79
79
|
"typescript": "7.0.2",
|
|
80
80
|
"validate-branch-name": "1.3.2",
|
|
81
|
-
"vitest": "5.0.
|
|
81
|
+
"vitest": "5.0.1",
|
|
82
82
|
"wireit": "0.14.13"
|
|
83
83
|
},
|
|
84
84
|
"overrides": {
|