@ds-sfdc/sfparty 1.4.2 → 1.4.4

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.
File without changes
package/package.json CHANGED
@@ -1,64 +1,64 @@
1
1
  {
2
- "name": "@ds-sfdc/sfparty",
3
- "version": "1.4.2",
4
- "description": "Salesforce metadata XML splitter for CI/CD",
5
- "type": "module",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/TimPaulaskasDS/sfparty.git"
9
- },
10
- "bin": {
11
- "sfparty": "src/index.js"
12
- },
13
- "main": "src/index.js",
14
- "scripts": {
15
- "test": "jest",
16
- "_postinstall": "husky install",
17
- "prepack": "pinst --disable",
18
- "postpack": "pinst --enable"
19
- },
20
- "keywords": [
21
- "salesforce,metadata,xml,split,yaml,json"
22
- ],
23
- "author": "Tim Paulaskas",
24
- "license": "BSD-3-Clause",
25
- "dependencies": {
26
- "axios": "^1.2.2",
27
- "cli-color": "^2.0.3",
28
- "cli-spinners": "^2.7.0",
29
- "convert-hrtime": "^5.0.0",
30
- "js-yaml": "^4.1.0",
31
- "log-update": "^5.0.1",
32
- "marked": "^4.2.12",
33
- "marked-terminal": "^5.1.1",
34
- "pinst": "^3.0.0",
35
- "pretty-quick": "^3.1.3",
36
- "semver": "^7.3.8",
37
- "util": "^0.10.3",
38
- "winston": "^3.8.2",
39
- "xml2js": "^0.4.23",
40
- "yargs": "^17.6.2"
41
- },
42
- "devDependencies": {
43
- "@babel/core": "^7.20.12",
44
- "@babel/preset-env": "^7.20.2",
45
- "@commitlint/cli": "^17.4.0",
46
- "@commitlint/config-conventional": "^17.4.0",
47
- "babel-jest": "^29.3.1",
48
- "husky": "^8.0.3",
49
- "jest": "^29.3.1",
50
- "nodemon": "^2.0.20",
51
- "prettier": "^2.8.3"
52
- },
53
- "engines": {
54
- "node": ">=0.11"
55
- },
56
- "bugs": {
57
- "url": "https://github.com/TimPaulaskasDS/sfparty/issues"
58
- },
59
- "homepage": "https://github.com/TimPaulaskasDS/sfparty#readme",
60
- "directories": {
61
- "lib": "lib",
62
- "test": "tests"
63
- }
2
+ "name": "@ds-sfdc/sfparty",
3
+ "version": "1.4.4",
4
+ "description": "Salesforce metadata XML splitter for CI/CD",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/TimPaulaskasDS/sfparty.git"
9
+ },
10
+ "bin": {
11
+ "sfparty": "src/index.js"
12
+ },
13
+ "main": "src/index.js",
14
+ "scripts": {
15
+ "test": "jest",
16
+ "_postinstall": "husky install",
17
+ "prepack": "pinst --disable",
18
+ "postpack": "pinst --enable"
19
+ },
20
+ "keywords": [
21
+ "salesforce,metadata,xml,split,yaml,json"
22
+ ],
23
+ "author": "Tim Paulaskas",
24
+ "license": "BSD-3-Clause",
25
+ "dependencies": {
26
+ "axios": "^1.2.2",
27
+ "cli-color": "^2.0.3",
28
+ "cli-spinners": "^2.7.0",
29
+ "convert-hrtime": "^5.0.0",
30
+ "js-yaml": "^4.1.0",
31
+ "log-update": "^5.0.1",
32
+ "marked": "^4.2.12",
33
+ "marked-terminal": "^5.1.1",
34
+ "pinst": "^3.0.0",
35
+ "pretty-quick": "^3.1.3",
36
+ "semver": "^7.3.8",
37
+ "util": "^0.10.3",
38
+ "winston": "^3.8.2",
39
+ "xml2js": "^0.4.23",
40
+ "yargs": "^17.6.2"
41
+ },
42
+ "devDependencies": {
43
+ "@babel/core": "^7.20.12",
44
+ "@babel/preset-env": "^7.20.2",
45
+ "@commitlint/cli": "^17.4.0",
46
+ "@commitlint/config-conventional": "^17.4.0",
47
+ "babel-jest": "^29.3.1",
48
+ "husky": "^8.0.3",
49
+ "jest": "^29.3.1",
50
+ "nodemon": "^2.0.20",
51
+ "prettier": "^2.8.3"
52
+ },
53
+ "engines": {
54
+ "node": ">=0.11"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/TimPaulaskasDS/sfparty/issues"
58
+ },
59
+ "homepage": "https://github.com/TimPaulaskasDS/sfparty#readme",
60
+ "directories": {
61
+ "lib": "lib",
62
+ "test": "tests"
63
+ }
64
64
  }
package/src/index.js CHANGED
@@ -350,7 +350,11 @@ function yargCheck(argv, options) {
350
350
  !options.array.includes(key),
351
351
  )
352
352
 
353
- if (!argv._.includes('update')) {
353
+ if (
354
+ !argv._.includes('update') &&
355
+ !argv._.includes('combine') &&
356
+ !argv._.includes('split')
357
+ ) {
354
358
  checkVersion({
355
359
  axios,
356
360
  spawnSync,
@@ -452,6 +456,12 @@ function splitHandler(argv, startTime) {
452
456
  let message = `Split completed in `
453
457
  displayMessageAndDuration(startTime, message)
454
458
  }
459
+ checkVersion({
460
+ axios,
461
+ spawnSync,
462
+ currentVersion: pkgObj.version,
463
+ update: false,
464
+ })
455
465
  }
456
466
  })
457
467
  }
@@ -601,6 +611,12 @@ function combineHandler(argv, startTime) {
601
611
  let message = `Split completed in `
602
612
  displayMessageAndDuration(startTime, message)
603
613
  }
614
+ checkVersion({
615
+ axios,
616
+ spawnSync,
617
+ currentVersion: pkgObj.version,
618
+ update: false,
619
+ })
604
620
  }
605
621
  })
606
622
  combine.catch((error) => {
@@ -28,8 +28,9 @@ export async function checkVersion({
28
28
  currentVersion,
29
29
  update = false,
30
30
  }) {
31
+ let result
31
32
  try {
32
- const { data } = await axios.get(
33
+ let { data } = await axios.get(
33
34
  'https://registry.npmjs.org/@ds-sfdc/sfparty',
34
35
  {
35
36
  params: {
@@ -37,9 +38,15 @@ export async function checkVersion({
37
38
  },
38
39
  },
39
40
  )
40
- const latestVersion = data['dist-tags'].latest
41
+ result = data
42
+ } catch (error) {
43
+ // do not display errors
44
+ }
45
+
46
+ if (result !== undefined) {
47
+ const latestVersion = result['dist-tags'].latest
41
48
  if (semver.gt(latestVersion, currentVersion)) {
42
- const version = clc.bgMagenta(data['dist-tags'].latest)
49
+ const version = clc.bgMagenta(result['dist-tags'].latest)
43
50
  const icon = update ? global.icons.working : global.icons.fail
44
51
  console.log()
45
52
  console.log(`${icon} A newer version ${version} is available.`)
@@ -85,12 +92,5 @@ export async function checkVersion({
85
92
  }
86
93
  return 'You are on the latest version'
87
94
  }
88
- } catch (error) {
89
- if (error.response && error.response.status === 404) {
90
- error = new PackageNotFoundError(
91
- 'Package not found on the npm registry',
92
- )
93
- }
94
- throw error
95
95
  }
96
96
  }
@@ -4,6 +4,7 @@ export const metadataDefinition = {
4
4
  directory: 'labels',
5
5
  filetype: 'labels',
6
6
  root: 'CustomLabels',
7
+ type: 'CustomLabel',
7
8
  alias: 'label',
8
9
  main: ['$'],
9
10
  singleFiles: [],
@@ -4,6 +4,7 @@ export const metadataDefinition = {
4
4
  directory: 'permissionsets',
5
5
  filetype: 'permissionset',
6
6
  root: 'PermissionSet',
7
+ type: 'PermissionSet',
7
8
  alias: 'permset',
8
9
  main: [
9
10
  'label',
@@ -4,6 +4,7 @@ export const metadataDefinition = {
4
4
  directory: 'profiles',
5
5
  filetype: 'profile',
6
6
  root: 'Profile',
7
+ type: 'Profile',
7
8
  alias: 'profile',
8
9
  main: ['fullName', 'custom', 'description', 'userLicense', '$'],
9
10
  singleFiles: [
@@ -4,6 +4,7 @@ export const metadataDefinition = {
4
4
  directory: 'workflows',
5
5
  filetype: 'workflow',
6
6
  root: 'Workflow',
7
+ type: 'Workflow',
7
8
  alias: 'workflow',
8
9
  main: ['$'],
9
10
  singleFiles: [],
@@ -6,7 +6,6 @@ import cliSpinners from 'cli-spinners'
6
6
  import fs from 'fs'
7
7
  import * as xml2js from 'xml2js'
8
8
  import * as fileUtils from '../lib/fileUtils.js'
9
- import * as packageUtil from '../lib/packageUtil.js'
10
9
 
11
10
  const spinner = cliSpinners['dots']
12
11
  const processed = {
@@ -156,7 +155,7 @@ export class Combine {
156
155
  ) {
157
156
  if (!that.#delta || that.#addedFiles.length > 0) {
158
157
  that.addPkg.addMember(
159
- that.#root,
158
+ that.metadataDefinition.type,
160
159
  that.#fileName.shortName,
161
160
  )
162
161
  }
@@ -164,7 +163,7 @@ export class Combine {
164
163
  // only include the workflow node if main part file is delete
165
164
  if (that.#delta && that.#mainDeleted) {
166
165
  that.desPkg.addMember(
167
- that.#root,
166
+ that.metadataDefinition.type,
168
167
  that.#fileName.shortName,
169
168
  )
170
169
  }
@@ -195,7 +194,10 @@ export class Combine {
195
194
  !that.metadataDefinition.packageTypeIsDirectory &&
196
195
  global.git.enabled
197
196
  ) {
198
- that.desPkg.addMember(that.#root, that.#fileName.shortName)
197
+ that.desPkg.addMember(
198
+ that.metadataDefinition.type,
199
+ that.#fileName.shortName,
200
+ )
199
201
  }
200
202
  deleteFile(that, that.#fileName.fullName)
201
203
  return 'deleted'
@@ -443,7 +445,7 @@ export class Combine {
443
445
  that.metadataDefinition.packageTypeIsDirectory
444
446
  ) {
445
447
  that.desPkg.addMember(
446
- that.#root,
448
+ that.metadataDefinition.type,
447
449
  fileObj.shortName.replace(`.${global.format}`, ''),
448
450
  )
449
451
  }
@@ -524,7 +526,7 @@ export class Combine {
524
526
  )
525
527
  } else if (that.metadataDefinition.packageTypeIsDirectory) {
526
528
  that.addPkg.addMember(
527
- that.#root,
529
+ that.metadataDefinition.type,
528
530
  fileObj.shortName.replace(`.${global.format}`, ''),
529
531
  )
530
532
  }