Specify Unpackaged Metadata for Package Version Creation Tests (Pilot)

If there are scenarios where you require metadata that shouldn’t be part of your package, but is necessary for Apex test runs during package version creation, you can specify the path containing unpackaged metadata in the sfdx-project.json file. Unpackaged metadata isn’t included in the package and isn’t installed in subscriber orgs.

Where: This change applies to second-generation managed packages and unlocked packages created using Salesforce CLI.

We provide unpackaged metadata path to selected customers through a pilot program that requires agreement to specific terms and conditions. To be nominated to participate in the program, contact Salesforce. Pilot programs are subject to change, and we can’t guarantee acceptance. Unpackaged metadata path isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for unpackaged metadata path in the Managed Packages group in the Partner Community

Who: Users need the System Administrator profile or the Create and Update Second-Generation Packages permission.

How: To join the pilot, log a case at https://partners.salesforce.com/partnerSupport.

After the pilot is enabled in your org, specify the path to the unpackaged metadata in your sfdx-project.json file.

In this example, metadata in the my-unpackaged-directory is available for test runs during the package version creation of the TV_unl package.

"packageDirectories": [
    {
        "path": "force-app",
        "package": "TV_unl", 
        "versionName": "ver 0.1",
        "versionNumber": ""0.1.0.NEXT",
        "default": true, 
        "unpackagedMetadata": {
            "path": "my-unpackaged-directory"
        }
    }, 
    {
        "path": "my-unpackaged-directory",
        "default": false
    }
]