Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: provide context to plugins #162

Open
superewald opened this issue Oct 5, 2023 · 0 comments
Open

feature request: provide context to plugins #162

superewald opened this issue Oct 5, 2023 · 0 comments

Comments

@superewald
Copy link

Providing a context to the plugins would be useful to reduce code duplicates and maintainability of the plugins itself.

motivation

I'm currently writing a hook plugin which automates the distribution of release assets and publishing packages. That requires some information which are currently only available in the root config (which plugins by default have no access to) and initializing clients for github/gitlab myself. This produces alot of "duplicate" code (since the config and providers are initialized by semantic-release before) and is somehow a bit error prone.

(You can take a look into https://github.com/superewald/semantic-release-hooks-distributor for reference, it's not finished but shows clearly why a context would be useful)

proposal

In order to make it easier for plugins to access resources which are already initialized by semantic-release a context should be passed to the plugin. I would suggest the context should provide the following resources to the plugin:

considerations

  • which plugins would benefit of such context (I assume it is only relevant to hook plugins)
  • how to pass the context to the plugin (obviously it would be needed at the Init but is there a nice way to add the context and maybe keep backwards compatibility ?)

I would be happy to implement this feature but beforehands I want to know if it would be integrated and need to have the considerations answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant