I've typically worked where there is only one root directory in an SFDX project (force-app). So I've imagined that the packageDirectories
in sfdx-project.json act as the source/sources of the files that are included when:
sfdx force:package:version:create ...
is run as they do when a:
sfdx force:source:push ...
is done.
But with --loglevel trace
set, it appears that any SFDX format directory in the project is automatically pulled in.
So what is a good way to to ignore specific directories when 2GP is done? Or am I misunderstanding what I'm seeing?
A bit more detail os that the sfdx-project.json is:
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"package": "xxx",
"versionName": "yyy",
"versionNumber": "2.0.0.NEXT",
"dependencies": [
{
"package": "zzz",
"versionNumber": "1.14.0.LATEST"
}
],
"definitionFile": "config/project-scratch-def.json"
},
{
"path": "no-ns",
"default": false
}
],
...
}
and trace messages include references to the "no-ns" folder from that JSON:
The profile "XXXX Salesforce Platform User" from the "/Users/keithc/Dev/pe-27-jun-2022/pe/no-ns/main/default/profiles/XXX Salesforce Platform User.profile-meta.xml" directory was added to this package version.
and references to a separate "digital-experience" folder:
The profile "${name} Profile" from the "/Users/keithc/Dev/pe-27-jun-2022/pe/digital-experience/reference-with-tokens/main/default/profiles/${name} Profile.profile-meta.xml" directory was added to this package version.
which is a surprise. Including -d force-app
makes no difference.
--loglevel trace
seems to suggest the same thing. My assumption has been that sfdx-project.json drives what is packaged but I haven't found any clear documentation on the subject either way yet...