sfdx-git-delta 6.41.2 → 6.43.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.
- package/README.md +35 -2
- package/lib/adapter/GitAdapter.d.ts +51 -2
- package/lib/adapter/GitAdapter.js +367 -41
- package/lib/adapter/GitAdapter.js.map +1 -1
- package/lib/adapter/gitBatchCatFile.d.ts +26 -4
- package/lib/adapter/gitBatchCatFile.js +128 -44
- package/lib/adapter/gitBatchCatFile.js.map +1 -1
- package/lib/adapter/gitBlobReader.d.ts +58 -0
- package/lib/adapter/gitBlobReader.js +27 -0
- package/lib/adapter/gitBlobReader.js.map +1 -0
- package/lib/adapter/ioExecutor.d.ts +18 -6
- package/lib/adapter/ioExecutor.js +97 -12
- package/lib/adapter/ioExecutor.js.map +1 -1
- package/lib/commands/sgd/source/delta.d.ts +2 -0
- package/lib/commands/sgd/source/delta.js +31 -1
- package/lib/commands/sgd/source/delta.js.map +1 -1
- package/lib/constant/cliConstants.d.ts +2 -0
- package/lib/constant/cliConstants.js +4 -0
- package/lib/constant/cliConstants.js.map +1 -1
- package/lib/constant/gitConstants.d.ts +1 -0
- package/lib/constant/gitConstants.js +4 -0
- package/lib/constant/gitConstants.js.map +1 -1
- package/lib/main.js +35 -7
- package/lib/main.js.map +1 -1
- package/lib/metadata/MetadataRepositoryImpl.d.ts +1 -0
- package/lib/metadata/MetadataRepositoryImpl.js +14 -2
- package/lib/metadata/MetadataRepositoryImpl.js.map +1 -1
- package/lib/post-processor/changesManifestProcessor.d.ts +15 -0
- package/lib/post-processor/changesManifestProcessor.js +50 -0
- package/lib/post-processor/changesManifestProcessor.js.map +1 -0
- package/lib/post-processor/flowTranslationProcessor.d.ts +31 -14
- package/lib/post-processor/flowTranslationProcessor.js +146 -51
- package/lib/post-processor/flowTranslationProcessor.js.map +1 -1
- package/lib/post-processor/packageGenerator.d.ts +1 -2
- package/lib/post-processor/packageGenerator.js +23 -34
- package/lib/post-processor/packageGenerator.js.map +1 -1
- package/lib/post-processor/postProcessorManager.js +9 -6
- package/lib/post-processor/postProcessorManager.js.map +1 -1
- package/lib/service/botHandler.d.ts +2 -1
- package/lib/service/botHandler.js +4 -3
- package/lib/service/botHandler.js.map +1 -1
- package/lib/service/containedDecomposedHandler.d.ts +3 -2
- package/lib/service/containedDecomposedHandler.js +6 -6
- package/lib/service/containedDecomposedHandler.js.map +1 -1
- package/lib/service/customFieldHandler.d.ts +2 -1
- package/lib/service/customFieldHandler.js +2 -2
- package/lib/service/customFieldHandler.js.map +1 -1
- package/lib/service/customLabelHandler.d.ts +2 -1
- package/lib/service/customLabelHandler.js +3 -3
- package/lib/service/customLabelHandler.js.map +1 -1
- package/lib/service/customObjectHandler.d.ts +2 -1
- package/lib/service/customObjectHandler.js +2 -2
- package/lib/service/customObjectHandler.js.map +1 -1
- package/lib/service/decomposedHandler.d.ts +2 -1
- package/lib/service/decomposedHandler.js +2 -2
- package/lib/service/decomposedHandler.js.map +1 -1
- package/lib/service/diffLineInterpreter.d.ts +1 -1
- package/lib/service/diffLineInterpreter.js +16 -6
- package/lib/service/diffLineInterpreter.js.map +1 -1
- package/lib/service/flowHandler.d.ts +2 -1
- package/lib/service/flowHandler.js +2 -2
- package/lib/service/flowHandler.js.map +1 -1
- package/lib/service/inFileHandler.d.ts +8 -7
- package/lib/service/inFileHandler.js +37 -30
- package/lib/service/inFileHandler.js.map +1 -1
- package/lib/service/inFolderHandler.d.ts +2 -1
- package/lib/service/inFolderHandler.js +2 -2
- package/lib/service/inFolderHandler.js.map +1 -1
- package/lib/service/inResourceHandler.d.ts +3 -2
- package/lib/service/inResourceHandler.js +5 -5
- package/lib/service/inResourceHandler.js.map +1 -1
- package/lib/service/objectTranslationHandler.d.ts +3 -3
- package/lib/service/objectTranslationHandler.js +15 -8
- package/lib/service/objectTranslationHandler.js.map +1 -1
- package/lib/service/reportingFolderHandler.d.ts +8 -4
- package/lib/service/reportingFolderHandler.js +5 -6
- package/lib/service/reportingFolderHandler.js.map +1 -1
- package/lib/service/sharedFolderHandler.d.ts +8 -4
- package/lib/service/sharedFolderHandler.js +5 -6
- package/lib/service/sharedFolderHandler.js.map +1 -1
- package/lib/service/standardHandler.d.ts +14 -7
- package/lib/service/standardHandler.js +47 -27
- package/lib/service/standardHandler.js.map +1 -1
- package/lib/service/typeHandlerFactory.d.ts +2 -0
- package/lib/service/typeHandlerFactory.js +15 -0
- package/lib/service/typeHandlerFactory.js.map +1 -1
- package/lib/types/config.d.ts +1 -0
- package/lib/types/handlerResult.d.ts +17 -8
- package/lib/types/handlerResult.js +9 -11
- package/lib/types/handlerResult.js.map +1 -1
- package/lib/types/work.d.ts +2 -5
- package/lib/utils/LoggingDecorator.js +22 -11
- package/lib/utils/LoggingDecorator.js.map +1 -1
- package/lib/utils/changeSet.d.ts +53 -0
- package/lib/utils/changeSet.js +257 -0
- package/lib/utils/changeSet.js.map +1 -0
- package/lib/utils/configValidator.d.ts +1 -0
- package/lib/utils/configValidator.js +39 -1
- package/lib/utils/configValidator.js.map +1 -1
- package/lib/utils/gitLfsHelper.js +9 -1
- package/lib/utils/gitLfsHelper.js.map +1 -1
- package/lib/utils/metadataDiff/index.d.ts +28 -0
- package/lib/utils/metadataDiff/index.js +57 -0
- package/lib/utils/metadataDiff/index.js.map +1 -0
- package/lib/utils/metadataDiff/streamingDiff.d.ts +68 -0
- package/lib/utils/metadataDiff/streamingDiff.js +300 -0
- package/lib/utils/metadataDiff/streamingDiff.js.map +1 -0
- package/lib/utils/metadataDiff/xmlEventReader.d.ts +28 -0
- package/lib/utils/metadataDiff/xmlEventReader.js +221 -0
- package/lib/utils/metadataDiff/xmlEventReader.js.map +1 -0
- package/lib/utils/metadataDiff/xmlWriter.d.ts +17 -0
- package/lib/utils/metadataDiff/xmlWriter.js +213 -0
- package/lib/utils/metadataDiff/xmlWriter.js.map +1 -0
- package/lib/utils/packageHelper.d.ts +8 -1
- package/lib/utils/packageHelper.js +25 -28
- package/lib/utils/packageHelper.js.map +1 -1
- package/lib/utils/renameResolver.d.ts +19 -0
- package/lib/utils/renameResolver.js +52 -0
- package/lib/utils/renameResolver.js.map +1 -0
- package/lib/utils/repoGitDiff.d.ts +18 -5
- package/lib/utils/repoGitDiff.js +66 -33
- package/lib/utils/repoGitDiff.js.map +1 -1
- package/lib/utils/treeIndexScope.d.ts +1 -1
- package/lib/utils/treeIndexScope.js.map +1 -1
- package/lib/utils/txmlAdapter.d.ts +30 -0
- package/lib/utils/txmlAdapter.js +121 -0
- package/lib/utils/txmlAdapter.js.map +1 -0
- package/lib/utils/xmlHelper.d.ts +0 -5
- package/lib/utils/xmlHelper.js +0 -57
- package/lib/utils/xmlHelper.js.map +1 -1
- package/messages/delta.md +12 -0
- package/npm-shrinkwrap.json +628 -486
- package/oclif.manifest.json +9 -1
- package/package.json +53 -21
- package/lib/utils/manifestAggregator.d.ts +0 -3
- package/lib/utils/manifestAggregator.js +0 -22
- package/lib/utils/manifestAggregator.js.map +0 -1
- package/lib/utils/metadataDiff.d.ts +0 -23
- package/lib/utils/metadataDiff.js +0 -242
- package/lib/utils/metadataDiff.js.map +0 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// txml ships .d.ts via `tXml.d.ts` but its package.json `exports` map only
|
|
3
|
+
// re-exports the runtime entry, so TypeScript can't pick the declarations
|
|
4
|
+
// up automatically. Declare the slice we use explicitly.
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
// @ts-expect-error -- type declarations not exposed via package exports
|
|
7
|
+
import { parse as txmlParse } from 'txml';
|
|
8
|
+
import { ATTRIBUTE_PREFIX, XML_HEADER_ATTRIBUTE_KEY, } from './xmlHelper.js';
|
|
9
|
+
const COMMENT_KEY = '#comment';
|
|
10
|
+
const COMMENT_PREFIX = '<!--';
|
|
11
|
+
const COMMENT_SUFFIX = '-->';
|
|
12
|
+
const isComment = (child) => typeof child === 'string' && child.startsWith(COMMENT_PREFIX);
|
|
13
|
+
const isText = (child) => typeof child === 'string' && !child.startsWith(COMMENT_PREFIX);
|
|
14
|
+
const stripComment = (raw) => raw.slice(COMMENT_PREFIX.length, raw.length - COMMENT_SUFFIX.length);
|
|
15
|
+
const renderAttributes = (attributes) => {
|
|
16
|
+
const out = {};
|
|
17
|
+
for (const key of Object.keys(attributes)) {
|
|
18
|
+
const value = attributes[key];
|
|
19
|
+
// FlexXMLParser emitted boolean attributes (no value) as `true`; txml
|
|
20
|
+
// emits them as `null`. Map back to `true` so downstream code (and the
|
|
21
|
+
// xmlWriter, which renders `attr="value"` from the value's `String(...)`
|
|
22
|
+
// representation) keeps the same shape.
|
|
23
|
+
out[`${ATTRIBUTE_PREFIX}${key}`] = value === null ? true : value;
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
};
|
|
27
|
+
// `addChild(out, key, child)` collapses repeated tag names at the same
|
|
28
|
+
// depth into an array — first repeat upgrades the slot from scalar to
|
|
29
|
+
// array, subsequent repeats append.
|
|
30
|
+
const addChild = (out, key, child) => {
|
|
31
|
+
const existing = out[key];
|
|
32
|
+
if (existing === undefined) {
|
|
33
|
+
out[key] = child;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (Array.isArray(existing)) {
|
|
37
|
+
existing.push(child);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
out[key] = [existing, child];
|
|
41
|
+
};
|
|
42
|
+
const addComment = (out, text) => {
|
|
43
|
+
const existing = out[COMMENT_KEY];
|
|
44
|
+
if (existing === undefined) {
|
|
45
|
+
out[COMMENT_KEY] = text;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (Array.isArray(existing)) {
|
|
49
|
+
existing.push(text);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
out[COMMENT_KEY] = [existing, text];
|
|
53
|
+
};
|
|
54
|
+
// Convert a single tNode into the value our compact format uses for it.
|
|
55
|
+
// Three cases:
|
|
56
|
+
// - empty element → {} (so xmlWriter emits `<tag></tag>`)
|
|
57
|
+
// - text-only leaf → primitive string
|
|
58
|
+
// - everything else (attributes, children, mixed) → XmlContent object
|
|
59
|
+
export const tNodeToXmlContent = (node) => {
|
|
60
|
+
const attributes = renderAttributes(node.attributes);
|
|
61
|
+
const hasAttributes = Object.keys(attributes).length > 0;
|
|
62
|
+
if (node.children.length === 0) {
|
|
63
|
+
return hasAttributes ? attributes : {};
|
|
64
|
+
}
|
|
65
|
+
// Text-only leaf: a single text child and no attributes collapse to the
|
|
66
|
+
// primitive string. Attributes-bearing leaves keep object form so the
|
|
67
|
+
// writer can render them with attributes.
|
|
68
|
+
if (!hasAttributes &&
|
|
69
|
+
node.children.length === 1 &&
|
|
70
|
+
isText(node.children[0])) {
|
|
71
|
+
return node.children[0];
|
|
72
|
+
}
|
|
73
|
+
const out = { ...attributes };
|
|
74
|
+
for (const child of node.children) {
|
|
75
|
+
if (isComment(child)) {
|
|
76
|
+
addComment(out, stripComment(child));
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (typeof child === 'string') {
|
|
80
|
+
// Mixed content (text + elements) is rare in our payloads but kept
|
|
81
|
+
// verbatim so a future use case isn't silently dropped.
|
|
82
|
+
addChild(out, '#text', child);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
addChild(out, child.tagName, tNodeToXmlContent(child));
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Parses XML text into our compact JSON shape. Empty input short-circuits
|
|
91
|
+
* to `{}`; malformed input (parse throws) is swallowed and also yields
|
|
92
|
+
* `{}` — preserving the existing `xml2Json` contract.
|
|
93
|
+
*/
|
|
94
|
+
export const parseXml = (xmlContent) => {
|
|
95
|
+
if (!xmlContent)
|
|
96
|
+
return {};
|
|
97
|
+
try {
|
|
98
|
+
const tree = txmlParse(xmlContent, {
|
|
99
|
+
keepComments: true,
|
|
100
|
+
});
|
|
101
|
+
const out = {};
|
|
102
|
+
for (const child of tree) {
|
|
103
|
+
if (isComment(child)) {
|
|
104
|
+
addComment(out, stripComment(child));
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (typeof child === 'string')
|
|
108
|
+
continue; // top-level whitespace
|
|
109
|
+
if (child.tagName === XML_HEADER_ATTRIBUTE_KEY) {
|
|
110
|
+
out[XML_HEADER_ATTRIBUTE_KEY] = renderAttributes(child.attributes);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
addChild(out, child.tagName, tNodeToXmlContent(child));
|
|
114
|
+
}
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return {};
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=txmlAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"txmlAdapter.js","sourceRoot":"","sources":["../../src/utils/txmlAdapter.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,2EAA2E;AAC3E,0EAA0E;AAC1E,yDAAyD;AACzD,6DAA6D;AAC7D,wEAAwE;AACxE,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAA;AAEzC,OAAO,EACL,gBAAgB,EAChB,wBAAwB,GAEzB,MAAM,gBAAgB,CAAA;AA2BvB,MAAM,WAAW,GAAG,UAAU,CAAA;AAC9B,MAAM,cAAc,GAAG,MAAM,CAAA;AAC7B,MAAM,cAAc,GAAG,KAAK,CAAA;AAE5B,MAAM,SAAS,GAAG,CAAC,KAAgB,EAAmB,EAAE,CACtD,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;AAE/D,MAAM,MAAM,GAAG,CAAC,KAAgB,EAAmB,EAAE,CACnD,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAA;AAEhE,MAAM,YAAY,GAAG,CAAC,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AAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
package/lib/utils/xmlHelper.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import type { Config } from '../types/config.js';
|
|
2
|
-
import type { FileGitRef } from '../types/git.js';
|
|
3
1
|
export type XmlContent = Record<string, unknown>;
|
|
4
|
-
export declare const xml2Json: (xmlContent: string) => XmlContent;
|
|
5
|
-
export declare const parseXmlFileToJson: (forRef: FileGitRef, config: Config) => Promise<XmlContent>;
|
|
6
|
-
export declare const convertJsonToXml: (jsonContent: XmlContent | unknown) => string;
|
|
7
2
|
export declare const ATTRIBUTE_PREFIX = "@_";
|
|
8
3
|
export declare const XML_HEADER_ATTRIBUTE_KEY = "?xml";
|
package/lib/utils/xmlHelper.js
CHANGED
|
@@ -1,61 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import FlexXMLParser from '@nodable/flexible-xml-parser';
|
|
3
|
-
import XMLBuilder from 'fast-xml-builder';
|
|
4
|
-
import { readPathFromGit } from './fsHelper.js';
|
|
5
|
-
const XML_PARSER_OPTION = {
|
|
6
|
-
skip: {
|
|
7
|
-
attributes: false,
|
|
8
|
-
nsPrefix: false,
|
|
9
|
-
comment: false,
|
|
10
|
-
declaration: false,
|
|
11
|
-
},
|
|
12
|
-
nameFor: {
|
|
13
|
-
comment: '#comment',
|
|
14
|
-
},
|
|
15
|
-
attributes: {
|
|
16
|
-
prefix: '@_',
|
|
17
|
-
valueParsers: [],
|
|
18
|
-
},
|
|
19
|
-
tags: {
|
|
20
|
-
valueParsers: ['trim'],
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
// processEntities MUST stay false: FlexXMLParser keeps XML entities raw in the
|
|
24
|
-
// parsed JSON (e.g. "a & b" → "a & b", not "a & b"). Flipping this to
|
|
25
|
-
// true makes XMLBuilder re-encode the already-raw entities, producing
|
|
26
|
-
// double-encoded output like "a &amp; b". Parser-builder symmetry matters.
|
|
27
|
-
const JSON_PARSER_OPTION = {
|
|
28
|
-
commentPropName: '#comment',
|
|
29
|
-
ignoreAttributes: false,
|
|
30
|
-
ignoreNameSpace: false,
|
|
31
|
-
parseTagValue: false,
|
|
32
|
-
parseNodeValue: false,
|
|
33
|
-
parseAttributeValue: false,
|
|
34
|
-
trimValues: true,
|
|
35
|
-
processEntities: false,
|
|
36
|
-
format: true,
|
|
37
|
-
indentBy: ' ',
|
|
38
|
-
suppressBooleanAttributes: false,
|
|
39
|
-
suppressEmptyNode: false,
|
|
40
|
-
};
|
|
41
|
-
const xmlParser = new FlexXMLParser(XML_PARSER_OPTION);
|
|
42
|
-
const xmlBuilder = new XMLBuilder(JSON_PARSER_OPTION);
|
|
43
|
-
export const xml2Json = (xmlContent) => {
|
|
44
|
-
if (!xmlContent) {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
try {
|
|
48
|
-
return xmlParser.parse(xmlContent);
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return {};
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
export const parseXmlFileToJson = async (forRef, config) => {
|
|
55
|
-
const xmlContent = await readPathFromGit(forRef, config);
|
|
56
|
-
return xml2Json(xmlContent);
|
|
57
|
-
};
|
|
58
|
-
export const convertJsonToXml = (jsonContent) => xmlBuilder.build(jsonContent);
|
|
59
2
|
export const ATTRIBUTE_PREFIX = '@_';
|
|
60
3
|
export const XML_HEADER_ATTRIBUTE_KEY = '?xml';
|
|
61
4
|
//# sourceMappingURL=xmlHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xmlHelper.js","sourceRoot":"","sources":["../../src/utils/xmlHelper.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"xmlHelper.js","sourceRoot":"","sources":["../../src/utils/xmlHelper.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAIZ,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAA;AAEpC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAA"}
|
package/messages/delta.md
CHANGED
|
@@ -76,6 +76,10 @@ file listing paths to explicitly include for any destructive actions
|
|
|
76
76
|
|
|
77
77
|
file containing additional metadata definitions to add to the registry
|
|
78
78
|
|
|
79
|
+
# flags.changes-manifest.summary
|
|
80
|
+
|
|
81
|
+
path to a JSON file grouping changed components by kind (add, modify, delete, rename); setting this flag also enables git rename detection
|
|
82
|
+
|
|
79
83
|
# error.ParameterIsNotGitSHA
|
|
80
84
|
|
|
81
85
|
--%s is not a valid sha pointer: '%s' (If in CI/CD context, check the fetch depth is properly set)
|
|
@@ -84,6 +88,14 @@ file containing additional metadata definitions to add to the registry
|
|
|
84
88
|
|
|
85
89
|
'%s' is not a git repository
|
|
86
90
|
|
|
91
|
+
# error.ChangesManifestNotAFile
|
|
92
|
+
|
|
93
|
+
--changes-manifest must point to a file path, '%s' already exists and is not a regular file
|
|
94
|
+
|
|
95
|
+
# error.ChangesManifestStatFailed
|
|
96
|
+
|
|
97
|
+
--changes-manifest: cannot inspect '%s': %s
|
|
98
|
+
|
|
87
99
|
# warning.ApiVersionOverridden
|
|
88
100
|
|
|
89
101
|
API version '%s' is not supported, using '%s' instead
|