@salesforce/source-deploy-retrieve 5.0.0-orb.5 → 5.0.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/CHANGELOG.md +190 -99
- package/README.md +1 -1
- package/lib/src/client/deployStrategies/auraDeploy.js +2 -2
- package/lib/src/client/deployStrategies/auraDeploy.js.map +1 -1
- package/lib/src/client/deployStrategies/baseDeploy.js +2 -2
- package/lib/src/client/deployStrategies/baseDeploy.js.map +1 -1
- package/lib/src/client/deployStrategies/containerDeploy.js +3 -3
- package/lib/src/client/deployStrategies/containerDeploy.js.map +1 -1
- package/lib/src/client/deployStrategies/lwcDeploy.js +2 -2
- package/lib/src/client/deployStrategies/lwcDeploy.js.map +1 -1
- package/lib/src/client/metadataApiRetrieve.d.ts +8 -1
- package/lib/src/client/metadataApiRetrieve.js +20 -9
- package/lib/src/client/metadataApiRetrieve.js.map +1 -1
- package/lib/src/client/metadataTransfer.js +2 -1
- package/lib/src/client/metadataTransfer.js.map +1 -1
- package/lib/src/collections/componentSet.d.ts +14 -10
- package/lib/src/collections/componentSet.js +113 -49
- package/lib/src/collections/componentSet.js.map +1 -1
- package/lib/src/collections/types.d.ts +8 -0
- package/lib/src/convert/convertContext.d.ts +1 -0
- package/lib/src/convert/convertContext.js +33 -6
- package/lib/src/convert/convertContext.js.map +1 -1
- package/lib/src/convert/metadataConverter.d.ts +2 -2
- package/lib/src/convert/metadataConverter.js +29 -22
- package/lib/src/convert/metadataConverter.js.map +1 -1
- package/lib/src/convert/streams.js +4 -4
- package/lib/src/convert/streams.js.map +1 -1
- package/lib/src/convert/transformers/decomposedMetadataTransformer.d.ts +0 -1
- package/lib/src/convert/transformers/decomposedMetadataTransformer.js +7 -24
- package/lib/src/convert/transformers/decomposedMetadataTransformer.js.map +1 -1
- package/lib/src/convert/transformers/staticResourceMetadataTransformer.js +6 -9
- package/lib/src/convert/transformers/staticResourceMetadataTransformer.js.map +1 -1
- package/lib/src/registry/nonSupportedTypes.d.ts +11 -0
- package/lib/src/registry/nonSupportedTypes.js +55 -0
- package/lib/src/registry/nonSupportedTypes.js.map +1 -0
- package/lib/src/registry/registry.d.ts +324 -1
- package/lib/src/registry/registry.json +342 -19
- package/lib/src/registry/registryAccess.d.ts +10 -0
- package/lib/src/registry/registryAccess.js +22 -1
- package/lib/src/registry/registryAccess.js.map +1 -1
- package/lib/src/registry/types.d.ts +47 -0
- package/lib/src/registry/types.js.map +1 -1
- package/lib/src/resolve/adapters/baseSourceAdapter.d.ts +1 -0
- package/lib/src/resolve/adapters/baseSourceAdapter.js +47 -15
- package/lib/src/resolve/adapters/baseSourceAdapter.js.map +1 -1
- package/lib/src/resolve/adapters/decomposedSourceAdapter.js +2 -1
- package/lib/src/resolve/adapters/decomposedSourceAdapter.js.map +1 -1
- package/lib/src/resolve/forceIgnore.d.ts +0 -5
- package/lib/src/resolve/forceIgnore.js +10 -91
- package/lib/src/resolve/forceIgnore.js.map +1 -1
- package/lib/src/resolve/manifestResolver.d.ts +1 -0
- package/lib/src/resolve/manifestResolver.js +28 -6
- package/lib/src/resolve/manifestResolver.js.map +1 -1
- package/lib/src/resolve/metadataResolver.d.ts +7 -3
- package/lib/src/resolve/metadataResolver.js +28 -3
- package/lib/src/resolve/metadataResolver.js.map +1 -1
- package/lib/src/resolve/sourceComponent.d.ts +42 -3
- package/lib/src/resolve/sourceComponent.js +106 -33
- package/lib/src/resolve/sourceComponent.js.map +1 -1
- package/lib/src/resolve/treeContainers.js +7 -7
- package/lib/src/resolve/treeContainers.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 +1 -0
- package/lib/src/utils/index.js.map +1 -1
- package/lib/src/utils/path.d.ts +22 -1
- package/lib/src/utils/path.js +32 -1
- package/lib/src/utils/path.js.map +1 -1
- package/package.json +9 -5
|
@@ -67,7 +67,28 @@ class RegistryAccess {
|
|
|
67
67
|
* @returns An array of metadata type objects that require strict parent folder names
|
|
68
68
|
*/
|
|
69
69
|
getStrictFolderTypes() {
|
|
70
|
-
|
|
70
|
+
if (!this.strictFolderTypes) {
|
|
71
|
+
this.strictFolderTypes = Object.values(this.registry.strictDirectoryNames).map((typeId) => this.registry.types[typeId]);
|
|
72
|
+
}
|
|
73
|
+
return this.strictFolderTypes;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Query for the types that have the folderContentType property defined.
|
|
77
|
+
* E.g., reportFolder, dashboardFolder, documentFolder, emailFolder
|
|
78
|
+
* @see {@link MetadataType.folderContentType}
|
|
79
|
+
*
|
|
80
|
+
* @returns An array of metadata type objects that have folder content
|
|
81
|
+
*/
|
|
82
|
+
getFolderContentTypes() {
|
|
83
|
+
if (!this.folderContentTypes) {
|
|
84
|
+
this.folderContentTypes = [];
|
|
85
|
+
for (const type of Object.values(this.registry.types)) {
|
|
86
|
+
if (type.folderContentType) {
|
|
87
|
+
this.folderContentTypes.push(type);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return this.folderContentTypes;
|
|
71
92
|
}
|
|
72
93
|
get apiVersion() {
|
|
73
94
|
return this.registry.apiVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registryAccess.js","sourceRoot":"","sources":["../../../src/registry/registryAccess.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yCAAyD;AACzD,sCAA0C;AAG1C;;GAEG;AACH,MAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"registryAccess.js","sourceRoot":"","sources":["../../../src/registry/registryAccess.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yCAAyD;AACzD,sCAA0C;AAG1C;;GAEG;AACH,MAAa,cAAc;IAMzB,YAAY,WAA6B,mBAAe;QACtD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACI,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AC3B,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAC5E,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CACxC,CAAC;SACH;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACI,qBAAqB;QAC1B,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAC5B,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;YAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;gBACrD,IAAI,IAAI,CAAC,iBAAiB,EAAE;oBAC1B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACpC;aACF;SACF;QACD,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;IAClC,CAAC;CACF;AA7FD,wCA6FC"}
|
|
@@ -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 {};
|
|
@@ -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;;;AA6IH;;GAEG;AACH,IAAkB,qBASjB;AATD,WAAkB,qBAAqB;IACrC;;OAEG;IACH,8CAAqB,CAAA;IACrB;;OAEG;IACH,wDAA+B,CAAA;AACjC,CAAC,EATiB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAStC;AAED;;GAEG;AACH,IAAkB,qBAKjB;AALD,WAAkB,qBAAqB;IACrC;;OAEG;IACH,kDAAyB,CAAA;AAC3B,CAAC,EALiB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKtC;AAED;;GAEG;AACH,IAAkB,mBAKjB;AALD,WAAkB,mBAAmB;IACnC,4CAAqB,CAAA;IACrB,gDAAyB,CAAA;IACzB,wDAAiC,CAAA;IACjC,sDAA+B,CAAA;AACjC,CAAC,EALiB,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAKpC"}
|
|
@@ -40,6 +40,7 @@ export declare abstract class BaseSourceAdapter implements SourceAdapter {
|
|
|
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
|
*
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseSourceAdapter = void 0;
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
const errors_1 = require("../../errors");
|
|
6
|
-
const path_1 = require("../../utils/path");
|
|
7
6
|
const forceIgnore_1 = require("../forceIgnore");
|
|
8
|
-
const
|
|
7
|
+
const path_1 = require("path");
|
|
9
8
|
const treeContainers_1 = require("../treeContainers");
|
|
10
9
|
const sourceComponent_1 = require("../sourceComponent");
|
|
11
10
|
const registry_1 = require("../../registry");
|
|
@@ -35,13 +34,13 @@ class BaseSourceAdapter {
|
|
|
35
34
|
}
|
|
36
35
|
let component;
|
|
37
36
|
if (rootMetadata) {
|
|
38
|
-
const componentName = this.type.folderType
|
|
39
|
-
? `${path_1.parentName(rootMetadata.path)}/${rootMetadata.fullName}`
|
|
40
|
-
: rootMetadata.fullName;
|
|
41
37
|
component = new sourceComponent_1.SourceComponent({
|
|
42
|
-
name:
|
|
38
|
+
name: this.calculateName(rootMetadata),
|
|
43
39
|
type: this.type,
|
|
44
40
|
xml: rootMetadata.path,
|
|
41
|
+
parentType: this.type.folderType
|
|
42
|
+
? this.registry.getTypeByName(this.type.folderType)
|
|
43
|
+
: undefined,
|
|
45
44
|
}, this.tree, this.forceIgnore);
|
|
46
45
|
}
|
|
47
46
|
return this.populate(path, component, isResolvingSource);
|
|
@@ -64,9 +63,9 @@ class BaseSourceAdapter {
|
|
|
64
63
|
if (metaXml) {
|
|
65
64
|
let isRootMetadataXml = false;
|
|
66
65
|
if (this.type.strictDirectoryName) {
|
|
67
|
-
const parentPath =
|
|
68
|
-
const typeDirName =
|
|
69
|
-
const nameMatchesParent =
|
|
66
|
+
const parentPath = path_1.dirname(path);
|
|
67
|
+
const typeDirName = path_1.basename(this.type.inFolder ? path_1.dirname(parentPath) : parentPath);
|
|
68
|
+
const nameMatchesParent = path_1.basename(parentPath) === metaXml.fullName;
|
|
70
69
|
const inTypeDir = typeDirName === this.type.directoryName;
|
|
71
70
|
// if the parent folder name matches the fullName OR parent folder name is
|
|
72
71
|
// metadata type's directory name, it's a root metadata xml.
|
|
@@ -95,25 +94,58 @@ class BaseSourceAdapter {
|
|
|
95
94
|
* @param path File path of a metadata component
|
|
96
95
|
*/
|
|
97
96
|
parseAsContentMetadataXml(path) {
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
// InFolder metadata can be nested more than 1 level beneath its
|
|
98
|
+
// associated directoryName.
|
|
99
|
+
if (this.type.inFolder) {
|
|
100
|
+
const fullName = utils_1.parseNestedFullName(path, this.type.directoryName);
|
|
101
|
+
if (fullName) {
|
|
102
|
+
return { fullName, suffix: this.type.suffix, path };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const parentPath = path_1.dirname(path);
|
|
106
|
+
const parts = parentPath.split(path_1.sep);
|
|
100
107
|
const typeFolderIndex = parts.lastIndexOf(this.type.directoryName);
|
|
101
|
-
|
|
108
|
+
// nestedTypes (ex: territory2) have a folderType equal to their type but are themselves
|
|
109
|
+
// in a folder per metadata item, with child folders for rules/territories
|
|
110
|
+
const allowedIndex = this.type.folderType === this.type.id ? parts.length - 2 : parts.length - 1;
|
|
102
111
|
if (typeFolderIndex !== allowedIndex) {
|
|
103
112
|
return undefined;
|
|
104
113
|
}
|
|
105
|
-
const match =
|
|
114
|
+
const match = path_1.basename(path).match(/(.+)\.(.+)/);
|
|
106
115
|
if (match && this.type.suffix === match[2]) {
|
|
107
116
|
return { fullName: match[1], suffix: match[2], path: path };
|
|
108
117
|
}
|
|
109
118
|
}
|
|
110
119
|
parseAsFolderMetadataXml(fsPath) {
|
|
111
|
-
const match =
|
|
112
|
-
const parts = fsPath.split(
|
|
120
|
+
const match = path_1.basename(fsPath).match(/(.+)-meta\.xml$/);
|
|
121
|
+
const parts = fsPath.split(path_1.sep);
|
|
113
122
|
if (match && !match[1].includes('.') && parts.length > 1) {
|
|
114
123
|
return { fullName: match[1], suffix: undefined, path: fsPath };
|
|
115
124
|
}
|
|
116
125
|
}
|
|
126
|
+
// Given a MetadataXml, build a fullName from the path and type.
|
|
127
|
+
calculateName(rootMetadata) {
|
|
128
|
+
const { directoryName, inFolder, folderType, folderContentType } = this.type;
|
|
129
|
+
// inFolder types (report, dashboard, emailTemplate, document) and their folder
|
|
130
|
+
// container types (reportFolder, dashboardFolder, emailFolder, documentFolder)
|
|
131
|
+
if (inFolder || folderContentType) {
|
|
132
|
+
return utils_1.parseNestedFullName(rootMetadata.path, directoryName);
|
|
133
|
+
}
|
|
134
|
+
// not using folders? then name is fullname
|
|
135
|
+
if (!folderType) {
|
|
136
|
+
return rootMetadata.fullName;
|
|
137
|
+
}
|
|
138
|
+
const grandparentType = this.registry.getTypeByName(folderType);
|
|
139
|
+
// type is nested inside another type (ex: Territory2Model). So the names are modelName.ruleName or modelName.territoryName
|
|
140
|
+
if (grandparentType.folderType && grandparentType.folderType !== this.type.id) {
|
|
141
|
+
const splits = rootMetadata.path.split(path_1.sep);
|
|
142
|
+
return `${splits[splits.indexOf(grandparentType.directoryName) + 1]}.${rootMetadata.fullName}`;
|
|
143
|
+
}
|
|
144
|
+
// this is the top level of nested types (ex: in a Territory2Model, the Territory2Model)
|
|
145
|
+
if (grandparentType.folderType === this.type.id) {
|
|
146
|
+
return rootMetadata.fullName;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
117
149
|
}
|
|
118
150
|
exports.BaseSourceAdapter = BaseSourceAdapter;
|
|
119
151
|
//# sourceMappingURL=baseSourceAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/baseSourceAdapter.ts"],"names":[],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"baseSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/baseSourceAdapter.ts"],"names":[],"mappings":";;;AAOA,uCAAoE;AACpE,yCAAqD;AACrD,gDAA6C;AAC7C,+BAA8C;AAC9C,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,IAAI,CAAC;QAQnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,C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Xml) {
|
|
77
77
|
const pathToContent = this.trimPathToContent(trigger);
|
|
78
78
|
const childTypeId = this.type.children.suffixes[metaXml.suffix];
|
|
79
|
-
|
|
79
|
+
// If the child is explicitly not addressable, return the parent SourceComponent.
|
|
80
|
+
const triggerIsAChild = !!childTypeId && this.type.children.types[childTypeId].isAddressable !== false;
|
|
80
81
|
const strategy = this.type.strategies.decomposition;
|
|
81
82
|
if (triggerIsAChild &&
|
|
82
83
|
(strategy === "folderPerType" /* FolderPerType */ || isResolvingSource)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decomposedSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/decomposedSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2EAAwE;AAExE,wDAAqD;AACrD,uCAAqE;AAErE,yCAAkD;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,uBAAwB,SAAQ,qDAAyB;IAAtE;;QACY,cAAS,GAAG,IAAI,CAAC;QACjB,wBAAmB,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"decomposedSourceAdapter.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/decomposedSourceAdapter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2EAAwE;AAExE,wDAAqD;AACrD,uCAAqE;AAErE,yCAAkD;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAa,uBAAwB,SAAQ,qDAAyB;IAAtE;;QACY,cAAS,GAAG,IAAI,CAAC;QACjB,wBAAmB,GAAG,KAAK,CAAC;IAuFxC,CAAC;IArFQ,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,IAA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AAQ,wCAAwC,IAAI,iBAAiB,CAAC,EACvE;gBACA,IAAI,MAAM,GAAG,SAAS,CAAC;gBACvB,IAAI,CAAC,MAAM,EAAE;oBACX,MAAM,GAAG,IAAI,iCAAe,CAC1B;wBACE,IAAI,EAAE,gBAAQ,CAAC,aAAa,CAAC;wBAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;qBAChB,EACD,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,CACjB,CAAC;iBACH;gBACD,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;AAzFD,0DAyFC"}
|
|
@@ -3,9 +3,7 @@ export declare class ForceIgnore {
|
|
|
3
3
|
static readonly FILE_NAME = ".forceignore";
|
|
4
4
|
private readonly parser;
|
|
5
5
|
private readonly forceIgnoreDirectory;
|
|
6
|
-
private readonly gitignoreParser;
|
|
7
6
|
private readonly contents?;
|
|
8
|
-
private readonly useNewParser;
|
|
9
7
|
private DEFAULT_IGNORE;
|
|
10
8
|
constructor(forceIgnorePath?: string);
|
|
11
9
|
/**
|
|
@@ -18,7 +16,4 @@ export declare class ForceIgnore {
|
|
|
18
16
|
static findAndCreate(seed: SourcePath): ForceIgnore;
|
|
19
17
|
denies(fsPath: SourcePath): boolean;
|
|
20
18
|
accepts(fsPath: SourcePath): boolean;
|
|
21
|
-
private parseContents;
|
|
22
|
-
private resolveConflict;
|
|
23
|
-
private emitWarning;
|
|
24
19
|
}
|
|
@@ -9,13 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.ForceIgnore = void 0;
|
|
10
10
|
const index_1 = require("ignore/index");
|
|
11
11
|
const path_1 = require("path");
|
|
12
|
-
const
|
|
12
|
+
const graceful_fs_1 = require("graceful-fs");
|
|
13
13
|
const fileSystemHandler_1 = require("../utils/fileSystemHandler");
|
|
14
|
-
// @ts-ignore this doesn't have typings
|
|
15
|
-
const gitignoreParser = require("gitignore-parser");
|
|
16
|
-
const core_1 = require("@salesforce/core");
|
|
17
|
-
let warn = true;
|
|
18
|
-
const troubleEmittedForPattern = new Set();
|
|
19
14
|
class ForceIgnore {
|
|
20
15
|
constructor(forceIgnorePath = '') {
|
|
21
16
|
this.DEFAULT_IGNORE = [
|
|
@@ -25,18 +20,13 @@ class ForceIgnore {
|
|
|
25
20
|
'**/package2-manifest.json',
|
|
26
21
|
];
|
|
27
22
|
try {
|
|
28
|
-
this.contents =
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.gitignoreParser = gitignoreParser.compile(this.parseContents(this.contents));
|
|
36
|
-
this.forceIgnoreDirectory = path_1.dirname(forceIgnorePath);
|
|
37
|
-
// read the file to determine which parser to use
|
|
38
|
-
this.useNewParser = this.contents.includes('# .forceignore v2');
|
|
39
|
-
// END REMOVE
|
|
23
|
+
this.contents = graceful_fs_1.readFileSync(forceIgnorePath, 'utf-8');
|
|
24
|
+
// check if file `.forceignore` exists
|
|
25
|
+
if (this.contents !== undefined) {
|
|
26
|
+
// add the default ignore paths, and then parse the .forceignore file
|
|
27
|
+
this.parser = index_1.default().add(`${this.contents}\n${this.DEFAULT_IGNORE.join('\n')}`);
|
|
28
|
+
this.forceIgnoreDirectory = path_1.dirname(forceIgnorePath);
|
|
29
|
+
}
|
|
40
30
|
}
|
|
41
31
|
catch (e) {
|
|
42
32
|
// TODO: log no force ignore
|
|
@@ -59,18 +49,7 @@ class ForceIgnore {
|
|
|
59
49
|
}
|
|
60
50
|
denies(fsPath) {
|
|
61
51
|
try {
|
|
62
|
-
|
|
63
|
-
let denies = false;
|
|
64
|
-
let fctResult = false;
|
|
65
|
-
// if there's a parser, and we're not trying to .forceignore the .forceignore
|
|
66
|
-
const relativePath = path_1.relative(this.forceIgnoreDirectory, fsPath);
|
|
67
|
-
if (this.parser && this.gitignoreParser && !!relativePath) {
|
|
68
|
-
denies = this.parser.ignores(relativePath);
|
|
69
|
-
fctResult = this.gitignoreParser.denies(relativePath);
|
|
70
|
-
// send to look for differences, analytics
|
|
71
|
-
this.resolveConflict(denies, fctResult, relativePath);
|
|
72
|
-
}
|
|
73
|
-
return this.useNewParser ? denies : fctResult;
|
|
52
|
+
return this.parser.ignores(path_1.relative(this.forceIgnoreDirectory, fsPath));
|
|
74
53
|
}
|
|
75
54
|
catch (e) {
|
|
76
55
|
return false;
|
|
@@ -78,72 +57,12 @@ class ForceIgnore {
|
|
|
78
57
|
}
|
|
79
58
|
accepts(fsPath) {
|
|
80
59
|
try {
|
|
81
|
-
|
|
82
|
-
let accepts = true;
|
|
83
|
-
let fctResult = true;
|
|
84
|
-
const relativePath = path_1.relative(this.forceIgnoreDirectory, fsPath);
|
|
85
|
-
if (this.parser && this.gitignoreParser && !!relativePath) {
|
|
86
|
-
accepts = !this.parser.ignores(relativePath);
|
|
87
|
-
fctResult = this.gitignoreParser.accepts(relativePath);
|
|
88
|
-
// send to look for differences, analytics
|
|
89
|
-
this.resolveConflict(accepts, fctResult, relativePath);
|
|
90
|
-
}
|
|
91
|
-
return this.useNewParser ? accepts : fctResult;
|
|
60
|
+
return !this.parser.ignores(path_1.relative(this.forceIgnoreDirectory, fsPath));
|
|
92
61
|
}
|
|
93
62
|
catch (e) {
|
|
94
63
|
return true;
|
|
95
64
|
}
|
|
96
65
|
}
|
|
97
|
-
// REMOVE THIS AFTER GITIGNORE-PARSER DEPRECATED
|
|
98
|
-
parseContents(contents) {
|
|
99
|
-
return contents
|
|
100
|
-
.split('\n')
|
|
101
|
-
.map((line) => line.trim())
|
|
102
|
-
.map((line) => line.replace(/[\\\/]/g, path_1.sep))
|
|
103
|
-
.map((line) => line.replace(/^\\/, ''))
|
|
104
|
-
.join('\n');
|
|
105
|
-
}
|
|
106
|
-
// AFTER GITIGNORE-PARSER DEPRECATED, remove this method
|
|
107
|
-
resolveConflict(newLibraryResults, oldLibraryResults, fsPath) {
|
|
108
|
-
const ignoreItems = this.contents.split('\n');
|
|
109
|
-
const troubledIgnoreLines = new Set();
|
|
110
|
-
if (newLibraryResults !== oldLibraryResults && ignoreItems) {
|
|
111
|
-
ignoreItems
|
|
112
|
-
.filter((ignoreItem) => ignoreItem.length)
|
|
113
|
-
.forEach((ignoreItem) => {
|
|
114
|
-
// we need to run the both of the compilers for a single line to find the problem entry
|
|
115
|
-
const gitignoreResult = gitignoreParser
|
|
116
|
-
.compile(this.parseContents(ignoreItem))
|
|
117
|
-
.accepts(fsPath);
|
|
118
|
-
const ignoreResult = !index_1.default().add([ignoreItem]).ignores(fsPath);
|
|
119
|
-
// print the warning only once per forceignore line item
|
|
120
|
-
if (ignoreResult !== gitignoreResult && !troubledIgnoreLines.has(ignoreItem)) {
|
|
121
|
-
// only show the warning once, it could come from denies() or accepts()
|
|
122
|
-
if (warn) {
|
|
123
|
-
warn = false;
|
|
124
|
-
this.emitWarning('We\'re replacing the current ".forceignore" parser with one that uses the same patterns as "git" uses with ".gitignore". Until we remove the old one, both parsers are available. But we recommend you start using the new parser soon by adding this line to the top of your ".forceignore" file: "# .forceignore v2". Read about the new ".gitgnore" pattern format here: https://git-scm.com/docs/gitignore. Then fix the following lines in your ".forceignore" file because they don\'t adhere to the new formatting rules.');
|
|
125
|
-
}
|
|
126
|
-
if (!troubleEmittedForPattern.has(ignoreItem)) {
|
|
127
|
-
troubleEmittedForPattern.add(ignoreItem);
|
|
128
|
-
this.emitWarning('\t' + ignoreItem);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
troubledIgnoreLines.add(ignoreItem);
|
|
132
|
-
});
|
|
133
|
-
// send analytics, if they exist.
|
|
134
|
-
core_1.Lifecycle.getInstance().emit('telemetry', {
|
|
135
|
-
eventName: 'FORCE_IGNORE_DIFFERENCE',
|
|
136
|
-
content: this.contents,
|
|
137
|
-
oldLibraryResults,
|
|
138
|
-
newLibraryResults,
|
|
139
|
-
ignoreLines: Array.from(troubledIgnoreLines),
|
|
140
|
-
file: fsPath,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
emitWarning(warning) {
|
|
145
|
-
process.emitWarning(warning);
|
|
146
|
-
}
|
|
147
66
|
}
|
|
148
67
|
exports.ForceIgnore = ForceIgnore;
|
|
149
68
|
ForceIgnore.FILE_NAME = '.forceignore';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forceIgnore.js","sourceRoot":"","sources":["../../../src/resolve/forceIgnore.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,wCAA8C;AAC9C,+
|
|
1
|
+
{"version":3,"file":"forceIgnore.js","sourceRoot":"","sources":["../../../src/resolve/forceIgnore.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,wCAA8C;AAC9C,+BAA+C;AAC/C,6CAA2C;AAE3C,kEAAsD;AAEtD,MAAa,WAAW;IAatB,YAAmB,eAAe,GAAG,EAAE;QAP/B,mBAAc,GAAa;YACjC,UAAU;YACV,OAAO;YACP,6BAA6B;YAC7B,2BAA2B;SAC5B,CAAC;QAGA,IAAI;YACF,IAAI,CAAC,QAAQ,GAAG,0BAAY,CAAC,eAAe,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,GAAG,cAAc,CAAC"}
|
|
@@ -39,18 +39,40 @@ class ManifestResolver {
|
|
|
39
39
|
const apiVersion = parsedManifest.version;
|
|
40
40
|
for (const typeMembers of packageTypeMembers) {
|
|
41
41
|
const typeName = typeMembers.name;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
const type = this.registry.getTypeByName(typeName);
|
|
43
|
+
const parentType = type.folderType ? this.registry.getTypeByName(type.folderType) : undefined;
|
|
44
|
+
const members = utils_1.normalizeToArray(typeMembers.members);
|
|
45
|
+
for (const fullName of members) {
|
|
46
|
+
let mdType = type;
|
|
47
|
+
if (this.isNestedInFolder(fullName, type, parentType, members)) {
|
|
48
|
+
mdType = parentType;
|
|
47
49
|
}
|
|
48
|
-
components.push({ fullName, type });
|
|
50
|
+
components.push({ fullName, type: mdType });
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
return { components, apiVersion };
|
|
52
54
|
});
|
|
53
55
|
}
|
|
56
|
+
// Use the folderType instead of the type from the manifest when:
|
|
57
|
+
// 1. InFolder types: (report, dashboard, emailTemplate, document)
|
|
58
|
+
// 1a. type.inFolder === true (from registry.json) AND
|
|
59
|
+
// 1b. The fullName doesn't contain a forward slash character AND
|
|
60
|
+
// 1c. The fullName with a slash appended is contained in another member entry
|
|
61
|
+
// OR
|
|
62
|
+
// 2. Non-InFolder, folder types: (territory2, territory2Model, territory2Type, territory2Rule)
|
|
63
|
+
// 2a. type.inFolder !== true (from registry.json) AND
|
|
64
|
+
// 2b. type.folderType has a value (from registry.json) AND
|
|
65
|
+
// 2c. This type's parent type has a folderType that doesn't match its ID.
|
|
66
|
+
isNestedInFolder(fullName, type, parentType, members) {
|
|
67
|
+
// Quick short-circuit for non-folderTypes
|
|
68
|
+
if (!type.folderType) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const isInFolderType = type.inFolder;
|
|
72
|
+
const isNestedInFolder = !fullName.includes('/') || members.some((m) => m.includes(`${fullName}/`));
|
|
73
|
+
const isNonMatchingFolder = parentType && parentType.folderType !== parentType.id;
|
|
74
|
+
return (isInFolderType && isNestedInFolder) || (!isInFolderType && isNonMatchingFolder);
|
|
75
|
+
}
|
|
54
76
|
}
|
|
55
77
|
exports.ManifestResolver = ManifestResolver;
|
|
56
78
|
//# sourceMappingURL=manifestResolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestResolver.js","sourceRoot":"","sources":["../../../src/resolve/manifestResolver.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"manifestResolver.js","sourceRoot":"","sources":["../../../src/resolve/manifestResolver.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;AAEH,0CAA2D;AAC3D,qDAAsE;AAEtE,qDAAoD;AACpD,oCAA4C;AA4B5C;;GAEG;AACH,MAAa,gBAAgB;IAI3B,YAAY,OAAsB,IAAI,oCAAmB,EAAE,EAAE,QAAQ,GAAG,IAAI,yBAAc,EAAE;QAC1F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEY,OAAO,CAAC,YAAoB;;YACvC,MAAM,UAAU,GAAwB,EAAE,CAAC;YAE3C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAEpD,MAAM,cAAc,GAA0B,uBAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;gBACtE,SAAS,EAAE,CAAC,SAAS,CAAC;aACvB,CAAC,CAAC,OAAO,CAAC;YACX,MAAM,kBAAkB,GAAG,wBAAgB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAClE,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC;YAE1C,KAAK,MAAM,WAAW,IAAI,kBAAkB,EAAE;gB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CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC;QAC7E,MAAM,mBAAmB,GAAG,UAAU,IAAI,UAAU,CAAC,UAAU,KAAK,UAAU,CAAC,EAAE,CAAC;QAElF,OAAO,CAAC,cAAc,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC,cAAc,IAAI,mBAAmB,CAAC,CAAC;IAC1F,CAAC;CACF;AAlED,4CAkEC"}
|
|
@@ -7,16 +7,18 @@ import { ComponentSet } from '../collections';
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export declare class MetadataResolver {
|
|
10
|
+
private registry;
|
|
11
|
+
private tree;
|
|
12
|
+
private useFsForceIgnore;
|
|
10
13
|
forceIgnoredPaths: Set<string>;
|
|
11
14
|
private forceIgnore;
|
|
12
15
|
private sourceAdapterFactory;
|
|
13
|
-
private
|
|
14
|
-
private registry;
|
|
16
|
+
private folderContentTypeDirNames;
|
|
15
17
|
/**
|
|
16
18
|
* @param registry Custom registry data
|
|
17
19
|
* @param tree `TreeContainer` to traverse with
|
|
18
20
|
*/
|
|
19
|
-
constructor(registry?: RegistryAccess, tree?: TreeContainer);
|
|
21
|
+
constructor(registry?: RegistryAccess, tree?: TreeContainer, useFsForceIgnore?: boolean);
|
|
20
22
|
/**
|
|
21
23
|
* Get the metadata component(s) from a file path.
|
|
22
24
|
*
|
|
@@ -49,9 +51,11 @@ export declare class MetadataResolver {
|
|
|
49
51
|
* @param fsPath File path of a potential content metadata file
|
|
50
52
|
*/
|
|
51
53
|
private parseAsContentMetadataXml;
|
|
54
|
+
private getFolderContentTypeDirNames;
|
|
52
55
|
/**
|
|
53
56
|
* Identify metadata xml for a folder component:
|
|
54
57
|
* .../email/TestFolder-meta.xml
|
|
58
|
+
* .../reports/foo/bar-meta.xml
|
|
55
59
|
*
|
|
56
60
|
* Do not match this pattern:
|
|
57
61
|
* .../tabs/TestFolder.tab-meta.xml
|
|
@@ -23,9 +23,10 @@ class MetadataResolver {
|
|
|
23
23
|
* @param registry Custom registry data
|
|
24
24
|
* @param tree `TreeContainer` to traverse with
|
|
25
25
|
*/
|
|
26
|
-
constructor(registry = new registryAccess_1.RegistryAccess(), tree = new treeContainers_1.NodeFSTreeContainer()) {
|
|
26
|
+
constructor(registry = new registryAccess_1.RegistryAccess(), tree = new treeContainers_1.NodeFSTreeContainer(), useFsForceIgnore = true) {
|
|
27
27
|
this.registry = registry;
|
|
28
28
|
this.tree = tree;
|
|
29
|
+
this.useFsForceIgnore = useFsForceIgnore;
|
|
29
30
|
this.sourceAdapterFactory = new sourceAdapterFactory_1.SourceAdapterFactory(this.registry, tree);
|
|
30
31
|
this.forceIgnoredPaths = new Set();
|
|
31
32
|
}
|
|
@@ -39,7 +40,10 @@ class MetadataResolver {
|
|
|
39
40
|
if (!this.tree.exists(fsPath)) {
|
|
40
41
|
throw new errors_1.TypeInferenceError('error_path_not_found', fsPath);
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
// use the default ignore if we aren't using a real one
|
|
44
|
+
this.forceIgnore = this.useFsForceIgnore
|
|
45
|
+
? forceIgnore_1.ForceIgnore.findAndCreate(fsPath)
|
|
46
|
+
: new forceIgnore_1.ForceIgnore();
|
|
43
47
|
if (this.tree.isDirectory(fsPath) && !this.resolveDirectoryAsComponent(fsPath)) {
|
|
44
48
|
return this.getComponentsFromPathRecursive(fsPath, inclusiveFilter);
|
|
45
49
|
}
|
|
@@ -199,19 +203,40 @@ class MetadataResolver {
|
|
|
199
203
|
parseAsContentMetadataXml(fsPath) {
|
|
200
204
|
return !!this.registry.getTypeBySuffix(utils_1.extName(fsPath));
|
|
201
205
|
}
|
|
206
|
+
// Get the array of directoryNames for types that have folderContentType
|
|
207
|
+
getFolderContentTypeDirNames() {
|
|
208
|
+
if (!this.folderContentTypeDirNames) {
|
|
209
|
+
this.folderContentTypeDirNames = this.registry
|
|
210
|
+
.getFolderContentTypes()
|
|
211
|
+
.map((t) => t.directoryName);
|
|
212
|
+
}
|
|
213
|
+
return this.folderContentTypeDirNames;
|
|
214
|
+
}
|
|
202
215
|
/**
|
|
203
216
|
* Identify metadata xml for a folder component:
|
|
204
217
|
* .../email/TestFolder-meta.xml
|
|
218
|
+
* .../reports/foo/bar-meta.xml
|
|
205
219
|
*
|
|
206
220
|
* Do not match this pattern:
|
|
207
221
|
* .../tabs/TestFolder.tab-meta.xml
|
|
208
222
|
*/
|
|
209
223
|
parseAsFolderMetadataXml(fsPath) {
|
|
224
|
+
let folderName;
|
|
210
225
|
const match = path_1.basename(fsPath).match(/(.+)-meta\.xml/);
|
|
211
226
|
if (match && !match[1].includes('.')) {
|
|
212
227
|
const parts = fsPath.split(path_1.sep);
|
|
213
|
-
|
|
228
|
+
if (parts.length > 1) {
|
|
229
|
+
const folderContentTypesDirs = this.getFolderContentTypeDirNames();
|
|
230
|
+
// check if the path contains a folder content name as a directory
|
|
231
|
+
// e.g., `/reports/` and if it does return that folder name.
|
|
232
|
+
folderContentTypesDirs.some((dirName) => {
|
|
233
|
+
if (fsPath.includes(`${path_1.sep}${dirName}${path_1.sep}`)) {
|
|
234
|
+
folderName = dirName;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
214
238
|
}
|
|
239
|
+
return folderName;
|
|
215
240
|
}
|
|
216
241
|
isMetadata(fsPath) {
|
|
217
242
|
return (!!utils_1.parseMetadataXml(fsPath) ||
|