Many Salesforce teams aim to organize their metadata by breaking it into multiple directories within a single Git repository, commonly referred to as a monorepo. This approach aligns with best practices for organizing code by domain. While this method isn’t limited to projects using Salesforce's Second Generation Packaging (2GP), the transition to 2GP is often a key motivator for structuring source directories this way.
Hutte makes it easy to work with multiple package directories. All you need is a valid sfdx-project.json
file in the root directory of your project. Hutte will automatically adapt the "Pull Changes" interface accordingly: When multiple source directories are detected, the Hutte interface displays these directories in the sidebar. It also provides a drag-and-drop feature to select the target directory for new metadata.
For metadata that already exists in the Git repository, there’s no need to manually move it: by default, it remains in its current directory unless explicitly dragged to another location.
Hutte deploys metadata in a single transaction, regardless of the package directory order specified in sfdx-project.json
, aligning with the default behavior of SFDX. This means the deployment functions as if all metadata were stored in a single directory, and any duplicate metadata components (e.g., HelloWorld.cls
) will be overwritten.
If you need to enforce a specific deployment order, we recommend using unlocked packages to structure and manage your metadata deployments effectively.