Skip to content

Feature Request: Clean unlocked packages #765

Open
@readeral

Description

@readeral

Hi Nicolas,

I'm slowly working my way through manually cleaning out items that I don't want to commit to source control, the list of manual metadata cleaning has been helpful thankyou (although I do have some feedback on that too!) but I'm coming unstuck with unlocked packages, specifically, a selection of packages from unofficialsf. These particular packages don't have a namespace so can't be targeted using sfdx hardis:project:clean:manageditems.

What I can do is run sf retrieve start --package-name FlowScreenComponentsBasePack which will give me all the metadata in its own root folder in my project, and then I can (for now) manually pick through my org metadata and delete the equivalent files I find that match the ones in the newly pulled package root.

So, here's my idea. Given you already have a duplicate finding command, would it be reasonable to develop an "unlocked packages dedupe" command/workflow to clean up unlocked packages?

I know there's risks of false positives given there's no namespace to check against, as well as probably any number of other hazards with damaging one's own unlocked packages, so it would probably have to be a command which:

  • only runs with a --package-name flag on a package-by-package basis
  • reports where it finds triplicates for manual intervention
  • offers a flag for report only
  • offers a flag approving every file deletion step by step

I dunno, does this sound crazy? I mustn't be the only one who uses unofficialsf or other similar unconventional packages that can't be namespaced.

I'd be happy to draft up the feature if you're interested in it? I'm a little rusty with typescript, but would be able to give it a good shot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions