Skip to content

Prevent accidentally dropping support for older Node.js versions in a non-major version bump #88

Open
@sindresorhus

Description

@sindresorhus
Owner

Scenario: Your package is at version 1.1.0. You decide to drop support for Node.js 0.12. You later do other changes and then publish a minor release. You've now accidentally done a breaking change in a minor release. This happens all the time. And will happen a lot more now that maintainers are starting to drop support for Node.js 0.10 and 0.12.

We could check if the engine field is higher than the latest version, and if not a major release, throw an error.

Thoughts?

Idea from: npm/npm#13549 // @bajtos

Activity

jfmengels

jfmengels commented on Aug 28, 2016

@jfmengels

Sounds like a good idea to me 👍

What should then be done if the engine field was not set in the latest version, and now is? It could be done to make the package requirements clearer ("we didn't support 0.12 before, but now it's written in the package.json"), or when dropping support of a version ("We are stopping support for 0.12, and we have heard of the engine field so we're setting it now").
For lack of better options, probably better to let it pass?

sindresorhus

sindresorhus commented on Aug 30, 2016

@sindresorhus
OwnerAuthor

Let it pass.

tommy-mitchell

tommy-mitchell commented on Apr 5, 2023

@tommy-mitchell
Collaborator

Should this check tsconfig.json too?

sindresorhus

sindresorhus commented on Apr 6, 2023

@sindresorhus
OwnerAuthor

@tommy-mitchell Do you mean the target field? If so, yes, that would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @sindresorhus@tommy-mitchell@jfmengels

      Issue actions

        Prevent accidentally dropping support for older Node.js versions in a non-major version bump · Issue #88 · sindresorhus/np