Repository: semver/semver
Branch: master
Commit: f99d5485190a
Files: 9
Total size: 29.9 KB
Directory structure:
gitextract_pdgbehk1/
├── .github/
│ └── workflows/
│ └── checks.yml
├── .gitignore
├── .remarkrc
├── CITATION.cff
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── README.md
├── package.json
└── semver.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/checks.yml
================================================
name: Check changes
on: [pull_request]
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: npm run lint
================================================
FILE: .gitignore
================================================
node_modules/
================================================
FILE: .remarkrc
================================================
{
"plugins": [
"remark-frontmatter",
"remark-preset-lint-node",
"remark-lint-mdash-style",
["remark-lint-fenced-code-flag", false],
["remark-lint-first-heading-level", false],
["remark-lint-maximum-line-length", false],
["remark-lint-no-file-name-articles", false],
["remark-lint-no-literal-urls", false],
["remark-lint-no-trailing-spaces", false],
["remark-lint-no-undefined-references", false],
["remark-lint-prohibited-strings", false],
["remark-lint-no-shortcut-reference-link", false],
["remark-lint-unordered-list-marker-style", "-"],
["remark-lint-heading-style", "setext"],
["remark-lint-code-block-style", "fenced"]
]
}
================================================
FILE: CITATION.cff
================================================
cff-version: 1.2.0
message: "If you reference the Semantic Versioning Specification in your work, please use this metadata."
abstract: '"Semantic Versioning" or "SemVer" contain a set of rules and requirements that dictate how version numbers are assigned and incremented.'
authors:
- family-names: Preston-Werner
given-names: Tom
- name: The SemVer Team
title: Semantic Versioning Specification
version: 2.0.0
date-released: 2013-06-18
url: "https://semver.org"
repository-code: "https://github.com/semver/semver"
license: "CC-BY-3.0"
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at haacked@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version].
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
================================================
FILE: CONTRIBUTING.md
================================================
# Semver Governance Model
The "RFC" (request for comments) process is intended to provide a consistent and controlled path for changes to the SemVer specification, so that all stakeholders can be confident about the direction the spec is evolving in.
## When you need to follow this process
You need to follow this process if you intend to make "substantial" changes to the specification or the RFC process itself. What constitutes a "substantial" change is evolving based on community norms and varies depending on what part of the specification you are proposing to change, but may include the following:
* Changes to the meaning of the specification.
Some changes do not require an RFC:
* Typo fixes
* Small wording clarifications that do not impact the semantics of the specification.
### Translations
Translations also don't require an RFC.
If you want to contribute to the translations, you can visit the [website repository](https://github.com/semver/semver.org) and submit a PR.
## What the process is
When a pull request ("PR" from here forward) is opened against the specification or
this repository, it may be tagged with an "RFC" tag ("RFC" from here forward).
RFCs require the consensus of all team members (see below) to merge.
## The SemVer Team
We welcome feedback from anyone on the direction of SemVer. However, a group of people, "the SemVer team," are responsible for making decisions about RFC PRs. The SemVer team is made up of representatives from package managers that use SemVer.
Team members are added and removed based on the consensus of the existing team members. The @semver/maintainers team on GitHub contains the official list of the members of "the SemVer team."
The maintainers are:
* [dherman](https://github.com/dherman) ([Notion](https://www.notionjs.com/))
* [indirect](https://github.com/indirect) ([Bundler](https://bundler.io/))
* [isaacs](https://github.com/isaacs) ([npm](https://www.npmjs.com/))
* [JohnTitor](https://github.com/JohnTitor) ([crates.io](https://crates.io/))
* [segiddins](https://github.com/segiddins) ([CocoaPods](https://cocoapods.org/))
* [steveklabnik](https://github.com/steveklabnik) ([Cargo](https://crates.io/))
* [Seldaek](https://github.com/Seldaek) ([Composer](https://getcomposer.org/))
* [zkat](https://github.com/zkat) ([NuGet](https://www.nuget.org/))
## Participation commitment
Participation in the SemVer governance process requires a commitment to maintain, to the greatest degree possible, consistency of the functional and semantic interoperability between SemVer implementations. Towards that end:
* RFCs will be considered formally adopted only when they are approved by the SemVer Maintainers group, _and_ implemented in a simple majority of represented implementations.
* No RFC will be approved if it is deemed to cause significant breakage to any of the SemVer-using communities represented by the SemVer Maintainers group. It is the responsibility of the SemVer Maintainers group to advocate for their communities in good faith.
* With the understanding that implementation may present challenges and require time to complete, refusal on principle to implement approved RFCs will result in removal from the group.
* Implementations may add functionality in advance of an approved RFC (in fact, they have to!) but all such functionality must be flagged as "experimental", so that users understand it may change in the future. (Maintainers are encouraged to perform these experimental changes on forks rather than the implementation in use by their package management communities, to reduce the chance of users coming to rely on experimental functionality.)
## The lifecycle of an RFC
Once a PR is tagged as an RFC:
* The author of the PR should build consensus and integrate feedback. RFCs that have broad support are much more likely to make progress than those that don't receive any comments. Feel free to reach out to the team members to get help identifying stakeholders and obstacles.
* The team will discuss the RFC, as much as possible in the comment thread of the pull request itself. Offline discussion will be summarized on the pull request comment thread.
* RFCs rarely go through this process unchanged. You can make edits, big and small, to the RFC to clarify or change the design, but make changes as new commits to the pull request, and leave a comment on the pull request explaining your changes. Specifically, do not squash or rebase commits after they are visible on the pull request.
* At some point, a member of the team will propose a "motion for final comment period" (FCP), along with a disposition for the RFC (merge, close, or postpone).
* This step is taken when enough of the tradeoffs have been discussed that the subteam is in a position to make a decision. That does not require consensus amongst all participants in the RFC thread (which is usually impossible). However, the argument supporting the disposition on the RFC needs to have already been clearly articulated, and there should not be a strong consensus against that position outside of the subteam. Subteam members use their best judgment in taking this step, and the FCP itself ensures there is ample time and notification for stakeholders to push back if it is made prematurely.
* For RFCs with lengthy discussion, the motion to FCP is usually preceded by a summary comment
trying to lay out the current state of the discussion and major tradeoffs/points of disagreement.
* Before actually entering FCP, all members of the subteam must sign off; this is often the point at which many subteam members first review the RFC in full depth.
* The FCP lasts ten calendar days, so that it is open for at least 5 business days. This way all stakeholders have a chance to lodge any final objections before a decision is reached.
* In most cases, the FCP period is quiet, and the RFC is either merged or closed. However, sometimes substantial new arguments or ideas are raised, the FCP is canceled, and the RFC goes back into development mode.
## RFC postponement
Some RFC pull requests are tagged with the "postponed" label when they are closed (as part of the rejection process). An RFC closed with "postponed" is marked as such because we want neither to think about evaluating the proposal nor about implementing the described feature until some time in the future, and we believe that we can afford to wait until then to do so. Postponed pull requests may be re-opened when the time is right. We don't have any formal process for that, you should ask members of the team.
Usually an RFC pull request marked as "postponed" has already passed an informal first round of evaluation, namely the round of "do we think we would ever possibly consider making this change, as outlined in the RFC pull request, or some semi-obvious variation of it." (When the answer to the latter question is "no", then the appropriate response is to close the RFC, not postpone it.)
================================================
FILE: README.md
================================================
# Semantic Versioning Specification
"Semantic Versioning" or "SemVer" contains a set of rules and requirements that dictate how version numbers are assigned and incremented. You can find the full document in [semver.md](./semver.md) or visit our official website [semver.org](https://semver.org) to find previous versions and localized specifications.
Changes to the document are published to the website by a [GitHub Actions workflow](https://github.com/semver/semver.org/blob/gh-pages/.github/workflows/sync.yml) which runs once each day.
## Contributing
See the [contribution guide](./CONTRIBUTING.md).
================================================
FILE: package.json
================================================
{
"name": "semver-spec",
"version": "2.0.0",
"description": "Semantic Versioning Specification",
"main": "semver.md",
"scripts": {
"lint": "remark -qf semver.md",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/semver/semver.git"
},
"keywords": [
"semver",
"semantic",
"versioning",
"specification",
"spec"
],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/semver/semver/issues"
},
"homepage": "https://github.com/semver/semver#readme",
"devDependencies": {
"remark-cli": "^11.0.0",
"remark-frontmatter": "^2.0.0",
"remark-lint-mdash-style": "^1.1.1",
"remark-preset-lint-node": "^1.16.0"
}
}
================================================
FILE: semver.md
================================================
Semantic Versioning 2.0.0
==============================
Summary
-------
Given a version number MAJOR.MINOR.PATCH, increment the:
1. MAJOR version when you make incompatible API changes
1. MINOR version when you add functionality in a backward compatible
manner
1. PATCH version when you make backward compatible bug fixes
Additional labels for pre-release and build metadata are available as extensions
to the MAJOR.MINOR.PATCH format.
Introduction
------------
In the world of software management there exists a dreaded place called
"dependency hell." The bigger your system grows and the more packages you
integrate into your software, the more likely you are to find yourself, one
day, in this pit of despair.
In systems with many dependencies, releasing new package versions can quickly
become a nightmare. If the dependency specifications are too tight, you are in
danger of version lock (the inability to upgrade a package without having to
release new versions of every dependent package). If dependencies are
specified too loosely, you will inevitably be bitten by version promiscuity
(assuming compatibility with more future versions than is reasonable).
Dependency hell is where you are when version lock and/or version promiscuity
prevent you from easily and safely moving your project forward.
As a solution to this problem, we propose a simple set of rules and
requirements that dictate how version numbers are assigned and incremented.
These rules are based on but not necessarily limited to pre-existing
widespread common practices in use in both closed and open-source software.
For this system to work, you first need to declare a public API. This may
consist of documentation or be enforced by the code itself. Regardless, it is
important that this API be clear and precise. Once you identify your public
API, you communicate changes to it with specific increments to your version
number. Consider a version format of X.Y.Z (Major.Minor.Patch). Bug fixes not
affecting the API increment the patch version, backward compatible API
additions/changes increment the minor version, and backward incompatible API
changes increment the major version.
We call this system "Semantic Versioning." Under this scheme, version numbers
and the way they change convey meaning about the underlying code and what has
been modified from one version to the next.
Semantic Versioning Specification (SemVer)
------------------------------------------
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).
1. Software using Semantic Versioning MUST declare a public API. This API
could be declared in the code itself or exist strictly in documentation.
However it is done, it SHOULD be precise and comprehensive.
1. A normal version number MUST take the form X.Y.Z where X, Y, and Z are
non-negative integers, and MUST NOT contain leading zeroes. X is the
major version, Y is the minor version, and Z is the patch version.
Each element MUST increase numerically. For instance: 1.9.0 -> 1.10.0 -> 1.11.0.
1. Once a versioned package has been released, the contents of that version
MUST NOT be modified. Any modifications MUST be released as a new version.
1. Major version zero (0.y.z) is for initial development. Anything MAY change
at any time. The public API SHOULD NOT be considered stable.
1. Version 1.0.0 defines the public API. The way in which the version number
is incremented after this release is dependent on this public API and how it
changes.
1. Patch version Z (x.y.Z | x > 0) MUST be incremented if only backward
compatible bug fixes are introduced. A bug fix is defined as an internal
change that fixes incorrect behavior.
1. Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backward
compatible functionality is introduced to the public API. It MUST be
incremented if any public API functionality is marked as deprecated. It MAY be
incremented if substantial new functionality or improvements are introduced
within the private code. It MAY include patch level changes. Patch version
MUST be reset to 0 when minor version is incremented.
1. Major version X (X.y.z | X > 0) MUST be incremented if any backward
incompatible changes are introduced to the public API. It MAY also include minor
and patch level changes. Patch and minor versions MUST be reset to 0 when major
version is incremented.
1. A pre-release version MAY be denoted by appending a hyphen and a
series of dot separated identifiers immediately following the patch
version. Identifiers MUST comprise only ASCII alphanumerics and hyphens
[0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST
NOT include leading zeroes. Pre-release versions have a lower
precedence than the associated normal version. A pre-release version
indicates that the version is unstable and might not satisfy the
intended compatibility requirements as denoted by its associated
normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7,
1.0.0-x.7.z.92, 1.0.0-x-y-z.\-\-.
1. Build metadata MAY be denoted by appending a plus sign and a series of dot
separated identifiers immediately following the patch or pre-release version.
Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-].
Identifiers MUST NOT be empty. Build metadata MUST be ignored when determining
version precedence. Thus two versions that differ only in the build metadata,
have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700,
1.0.0-beta+exp.sha.5114f85, 1.0.0+21AF26D3\-\-\-\-117B344092BD.
1. Precedence refers to how versions are compared to each other when ordered.
1. Precedence MUST be calculated by separating the version into major,
minor, patch and pre-release identifiers in that order (build metadata
does not figure into precedence).
1. Precedence is determined by the first difference when comparing each of
these identifiers from left to right as follows: major, minor, and patch
versions are always compared numerically.
Example: 1.0.0 < 2.0.0 < 2.1.0 < 2.1.1.
1. When major, minor, and patch are equal, a pre-release version has lower
precedence than a normal version:
Example: 1.0.0-alpha < 1.0.0.
1. Precedence for two pre-release versions with the same major, minor, and
patch version MUST be determined by comparing each dot separated identifier
from left to right until a difference is found as follows:
1. Identifiers consisting of only digits are compared numerically.
1. Identifiers with letters or hyphens are compared lexically in ASCII
sort order.
1. Numeric identifiers always have lower precedence than non-numeric
identifiers.
1. A larger set of pre-release fields has a higher precedence than a
smaller set, if all of the preceding identifiers are equal.
Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta <
1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0.
Backus–Naur Form Grammar for Valid SemVer Versions
--------------------------------------------------
```
<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"
```
Why Use Semantic Versioning?
----------------------------
This is not a new or revolutionary idea. In fact, you probably do something
close to this already. The problem is that "close" isn't good enough. Without
compliance to some sort of formal specification, version numbers are
essentially useless for dependency management. By giving a name and clear
definition to the above ideas, it becomes easy to communicate your intentions
to the users of your software. Once these intentions are clear, flexible (but
not too flexible) dependency specifications can finally be made.
A simple example will demonstrate how Semantic Versioning can make dependency
hell a thing of the past. Consider a library called "Firetruck." It requires a
Semantically Versioned package named "Ladder." At the time that Firetruck is
created, Ladder is at version 3.1.0. Since Firetruck uses some functionality
that was first introduced in 3.1.0, you can safely specify the Ladder
dependency as greater than or equal to 3.1.0 but less than 4.0.0. Now, when
Ladder version 3.1.1 and 3.2.0 become available, you can release them to your
package management system and know that they will be compatible with existing
dependent software.
As a responsible developer you will, of course, want to verify that any
package upgrades function as advertised. The real world is a messy place;
there's nothing we can do about that but be vigilant. What you can do is let
Semantic Versioning provide you with a sane way to release and upgrade
packages without having to roll new versions of dependent packages, saving you
time and hassle.
If all of this sounds desirable, all you need to do to start using Semantic
Versioning is to declare that you are doing so and then follow the rules. Link
to this website from your README so others know the rules and can benefit from
them.
FAQ
---
### How should I deal with revisions in the 0.y.z initial development phase?
The simplest thing to do is start your initial development release at 0.1.0
and then increment the minor version for each subsequent release.
### How do I know when to release 1.0.0?
If your software is being used in production, it should probably already be
1.0.0. If you have a stable API on which users have come to depend, you should
be 1.0.0. If you're worrying a lot about backward compatibility, you should
probably already be 1.0.0.
### Doesn't this discourage rapid development and fast iteration?
Major version zero is all about rapid development. If you're changing the API
every day you should either still be in version 0.y.z or on a separate
development branch working on the next major version.
### If even the tiniest backward incompatible changes to the public API require a major version bump, won't I end up at version 42.0.0 very rapidly?
This is a question of responsible development and foresight. Incompatible
changes should not be introduced lightly to software that has a lot of
dependent code. The cost that must be incurred to upgrade can be significant.
Having to bump major versions to release incompatible changes means you'll
think through the impact of your changes, and evaluate the cost/benefit ratio
involved.
### Documenting the entire public API is too much work!
It is your responsibility as a professional developer to properly document
software that is intended for use by others. Managing software complexity is a
hugely important part of keeping a project efficient, and that's hard to do if
nobody knows how to use your software, or what methods are safe to call. In
the long run, Semantic Versioning, and the insistence on a well defined public
API can keep everyone and everything running smoothly.
### What do I do if I accidentally release a backward incompatible change as a minor version?
As soon as you realize that you've broken the Semantic Versioning spec, fix
the problem and release a new patch version that corrects the problem and
restores backward compatibility. Even under this circumstance, it is
unacceptable to modify versioned releases. If it's appropriate,
document the offending version and inform your users of the problem so that
they are aware of the offending version.
### What should I do if I update my own dependencies without changing the public API?
That would be considered compatible since it does not affect the public API.
Software that explicitly depends on the same dependencies as your package
should have their own dependency specifications and the author will notice any
conflicts. Determining whether the change is a patch level or minor level
modification depends on whether you updated your dependencies in order to fix
a bug or introduce new functionality. We would usually expect additional code
for the latter instance, in which case it's obviously a minor level increment.
### What if I inadvertently alter the public API in a way that is not compliant with the version number change (i.e. the code incorrectly introduces a major breaking change in a patch release)?
Use your best judgment. If you have a huge audience that will be drastically
impacted by changing the behavior back to what the public API intended, then
it may be best to perform a major version release, even though the fix could
strictly be considered a patch release. Remember, Semantic Versioning is all
about conveying meaning by how the version number changes. If these changes
are important to your users, use the version number to inform them.
### How should I handle deprecating functionality?
Deprecating existing functionality is a normal part of software development and
is often required to make forward progress. When you deprecate part of your
public API, you should do two things: (1) update your documentation to let
users know about the change, (2) issue a new minor release with the deprecation
in place. Before you completely remove the functionality in a new major release
there should be at least one minor release that contains the deprecation so
that users can smoothly transition to the new API.
### Does SemVer have a size limit on the version string?
No, but use good judgment. A 255 character version string is probably an overkill,
for example. Also, specific systems may impose their own limits on the size of
the string.
### Is "v1.2.3" a semantic version?
No, "v1.2.3" is not a semantic version. However, prefixing a semantic version
with a "v" is a common way (in English) to indicate it is a version number.
Abbreviating "version" as "v" is often seen with version control. Example:
`git tag v1.2.3 -m "Release version 1.2.3"`, in which case "v1.2.3" is a tag
name and the semantic version is "1.2.3".
### Is there a suggested regular expression (RegEx) to check a SemVer string?
There are two. One with named groups for those systems that support them
(PCRE [Perl Compatible Regular Expressions, i.e. Perl, PHP and R], Python
and Go).
See: <https://regex101.com/r/Ly7O1x/3/>
```
^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
```
And one with numbered capture groups instead (so cg1 = major, cg2 = minor,
cg3 = patch, cg4 = prerelease and cg5 = buildmetadata) that is compatible
with ECMA Script (JavaScript), PCRE (Perl Compatible Regular Expressions,
i.e. Perl, PHP and R), Python and Go.
See: <https://regex101.com/r/vkijKf/1/>
```
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
```
About
-----
The Semantic Versioning specification was originally authored by [Tom
Preston-Werner](https://tom.preston-werner.com), inventor of Gravatar and
cofounder of GitHub.
If you'd like to leave feedback, please [open an issue on
GitHub](https://github.com/semver/semver/issues).
License
-------
[Creative Commons ― CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
gitextract_pdgbehk1/ ├── .github/ │ └── workflows/ │ └── checks.yml ├── .gitignore ├── .remarkrc ├── CITATION.cff ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── README.md ├── package.json └── semver.md
Condensed preview — 9 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (32K chars).
[
{
"path": ".github/workflows/checks.yml",
"chars": 275,
"preview": "name: Check changes\n\non: [pull_request]\n\njobs:\n checks:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/che"
},
{
"path": ".gitignore",
"chars": 13,
"preview": "node_modules/"
},
{
"path": ".remarkrc",
"chars": 692,
"preview": "{\n \"plugins\": [\n \"remark-frontmatter\",\n \"remark-preset-lint-node\",\n \"remark-lint-mdash-style\",\n [\"remark-li"
},
{
"path": "CITATION.cff",
"chars": 544,
"preview": "cff-version: 1.2.0\nmessage: \"If you reference the Semantic Versioning Specification in your work, please use this metada"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3218,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "CONTRIBUTING.md",
"chars": 6979,
"preview": "# Semver Governance Model\n\nThe \"RFC\" (request for comments) process is intended to provide a consistent and controlled p"
},
{
"path": "README.md",
"chars": 610,
"preview": "# Semantic Versioning Specification\n\n\"Semantic Versioning\" or \"SemVer\" contains a set of rules and requirements that dic"
},
{
"path": "package.json",
"chars": 776,
"preview": "{\n \"name\": \"semver-spec\",\n \"version\": \"2.0.0\",\n \"description\": \"Semantic Versioning Specification\",\n \"main\": \"semver"
},
{
"path": "semver.md",
"chars": 17470,
"preview": "Semantic Versioning 2.0.0\n==============================\n\nSummary\n-------\n\nGiven a version number MAJOR.MINOR.PATCH, inc"
}
]
About this extraction
This page contains the full source code of the semver/semver GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 9 files (29.9 KB), approximately 7.4k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.