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

Running the same plugin multiple times #3038

Open
jackmoxley opened this issue Oct 31, 2023 · 0 comments
Open

Running the same plugin multiple times #3038

jackmoxley opened this issue Oct 31, 2023 · 0 comments

Comments

@jackmoxley
Copy link

New feature motivation

When building from our repo, often we are publishing multiple artefacts built from different package.json's, for instance publishing @types/mylibrary might be an additional artefact. Being able to define multiple runs of certain plugins gives greater control of the ci/cd pipeline.

With the move to ESM, and the changes in 28.x that have made the import cache even more difficult to find.
Both states of affairs make the very useful amanda-mitchell/semantic-release-npm-multiple plugin unusable. If a plugin can be declared multiple times with different config then there would be no need for the aforementioned plugin, which is not an ideal solution anyway as it involves reloading the require cache on each instance as a workaround due to the singleton nature of the plugins.

However looking through the semantic-release/npm plugin, there is very little in there apart from 2 booleans that mean that it is a true singleton, I cannot see a limitation to running this. However leafing through the documentation I have been unable to find any reference to what the expected outcome would be. Certainly support for this feature so it applies to all plugins would be infinitely more useful.

New feature description

Within the semantic release config be able to define the same plugin multiple times with different configuations.

Have the plugin run each time with it's own unique configuration.

New feature implementation

Move all singleton state out of the plugin, and defined within the instance.

If necessary adjust the runner.

Document with examples.

(Optionally) define a config lifecycle state that sets the config for semantic-release, and can be defined using customised plugins (possibly a separate feature)

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