@salesforce/source-deploy-retrieve 5.0.0-orb.2 → 5.0.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/CHANGELOG.md +186 -101
- package/LICENSE.txt +12 -0
- package/README.md +2 -2
- package/lib/src/client/deployStrategies/auraDeploy.d.ts +2 -2
- package/lib/src/client/deployStrategies/auraDeploy.js +99 -109
- package/lib/src/client/deployStrategies/auraDeploy.js.map +1 -1
- package/lib/src/client/deployStrategies/baseDeploy.d.ts +1 -1
- package/lib/src/client/deployStrategies/baseDeploy.js +37 -38
- package/lib/src/client/deployStrategies/baseDeploy.js.map +1 -1
- package/lib/src/client/deployStrategies/containerDeploy.d.ts +2 -2
- package/lib/src/client/deployStrategies/containerDeploy.js +58 -73
- package/lib/src/client/deployStrategies/containerDeploy.js.map +1 -1
- package/lib/src/client/deployStrategies/index.js +4 -3
- package/lib/src/client/deployStrategies/index.js.map +1 -1
- package/lib/src/client/deployStrategies/lwcDeploy.d.ts +2 -2
- package/lib/src/client/deployStrategies/lwcDeploy.js +98 -109
- package/lib/src/client/deployStrategies/lwcDeploy.js.map +1 -1
- package/lib/src/client/diagnosticUtil.d.ts +1 -1
- package/lib/src/client/diagnosticUtil.js +11 -11
- package/lib/src/client/diagnosticUtil.js.map +1 -1
- package/lib/src/client/index.d.ts +1 -1
- package/lib/src/client/index.js +1 -1
- package/lib/src/client/index.js.map +1 -1
- package/lib/src/client/metadataApiDeploy.d.ts +4 -4
- package/lib/src/client/metadataApiDeploy.js +57 -73
- package/lib/src/client/metadataApiDeploy.js.map +1 -1
- package/lib/src/client/metadataApiRetrieve.d.ts +10 -3
- package/lib/src/client/metadataApiRetrieve.js +102 -111
- package/lib/src/client/metadataApiRetrieve.js.map +1 -1
- package/lib/src/client/metadataTransfer.d.ts +2 -2
- package/lib/src/client/metadataTransfer.js +102 -118
- package/lib/src/client/metadataTransfer.js.map +1 -1
- package/lib/src/client/retrieveUtil.d.ts +1 -1
- package/lib/src/client/retrieveUtil.js +17 -17
- package/lib/src/client/retrieveUtil.js.map +1 -1
- package/lib/src/client/toolingApi.d.ts +2 -2
- package/lib/src/client/toolingApi.js +71 -94
- package/lib/src/client/toolingApi.js.map +1 -1
- package/lib/src/client/types.js +1 -14
- package/lib/src/client/types.js.map +1 -1
- package/lib/src/collections/componentSet.d.ts +16 -10
- package/lib/src/collections/componentSet.js +160 -114
- package/lib/src/collections/componentSet.js.map +1 -1
- package/lib/src/collections/index.js +1 -0
- package/lib/src/collections/index.js.map +1 -1
- package/lib/src/collections/lazyCollection.js +5 -1
- package/lib/src/collections/lazyCollection.js.map +1 -1
- package/lib/src/collections/types.d.ts +8 -0
- package/lib/src/common/constants.js +1 -1
- package/lib/src/common/constants.js.map +1 -1
- package/lib/src/common/index.d.ts +1 -1
- package/lib/src/common/index.js +1 -0
- package/lib/src/common/index.js.map +1 -1
- package/lib/src/convert/convertContext.d.ts +9 -10
- package/lib/src/convert/convertContext.js +165 -173
- package/lib/src/convert/convertContext.js.map +1 -1
- package/lib/src/convert/index.js +1 -0
- package/lib/src/convert/index.js.map +1 -1
- package/lib/src/convert/metadataConverter.d.ts +3 -18
- package/lib/src/convert/metadataConverter.js +112 -110
- package/lib/src/convert/metadataConverter.js.map +1 -1
- package/lib/src/convert/streams.d.ts +4 -4
- package/lib/src/convert/streams.js +111 -147
- package/lib/src/convert/streams.js.map +1 -1
- package/lib/src/convert/transformers/baseMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/decomposedMetadataTransformer.d.ts +2 -2
- package/lib/src/convert/transformers/decomposedMetadataTransformer.js +124 -149
- package/lib/src/convert/transformers/decomposedMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/defaultMetadataTransformer.d.ts +1 -1
- package/lib/src/convert/transformers/defaultMetadataTransformer.js +11 -23
- package/lib/src/convert/transformers/defaultMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/index.js +1 -0
- package/lib/src/convert/transformers/index.js.map +1 -1
- package/lib/src/convert/transformers/metadataTransformerFactory.js +1 -1
- package/lib/src/convert/transformers/metadataTransformerFactory.js.map +1 -1
- package/lib/src/convert/transformers/nonDecomposedMetadataTransformer.d.ts +1 -1
- package/lib/src/convert/transformers/nonDecomposedMetadataTransformer.js +18 -29
- package/lib/src/convert/transformers/nonDecomposedMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/staticResourceMetadataTransformer.d.ts +1 -1
- package/lib/src/convert/transformers/staticResourceMetadataTransformer.js +78 -135
- package/lib/src/convert/transformers/staticResourceMetadataTransformer.js.map +1 -1
- package/lib/src/convert/types.d.ts +1 -1
- package/lib/src/errors/index.js.map +1 -1
- package/lib/src/i18n/i18n.js +3 -2
- package/lib/src/i18n/i18n.js.map +1 -1
- package/lib/src/i18n/index.js +3 -4
- package/lib/src/i18n/index.js.map +1 -1
- package/lib/src/i18n/localization.js +4 -4
- package/lib/src/i18n/localization.js.map +1 -1
- package/lib/src/index.js +1 -4
- package/lib/src/index.js.map +1 -1
- package/lib/src/registry/index.js +1 -4
- package/lib/src/registry/index.js.map +1 -1
- package/lib/src/registry/{registry.json → metadataRegistry.json} +376 -20
- package/lib/src/registry/nonSupportedTypes.d.ts +11 -0
- package/lib/src/registry/nonSupportedTypes.js +53 -0
- package/lib/src/registry/nonSupportedTypes.js.map +1 -0
- package/lib/src/registry/registry.d.ts +357 -1
- package/lib/src/registry/registry.js +2 -2
- package/lib/src/registry/registry.js.map +1 -1
- package/lib/src/registry/registryAccess.d.ts +12 -0
- package/lib/src/registry/registryAccess.js +25 -2
- package/lib/src/registry/registryAccess.js.map +1 -1
- package/lib/src/registry/types.d.ts +47 -0
- package/lib/src/registry/types.js +0 -35
- package/lib/src/registry/types.js.map +1 -1
- package/lib/src/resolve/adapters/baseSourceAdapter.d.ts +3 -2
- package/lib/src/resolve/adapters/baseSourceAdapter.js +55 -19
- package/lib/src/resolve/adapters/baseSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/bundleSourceAdapter.d.ts +1 -1
- package/lib/src/resolve/adapters/bundleSourceAdapter.js +0 -6
- package/lib/src/resolve/adapters/bundleSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/decomposedSourceAdapter.d.ts +1 -1
- package/lib/src/resolve/adapters/decomposedSourceAdapter.js +8 -14
- package/lib/src/resolve/adapters/decomposedSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/defaultSourceAdapter.d.ts +1 -1
- package/lib/src/resolve/adapters/defaultSourceAdapter.js +0 -6
- package/lib/src/resolve/adapters/defaultSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/index.js +1 -0
- package/lib/src/resolve/adapters/index.js.map +1 -1
- package/lib/src/resolve/adapters/matchingContentSourceAdapter.d.ts +1 -1
- package/lib/src/resolve/adapters/matchingContentSourceAdapter.js +2 -2
- package/lib/src/resolve/adapters/matchingContentSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/mixedContentSourceAdapter.d.ts +1 -1
- package/lib/src/resolve/adapters/mixedContentSourceAdapter.js +6 -6
- package/lib/src/resolve/adapters/mixedContentSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/sourceAdapterFactory.js +2 -2
- package/lib/src/resolve/adapters/sourceAdapterFactory.js.map +1 -1
- package/lib/src/resolve/forceIgnore.d.ts +0 -5
- package/lib/src/resolve/forceIgnore.js +14 -100
- package/lib/src/resolve/forceIgnore.js.map +1 -1
- package/lib/src/resolve/index.d.ts +1 -1
- package/lib/src/resolve/index.js +1 -0
- package/lib/src/resolve/index.js.map +1 -1
- package/lib/src/resolve/manifestResolver.d.ts +1 -0
- package/lib/src/resolve/manifestResolver.js +42 -31
- package/lib/src/resolve/manifestResolver.js.map +1 -1
- package/lib/src/resolve/metadataResolver.d.ts +12 -7
- package/lib/src/resolve/metadataResolver.js +39 -19
- package/lib/src/resolve/metadataResolver.js.map +1 -1
- package/lib/src/resolve/sourceComponent.d.ts +46 -7
- package/lib/src/resolve/sourceComponent.js +126 -65
- package/lib/src/resolve/sourceComponent.js.map +1 -1
- package/lib/src/resolve/treeContainers.d.ts +1 -1
- package/lib/src/resolve/treeContainers.js +21 -32
- package/lib/src/resolve/treeContainers.js.map +1 -1
- package/lib/src/resolve/types.d.ts +2 -2
- package/lib/src/utils/collections.js +1 -1
- package/lib/src/utils/collections.js.map +1 -1
- package/lib/src/utils/fileSystemHandler.js +1 -1
- package/lib/src/utils/fileSystemHandler.js.map +1 -1
- package/lib/src/utils/index.d.ts +1 -1
- package/lib/src/utils/index.js +2 -0
- package/lib/src/utils/index.js.map +1 -1
- package/lib/src/utils/metadata.js +1 -3
- package/lib/src/utils/metadata.js.map +1 -1
- package/lib/src/utils/path.d.ts +26 -1
- package/lib/src/utils/path.js +40 -5
- package/lib/src/utils/path.js.map +1 -1
- package/package.json +44 -35
|
@@ -4,6 +4,8 @@ import { MetadataRegistry, MetadataType } from './types';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class RegistryAccess {
|
|
6
6
|
private registry;
|
|
7
|
+
private strictFolderTypes;
|
|
8
|
+
private folderContentTypes;
|
|
7
9
|
constructor(registry?: MetadataRegistry);
|
|
8
10
|
/**
|
|
9
11
|
* Query a metadata type by its name.
|
|
@@ -29,10 +31,20 @@ export declare class RegistryAccess {
|
|
|
29
31
|
findType(predicate: (type: MetadataType) => boolean): MetadataType;
|
|
30
32
|
/**
|
|
31
33
|
* Query the types that require a strict parent directory
|
|
34
|
+
*
|
|
32
35
|
* @see {@link MetadataType.strictDirectoryName}
|
|
33
36
|
*
|
|
34
37
|
* @returns An array of metadata type objects that require strict parent folder names
|
|
35
38
|
*/
|
|
36
39
|
getStrictFolderTypes(): MetadataType[];
|
|
40
|
+
/**
|
|
41
|
+
* Query for the types that have the folderContentType property defined.
|
|
42
|
+
* E.g., reportFolder, dashboardFolder, documentFolder, emailFolder
|
|
43
|
+
*
|
|
44
|
+
* @see {@link MetadataType.folderContentType}
|
|
45
|
+
*
|
|
46
|
+
* @returns An array of metadata type objects that have folder content
|
|
47
|
+
*/
|
|
48
|
+
getFolderContentTypes(): MetadataType[];
|
|
37
49
|
get apiVersion(): string;
|
|
38
50
|
}
|
|
@@ -7,8 +7,8 @@ exports.RegistryAccess = void 0;
|
|
|
7
7
|
* Licensed under the BSD 3-Clause license.
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
|
-
const registry_1 = require("./registry");
|
|
11
10
|
const errors_1 = require("../errors");
|
|
11
|
+
const registry_1 = require("./registry");
|
|
12
12
|
/**
|
|
13
13
|
* Container for querying metadata registry data.
|
|
14
14
|
*/
|
|
@@ -62,12 +62,35 @@ class RegistryAccess {
|
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Query the types that require a strict parent directory
|
|
65
|
+
*
|
|
65
66
|
* @see {@link MetadataType.strictDirectoryName}
|
|
66
67
|
*
|
|
67
68
|
* @returns An array of metadata type objects that require strict parent folder names
|
|
68
69
|
*/
|
|
69
70
|
getStrictFolderTypes() {
|
|
70
|
-
|
|
71
|
+
if (!this.strictFolderTypes) {
|
|
72
|
+
this.strictFolderTypes = Object.values(this.registry.strictDirectoryNames).map((typeId) => this.registry.types[typeId]);
|
|
73
|
+
}
|
|
74
|
+
return this.strictFolderTypes;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Query for the types that have the folderContentType property defined.
|
|
78
|
+
* E.g., reportFolder, dashboardFolder, documentFolder, emailFolder
|
|
79
|
+
*
|
|
80
|
+
* @see {@link MetadataType.folderContentType}
|
|
81
|
+
*
|
|
82
|
+
* @returns An array of metadata type objects that have folder content
|
|
83
|
+
*/
|
|
84
|
+
getFolderContentTypes() {
|
|
85
|
+
if (!this.folderContentTypes) {
|
|
86
|
+
this.folderContentTypes = [];
|
|
87
|
+
for (const type of Object.values(this.registry.types)) {
|
|
88
|
+
if (type.folderContentType) {
|
|
89
|
+
this.folderContentTypes.push(type);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return this.folderContentTypes;
|
|
71
94
|
}
|
|
72
95
|
get apiVersion() {
|
|
73
96
|
return this.registry.apiVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registryAccess.js","sourceRoot":"","sources":["../../../src/registry/registryAccess.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"registryAccess.js","sourceRoot":"","sources":["../../../src/registry/registryAccess.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,sCAA0C;AAC1C,yCAAyD;AAGzD;;GAEG;AACH,MAAa,cAAc;IAMzB,YAAmB,WAA6B,mBAAe;QAC7D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,IAAY;;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YACnC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACrD,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,0CAAE,KAAK,CAAC,KAAK,CAAC,CAAC;YAC3E,IAAI,SAAS,EAAE;gBACb,OAAO,SAAS,CAAC;aAClB;YACD,MAAM,IAAI,sBAAa,CAAC,qCAAqC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;SACvF;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC/B,MAAM,IAAI,sBAAa,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;SACjE;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KA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AC,UAAU,CAAC;IAClC,CAAC;CACF;AA/FD,wCA+FC"}
|
|
@@ -66,6 +66,10 @@ export interface MetadataType {
|
|
|
66
66
|
* If the parent name should be ignored when constructing the type's fullName
|
|
67
67
|
*/
|
|
68
68
|
ignoreParentName?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The XML element name for the type in the xml file used for constructing child components.
|
|
71
|
+
*/
|
|
72
|
+
xmlElementName?: string;
|
|
69
73
|
/**
|
|
70
74
|
* When converting deploying source, this will update the suffix in the output or temporary directory (metadata format)
|
|
71
75
|
* Use this, along with additional suffix keys in the registry, to support incorrect suffixes from existing code
|
|
@@ -75,6 +79,20 @@ export interface MetadataType {
|
|
|
75
79
|
* The xml attribute used as the unique identifier when parsing the xml
|
|
76
80
|
*/
|
|
77
81
|
uniqueIdElement?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Whether the component is supported by the Metadata API and therefore should be included within a manifest.
|
|
84
|
+
*/
|
|
85
|
+
isAddressable?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether or not components of the same type can be can be specified with the wildcard character, and by name in a manifest
|
|
88
|
+
*
|
|
89
|
+
```
|
|
90
|
+
<members>*</members>
|
|
91
|
+
<members>Account</members>
|
|
92
|
+
<name>CustomObject</name>
|
|
93
|
+
```
|
|
94
|
+
*/
|
|
95
|
+
supportsWildcardAndName?: boolean;
|
|
78
96
|
/**
|
|
79
97
|
* Type definitions for child types, if the type has any.
|
|
80
98
|
*
|
|
@@ -144,4 +162,33 @@ export declare const enum TransformerStrategy {
|
|
|
144
162
|
StaticResource = "staticResource",
|
|
145
163
|
NonDecomposed = "nonDecomposed"
|
|
146
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Subset of an item from the Metadata Coverage Report
|
|
167
|
+
*/
|
|
168
|
+
export interface CoverageObjectType {
|
|
169
|
+
scratchDefinitions: {
|
|
170
|
+
professional: string;
|
|
171
|
+
group: string;
|
|
172
|
+
enterprise: string;
|
|
173
|
+
developer: string;
|
|
174
|
+
};
|
|
175
|
+
channels: {
|
|
176
|
+
metadataApi: boolean;
|
|
177
|
+
sourceTracking: boolean;
|
|
178
|
+
toolingApi: boolean;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The structure returned by the metadata coverage report
|
|
183
|
+
*/
|
|
184
|
+
export interface CoverageObject {
|
|
185
|
+
types: {
|
|
186
|
+
[key: string]: CoverageObjectType;
|
|
187
|
+
};
|
|
188
|
+
versions: {
|
|
189
|
+
selected: number;
|
|
190
|
+
max: number;
|
|
191
|
+
min: number;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
147
194
|
export {};
|
|
@@ -6,39 +6,4 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.TransformerStrategy = exports.RecompositionStrategy = exports.DecompositionStrategy = void 0;
|
|
10
|
-
/**
|
|
11
|
-
* Strategy names for handling component decomposition.
|
|
12
|
-
*/
|
|
13
|
-
var DecompositionStrategy;
|
|
14
|
-
(function (DecompositionStrategy) {
|
|
15
|
-
/**
|
|
16
|
-
* Elements of child types are decomposed to the same folder the parent object is in.
|
|
17
|
-
*/
|
|
18
|
-
DecompositionStrategy["TopLevel"] = "topLevel";
|
|
19
|
-
/**
|
|
20
|
-
* Elements of child types are decomposed into folders of their respective types.
|
|
21
|
-
*/
|
|
22
|
-
DecompositionStrategy["FolderPerType"] = "folderPerType";
|
|
23
|
-
})(DecompositionStrategy = exports.DecompositionStrategy || (exports.DecompositionStrategy = {}));
|
|
24
|
-
/**
|
|
25
|
-
* Strategy names for handling component recomposition.
|
|
26
|
-
*/
|
|
27
|
-
var RecompositionStrategy;
|
|
28
|
-
(function (RecompositionStrategy) {
|
|
29
|
-
/**
|
|
30
|
-
* The parent object should start as an empty object when recomposing the child types
|
|
31
|
-
*/
|
|
32
|
-
RecompositionStrategy["StartEmpty"] = "startEmpty";
|
|
33
|
-
})(RecompositionStrategy = exports.RecompositionStrategy || (exports.RecompositionStrategy = {}));
|
|
34
|
-
/**
|
|
35
|
-
* Strategy names for the type of transformation to use for metadata types.
|
|
36
|
-
*/
|
|
37
|
-
var TransformerStrategy;
|
|
38
|
-
(function (TransformerStrategy) {
|
|
39
|
-
TransformerStrategy["Standard"] = "standard";
|
|
40
|
-
TransformerStrategy["Decomposed"] = "decomposed";
|
|
41
|
-
TransformerStrategy["StaticResource"] = "staticResource";
|
|
42
|
-
TransformerStrategy["NonDecomposed"] = "nonDecomposed";
|
|
43
|
-
})(TransformerStrategy = exports.TransformerStrategy || (exports.TransformerStrategy = {}));
|
|
44
9
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/registry/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/registry/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MetadataXml, SourceAdapter } from '../types';
|
|
2
2
|
import { ForceIgnore } from '../forceIgnore';
|
|
3
3
|
import { TreeContainer } from '../treeContainers';
|
|
4
4
|
import { SourceComponent } from '../sourceComponent';
|
|
@@ -34,12 +34,13 @@ export declare abstract class BaseSourceAdapter implements SourceAdapter {
|
|
|
34
34
|
* for a component, parse the name and return it. This allows matching files in metadata
|
|
35
35
|
* format such as:
|
|
36
36
|
*
|
|
37
|
-
*
|
|
37
|
+
* .../tabs/MyTab.tab
|
|
38
38
|
*
|
|
39
39
|
* @param path File path of a metadata component
|
|
40
40
|
*/
|
|
41
41
|
private parseAsContentMetadataXml;
|
|
42
42
|
private parseAsFolderMetadataXml;
|
|
43
|
+
private calculateName;
|
|
43
44
|
/**
|
|
44
45
|
* Determine the related root metadata xml when the path given to `getComponent` isn't one.
|
|
45
46
|
*
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseSourceAdapter = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const path_1 = require("path");
|
|
4
11
|
const utils_1 = require("../../utils");
|
|
5
12
|
const errors_1 = require("../../errors");
|
|
6
|
-
const path_1 = require("../../utils/path");
|
|
7
13
|
const forceIgnore_1 = require("../forceIgnore");
|
|
8
|
-
const path_2 = require("path");
|
|
9
14
|
const treeContainers_1 = require("../treeContainers");
|
|
10
15
|
const sourceComponent_1 = require("../sourceComponent");
|
|
11
16
|
const registry_1 = require("../../registry");
|
|
@@ -27,7 +32,7 @@ class BaseSourceAdapter {
|
|
|
27
32
|
if (!rootMetadata) {
|
|
28
33
|
const rootMetadataPath = this.getRootMetadataXmlPath(path);
|
|
29
34
|
if (rootMetadataPath) {
|
|
30
|
-
rootMetadata = utils_1.parseMetadataXml(rootMetadataPath);
|
|
35
|
+
rootMetadata = (0, utils_1.parseMetadataXml)(rootMetadataPath);
|
|
31
36
|
}
|
|
32
37
|
}
|
|
33
38
|
if (rootMetadata && this.forceIgnore.denies(rootMetadata.path)) {
|
|
@@ -35,13 +40,11 @@ class BaseSourceAdapter {
|
|
|
35
40
|
}
|
|
36
41
|
let component;
|
|
37
42
|
if (rootMetadata) {
|
|
38
|
-
const componentName = this.type.folderType
|
|
39
|
-
? `${path_1.parentName(rootMetadata.path)}/${rootMetadata.fullName}`
|
|
40
|
-
: rootMetadata.fullName;
|
|
41
43
|
component = new sourceComponent_1.SourceComponent({
|
|
42
|
-
name:
|
|
44
|
+
name: this.calculateName(rootMetadata),
|
|
43
45
|
type: this.type,
|
|
44
46
|
xml: rootMetadata.path,
|
|
47
|
+
parentType: this.type.folderType ? this.registry.getTypeByName(this.type.folderType) : undefined,
|
|
45
48
|
}, this.tree, this.forceIgnore);
|
|
46
49
|
}
|
|
47
50
|
return this.populate(path, component, isResolvingSource);
|
|
@@ -60,13 +63,13 @@ class BaseSourceAdapter {
|
|
|
60
63
|
* @param path File path of a metadata component
|
|
61
64
|
*/
|
|
62
65
|
parseAsRootMetadataXml(path) {
|
|
63
|
-
const metaXml = utils_1.parseMetadataXml(path);
|
|
66
|
+
const metaXml = (0, utils_1.parseMetadataXml)(path);
|
|
64
67
|
if (metaXml) {
|
|
65
68
|
let isRootMetadataXml = false;
|
|
66
69
|
if (this.type.strictDirectoryName) {
|
|
67
|
-
const parentPath =
|
|
68
|
-
const typeDirName =
|
|
69
|
-
const nameMatchesParent =
|
|
70
|
+
const parentPath = (0, path_1.dirname)(path);
|
|
71
|
+
const typeDirName = (0, path_1.basename)(this.type.inFolder ? (0, path_1.dirname)(parentPath) : parentPath);
|
|
72
|
+
const nameMatchesParent = (0, path_1.basename)(parentPath) === metaXml.fullName;
|
|
70
73
|
const inTypeDir = typeDirName === this.type.directoryName;
|
|
71
74
|
// if the parent folder name matches the fullName OR parent folder name is
|
|
72
75
|
// metadata type's directory name, it's a root metadata xml.
|
|
@@ -90,30 +93,63 @@ class BaseSourceAdapter {
|
|
|
90
93
|
* for a component, parse the name and return it. This allows matching files in metadata
|
|
91
94
|
* format such as:
|
|
92
95
|
*
|
|
93
|
-
*
|
|
96
|
+
* .../tabs/MyTab.tab
|
|
94
97
|
*
|
|
95
98
|
* @param path File path of a metadata component
|
|
96
99
|
*/
|
|
97
100
|
parseAsContentMetadataXml(path) {
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
// InFolder metadata can be nested more than 1 level beneath its
|
|
102
|
+
// associated directoryName.
|
|
103
|
+
if (this.type.inFolder) {
|
|
104
|
+
const fullName = (0, utils_1.parseNestedFullName)(path, this.type.directoryName);
|
|
105
|
+
if (fullName) {
|
|
106
|
+
return { fullName, suffix: this.type.suffix, path };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const parentPath = (0, path_1.dirname)(path);
|
|
110
|
+
const parts = parentPath.split(path_1.sep);
|
|
100
111
|
const typeFolderIndex = parts.lastIndexOf(this.type.directoryName);
|
|
101
|
-
|
|
112
|
+
// nestedTypes (ex: territory2) have a folderType equal to their type but are themselves
|
|
113
|
+
// in a folder per metadata item, with child folders for rules/territories
|
|
114
|
+
const allowedIndex = this.type.folderType === this.type.id ? parts.length - 2 : parts.length - 1;
|
|
102
115
|
if (typeFolderIndex !== allowedIndex) {
|
|
103
116
|
return undefined;
|
|
104
117
|
}
|
|
105
|
-
const match =
|
|
118
|
+
const match = new RegExp(/(.+)\.(.+)/).exec((0, path_1.basename)(path));
|
|
106
119
|
if (match && this.type.suffix === match[2]) {
|
|
107
|
-
return { fullName: match[1], suffix: match[2], path
|
|
120
|
+
return { fullName: match[1], suffix: match[2], path };
|
|
108
121
|
}
|
|
109
122
|
}
|
|
110
123
|
parseAsFolderMetadataXml(fsPath) {
|
|
111
|
-
const match =
|
|
112
|
-
const parts = fsPath.split(
|
|
124
|
+
const match = new RegExp(/(.+)-meta\.xml$/).exec((0, path_1.basename)(fsPath));
|
|
125
|
+
const parts = fsPath.split(path_1.sep);
|
|
113
126
|
if (match && !match[1].includes('.') && parts.length > 1) {
|
|
114
127
|
return { fullName: match[1], suffix: undefined, path: fsPath };
|
|
115
128
|
}
|
|
116
129
|
}
|
|
130
|
+
// Given a MetadataXml, build a fullName from the path and type.
|
|
131
|
+
calculateName(rootMetadata) {
|
|
132
|
+
const { directoryName, inFolder, folderType, folderContentType } = this.type;
|
|
133
|
+
// inFolder types (report, dashboard, emailTemplate, document) and their folder
|
|
134
|
+
// container types (reportFolder, dashboardFolder, emailFolder, documentFolder)
|
|
135
|
+
if (inFolder || folderContentType) {
|
|
136
|
+
return (0, utils_1.parseNestedFullName)(rootMetadata.path, directoryName);
|
|
137
|
+
}
|
|
138
|
+
// not using folders? then name is fullname
|
|
139
|
+
if (!folderType) {
|
|
140
|
+
return rootMetadata.fullName;
|
|
141
|
+
}
|
|
142
|
+
const grandparentType = this.registry.getTypeByName(folderType);
|
|
143
|
+
// type is nested inside another type (ex: Territory2Model). So the names are modelName.ruleName or modelName.territoryName
|
|
144
|
+
if (grandparentType.folderType && grandparentType.folderType !== this.type.id) {
|
|
145
|
+
const splits = rootMetadata.path.split(path_1.sep);
|
|
146
|
+
return `${splits[splits.indexOf(grandparentType.directoryName) + 1]}.${rootMetadata.fullName}`;
|
|
147
|
+
}
|
|
148
|
+
// this is the top level of nested types (ex: in a Territory2Model, the Territory2Model)
|
|
149
|
+
if (grandparentType.folderType === this.type.id) {
|
|
150
|
+
return rootMetadata.fullName;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
117
153
|
}
|
|
118
154
|
exports.BaseSourceAdapter = BaseSourceAdapter;
|
|
119
155
|
//# sourceMappingURL=baseSourceAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/baseSourceAdapter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"baseSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/baseSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,+BAA8C;AAE9C,uCAAoE;AACpE,yCAAqD;AACrD,gDAA6C;AAC7C,sDAAuE;AACvE,wDAAqD;AAErD,6CAA8D;AAE9D,MAAsB,iBAAiB;IAarC,YACE,IAAkB,EAClB,QAAQ,GAAG,IAAI,yBAAc,EAAE,EAC/B,cAA2B,IAAI,yBAAW,EAAE,EAC5C,OAAsB,IAAI,oCAAmB,EAAE;QAXjD;;;WAGG;QACO,cAAS,GAAG,KAAK,CAAC;QAClB,wBAAmB,GAAG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AU,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;YAC/C,OAAO,YAAY,CAAC,QAAQ,CAAC;SAC9B;IACH,CAAC;CAqBF;AA1LD,8CA0LC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MixedContentSourceAdapter } from './mixedContentSourceAdapter';
|
|
2
1
|
import { SourcePath } from '../../common';
|
|
3
2
|
import { SourceComponent } from '../sourceComponent';
|
|
3
|
+
import { MixedContentSourceAdapter } from './mixedContentSourceAdapter';
|
|
4
4
|
/**
|
|
5
5
|
* Handles _bundle_ types. A bundle component has all its source files, including the
|
|
6
6
|
* root metadata xml, contained in its own directory.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BundleSourceAdapter = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
|
-
* All rights reserved.
|
|
7
|
-
* Licensed under the BSD 3-Clause license.
|
|
8
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
-
*/
|
|
10
4
|
const mixedContentSourceAdapter_1 = require("./mixedContentSourceAdapter");
|
|
11
5
|
/**
|
|
12
6
|
* Handles _bundle_ types. A bundle component has all its source files, including the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/bundleSourceAdapter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"bundleSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/bundleSourceAdapter.ts"],"names":[],"mappings":";;;AAQA,2EAAwE;AAExE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,mBAAoB,SAAQ,qDAAyB;IAAlE;;QACY,cAAS,GAAG,IAAI,CAAC;IA2B7B,CAAC;IAzBC;;;;;;;;;;;;;;;;;OAiBG;IACO,QAAQ,CAAC,OAAmB,EAAE,SAA2B;;QACjE,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,0CAAE,MAAM,CAAA,EAAE;YAC/E,oEAAoE;YACpE,OAAO;SACR;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5C,CAAC;CACF;AA5BD,kDA4BC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MixedContentSourceAdapter } from './mixedContentSourceAdapter';
|
|
2
1
|
import { SourcePath } from '../../common';
|
|
3
2
|
import { SourceComponent } from '../sourceComponent';
|
|
3
|
+
import { MixedContentSourceAdapter } from './mixedContentSourceAdapter';
|
|
4
4
|
/**
|
|
5
5
|
* Handles decomposed types. A flavor of mixed content where a component can
|
|
6
6
|
* have additional -meta.xml files that represent child components of the main
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DecomposedSourceAdapter = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
|
-
* All rights reserved.
|
|
7
|
-
* Licensed under the BSD 3-Clause license.
|
|
8
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
-
*/
|
|
10
|
-
const mixedContentSourceAdapter_1 = require("./mixedContentSourceAdapter");
|
|
11
4
|
const sourceComponent_1 = require("../sourceComponent");
|
|
12
5
|
const utils_1 = require("../../utils");
|
|
13
6
|
const errors_1 = require("../../errors");
|
|
7
|
+
const mixedContentSourceAdapter_1 = require("./mixedContentSourceAdapter");
|
|
14
8
|
/**
|
|
15
9
|
* Handles decomposed types. A flavor of mixed content where a component can
|
|
16
10
|
* have additional -meta.xml files that represent child components of the main
|
|
@@ -50,13 +44,13 @@ class DecomposedSourceAdapter extends mixedContentSourceAdapter_1.MixedContentSo
|
|
|
50
44
|
if (!rootMetadata) {
|
|
51
45
|
const rootMetadataPath = this.getRootMetadataXmlPath(path);
|
|
52
46
|
if (rootMetadataPath) {
|
|
53
|
-
rootMetadata = utils_1.parseMetadataXml(rootMetadataPath);
|
|
47
|
+
rootMetadata = (0, utils_1.parseMetadataXml)(rootMetadataPath);
|
|
54
48
|
}
|
|
55
49
|
}
|
|
56
50
|
let component;
|
|
57
51
|
if (rootMetadata) {
|
|
58
52
|
const componentName = this.type.folderType
|
|
59
|
-
? `${utils_1.parentName(rootMetadata.path)}/${rootMetadata.fullName}`
|
|
53
|
+
? `${(0, utils_1.parentName)(rootMetadata.path)}/${rootMetadata.fullName}`
|
|
60
54
|
: rootMetadata.fullName;
|
|
61
55
|
component = new sourceComponent_1.SourceComponent({
|
|
62
56
|
name: componentName,
|
|
@@ -72,18 +66,18 @@ class DecomposedSourceAdapter extends mixedContentSourceAdapter_1.MixedContentSo
|
|
|
72
66
|
* `BaseSourceAdapter`, and return the child component instead.
|
|
73
67
|
*/
|
|
74
68
|
populate(trigger, component, isResolvingSource) {
|
|
75
|
-
const metaXml = utils_1.parseMetadataXml(trigger);
|
|
69
|
+
const metaXml = (0, utils_1.parseMetadataXml)(trigger);
|
|
76
70
|
if (metaXml) {
|
|
77
71
|
const pathToContent = this.trimPathToContent(trigger);
|
|
78
72
|
const childTypeId = this.type.children.suffixes[metaXml.suffix];
|
|
79
|
-
|
|
73
|
+
// If the child is explicitly not addressable, return the parent SourceComponent.
|
|
74
|
+
const triggerIsAChild = !!childTypeId && this.type.children.types[childTypeId].isAddressable !== false;
|
|
80
75
|
const strategy = this.type.strategies.decomposition;
|
|
81
|
-
if (triggerIsAChild &&
|
|
82
|
-
(strategy === "folderPerType" /* FolderPerType */ || isResolvingSource)) {
|
|
76
|
+
if (triggerIsAChild && (strategy === "folderPerType" /* FolderPerType */ || isResolvingSource)) {
|
|
83
77
|
let parent = component;
|
|
84
78
|
if (!parent) {
|
|
85
79
|
parent = new sourceComponent_1.SourceComponent({
|
|
86
|
-
name: utils_1.baseName(pathToContent),
|
|
80
|
+
name: (0, utils_1.baseName)(pathToContent),
|
|
87
81
|
type: this.type,
|
|
88
82
|
}, this.tree, this.forceIgnore);
|
|
89
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decomposedSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/decomposedSourceAdapter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"decomposedSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/decomposedSourceAdapter.ts"],"names":[],"mappings":";;;AAOA,wDAAqD;AACrD,uCAAqE;AAErE,yCAAkD;AAClD,2EAAwE;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,uBAAwB,SAAQ,qDAAyB;IAAtE;;QACY,cAAS,GAAG,IAAI,CAAC;QACjB,wBAAmB,GAAG,KAAK,CAAC;IA+ExC,CAAC;IA7EQ,YAAY,CAAC,IAAgB,EAAE,iBAAiB,GAAG,IAAI;QAC5D,IAAI,YAAY,GAAG,KAAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;YAC3D,IAAI,gBAAgB,EAAE;gBACpB,YAAY,GAAG,IAAA,wBAAgB,EAAC,gBAAgB,CAAC,CAAC;aACnD;SACF;QAED,IAAI,SAA0B,CAAC;QAC/B,IAAI,YAAY,EAAE;YAChB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU;gBACxC,CAAC,CAAC,GAAG,IAAA,kBAAU,EAAC,YAAY,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,QAAQ,EAAE;gBAC7D,CAAC,CA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MAAM,CAAC,OAAO,GAAG,aAAa,CAAC;gBAC/B,OAAO,IAAI,iCAAe,CACxB;oBACE,IAAI,EAAE,OAAO,CAAC,QAAQ;oBACtB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC;oBAC3C,GAAG,EAAE,OAAO;oBACZ,MAAM;iBACP,EACD,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,CACjB,CAAC;aACH;YACD,IAAI,CAAC,eAAe,EAAE;gBACpB,IAAI,CAAC,SAAS,EAAE;oBACd,gFAAgF;oBAChF,qEAAqE;oBACrE,MAAM,IAAI,2BAAkB,CAAC,6BAA6B,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;iBACxF;gBACD,SAAS,CAAC,OAAO,GAAG,aAAa,CAAC;aACnC;SACF;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjFD,0DAiFC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSourceAdapter } from './baseSourceAdapter';
|
|
2
1
|
import { SourcePath } from '../../common';
|
|
3
2
|
import { SourceComponent } from '../sourceComponent';
|
|
3
|
+
import { BaseSourceAdapter } from './baseSourceAdapter';
|
|
4
4
|
/**
|
|
5
5
|
* The default source adapter. Handles simple types with no additional content.
|
|
6
6
|
*
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DefaultSourceAdapter = void 0;
|
|
4
|
-
/*
|
|
5
|
-
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
|
-
* All rights reserved.
|
|
7
|
-
* Licensed under the BSD 3-Clause license.
|
|
8
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
-
*/
|
|
10
4
|
const baseSourceAdapter_1 = require("./baseSourceAdapter");
|
|
11
5
|
/**
|
|
12
6
|
* The default source adapter. Handles simple types with no additional content.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/defaultSourceAdapter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"defaultSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/defaultSourceAdapter.ts"],"names":[],"mappings":";;;AAQA,2DAAwD;AAExD;;;;;;;;;;;;;GAaG;AACH,MAAa,oBAAqB,SAAQ,qCAAiB;IAA3D;;QACY,wBAAmB,GAAG,KAAK,CAAC;IAaxC,CAAC;IAXC,0BAA0B;IAChB,sBAAsB,CAAC,OAAe;QAC9C,0EAA0E;QAC1E,+EAA+E;QAC/E,4CAA4C;QAC5C,OAAO,OAAO,CAAC;IACjB,CAAC;IAES,QAAQ,CAAC,OAAmB,EAAE,SAA0B;QAChE,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAdD,oDAcC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseSourceAdapter = exports.DefaultSourceAdapter = exports.DecomposedSourceAdapter = exports.MixedContentSourceAdapter = exports.BundleSourceAdapter = exports.MatchingContentSourceAdapter = void 0;
|
|
3
4
|
/*
|
|
4
5
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
5
6
|
* All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,+EAA8E;AAArE,4IAAA,4BAA4B,OAAA;AACrC,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA;AAClC,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSourceAdapter } from './baseSourceAdapter';
|
|
2
1
|
import { SourcePath } from '../../common';
|
|
3
2
|
import { SourceComponent } from '../sourceComponent';
|
|
3
|
+
import { BaseSourceAdapter } from './baseSourceAdapter';
|
|
4
4
|
/**
|
|
5
5
|
* Handles types with a single content file with a matching file extension.
|
|
6
6
|
*
|
|
@@ -7,10 +7,10 @@ exports.MatchingContentSourceAdapter = void 0;
|
|
|
7
7
|
* Licensed under the BSD 3-Clause license.
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
|
-
const baseSourceAdapter_1 = require("./baseSourceAdapter");
|
|
11
10
|
const errors_1 = require("../../errors");
|
|
12
11
|
const common_1 = require("../../common");
|
|
13
12
|
const path_1 = require("../../utils/path");
|
|
13
|
+
const baseSourceAdapter_1 = require("./baseSourceAdapter");
|
|
14
14
|
/**
|
|
15
15
|
* Handles types with a single content file with a matching file extension.
|
|
16
16
|
*
|
|
@@ -54,7 +54,7 @@ class MatchingContentSourceAdapter extends baseSourceAdapter_1.BaseSourceAdapter
|
|
|
54
54
|
return fsPath.slice(0, fsPath.lastIndexOf(common_1.META_XML_SUFFIX));
|
|
55
55
|
}
|
|
56
56
|
extensionMatchesType(fsPath) {
|
|
57
|
-
return this.registry.getTypeBySuffix(path_1.extName(fsPath)) === this.type;
|
|
57
|
+
return this.registry.getTypeBySuffix((0, path_1.extName)(fsPath)) === this.type;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
exports.MatchingContentSourceAdapter = MatchingContentSourceAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchingContentSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/matchingContentSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"matchingContentSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/matchingContentSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yCAA+E;AAC/E,yCAA2D;AAC3D,2CAA2C;AAE3C,2DAAwD;AAExD;;;;;;;;;;;;;;GAcG;AACH,MAAa,4BAA6B,SAAQ,qCAAiB;IACvD,sBAAsB,CAAC,OAAmB;QAClD,OAAO,GAAG,OAAO,GAAG,wBAAe,EAAE,CAAC;IACxC,CAAC;IAES,QAAQ,CAAC,OAAmB,EAAE,SAA0B;QAChE,IAAI,UAAsB,CAAC;QAE3B,IAAI,SAAS,CAAC,GAAG,KAAK,OAAO,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YACjD,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;gBAC5B,UAAU,GAAG,MAAM,CAAC;aACrB;SACF;aAAM,IAAI,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE;YAC7C,UAAU,GAAG,OAAO,CAAC;SACtB;QAED,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,iCAAwB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SACxD;aAAM,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;YAC9C,MAAM,IAAI,8BAAqB,CAAC,wBAAwB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;SACzF;QAED,SAAS,CAAC,OAAO,GAAG,UAAU,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,mBAAmB,CAAC,MAAkB;QAC5C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC,wBAAe,CAAC,CAAC,CAAC;IAC9D,CAAC;IAEO,oBAAoB,CAAC,MAAkB;QAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC;IACtE,CAAC;CACF;AAlCD,oEAkCC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseSourceAdapter } from './baseSourceAdapter';
|
|
2
1
|
import { SourcePath } from '../../common';
|
|
3
2
|
import { SourceComponent } from '../sourceComponent';
|
|
3
|
+
import { BaseSourceAdapter } from './baseSourceAdapter';
|
|
4
4
|
/**
|
|
5
5
|
* Handles types with mixed content. Mixed content means there are one or more additional
|
|
6
6
|
* file(s) associated with a component with any file extension. Even an entire folder
|
|
@@ -7,11 +7,11 @@ exports.MixedContentSourceAdapter = void 0;
|
|
|
7
7
|
* Licensed under the BSD 3-Clause license.
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
|
-
const baseSourceAdapter_1 = require("./baseSourceAdapter");
|
|
11
10
|
const path_1 = require("path");
|
|
12
11
|
const errors_1 = require("../../errors");
|
|
13
12
|
const path_2 = require("../../utils/path");
|
|
14
13
|
const sourceComponent_1 = require("../sourceComponent");
|
|
14
|
+
const baseSourceAdapter_1 = require("./baseSourceAdapter");
|
|
15
15
|
/**
|
|
16
16
|
* Handles types with mixed content. Mixed content means there are one or more additional
|
|
17
17
|
* file(s) associated with a component with any file extension. Even an entire folder
|
|
@@ -40,14 +40,14 @@ class MixedContentSourceAdapter extends baseSourceAdapter_1.BaseSourceAdapter {
|
|
|
40
40
|
getRootMetadataXmlPath(trigger) {
|
|
41
41
|
if (this.ownFolder) {
|
|
42
42
|
const componentRoot = this.trimPathToContent(trigger);
|
|
43
|
-
return this.tree.find('metadataXml', path_1.basename(componentRoot), componentRoot);
|
|
43
|
+
return this.tree.find('metadataXml', (0, path_1.basename)(componentRoot), componentRoot);
|
|
44
44
|
}
|
|
45
45
|
return this.findMetadataFromContent(trigger);
|
|
46
46
|
}
|
|
47
47
|
populate(trigger, component) {
|
|
48
48
|
let contentPath = this.trimPathToContent(trigger);
|
|
49
49
|
if (contentPath === (component === null || component === void 0 ? void 0 : component.xml)) {
|
|
50
|
-
contentPath = this.tree.find('content', path_2.baseName(contentPath), path_1.dirname(contentPath));
|
|
50
|
+
contentPath = this.tree.find('content', (0, path_2.baseName)(contentPath), (0, path_1.dirname)(contentPath));
|
|
51
51
|
}
|
|
52
52
|
if (!this.tree.exists(contentPath)) {
|
|
53
53
|
throw new errors_1.ExpectedSourceFilesError(this.type, trigger);
|
|
@@ -57,7 +57,7 @@ class MixedContentSourceAdapter extends baseSourceAdapter_1.BaseSourceAdapter {
|
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
component = new sourceComponent_1.SourceComponent({
|
|
60
|
-
name: path_2.baseName(contentPath),
|
|
60
|
+
name: (0, path_2.baseName)(contentPath),
|
|
61
61
|
type: this.type,
|
|
62
62
|
content: contentPath,
|
|
63
63
|
}, this.tree, this.forceIgnore);
|
|
@@ -87,8 +87,8 @@ class MixedContentSourceAdapter extends baseSourceAdapter_1.BaseSourceAdapter {
|
|
|
87
87
|
*/
|
|
88
88
|
findMetadataFromContent(path) {
|
|
89
89
|
const rootContentPath = this.trimPathToContent(path);
|
|
90
|
-
const rootTypeDirectory = path_1.dirname(rootContentPath);
|
|
91
|
-
const contentFullName = path_2.baseName(rootContentPath);
|
|
90
|
+
const rootTypeDirectory = (0, path_1.dirname)(rootContentPath);
|
|
91
|
+
const contentFullName = (0, path_2.baseName)(rootContentPath);
|
|
92
92
|
return this.tree.find('metadataXml', contentFullName, rootTypeDirectory);
|
|
93
93
|
}
|
|
94
94
|
}
|