Org Check is an easy-to-install and easy-to-use Salesforce application in order to quickly analyze your org and its technical debt.
This guide will walk you through setting up a developer environment allowing you to deploy Org Check as your own unlocked package.
This page is also a good start if you want to participate in the project and propose your own PR o the team!
Before you begin, ensure you have installed the following elements:
First, clone the Org Check project repository from GitHub:
git clone https://github.com/SalesforceLabs/OrgCheck.git
cd OrgCheck
Make sure your user is correclty setup in git:
git config --global user.name "<Your Fullname>"
git config --global user.email "<Your Email>"
You need two developer orgs:
Pre-requisite: Enable Unlocked Packages and Second-Generation Managed Packages
Create a fresh sfdx-project.json file with your namespace:
{
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "<yournamespace>",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "64.0"
}
Replace <namespace> with your actual namespace.
Pre-requisite:
sf plugins install @salesforce/plugin-packagingCreate an Unlocked package based on OrgCheck using the Salesforce CLI(Recommended for debugging):
sf package create --name "Org Check Unlocked" --package-type Unlocked --path force-app --target-dev-hub <devhubalias>
Alternatively, you can also create and test the OrgCheck App as a Managed package:
sf package create --name "Org Check" --package-type Managed --path force-app --target-dev-hub <devhubalias>
Use yarn build:js to generate the necessary JavaScript files:
yarn install && yarn build:js
Use build-static-resource.sh (bash) or build-static-resource.ps1(powershell) to generate a Static resource at: force-app/main/default/staticresources/OrgCheck_SR.resource
build/build-static-resource.sh
Create a package version with the generated Package Id:
sf package version create --package "Org Check" --installation-key-bypass --wait 10 --target-dev-hub <devhubalias>
Note the Subscriber Package Version Id from the output.
If you want to use a scratch org, create it using:
sf org create scratch --definition-file orgs/dev.json --alias <scratchorgalias> --target-dev-hub <devhubalias> --wait 10
Deploy the package to your org using the Subscriber Package Version Id.
sf package install --package <subscriberpackageversionid> -u <scratchorgalias> -w 10
Alternatively, you can use the corresponding alias of the version id, which has been generated for you (on step 7) in the sfdx-project.json under the section packageAliases.
sf package install --package <namespace>@1.2.3.4 -u <scratchorgalias> -w 10
To debug, go to Setup in Salesforce:
OrgCheck_App_VFP.If you encounter any issues, check the following:
sfdx-project.json.You should now have a fully working unlocked package of Org Check, using your own namespace. For further assistance, refer to the official documentation or reach out to the community. Happy coding!