Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coverage:
precision: 2
round: down
range: "75...100"
range: '75...100'
status:
patch:
default:
Expand All @@ -19,4 +19,4 @@ coverage:
flags:
- Apex
ignore:
- "force-app/main/default/staticresources/**"
- 'force-app/main/default/staticresources/**'
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ on:
#- "sfdx-project.json"
#- "README.md"
paths:
- "force-app/**"
- ".github/workflows/ci.yml"
- 'force-app/**'
- '.github/workflows/ci.yml'

# Jobs to be executed
jobs:
format-lint:
runs-on: ubuntu-latest
steps:
# Checkout the source code
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4

# Cache node_modules to speed up the process
- name: "Restore node_modules cache"
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v3
with:
Expand All @@ -32,12 +32,12 @@ jobs:
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies for Prettier and Jest
- name: "Install npm dependencies"
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

# Prettier formatting
- name: "Code formatting verification with Prettier"
- name: 'Code formatting verification with Prettier'
run: npm run prettier:verify:apex

pmd-analysis:
Expand All @@ -46,17 +46,17 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Checkout the source code
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install PMD
- name: "Install PMD"
- name: 'Install PMD'
run: |
PMD_VERSION=$(curl -s https://api.github.com/repos/pmd/pmd/releases/latest | grep '.tag_name' | sed 's:.*/::' | sed 's:",::')
wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F$PMD_VERSION/pmd-dist-$PMD_VERSION-bin.zip
unzip pmd-dist-$PMD_VERSION-bin.zip -d ~
mv ~/pmd-bin-$PMD_VERSION ~/pmd
~/pmd/bin/pmd --version
# Run PMD scan
- name: "Run PMD scan"
- name: 'Run PMD scan'
run: ~/pmd/bin/pmd check --dir force-app --rulesets pmd/apexQuickStart.xml --format text --cache pmd/cache --minimum-priority "Medium Low"
6 changes: 3 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4
- name: Install Dependencies
run: |
Expand All @@ -17,7 +17,7 @@ jobs:
- name: Populate auth file
run: 'echo "${{ secrets.SALESFORCE_AUTH_URL }}" > ./SALESFORCE_AUTH_URL.txt'
- name: Authenticate Dev Hub
run: "sf org login sfdx-url --sfdx-url-file ./SALESFORCE_AUTH_URL.txt --alias DevHub --set-default-dev-hub"
run: 'sf org login sfdx-url --sfdx-url-file ./SALESFORCE_AUTH_URL.txt --alias DevHub --set-default-dev-hub'
- name: Create Scratch Org
run: sf force org create scratch --set-default --definition-file config/project-scratch-def.json --alias ciorg --duration-days 1
- name: Deploy source
Expand All @@ -28,7 +28,7 @@ jobs:
run: sf apex run test --code-coverage --result-format human --output-dir ./
#- name: Delete coverage file (temporary fix)
# run: rm ./test-result-707*-codecoverage.json
- name: "Upload code coverage for Apex to Codecov.io"
- name: 'Upload code coverage for Apex to Codecov.io'
uses: codecov/codecov-action@v3
with:
flags: Apex
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dependabot-approve-and-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: "Fetch Dependabot metadata"
- name: 'Fetch Dependabot metadata'
id: dependabot
uses: dependabot/fetch-metadata@v1

- name: "Check auto merge conditions"
- name: 'Check auto merge conditions'
id: auto-merge
if: |
(
Expand All @@ -28,7 +28,7 @@ jobs:
)
run: echo "::notice ::auto-merge conditions satisfied"

- name: "Approve and merge PR"
- name: 'Approve and merge PR'
if: ${{ steps.auto-merge.conclusion == 'success' }}
run: |
gh pr review --approve "$PR_URL"
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
pull_request:
types: [opened, edited, synchronize, reopened]
paths:
- "force-app/**"
- ".github/workflows/pr.yml"
- 'force-app/**'
- '.github/workflows/pr.yml'

# Jobs to be executed
jobs:
Expand All @@ -17,15 +17,15 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout the source code
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Volta to enforce proper node and package manager versions
- name: "Install Volta"
- name: 'Install Volta'
uses: volta-cli/action@v4

# Cache node_modules to speed up the process
- name: "Restore node_modules cache"
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v3
with:
Expand All @@ -36,12 +36,12 @@ jobs:
npm-

# Install npm dependencies for Prettier and Jest
- name: "Install npm dependencies"
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

# Prettier formatting
- name: "Code formatting verification with Prettier"
- name: 'Code formatting verification with Prettier'
run: npm run prettier:verify

scratch-org-test:
Expand All @@ -50,30 +50,30 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Checkout the source code
- name: "Checkout source code"
- name: 'Checkout source code'
uses: actions/checkout@v4

# Run PMD scan
- name: "Run PMD scan"
- name: 'Run PMD scan'
uses: pmd/pmd-github-action@v1
id: pmd
with:
sourcePath: "force-app"
rulesets: "pmd/apexQuickStart.xml"
sourcePath: 'force-app'
rulesets: 'pmd/apexQuickStart.xml'

# Check for PMD violations
- name: "Check for PMD violations"
- name: 'Check for PMD violations'
if: steps.pmd.outputs.violations != 0
run: exit 1

# Install Salesforce CLI
- name: "Install Salesforce CLI"
- name: 'Install Salesforce CLI'
run: |
npm install @salesforce/cli --global
sf --version

# Store secret for dev hub
- name: "Populate auth file with SALESFORCE_AUTH_URL secret"
- name: 'Populate auth file with SALESFORCE_AUTH_URL secret'
shell: bash
run: |
echo ${{ secrets.SALESFORCE_AUTH_URL}} > ./SALESFORCE_AUTH_URL.txt
Expand All @@ -84,36 +84,36 @@ jobs:
fi

# Authenticate dev hub
- name: "Authenticate Dev Hub"
- name: 'Authenticate Dev Hub'
run: sf org login sfdx-url --sfdx-url-file ./SALESFORCE_AUTH_URL.txt --alias devhub --set-default-dev-hub

# Create scratch org
- name: "Create scratch org"
run: sf org create scratch --definition-file config/project-scratch-def.json --alias scratch-org --set-default --duration-days 1
- name: 'Create scratch org'
run: SF_USE_PROGRESS_BAR=false sf org create scratch --definition-file config/project-scratch-def.json --alias scratch-org --set-default --duration-days 1 --no-track-source

# Deploy source to scratch org
- name: "Push source to scratch org"
- name: 'Push source to scratch org'
run: sf project deploy start

# Assign permissionset
- name: "Assign permissionset to default user"
- name: 'Assign permissionset to default user'
run: sf org assign permset --name Duplicates_Handler

# Run Apex tests in scratch org
- name: "Run Apex tests"
- name: 'Run Apex tests'
run: sf apex run test --code-coverage --result-format human --output-dir ./tests/apex --wait 20

# Delete temporary test file that Codecov is unable to parse
- name: "Delete coverage file (temporary step)"
- name: 'Delete coverage file (temporary step)'
run: rm ./tests/apex/test-result-707*-codecoverage.json

# Upload code coverage data
- name: "Upload code coverage for Apex to Codecov.io"
- name: 'Upload code coverage for Apex to Codecov.io'
uses: codecov/codecov-action@v3
with:
flags: Apex

# Housekeeping
- name: "Delete scratch org"
- name: 'Delete scratch org'
if: always()
run: sf org delete scratch --no-prompt --target-org scratch-org
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

pmd/
coverage/
docs/assets/
docs/assets/*.js
doc-assets/

LICENSE
27 changes: 24 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,42 @@
"printWidth": 180,
"bracketSameLine": true,
"bracketSpacing": true,
"apexInsertFinalNewline": false,
"htmlWhitespaceSensitivity": "css",
"xmlSelfClosingSpace": true,
"overrides": [
{
"files": "*.cls",
"options": {
"apexInsertFinalNewline": false,
"parser": "apex"
}
},
{
"files": "**/lwc/**/*.html",
"options": { "parser": "lwc" }
},
{
"files": "*.{cmp,page,component}",
"files": "docs/*.html",
"options": {
"parser": "html",
"tabWidth": 2,
"useTabs": true,
"bracketSameLine": true,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "ignore",
"printWidth": 180
}
},
{
"files": "*.{cmp,page,component,html}",
"options": { "parser": "html" }
},
{
"files": "sfdx-project.json",
"options": { "useTabs": false, "tabWidth": 2 }
},
{ "files": "*.yml", "options": { "parser": "yaml" } },
{ "files": "*.{yml,yaml}", "options": { "parser": "yaml", "singleQuote": true } },
{ "files": ".prettierrc", "options": { "parser": "json" } }
],
"plugins": ["prettier-plugin-apex", "@prettier/plugin-xml"],
Expand Down
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"**/node_modules": true,
"**/bower_components": true,
"**/.sfdx": true,
"**/.sf": true
"**/.sf": true
},
"salesforcedx-vscode-core.retrieve-test-code-coverage": true,
"apexPMD.enableCache": true,
Expand All @@ -19,5 +19,6 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.configPath": ".prettierrc",
//"prettier.prettierPath": "node_modules/prettier/index.cjs",
"salesforcedx-vscode-core.push-or-deploy-on-save.enabled": false
"salesforcedx-vscode-core.push-or-deploy-on-save.enabled": false,
"editor.tabSize": 2
}
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

> This application is designed to run on the Salesforce Platform.

## [Changelog](./CHANGELOG.md)

## Table of contents

- [Quick Deploy](#quick-deploy): Fast, easy installation of this repository into any org.
Expand All @@ -16,6 +18,19 @@

- [Installing the app using a Developer Edition Org or a Trailhead Playground](#installing-the-app-using-a-developer-edition-org-or-a-trailhead-playground): Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a Scratch org.

## Package Installation

<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04t3a000000LdirAAC">
<img alt="Deploy to Salesforce"
src="./media/deploy-package-to-prod.png">
</a>
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04t3a000000LdirAAC">
<img alt="Deploy to Salesforce Sandbox"
src="./media/deploy-package-to-sandbox.png">
</a>

<br/>

## Quick Deploy

<a href="https://githubsfdeploy.herokuapp.com">
Expand Down
Loading