we have an unlocked package (mypkg) that has a folder with some metadata no longer in use by the org and we just want to remove it. Here are my steps:
I went to 'mypg' installed package detail in the UI under 'installed packages' and then clicked 'view components'
I then removed the metadata that I was planning to delete in the new package.
I then went into my package git source and deleted the folder and committed the changes.
I created a new package version:
sfdx force:package:version:create --package mypkg--installationkeybypass --wait 20
After that I installed it:
sfdx force:package:install --package email@example.com -u sandbox3-org --publishwait 20 --wait 10 --apexcompile package --upgradetype Delete
Now when I go to the sandbox, I still see the metadata (classes and custom objects). Why is that? There are no references to it. Documentation states that --upgradetype Delete should have deleted that metadata.