Configure Your Project

A. Ensure you have enabled and authenticated to DevHub

Ensure you have enabled DevHub in your production org or created a developer org.

B. Authenticate your Salesforce CLI to DevHub

Ensure you have authenticated your local development environment to your DevHub. If you are not familiar with the process, you can follow the instructions provided by Salesforce here.

C. Add additional attributes to your Salesforce DX Project

sfp cli only works with a Salesforce DX project, with source format as described here . If your project is not source format, you would need to convert into source format using the options provided by salesforce cli.

  1. Navigate to your sfdx-project.json file and locate the packageDirectories property.

{ 
"packageDirectories" : [ 
    { "path": "force-app", "default": true}, 
    { "path" : "unpackaged" }, 
    { "path" : "utils" } 
  ],
"namespace": "", 
"sfdcLoginUrl" : "https://login.salesforce.com", 
"sourceApiVersion": "60.0"
}

In the above example, the package directories are

  • force-app

  • unpackaged

  • utils

  1. Add the following additional attributes to the sfdx-project.json and save.

  • package

  • versionNumber

{
   "packageDirectories" : [ 
    {
       "package": "force-app",
       "versionNumber": "1.0.0.NEXT",
       "path": "force-app",
       "default": true
     }, 
    { "path" : "unpackaged" },  // You can repeat the same for additonal directories
    { "path" : "utils" }  // You can repeat the same for additonal directories
   ],
"namespace": "", 
"sfdcLoginUrl" : "https://login.salesforce.com", 
"sourceApiVersion": "60.0"
}

Thats the minimal configuration required to run sfp on a project.

Move on to the next chapter to execute sfp commands in this directory.

For detailed configurations on this sfdx-project.json schema for sfp, click here.

Last updated