@ds-sfdc/sfparty 1.4.9 → 1.4.11
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/.prettierignore +1 -0
- package/package.json +1 -1
- package/src/lib/fileUtils.js +6 -2
- package/src/party/combine.js +43 -26
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
force-app-party/**/*.yaml
|
package/package.json
CHANGED
package/src/lib/fileUtils.js
CHANGED
|
@@ -44,8 +44,12 @@ export function deleteDirectory(dirPath, recursive = false, fsTmp = fs) {
|
|
|
44
44
|
// recurse
|
|
45
45
|
deleteDirectory(curPath, recursive, fsTmp)
|
|
46
46
|
} else {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
try {
|
|
48
|
+
// delete file
|
|
49
|
+
fsTmp.unlinkSync(curPath)
|
|
50
|
+
} catch (error) {
|
|
51
|
+
fsTmp.rmdirSync(curPath)
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
})
|
|
51
55
|
return fsTmp.rmdirSync(dirPath)
|
package/src/party/combine.js
CHANGED
|
@@ -22,6 +22,7 @@ export class Combine {
|
|
|
22
22
|
#fileName = {
|
|
23
23
|
fullName: undefined,
|
|
24
24
|
shortName: undefined,
|
|
25
|
+
profileName: undefined,
|
|
25
26
|
}
|
|
26
27
|
#errorMessage = ''
|
|
27
28
|
#frameIndex = 0
|
|
@@ -115,35 +116,37 @@ export class Combine {
|
|
|
115
116
|
})
|
|
116
117
|
|
|
117
118
|
function processStart(that) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}/`
|
|
119
|
+
// set delta based on metadata definition if git delta enabled
|
|
120
|
+
that.#delta = that.metadataDefinition.delta && global.git.delta
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
i.toLowerCase().includes(pathMatch.toLowerCase()),
|
|
127
|
-
)
|
|
122
|
+
if (that.#delta) {
|
|
123
|
+
const pathMatch = `/${that.metadataDefinition.directory}/${
|
|
124
|
+
that.#fileName.shortName
|
|
125
|
+
}/`
|
|
128
126
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
// get a list of all the added files
|
|
128
|
+
that.#addedFiles = global.metaTypes[
|
|
129
|
+
that.metadataDefinition.alias
|
|
130
|
+
].add.files.filter((i) =>
|
|
131
|
+
i.toLowerCase().includes(pathMatch.toLowerCase()),
|
|
132
|
+
)
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
i.toLowerCase().includes(`/main.${global.format}`),
|
|
143
|
-
)
|
|
134
|
+
// get a list of all the removed files
|
|
135
|
+
that.#deletedFiles = global.metaTypes[
|
|
136
|
+
that.metadataDefinition.alias
|
|
137
|
+
].remove.files.filter((i) =>
|
|
138
|
+
i.toLowerCase().includes(pathMatch.toLowerCase()),
|
|
139
|
+
)
|
|
144
140
|
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
// check if main part file deleted
|
|
142
|
+
that.#mainDeleted = global.metaTypes[
|
|
143
|
+
that.metadataDefinition.alias
|
|
144
|
+
].remove.files.some(
|
|
145
|
+
(i) =>
|
|
146
|
+
i.includes(pathMatch) &&
|
|
147
|
+
i.toLowerCase().includes(`/main.${global.format}`),
|
|
148
|
+
)
|
|
149
|
+
}
|
|
147
150
|
|
|
148
151
|
let success = processParts(that)
|
|
149
152
|
// Ensure we only match existing metadata type directory and item
|
|
@@ -455,7 +458,7 @@ export class Combine {
|
|
|
455
458
|
|
|
456
459
|
// abort function if doing a delta deploy and file is not in git list
|
|
457
460
|
if (
|
|
458
|
-
|
|
461
|
+
that.#delta &&
|
|
459
462
|
!global.metaTypes[
|
|
460
463
|
that.metadataDefinition.alias
|
|
461
464
|
].add.files.includes(fileObj.fullName) &&
|
|
@@ -469,6 +472,20 @@ export class Combine {
|
|
|
469
472
|
return true
|
|
470
473
|
}
|
|
471
474
|
let result = fileUtils.readFile(fileObj.fullName)
|
|
475
|
+
if (
|
|
476
|
+
fileObj.fullName ==
|
|
477
|
+
path.join(
|
|
478
|
+
that.sourceDir,
|
|
479
|
+
that.metaDir,
|
|
480
|
+
`main.${global.format}`,
|
|
481
|
+
) &&
|
|
482
|
+
that.#type == 'profile'
|
|
483
|
+
) {
|
|
484
|
+
that.#fileName.profileName = path.join(
|
|
485
|
+
that.targetDir,
|
|
486
|
+
result.main.fullName + `.${that.#type}-meta.xml`,
|
|
487
|
+
)
|
|
488
|
+
}
|
|
472
489
|
|
|
473
490
|
// if split by object we need to add object back to values
|
|
474
491
|
if (
|