qfpm 1.1.1 → 1.1.3

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/.forceignore ADDED
@@ -0,0 +1,8 @@
1
+ # List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
2
+ # More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
3
+ #
4
+
5
+ package.xml
6
+ bin/
7
+ etc/
8
+ src/
@@ -0,0 +1,9 @@
1
+ # CONTRIBUTING
2
+
3
+ If I was to update this I'd likely re-write it into javascript and possibly a sfdx plugin, but if one does want to contribute to this in its frankenstien bash javascript form.
4
+
5
+ 1. Clone
6
+ 2. Edit
7
+ 3. Submit Pull Request
8
+ 4. Wait untill it is looked at it
9
+ 5. Repeat as needed
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ [![NPM](https://img.shields.io/npm/v/qfpm.svg)](https://www.npmjs.com/package/qfpm)
2
+ [![Downloads/week](https://img.shields.io/npm/dw/qfpm.svg)](https://npmjs.org/package/qfpm)
3
+ ![QFPM Tests](https://github.com/gussamer/qfpm/actions/workflows/qfpmtest.yml/badge.svg)
4
+ [![qfpm](https://snyk.io/advisor/npm-package/qfpm/badge.svg)](https://snyk.io/advisor/npm-package/qfpm)
5
+ [![License](https://img.shields.io/badge/ISC-blue.svg)](https://raw.githubusercontent.com/gussamer/qfpm/master/LICENSE)
1
6
  # QFPM
2
7
 
3
8
  ## QRFDev Package Manager
@@ -8,6 +13,8 @@ The package mangement methodology intended with qfpm is meant to aid with the de
8
13
 
9
14
  ## Updates
10
15
 
16
+ - Updated the commands for the new sf structure
17
+
11
18
  - The removal of the bin/qfpm script dependancy complete, automated removal doesn't seem to work so feel free to delete them after upgrading
12
19
 
13
20
  - Conversion to using native npm bin definition seems stable and opens up better linux support
@@ -20,7 +27,7 @@ The package mangement methodology intended with qfpm is meant to aid with the de
20
27
  1. Navigate to folder you want your project
21
28
  1. Create a SFDX project with
22
29
  ```bash
23
- sfdx force:project:create -n newsfdxproject
30
+ sf force project create -n newsfdxproject
24
31
  ```
25
32
  1. Move into the project folder with
26
33
  ```bash
@@ -35,7 +42,7 @@ The package mangement methodology intended with qfpm is meant to aid with the de
35
42
  npm run setup
36
43
  ```
37
44
 
38
- \* qfpm has no external dependancies all warnings are due to packages salesforce uses in their default project package.json
45
+ \* all warnings are due to packages salesforce uses in their default project package.json
39
46
 
40
47
  ## Use
41
48
 
@@ -54,9 +61,9 @@ This example demonstates facilitating two layers of dependancies required to get
54
61
  ```bash
55
62
  cd fflib-apex-common-samplecode
56
63
  ```
57
- 1. init npm and hit enter through all questions
64
+ 1. init npm to create package.json
58
65
  ```bash
59
- npm init
66
+ npm init -y
60
67
  ```
61
68
  1. install the qfpm tools
62
69
  ```bash
@@ -85,9 +92,9 @@ This example expands on the previous fflib sample code to satisfy the requirment
85
92
  ```bash
86
93
  cd at4dx-samplecode
87
94
  ```
88
- 1. init npm and hit enter through all questions
95
+ 1. init npm to create package.json
89
96
  ```bash
90
- npm init
97
+ npm init -y
91
98
  ```
92
99
  1. install the qfpm tools
93
100
  ```bash
package/SECURITY.md ADDED
@@ -0,0 +1,4 @@
1
+ # Security
2
+ ___
3
+
4
+ Please report any vulnerabilities in the issues here on github as soon as possible. QFPM only depends on SFDX... and NPM and NODE but otherwise has no production dependancies to reduce possible issues but that doesn't preclude the possibility.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qfpm",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Salesforce package management tool set for mananging dependencies between packages",
5
5
  "main": "index.js",
6
6
  "man": "./README.md",
@@ -0,0 +1,11 @@
1
+ {
2
+ "packageDirectories": [
3
+ {
4
+ "path": "test",
5
+ "default": true
6
+ }
7
+ ],
8
+ "namespace": "",
9
+ "sfdcLoginUrl": "https://login.salesforce.com",
10
+ "sourceApiVersion": "55.0"
11
+ }
package/src/build.sh CHANGED
@@ -12,5 +12,5 @@ if [ "$DXPM_CURRENT_PACKAGE_NAME" = "" ]; then
12
12
  DXPM_CURRENT_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
13
13
  fi
14
14
  echo "[+] converting source for $DXPM_CURRENT_PACKAGE_NAME"
15
- sfdx force:source:convert -d "./manifest" -n "$DXPM_CURRENT_PACKAGE_NAME" -p "$($DXPM_NODE_MOD/.bin/qgetsrcfolders)" && wait
15
+ sf force source convert -d "./manifest" -n "$DXPM_CURRENT_PACKAGE_NAME" -p "$($DXPM_NODE_MOD/.bin/qgetsrcfolders)" && wait
16
16
  echo "[+] finished converting source for $DXPM_CURRENT_PACKAGE_NAME"
package/src/clean.sh CHANGED
@@ -12,5 +12,5 @@ if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
12
12
  DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
13
13
  fi
14
14
  echo "[+] checking if $DXPM_SETUP_PACKAGE_NAME scrach org exists and deleting it"
15
- $DXPM_NODE_MOD/.bin/qisscratched && sfdx force:org:delete -u "$DXPM_SETUP_PACKAGE_NAME" -p && wait
15
+ $DXPM_NODE_MOD/.bin/qisscratched && sf org delete scratch -o "$DXPM_SETUP_PACKAGE_NAME" -p && wait
16
16
  echo "[+] finished cleaning $DXPM_SETUP_PACKAGE_NAME scrach org"
package/src/deploy.sh CHANGED
@@ -16,5 +16,5 @@ if [ "$DXPM_CURRENT_PACKAGE_NAME" = "" ]; then
16
16
  fi
17
17
  echo "[+] deploying $DXPM_CURRENT_PACKAGE_NAME metadata to scratch org $DXPM_SETUP_PACKAGE_NAME"
18
18
  #todo: read package.json for all folder locations
19
- sfdx force:source:deploy -p "$($DXPM_NODE_MOD/.bin/qgetsrcfolders)" -w 10 -u "$DXPM_SETUP_PACKAGE_NAME" && wait
19
+ sf force source deploy -p "$($DXPM_NODE_MOD/.bin/qgetsrcfolders)" -w 10 -u "$DXPM_SETUP_PACKAGE_NAME" && wait
20
20
  echo "[+] finished deploying $DXPM_CURRENT_PACKAGE_NAME metadata to scratch org $DXPM_SETUP_PACKAGE_NAME"
package/src/isqfpm.js CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env node
2
- var packageJSON = require('fs').readFileSync(process.cwd()+'/package.json')
2
+ var location
3
+ if(process.argv[2]==undefined) location=process.cwd()
4
+ else location=process.argv[2]
5
+ var packageJSON = require('fs').readFileSync(location+'/package.json')
3
6
  var pack = JSON.parse(packageJSON)
4
7
  if(pack['dependencies']!==undefined){
5
8
  if(pack['dependencies'].hasOwnProperty('qfpm')) process.exit()
@@ -5,7 +5,7 @@ if(process.argv[2]==undefined){
5
5
  var pack = JSON.parse(packageJSON)
6
6
  scratchName=pack.name
7
7
  }else scratchName=process.argv[2]
8
- var orgsJSON = require('child_process').execSync('sfdx force:org:list --json')
8
+ var orgsJSON = require('child_process').execSync('sf force org list --json')
9
9
  var orgs = JSON.parse(orgsJSON).result
10
10
  orgs.scratchOrgs.forEach(org => {
11
11
  if(org.alias==scratchName) process.exit()
package/src/push.sh CHANGED
@@ -11,5 +11,5 @@ if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
11
11
  DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
12
12
  fi
13
13
  echo "[+] pushing source to scratch org $DXPM_SETUP_PACKAGE_NAME"
14
- sfdx force:source:push -f -w 10 -u "$DXPM_SETUP_PACKAGE_NAME" && wait
14
+ sf force source push -f -w 10 -o "$DXPM_SETUP_PACKAGE_NAME" && wait
15
15
  echo "[+] finished pushing source to scratch org $DXPM_SETUP_PACKAGE_NAME"
@@ -9,5 +9,5 @@ fi
9
9
  folders="$(find $DXPM_NODE_MOD/ -name sfdx-project.json)"
10
10
  folders="$(echo $folders | sed 's/\/sfdx-project.json//g')"
11
11
  for val in $folders; do
12
- rm -fr $val
12
+ $DXPM_NODE_MOD/.bin/qisqfpm "$val" && rm -fr $val
13
13
  done
package/src/scratch.sh CHANGED
@@ -11,8 +11,8 @@ if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
11
11
  DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
12
12
  fi
13
13
  echo "[+] setting up scratch org $DXPM_SETUP_PACKAGE_NAME"
14
- sfdx force:org:create -f $PWD/config/project-scratch-def.json -a "$DXPM_SETUP_PACKAGE_NAME" -d 1 -w 5 && wait
14
+ sf force org create -f $PWD/config/project-scratch-def.json -a "$DXPM_SETUP_PACKAGE_NAME" -d 1 -w 6 && wait
15
15
  echo "[+] finished setting up scratch org $DXPM_SETUP_PACKAGE_NAME"
16
16
  echo "[+] setting scratch org $DXPM_SETUP_PACKAGE_NAME as default locally"
17
- sfdx force:config:set defaultusername=$DXPM_SETUP_PACKAGE_NAME
17
+ sf force config set target-org $DXPM_SETUP_PACKAGE_NAME
18
18
  echo "[+] finished setting scratch org $DXPM_SETUP_PACKAGE_NAME as default username locally"
package/src/setup.sh CHANGED
@@ -6,7 +6,7 @@ export DXPM_CURRENT_PACKAGE_NAME="$DXPM_SETUP_PACKAGE_NAME"
6
6
  echo "[+] checking if $DXPM_SETUP_PACKAGE_NAME scrach org exists or creating it"
7
7
  $DXPM_NODE_MOD/.bin/qisscratched || $DXPM_NODE_MOD/.bin/qscratch && wait
8
8
  echo "[+] installing package $DXPM_SETUP_PACKAGE_NAME"
9
- npm install --only=prod && wait
9
+ npm install --omit=dev && wait
10
10
  echo "[+] finished installing package $DXPM_SETUP_PACKAGE_NAME"
11
11
  export DXPM_CURRENT_PACKAGE_NAME=""
12
12
  export DXPM_SETUP_PACKAGE_NAME=""
package/src/test.sh CHANGED
@@ -11,5 +11,5 @@ if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
11
11
  DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
12
12
  fi
13
13
  echo "[+] running tests for $DXPM_SETUP_PACKAGE_NAME"
14
- sfdx force:apex:test:run -l RunLocalTests -d ./test_results -r json -w 10 -u "$DXPM_SETUP_PACKAGE_NAME" && wait
14
+ sf force apex test run -l RunLocalTests -d ./test_results -r json -w 10 -o "$DXPM_SETUP_PACKAGE_NAME" && wait
15
15
  echo "[+] finished running tests for $DXPM_SETUP_PACKAGE_NAME"