@ds-sfdc/sfparty 1.4.1 → 1.4.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/package.json
CHANGED
package/src/lib/packageUtil.js
CHANGED
|
@@ -68,8 +68,9 @@ export class Package {
|
|
|
68
68
|
packageDefinition.metadataDefinition.fallbackVersion
|
|
69
69
|
}
|
|
70
70
|
that.packageJSON = json
|
|
71
|
-
if (json.Package.types !== undefined)
|
|
71
|
+
if (json.Package.types !== undefined) {
|
|
72
72
|
transformJSON(json.Package.types)
|
|
73
|
+
}
|
|
73
74
|
cleanPackage(that)
|
|
74
75
|
}
|
|
75
76
|
|
|
@@ -80,6 +81,7 @@ export class Package {
|
|
|
80
81
|
)
|
|
81
82
|
if (that.packageJSON.Package == undefined)
|
|
82
83
|
throw new Error('Package initialization failed')
|
|
84
|
+
|
|
83
85
|
if (that.packageJSON.Package.types === undefined)
|
|
84
86
|
return 'No types found'
|
|
85
87
|
|
|
@@ -93,6 +95,12 @@ export class Package {
|
|
|
93
95
|
)
|
|
94
96
|
}
|
|
95
97
|
})
|
|
98
|
+
|
|
99
|
+
// remove all types nodes that have no members
|
|
100
|
+
that.packageJSON.Package.types =
|
|
101
|
+
that.packageJSON.Package.types.filter(
|
|
102
|
+
(subType) => subType.members.length > 0,
|
|
103
|
+
)
|
|
96
104
|
}
|
|
97
105
|
}
|
|
98
106
|
|
package/src/meta/Profiles.js
CHANGED
package/src/meta/Workflows.js
CHANGED
package/src/party/combine.js
CHANGED
|
@@ -32,7 +32,7 @@ export class Combine {
|
|
|
32
32
|
mtime: undefined,
|
|
33
33
|
}
|
|
34
34
|
#json = {}
|
|
35
|
-
#
|
|
35
|
+
#delta = false
|
|
36
36
|
#addedFiles = []
|
|
37
37
|
#deletedFiles = []
|
|
38
38
|
#mainDeleted = false
|
|
@@ -86,11 +86,6 @@ export class Combine {
|
|
|
86
86
|
combine() {
|
|
87
87
|
return new Promise((resolve, reject) => {
|
|
88
88
|
const that = this
|
|
89
|
-
that.#diffOnly =
|
|
90
|
-
global.metaTypes[that.metadataDefinition.alias].add.files
|
|
91
|
-
.length > 0 ||
|
|
92
|
-
global.metaTypes[that.metadataDefinition.alias].remove.files
|
|
93
|
-
.length > 0
|
|
94
89
|
|
|
95
90
|
if (!fileUtils.directoryExists({ dirPath: that.sourceDir, fs }))
|
|
96
91
|
reject(`Path does not exist: ${that.sourceDir}`)
|
|
@@ -148,6 +143,9 @@ export class Combine {
|
|
|
148
143
|
i.toLowerCase().includes(`/main.${global.format}`),
|
|
149
144
|
)
|
|
150
145
|
|
|
146
|
+
// set delta based on metadata definition
|
|
147
|
+
that.#delta = that.metadataDefinition.delta
|
|
148
|
+
|
|
151
149
|
let success = processParts(that)
|
|
152
150
|
// Ensure we only match existing metadata type directory and item
|
|
153
151
|
|
|
@@ -156,7 +154,7 @@ export class Combine {
|
|
|
156
154
|
!that.metadataDefinition.packageTypeIsDirectory &&
|
|
157
155
|
global.git.enabled
|
|
158
156
|
) {
|
|
159
|
-
if (!that.#
|
|
157
|
+
if (!that.#delta || that.#addedFiles.length > 0) {
|
|
160
158
|
that.addPkg.addMember(
|
|
161
159
|
that.#root,
|
|
162
160
|
that.#fileName.shortName,
|
|
@@ -164,7 +162,7 @@ export class Combine {
|
|
|
164
162
|
}
|
|
165
163
|
|
|
166
164
|
// only include the workflow node if main part file is delete
|
|
167
|
-
if (that.#
|
|
165
|
+
if (that.#delta && that.#mainDeleted) {
|
|
168
166
|
that.desPkg.addMember(
|
|
169
167
|
that.#root,
|
|
170
168
|
that.#fileName.shortName,
|
|
@@ -389,7 +387,7 @@ export class Combine {
|
|
|
389
387
|
)
|
|
390
388
|
}
|
|
391
389
|
|
|
392
|
-
if (that.#
|
|
390
|
+
if (that.#delta) {
|
|
393
391
|
if (
|
|
394
392
|
!that.#addedFiles
|
|
395
393
|
.concat(that.#deletedFiles)
|
|
@@ -152,7 +152,7 @@ it('should correctly process the json object returned from the XML file', async
|
|
|
152
152
|
name: 'PermissionSet',
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
|
-
members: ['Test
|
|
155
|
+
members: ['Test.yaml'],
|
|
156
156
|
name: 'Workflow',
|
|
157
157
|
},
|
|
158
158
|
],
|
|
@@ -182,10 +182,6 @@ it('should correctly process the json object returned from the XML file', async
|
|
|
182
182
|
members: ['Test'],
|
|
183
183
|
name: 'PermissionSet',
|
|
184
184
|
},
|
|
185
|
-
{
|
|
186
|
-
members: ['Test'],
|
|
187
|
-
name: 'Workflow',
|
|
188
|
-
},
|
|
189
185
|
],
|
|
190
186
|
version: '56.0',
|
|
191
187
|
},
|