GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [BUG] Increase pre* with pre-release identifiers without build · Issue #441 · npm/node-semver

[BUG] Increase pre* with pre-release identifiers without build #441

New issue
Copy link
New issue
Copy link
Closed
#548
Closed
[BUG] Increase pre* with pre-release identifiers without build#441
#548
Copy link
Labels
Bugthing that needs fixing

Description

@pellmont
pellmont
opened on Mar 24, 2022
Issue body actions

What / Why

the semver package should be able to execute a increment premajor, preminor and prepatch for versioning schemes without a build number.
It for sure affects the standard maven versioning system (which is semver compliant).

Examples

Actual

0.0.1-SNAPSHOT premajor -> 1.0.0-SNAPSHOT.0
0.0.1-SNAPSHOT preminor -> 0.1.0-SNAPSHOT.0
0.0.1-SNAPSHOT prepatch -> 0.0.2-SNAPSHOT.0

Expected

0.0.1-SNAPSHOT premajor -> 1.0.0-SNAPSHOT
0.0.1-SNAPSHOT preminor -> 0.1.0-SNAPSHOT
0.0.1-SNAPSHOT prepatch -> 0.0.2-SNAPSHOT

Currently this package always sets a dot-separated build. I t would be desirable if the behavior could be chosen, or if it would at least respect the current versioning scheme.

Reacted by Michael Kriese, Anne Stellingwerf, Alex Weininger and Luka Svalina

Activity

  1. ljharb commented on Mar 24, 2022

    @ljharb
    ljharb
    on Mar 24, 2022
    Contributor
    More actions

    Wouldn’t that mean you can only ever have one snapshot per version? That seems a bit short-sighted.

  2. pellmont commented on Mar 24, 2022

    @pellmont
    pellmont
    on Mar 24, 2022
    Author
    More actions

    This is correct, for MAVEN repositories the SNAPSHOT versions are allowed to be updated. (internal it uses a timestamp for the different versions)

  3. ljharb commented on Mar 24, 2022

    @ljharb
    ljharb
    on Mar 24, 2022
    Contributor
    More actions

    sounds like a build number. Why isn’t it part of the version number?

  4. astellingwerf commented on Mar 24, 2022

    @astellingwerf
    astellingwerf
    on Mar 24, 2022
    More actions

    The whole idea of the snapshot version is that you don't need to update references to it with every new build. See also What is a SNAPSHOT version?.

  5. ljharb commented on Mar 24, 2022

    @ljharb
    ljharb
    on Mar 24, 2022
    Contributor
    More actions

    Wouldn’t a semver range like 1.2.3-SNAPSHOT.0 do that?

  6. ljharb commented on Mar 24, 2022

    @ljharb
    ljharb
    on Mar 24, 2022
    Contributor
    More actions

    Versions in semver are designed to be immutable - in other words, it’s not semver if it’s changing over time.

  7. astellingwerf commented on Mar 25, 2022

    @astellingwerf
    astellingwerf
    on Mar 25, 2022
    More actions

    1.2.3-SNAPSHOT is a perfectly valid semver. See this overview of the spec, where I marked the choices for the different options using >>> in front.

            <valid semver> ::= <version core>
    >>>                      | <version core> "-" <pre-release>
                             | <version core> "+" <build>
                             | <version core> "-" <pre-release> "+" <build>
    
            <version core> ::= <major> "." <minor> "." <patch>
    
            <major> ::= <numeric identifier>
    
            <minor> ::= <numeric identifier>
            
            <patch> ::= <numeric identifier>
    
    >>>     <pre-release> ::= <dot-separated pre-release identifiers>
    
    >>>     <dot-separated pre-release identifiers> ::= <pre-release identifier>
                                                      | <pre-release identifier> "." <dot-separated pre-release identifiers>
    
            <build> ::= <dot-separated build identifiers>
    
            <dot-separated build identifiers> ::= <build identifier>
                                                | <build identifier> "." <dot-separated build identifiers>
    
    >>>     <pre-release identifier> ::= <alphanumeric identifier>
                                       | <numeric identifier>
    
            <build identifier> ::= <alphanumeric identifier>
                                 | <digits>
    
            <alphanumeric identifier> ::= <non-digit>
    >>>                                 | <non-digit> <identifier characters>
                                        | <identifier characters> <non-digit>
                                        | <identifier characters> <non-digit> <identifier characters>
    
            <numeric identifier> ::= "0"
                                   | <positive digit>
                                   | <positive digit> <digits>
    
            <identifier characters> ::= <identifier character>
    >>>                               | <identifier character> <identifier characters>
    
            <identifier character> ::= <digit>
    >>>                              | <non-digit>
    
    >>>     <non-digit> ::= <letter>
                          | "-"
    
            <digits> ::= <digit>
                       | <digit> <digits>
    
            <digit> ::= "0"
                      | <positive digit>
    
            <positive digit> ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
    
    >>>     <letter> ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J"
    >>>                | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T"
                       | "U" | "V" | "W" | "X" | "Y" | "Z" | "a" | "b" | "c" | "d"
                       | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n"
                       | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x"
                       | "y" | "z"
    
  8. ljharb commented on Mar 25, 2022

    @ljharb
    ljharb
    on Mar 25, 2022
    Contributor
    More actions

    Absolutely that string is valid semver. But its contents must never change - versions are immutable.

  9. astellingwerf commented on Mar 25, 2022

    @astellingwerf
    astellingwerf
    on Mar 25, 2022
    More actions

    Fair enough, but whether I adhere to that rule should not be a problem when reasoning about the semver version. If we have semver version number 1.2.3-anything, and we order node-semver to increment the minor component, there's no reason to fiddle with the pre-release identifier. It should return 1.3.3-anything.

  10. ljharb commented on Mar 25, 2022

    @ljharb
    ljharb
    on Mar 25, 2022
    Contributor
    More actions

    Fair enough.

    the standard maven versioning system (which is semver compliant).

    still worth establishing that it is not compliant, because snapshot contents change - and that by appending a .0, and relying on that instead, it would be, and this bug wouldn't apply.

  11. darcyclarke
    added
    Bugthing that needs fixing
    on Jul 28, 2022
  12. astellingwerf commented on Oct 20, 2022

    @astellingwerf
    astellingwerf
    on Oct 20, 2022
    More actions

    The semver 2.0.0 spec mentions "increment" 16 times, but only for the major, minor, and patch versions. In it, I didn't see instructions on adding significant figures to any of the elements.

  13. wraithgar
    closed this as completedin #548on Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.