qfpm 1.0.23 → 1.1.0

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/README.md CHANGED
@@ -5,6 +5,14 @@
5
5
  ### Installs the NPM SFDX Package Dependancy Resolution Proof of Concept scripts
6
6
  ======================================
7
7
 
8
+ ## Updates
9
+
10
+ - The removal of the bin/qfpm script dependancy complete, automated removal doesn't seem to work so feel free to delete them after upgrading
11
+
12
+ - Conversion to using native npm bin definition seems stable and opens up better linux support
13
+
14
+ - WSL support seems to be working though with a big salesforce asterisk down in the AT4DX example
15
+
8
16
  ## Install
9
17
 
10
18
  1. Open Git Bash on Windows
@@ -80,15 +88,17 @@
80
88
  ```bash
81
89
  npm install --save qfpm
82
90
  ```
83
- 1. install the the fflib commons
91
+ 1. install the at4dx libraries
84
92
  ```bash
85
93
  npm install --save npm-at4dx
86
94
  ```
87
- 1. setup scratch org and install all
95
+ 1. setup scratch org and install all*
88
96
  ```bash
89
97
  npm run setup
90
98
  ```
91
99
 
100
+ *sfdx on WSL(maybe linux in general) seems to have an issue with the README.md inside the sfdx source dirs so I moved them in the npm package
101
+
92
102
  ### Commands
93
103
 
94
104
  1. Build source into metadata format
@@ -23,7 +23,7 @@ if(!pack.scripts){
23
23
  pack.scripts = {}
24
24
  }
25
25
  scripts.forEach(script => {
26
- pack.scripts[script.name] = './node_modules/.bin/'+script.run
26
+ pack.scripts[script.name] = script.run
27
27
  })
28
28
  fs.writeFileSync(path.resolve(installPath,'package.json'),JSON.stringify(pack,null,4))
29
29
  console.log('[!] finished package.json update!')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qfpm",
3
- "version": "1.0.23",
3
+ "version": "1.1.0",
4
4
  "description": "installs the NPM SFDX Package Dependancy Resolution Proof of Concept scripts",
5
5
  "main": "index.js",
6
6
  "keywords": [
package/src/build.sh CHANGED
@@ -1,9 +1,16 @@
1
1
  #!/usr/bin/env bash
2
- echo "build PWD: $PWD"
2
+ echo "[!] build PWD: $PWD"
3
+ if [ "$DXPM_NODE_MOD" = "" ]; then
4
+ if [[ "$PWD" != *"node_modules"* ]]; then
5
+ DXPM_NODE_MOD="$PWD/node_modules"
6
+ else
7
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
8
+ fi
9
+ fi
3
10
  DXPM_CURRENT_PACKAGE_NAME="$1"
4
11
  if [ "$DXPM_CURRENT_PACKAGE_NAME" = "" ]; then
5
- DXPM_CURRENT_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
12
+ DXPM_CURRENT_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
6
13
  fi
7
14
  echo "[+] converting source for $DXPM_CURRENT_PACKAGE_NAME"
8
- sfdx force:source:convert -d "./manifest" -n "$DXPM_CURRENT_PACKAGE_NAME" -p "$($PWD/node_modules/.bin/qgetsrcfolders)" && wait
15
+ sfdx force:source:convert -d "./manifest" -n "$DXPM_CURRENT_PACKAGE_NAME" -p "$($DXPM_NODE_MOD/.bin/qgetsrcfolders)" && wait
9
16
  echo "[+] finished converting source for $DXPM_CURRENT_PACKAGE_NAME"
package/src/clean.sh CHANGED
@@ -1,9 +1,16 @@
1
1
  #!/usr/bin/env bash
2
- echo "clean PWD: $PWD"
2
+ echo "[!] clean PWD: $PWD"
3
+ if [ "$DXPM_NODE_MOD" = "" ]; then
4
+ if [[ "$PWD" != *"node_modules"* ]]; then
5
+ DXPM_NODE_MOD="$PWD/node_modules"
6
+ else
7
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
8
+ fi
9
+ fi
3
10
  DXPM_SETUP_PACKAGE_NAME="$1"
4
11
  if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
5
- DXPM_SETUP_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
12
+ DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
6
13
  fi
7
14
  echo "[+] checking if $DXPM_SETUP_PACKAGE_NAME scrach org exists and deleting it"
8
- $PWD/node_modules/.bin/qisscratched && sfdx force:org:delete -u "$DXPM_SETUP_PACKAGE_NAME" -p && wait
15
+ $DXPM_NODE_MOD/.bin/qisscratched && sfdx force:org:delete -u "$DXPM_SETUP_PACKAGE_NAME" -p && wait
9
16
  echo "[+] finished cleaning $DXPM_SETUP_PACKAGE_NAME scrach org"
package/src/deploy.sh CHANGED
@@ -1,7 +1,14 @@
1
1
  #!/usr/bin/env bash
2
+ if [ "$DXPM_NODE_MOD" = "" ]; then
3
+ if [[ "$PWD" != *"node_modules"* ]]; then
4
+ DXPM_NODE_MOD="$PWD/node_modules"
5
+ else
6
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
7
+ fi
8
+ fi
2
9
  DXPM_SETUP_PACKAGE_NAME="$1"
3
10
  if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
4
- DXPM_SETUP_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
11
+ DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
5
12
  fi
6
13
  DXPM_CURRENT_PACKAGE_NAME="$2"
7
14
  if [ "$DXPM_CURRENT_PACKAGE_NAME" = "" ]; then
@@ -9,5 +16,5 @@ if [ "$DXPM_CURRENT_PACKAGE_NAME" = "" ]; then
9
16
  fi
10
17
  echo "[+] deploying $DXPM_CURRENT_PACKAGE_NAME metadata to scratch org $DXPM_SETUP_PACKAGE_NAME"
11
18
  #todo: read package.json for all folder locations
12
- sfdx force:source:deploy -p "$($PWD/node_modules/.bin/qgetsrcfolders)" -w 10 -u "$DXPM_SETUP_PACKAGE_NAME" && wait
19
+ sfdx force:source:deploy -p "$($DXPM_NODE_MOD/.bin/qgetsrcfolders)" -w 10 -u "$DXPM_SETUP_PACKAGE_NAME" && wait
13
20
  echo "[+] finished deploying $DXPM_CURRENT_PACKAGE_NAME metadata to scratch org $DXPM_SETUP_PACKAGE_NAME"
@@ -1,17 +1,24 @@
1
1
  #!/usr/bin/env bash
2
2
  echo "[!] postinstall PWD: $PWD"
3
3
  echo "[!] postinstall INIT_CWD: $INIT_CWD"
4
- DXPM_SETUP_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname $INIT_CWD)"
5
- DXPM_CURRENT_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
4
+ if [ "$DXPM_NODE_MOD" = "" ]; then
5
+ if [[ "$PWD" != *"node_modules"* ]]; then
6
+ DXPM_NODE_MOD="$PWD/node_modules"
7
+ else
8
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
9
+ fi
10
+ fi
11
+ DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname $INIT_CWD)"
12
+ DXPM_CURRENT_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
6
13
  echo "[!] postinstall DXPM_SETUP_PACKAGE_NAME: $DXPM_SETUP_PACKAGE_NAME"
7
14
  echo "[!] postinstall DXPM_CURRENT_PACKAGE_NAME: $DXPM_CURRENT_PACKAGE_NAME"
8
15
  echo "[+] check if $DXPM_CURRENT_PACKAGE_NAME is the setup package $DXPM_SETUP_PACKAGE_NAME or a dependancy of $DXPM_SETUP_PACKAGE_NAME"
9
16
  if [ "$DXPM_SETUP_PACKAGE_NAME" = "$DXPM_CURRENT_PACKAGE_NAME" ]; then
10
17
  echo "[+] setting up for $DXPM_CURRENT_PACKAGE_NAME development and testing"
11
- $PWD/node_modules/.bin/qisscratched && bash $PWD/node_modules/.bin/qpush $DXPM_CURRENT_PACKAGE_NAME && wait
18
+ $DXPM_NODE_MOD/.bin/qisscratched && $DXPM_NODE_MOD/.bin/qpush $DXPM_CURRENT_PACKAGE_NAME && wait
12
19
  echo "[+] finished setting up for $DXPM_CURRENT_PACKAGE_NAME development and testing"
13
20
  else
14
21
  echo "[+] installing dependancy $DXPM_CURRENT_PACKAGE_NAME of $DXPM_SETUP_PACKAGE_NAME"
15
- $PWD/node_modules/.bin/qisscratched $DXPM_SETUP_PACKAGE_NAME && bash $PWD/bin/qfpm/deploy.sh $DXPM_SETUP_PACKAGE_NAME $DXPM_CURRENT_PACKAGE_NAME && wait
22
+ $DXPM_NODE_MOD/.bin/qisscratched $DXPM_SETUP_PACKAGE_NAME && $DXPM_NODE_MOD/.bin/qdeploy $DXPM_SETUP_PACKAGE_NAME $DXPM_CURRENT_PACKAGE_NAME && wait
16
23
  echo "[+] finished installing dependancy $DXPM_CURRENT_PACKAGE_NAME of $DXPM_SETUP_PACKAGE_NAME"
17
24
  fi
package/src/preinstall.sh CHANGED
@@ -1,13 +1,20 @@
1
1
  #!/usr/bin/env bash
2
2
  echo "[!] preinstall PWD: $PWD"
3
3
  echo "[!] preinstall INIT_CWD: $INIT_CWD"
4
- DXPM_SETUP_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname $INIT_CWD)"
5
- DXPM_CURRENT_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
4
+ if [ "$DXPM_NODE_MOD" = "" ]; then
5
+ if [[ "$PWD" != *"node_modules"* ]]; then
6
+ DXPM_NODE_MOD="$PWD/node_modules"
7
+ else
8
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
9
+ fi
10
+ fi
11
+ DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname $INIT_CWD)"
12
+ DXPM_CURRENT_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
6
13
  echo "[!] preinstall DXPM_SETUP_PACKAGE_NAME: $DXPM_SETUP_PACKAGE_NAME"
7
14
  echo "[!] preinstall DXPM_CURRENT_PACKAGE_NAME: $DXPM_CURRENT_PACKAGE_NAME"
8
15
  echo "[+] begin install of $DXPM_CURRENT_PACKAGE_NAME"
9
16
  if [ "$DXPM_SETUP_PACKAGE_NAME" = "$DXPM_CURRENT_PACKAGE_NAME" ]; then
10
17
  echo "[+] removing dependancies for $DXPM_CURRENT_PACKAGE_NAME to force reinstall"
11
- $PWD/node_modules/.bin/qremovedepends
18
+ $DXPM_NODE_MOD/.bin/qremovedepends
12
19
  echo "[+] finished removing dependancies for $DXPM_CURRENT_PACKAGE_NAME"
13
20
  fi
package/src/push.sh CHANGED
@@ -1,7 +1,14 @@
1
1
  #!/usr/bin/env bash
2
+ if [ "$DXPM_NODE_MOD" = "" ]; then
3
+ if [[ "$PWD" != *"node_modules"* ]]; then
4
+ DXPM_NODE_MOD="$PWD/node_modules"
5
+ else
6
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
7
+ fi
8
+ fi
2
9
  DXPM_SETUP_PACKAGE_NAME="$1"
3
10
  if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
4
- DXPM_SETUP_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
11
+ DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
5
12
  fi
6
13
  echo "[+] pushing source to scratch org $DXPM_SETUP_PACKAGE_NAME"
7
14
  sfdx force:source:push -f -w 10 -u "$DXPM_SETUP_PACKAGE_NAME" && wait
@@ -1,5 +1,12 @@
1
1
  #!/usr/bin/env bash
2
- folders="$(find $PWD/node_modules/ -name sfdx-project.json)"
2
+ if [ "$DXPM_NODE_MOD" = "" ]; then
3
+ if [[ "$PWD" != *"node_modules"* ]]; then
4
+ DXPM_NODE_MOD="$PWD/node_modules"
5
+ else
6
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
7
+ fi
8
+ fi
9
+ folders="$(find $DXPM_NODE_MOD/ -name sfdx-project.json)"
3
10
  folders="$(echo $folders | sed 's/\/sfdx-project.json//g')"
4
11
  for val in $folders; do
5
12
  rm -fr $val
package/src/scratch.sh CHANGED
@@ -1,7 +1,14 @@
1
1
  #!/usr/bin/env bash
2
+ if [ "$DXPM_NODE_MOD" = "" ]; then
3
+ if [[ "$PWD" != *"node_modules"* ]]; then
4
+ DXPM_NODE_MOD="$PWD/node_modules"
5
+ else
6
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
7
+ fi
8
+ fi
2
9
  DXPM_SETUP_PACKAGE_NAME="$1"
3
10
  if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
4
- DXPM_SETUP_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
11
+ DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
5
12
  fi
6
13
  echo "[+] setting up scratch org $DXPM_SETUP_PACKAGE_NAME"
7
14
  sfdx force:org:create -f $PWD/config/project-scratch-def.json -a "$DXPM_SETUP_PACKAGE_NAME" -d 1 -w 5 && wait
package/src/setup.sh CHANGED
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env bash
2
- export DXPM_SETUP_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
2
+ export DXPM_SETUP_PATH="$PWD"
3
+ export DXPM_NODE_MOD="$PWD/node_modules"
4
+ export DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
3
5
  export DXPM_CURRENT_PACKAGE_NAME="$DXPM_SETUP_PACKAGE_NAME"
4
6
  echo "[+] checking if $DXPM_SETUP_PACKAGE_NAME scrach org exists or creating it"
5
- $PWD/node_modules/.bin/qisscratched || $PWD/node_modules/.bin/qscratch && wait
7
+ $DXPM_NODE_MOD/.bin/qisscratched || $DXPM_NODE_MOD/.bin/qscratch && wait
6
8
  echo "[+] installing package $DXPM_SETUP_PACKAGE_NAME"
7
9
  npm install --only=prod && wait
8
10
  echo "[+] finished installing package $DXPM_SETUP_PACKAGE_NAME"
package/src/test.sh CHANGED
@@ -1,7 +1,14 @@
1
1
  #!/usr/bin/env bash
2
+ if [ "$DXPM_NODE_MOD" = "" ]; then
3
+ if [[ "$PWD" != *"node_modules"* ]]; then
4
+ DXPM_NODE_MOD="$PWD/node_modules"
5
+ else
6
+ DXPM_NODE_MOD=$(echo $PWD | sed -r "s|^(.*/node_modules)/(.*)$|\1|g")
7
+ fi
8
+ fi
2
9
  DXPM_SETUP_PACKAGE_NAME="$1"
3
10
  if [ "$DXPM_SETUP_PACKAGE_NAME" = "" ]; then
4
- DXPM_SETUP_PACKAGE_NAME="$($PWD/node_modules/.bin/qgetprojectname)"
11
+ DXPM_SETUP_PACKAGE_NAME="$($DXPM_NODE_MOD/.bin/qgetprojectname)"
5
12
  fi
6
13
  echo "[+] running tests for $DXPM_SETUP_PACKAGE_NAME"
7
14
  sfdx force:apex:test:run -l RunLocalTests -d ./test_results -r json -w 10 -u "$DXPM_SETUP_PACKAGE_NAME" && wait