Skip to content

Salesforce CLI with Multiple Packages - Improve Scratch Org compatibility #412

@RemyVULTAGGIO

Description

@RemyVULTAGGIO

The problem :
Following the best practices in Salesforce led me to have a multiple packages SFDX project.
The project is splitted in several packageDirectories (sfdx-project.json). Each Package Directory stands for a Feature of my Salesforce Org. Some are big, others are small, but every Package is standalone.
While naturally using a Scratch Org in developping phase, I encountered a painful constraint : sfdx force:source:status/push/pull commands include every sources of every Package Directories. Thereby I can't focus on a specific Package,

What I am trying to do :
In a multiple packages SFDX project, as a Developer, I want to be able to create a Scratch Org for a specified Package Directory, so that I can focus on a Feature.

The solution I would like :
As, in the "sfdx-project.json" File, every Package Directory can have a Scratch Org Definition File ("definitionFile"), I would suggest to use this information to limit the scope of synchronized sources between the Package Directory and the Scratch Org to the Package Directory Path ("path").
So, every time I create a Scratch Org using a "project-scratch-def.json" File, the Scratch Org creation process will scan the "sfdx-project.json" File and gather the corresponding "path"s in order to list the sources that can be synchronized.

Alternatives I have considered :
I thought of three more possibilities but put them aside as they divert best practices, cli commands and configuration files from their intended purpose :

  • Add a new field (e.g. : "paths") in "project-scratch-def.json" to handle the synchronizable sources paths.
    {
    "orgName": ...,
    ...
    "paths": [
    "sfdx-source/feature_01", "sfdx-source/feature_11", "sfdx-source/feature_06"
    ],
    ...
    }

  • Add a new parameter to the sfdx force:source:status/push/pull commands to handle the synchronizable sources paths.
    sfdx force:source:status --paths "sfdx-source/feature_01,sfdx-source/feature_11,sfdx-source/feature_06"

  • Split my Features into seperate SFDX projects.

Additional context :
Just handle a single Path would be already great! ;)

I think this is, in a way, linked to the following issue : #379

I guess my feature request has already been identified by your team but, as far as my research led me, I did not find any issue allowing to clearly follow it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIssue or pull request for a new feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions