@ds-sfdc/sfparty 1.4.10 → 1.4.12
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/checkVersion.js +8 -1
- package/src/lib/fileUtils.js +6 -2
- package/src/party/combine.js +28 -26
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
force-app-party/**/*.yaml
|
package/package.json
CHANGED
package/src/lib/checkVersion.js
CHANGED
|
@@ -43,6 +43,13 @@ export async function checkVersion({
|
|
|
43
43
|
// do not display errors
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
let updateCommand
|
|
47
|
+
if (process.env.npm_lifecycle_script === 'sfparty') {
|
|
48
|
+
updateCommand = 'npm i @ds-sfdc/sfparty@latest'
|
|
49
|
+
} else {
|
|
50
|
+
updateCommand = 'sfparty update'
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
if (result !== undefined) {
|
|
47
54
|
const latestVersion = result['dist-tags'].latest
|
|
48
55
|
if (semver.gt(latestVersion, currentVersion)) {
|
|
@@ -53,7 +60,7 @@ export async function checkVersion({
|
|
|
53
60
|
if (!update) {
|
|
54
61
|
console.log(
|
|
55
62
|
`Please upgrade by running ${clc.cyanBright(
|
|
56
|
-
|
|
63
|
+
updateCommand,
|
|
57
64
|
)}`,
|
|
58
65
|
)
|
|
59
66
|
return 'A newer version'
|
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
|
@@ -116,35 +116,37 @@ export class Combine {
|
|
|
116
116
|
})
|
|
117
117
|
|
|
118
118
|
function processStart(that) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}/`
|
|
119
|
+
// set delta based on metadata definition if git delta enabled
|
|
120
|
+
that.#delta = that.metadataDefinition.delta && global.git.delta
|
|
122
121
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
i.toLowerCase().includes(pathMatch.toLowerCase()),
|
|
128
|
-
)
|
|
122
|
+
if (that.#delta) {
|
|
123
|
+
const pathMatch = `/${that.metadataDefinition.directory}/${
|
|
124
|
+
that.#fileName.shortName
|
|
125
|
+
}/`
|
|
129
126
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
+
)
|
|
136
133
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
i.toLowerCase().includes(`/main.${global.format}`),
|
|
144
|
-
)
|
|
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
|
+
)
|
|
145
140
|
|
|
146
|
-
|
|
147
|
-
|
|
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
|
+
}
|
|
148
150
|
|
|
149
151
|
let success = processParts(that)
|
|
150
152
|
// Ensure we only match existing metadata type directory and item
|
|
@@ -456,7 +458,7 @@ export class Combine {
|
|
|
456
458
|
|
|
457
459
|
// abort function if doing a delta deploy and file is not in git list
|
|
458
460
|
if (
|
|
459
|
-
|
|
461
|
+
that.#delta &&
|
|
460
462
|
!global.metaTypes[
|
|
461
463
|
that.metadataDefinition.alias
|
|
462
464
|
].add.files.includes(fileObj.fullName) &&
|