@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.
@@ -0,0 +1 @@
1
+ force-app-party/**/*.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ds-sfdc/sfparty",
3
- "version": "1.4.10",
3
+ "version": "1.4.12",
4
4
  "description": "Salesforce metadata XML splitter for CI/CD",
5
5
  "type": "module",
6
6
  "repository": {
@@ -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
- 'sfparty update',
63
+ updateCommand,
57
64
  )}`,
58
65
  )
59
66
  return 'A newer version'
@@ -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
- // delete file
48
- fsTmp.unlinkSync(curPath)
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)
@@ -116,35 +116,37 @@ export class Combine {
116
116
  })
117
117
 
118
118
  function processStart(that) {
119
- const pathMatch = `/${that.metadataDefinition.directory}/${
120
- that.#fileName.shortName
121
- }/`
119
+ // set delta based on metadata definition if git delta enabled
120
+ that.#delta = that.metadataDefinition.delta && global.git.delta
122
121
 
123
- // get a list of all the added files
124
- that.#addedFiles = global.metaTypes[
125
- that.metadataDefinition.alias
126
- ].add.files.filter((i) =>
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
- // get a list of all the removed files
131
- that.#deletedFiles = global.metaTypes[
132
- that.metadataDefinition.alias
133
- ].remove.files.filter((i) =>
134
- i.toLowerCase().includes(pathMatch.toLowerCase()),
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
- // check if main part file deleted
138
- that.#mainDeleted = global.metaTypes[
139
- that.metadataDefinition.alias
140
- ].remove.files.some(
141
- (i) =>
142
- i.includes(pathMatch) &&
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
- // set delta based on metadata definition if git delta enabled
147
- that.#delta = that.metadataDefinition.delta && global.git.delta
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
- global.git.delta &&
461
+ that.#delta &&
460
462
  !global.metaTypes[
461
463
  that.metadataDefinition.alias
462
464
  ].add.files.includes(fileObj.fullName) &&