Combining all these potential changes together, you can see that a build now would have its relative precedence again and alphanumeric comments can still be defined but have no meaning. This brings us to the missing definitions of semantic versioning.
Most notably is a complete lack of context for describing software, or projects itself in the current Sanvers specification. Reading directly from the current spec, version numbers and the way they change convey meaning about the underlying code and what has been modified from one version to the next. Inherently, there is a connection between the versions and the context in which they apply.
In this example, I show what a context schema may look like by prefacing a normal version with an alphanumeric context, separated by an at symbol, which is commonplace. This definition will definitely look familiar because we see it all the time in our existing package management ecosystems, notably NPM JavaScript.
Another key missing definition is the concept of sets. It may seem pedantic, but not defining sets or how sets can be created, ordered or ordered, leaves fundamental gaps in our collective understanding of how to manage more than one software version. As mentioned, the current spec only defines precedence. In this case, 1.0.0 is greater than 2.1.6 and then 2.3.9. Precedence itself does not give us enough clarity or language to create and manage version sets.
This is where NPM's nonstandard library has historically come to the rescue and filled many of these gaps. This library handles everything but deriving context out of a version. If you dig in deeper, you'll actually find that NPM has solved that problem as well. The library NPM package arg will parse context out of nonstandard, yet more fully conceptualized version values. Example, react at carats 1, 2, 3. This library itself uses the previous node semver library under the hood.
So, what would a missing set definition look like for semver? Well, it would include software context and a definition for individual software version sets. What this would could codify is software's inherent sets. In these two examples above, you see the versions of react cannot and should not ever be compared against the versions of express. This is the first type of set, the contextual set.
Below the examples, you'll see definitions for the missing range operators included and often included in package managers, the most notable of which is star or xgrammar, which matches any version within a relative set. Here are the three missing sets for normal, pre-release, and post-release, also referred to as build sets. Defining these explicitly allows us to know when we are including or filtering out particular versions for comparison. These are helpful delineations as both a consumer or as a tooling author. Second to last, we get to the missing concept of subsets. In this example, you can see all the different subsets that live within each of the particular levels of a semantic version. These represent all the potential versions that could exist within the project's context. And lastly, we must define ordered and unordered sets.
Comments