Contributing
Everyone is welcome to contribute to sfdx-hardis (even juniors: we will help you).
Salesforce CLI Plugin: sfdx-hardis
- Install Node.js (recommended version)
- Install TypeScript by running
npm install typescript --global - Install yarn by running
npm install yarn --global - Install the Salesforce CLI by running
npm install @salesforce/cli --global - Fork https://github.com/hardisgroupcom/sfdx-hardis and clone it (or just clone if you are an internal contributor)
- At the root of the repository:
- Run
yarnto install dependencies - Run
sf plugins linkto link the local sfdx-hardis to the Salesforce CLI - Run
tsc --watchto transpile TypeScript into JavaScript every time you update a TS file
- Run
- Debug commands using
NODE_OPTIONS=--inspect-brk sf hardis:somecommand --someparameter somevalue(you can also debug commands with the VS Code SFDX Hardis extension debug setting)
Note: To test a feature from CI, you can add the following code in your workflow before running sfdx-hardis commands:
REPO_URL="https://github.com/hardisgroupcom/sfdx-hardis.git" # or your forked repo URL
GIT_BRANCH="fixes/my-git-branch" # or the branch you want to test
TEMP_DIR=$(mktemp -d)
git clone "$REPO_URL" "$TEMP_DIR"
cd "$TEMP_DIR"
git checkout "$GIT_BRANCH"
yarn
npm install typescript --global
tsc
sf plugins link
cd -
VS Code Extension: vscode-sfdx-hardis
- Install Node.js (recommended version)
- Install TypeScript by running
npm install typescript --global - Install yarn by running
npm install yarn --global - Install Visual Studio Code Insiders (download here)
- Fork https://github.com/hardisgroupcom/vscode-sfdx-hardis and clone it (or just clone if you are an internal contributor)
- At the root of the repository:
- Run
yarnto install dependencies
- Run
- To test your code in the VS Code extension:
- Open the
vscode-sfdx-hardisfolder in VS Code Insiders - Press
F5to open a new VS Code window with the extension loaded (or menu Run > Start Debugging) - In the new window, open a Salesforce DX project
- Run commands from the command palette (Ctrl+Shift+P) or use the buttons in the panel or webviews
- Open the