sfdx package version create
removesfieldPermissions
too aggressively
<fieldPermissions>
for Event
and Task
are being removed from Profiles.
Create an unlocked package first:
sfdx package create -t Unlocked --no-namespace --path force-app -n "2GP Profile Filtering"
Now create a package version:
export SF_LOG_LEVEL="debug"
sfdx package version create -x -d force-app -w 20
See output in ~/.sf/sf.log
:
The profile "Dummy Profile" from the "/path/to/project/force-app/main/default/profiles/Dummy Profile.profile-meta.xml" directory was added to this package version.
The "Event.Event_Field__c" profile setting was removed from the "Dummy Profile" profile.
The "Task.Task_Field__c" profile setting was removed from the "Dummy Profile" profile.