Skip to content

[Feature] Plugin hook support for import and remove #6896

@drodil

Description

@drodil
  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

When a plugin is imported with yarn plugin import it would be beneficial for the plugin to have possibility to call methods after the import has completed. The same goes for yarn plugin remove so that the plugin can modify the repository before the plugin is actually removed. This use case is for plugins that handle custom versions for plugins such as https://github.com/backstage/backstage/tree/master/packages/yarn-plugin

Describe the solution you'd like

Add new hooks:

  • pluginPostImport - called after the plugin has been imported to the repository
  • pluginPreRemove - called before the plugin has been removed from the repository

Describe the drawbacks of your solution

None

Describe alternatives you've considered

This cannot be achieved with plugin so it should be part of the yarn core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions