gussamer / qfpm

A blend of NPM and SFDX into a Salesforce package dependancy management tool set

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NPM Downloads/week QFPM Tests qfpm License

QFPM

QRFDev Package Manager

A blend of NPM and SFDX into a Salesforce package dependancy management tool set

The package mangement methodology intended with qfpm is meant to aid with the dependancy management side of salesforce packages. Currently this could be implmented with a private npm service to benefit from the npm dependancy resolution applied to a teams salesforce metadata libraries as they are broken down into packages with a dependancy hierarchy. QFPM could be extended to support the management of sfdx package2 building and installation with dependencies, as well converted to sfdx plugin, if I ever get around to doing it.

Updates

  • The removal of the bin/qfpm script dependancy complete, automated removal doesn't seem to work so feel free to delete them after upgrading

  • Conversion to using native npm bin definition seems stable and opens up better linux support

  • WSL support seems to be working though with a big salesforce asterisk down in the AT4DX example

Install

  1. Open Git Bash on Windows
  2. Navigate to folder you want your project
  3. Create a SFDX project with
    sfdx force:project:create -n newsfdxproject
  4. Move into the project folder with
    cd newsfdxproject
  5. Install the qfpm tools with*
    npm install qfpm --save --only=prod
  6. Run setup to create scratch org and deploy dependancies
    npm run setup

* qfpm has no external dependancies all warnings are due to packages salesforce uses in their default project package.json

Use

Example

Setup FFLIB commons sample code with dependancies

This example demonstates facilitating two layers of dependancies required to get started with the fflib apex common sample code library. The sample code requries the fflib apex commons library which intern is dependant on the fflib apex mocks library. With example npm packages for both the commons and mocks published publicly to npm, qfpm is able to install all dependancies via soap to avoid source tracking and then push the sample code for work tracked in the scratch org.

  1. Navigate to the fflib sample code
  2. Clone the repo locally
    git clone https://github.com/apex-enterprise-patterns/fflib-apex-common-samplecode.git
  3. cd into repo
    cd fflib-apex-common-samplecode
  4. init npm to create package.json
    npm init -y
  5. install the qfpm tools
    npm install --save qfpm
  6. install the the fflib commons
    npm install --save npm-fflib-common
  7. setup scratch org and install all
    npm run setup

Setup AT4DX sample code with dependancies

This example expands on the previous fflib sample code to satisfy the requirments of the at4dx sample code. As before the multi layered fflib commons and mocks are required by the at4dx requirement which also has a parallel dependancy of force-di. All of which are installed via soap into a scratch org with the at4dx sample code pushed for tracking.

  1. Navigate to the at4dx sample code
  2. Clone the repo locally
    git clone https://github.com/apex-enterprise-patterns/at4dx-samplecode.git
  3. cd into repo
    cd at4dx-samplecode
  4. init npm to create package.json
    npm init -y
  5. install the qfpm tools
    npm install --save qfpm
  6. install the at4dx libraries
    npm install --save npm-at4dx
  7. setup scratch org and install all*
    npm run setup

*sfdx on WSL(maybe linux in general) seems to have an issue thinking the README.md inside the sfdx source dirs is a custom metadata type, so I removed them in the npm package as they just said put stuff here. You can run this command after cloning to delete all the offending README.md files in this repo as a work around.

for x in $(find ./sfdx-source/ -name README.md); do rm -f $x; done

Commands

  1. Build source into metadata format

    • executes sfdx source convert
    npm run build
  2. Clean up scratch org

    • marks projects scratch org for deletion
    npm run clean
  3. Deploy whole project directly as metadata format

    • executes sfdx source deploy
    • bypasses source tracking
    npm run deploy
  4. Push source to scratch org

    • executes sfdx source push
    npm run push
  5. Scratch a new org

    • creates new scratch org from config
    • checks if org already exists
    npm run scratch
  6. Setup current project for development

    • setups up a scratch org
    • deploys all dependancies to scratch org
    npm run setup
  7. Test project

    • runs all tests in scratch org
    npm run test

About

A blend of NPM and SFDX into a Salesforce package dependancy management tool set

License:ISC License


Languages

Language:Shell 72.7%Language:JavaScript 23.5%Language:Apex 3.8%