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

Add 'version' property on Plugin type #4771

Merged
merged 1 commit into from Dec 28, 2022

Conversation

Septh
Copy link
Contributor

@Septh Septh commented Dec 27, 2022

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

Checking the version of a fellow plugin is a common task in inter-plugin communication scenarios - as an example, @rollup/plugin-commonjs checks what version of @rollup/plugin-node-resolve is present:

const nodeResolve = plugins.find(({ name }) => name === 'node-resolve');
if (nodeResolve) {
  validateVersion(nodeResolve.version, '^13.0.6', '@rollup/plugin-node-resolve');
}

This works because @rollup/plugin-node-resolve has an unofficial version field added to it. This PR just proposes to make this property official (and discoverable for Intellisense users) by adding a version?: string property to the OutputPlugin type.

The docs are updated accordingly.

@codecov
Copy link

codecov bot commented Dec 27, 2022

Codecov Report

Merging #4771 (b5df5d4) into master (0d543a2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4771   +/-   ##
=======================================
  Coverage   99.03%   99.03%           
=======================================
  Files         217      217           
  Lines        7774     7774           
  Branches     2154     2154           
=======================================
  Hits         7699     7699           
  Misses         24       24           
  Partials       51       51           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea 👍

@lukastaegert lukastaegert merged commit 57fa7e0 into rollup:master Dec 28, 2022
@rollup-bot
Copy link
Collaborator

This PR has been released as part of rollup@3.9.0. You can test it via npm install rollup.

@Septh Septh deleted the pr/plugin-version branch January 25, 2023 00:22
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

Successfully merging this pull request may close these issues.

None yet

3 participants