If I’m versioning my package according to the PVP and I add a new data constructor to a type that is exported, then does the PVP require me to do a MAJOR version bump? Or is only a MINOR version bump allowed?
The PVP says (emphasis mine):
A.B is known as the major version number, and C the minor version number. When a package is updated, the following rules govern how the version number must change relative to the previous version:
Breaking change. If any entity was removed, or the types of any entities or the definitions of datatypes or classes were changed, or orphan instances were added or any instances were removed, then the new A.B MUST be greater than the previous A.B. Note that modifying imports or depending on a newer version of another package may cause extra orphan instances to be exported and thus force a major version change.
Non-breaking change. Otherwise, if only new bindings, types, classes, non-orphan instances or modules (but see below) were added to the interface, then A.B MAY remain the same but the new C MUST be greater than the old C. Note that modifying imports or depending on a newer version of another package may cause extra non-orphan instances to be exported and thus force a minor version change.
Does adding a data constructor to an existing type count as changing the definition of a datatype (which would require a major version bump), or adding a new binding (which would require only a minor version bump)?
If anyone is interested in the reason for this question, I’m wondering specifically about the package language-javascript-0.7.1.0
, where a new constructor is added to an existing data type: Add support for async function specifier and await keyword by erikd · Pull Request #113 · erikd/language-javascript · GitHub. The JSAsyncFunction
constructor is added to the JSStatement
data type, and the release that contained this change did a minor version bump from 0.7.0.0
to 0.7.1.0
.
This came up while I was trying to update PureScript to a more recent LTS release: Bump PureScript to building with LTS-18 by cdepillabout · Pull Request #4199 · purescript/purescript · GitHub