Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: npm/node-semver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 46727afbe21b8d14641a0d1c4c7ee58bd053f922
Choose a base ref
...
head repository: npm/node-semver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e7b78de06eb14a7fa2075cedf9f167040d8d31af
Choose a head ref
Loading
Showing with 7,606 additions and 6,767 deletions.
  1. +10 −0 .commitlintrc.js
  2. +17 −0 .eslintrc.js
  3. +18 −0 .eslintrc.local.js
  4. +3 −0 .github/CODEOWNERS
  5. +54 −0 .github/ISSUE_TEMPLATE/bug.yml
  6. +3 −0 .github/ISSUE_TEMPLATE/config.yml
  7. +17 −0 .github/dependabot.yml
  8. +32 −0 .github/matchers/tap.json
  9. +26 −0 .github/settings.yml
  10. +39 −0 .github/workflows/audit.yml
  11. +216 −0 .github/workflows/ci-release.yml
  12. +107 −0 .github/workflows/ci.yml
  13. +38 −0 .github/workflows/codeql-analysis.yml
  14. +121 −0 .github/workflows/post-dependabot.yml
  15. +50 −0 .github/workflows/pull-request.yml
  16. +399 −0 .github/workflows/release.yml
  17. +36 −5 .gitignore
  18. +3 −0 .npmrc
  19. +3 −0 .release-please-manifest.json
  20. +0 −11 .travis.yml
  21. +204 −0 CHANGELOG.md
  22. +7 −0 CODE_OF_CONDUCT.md
  23. +50 −1 CONTRIBUTING.md
  24. +277 −41 README.md
  25. +13 −0 SECURITY.md
  26. +0 −153 bin/semver
  27. +197 −0 bin/semver.js
  28. +141 −0 classes/comparator.js
  29. +5 −0 classes/index.js
  30. +536 −0 classes/range.js
  31. +302 −0 classes/semver.js
  32. +6 −0 functions/clean.js
  33. +52 −0 functions/cmp.js
  34. +52 −0 functions/coerce.js
  35. +7 −0 functions/compare-build.js
  36. +3 −0 functions/compare-loose.js
  37. +5 −0 functions/compare.js
  38. +65 −0 functions/diff.js
  39. +3 −0 functions/eq.js
  40. +3 −0 functions/gt.js
  41. +3 −0 functions/gte.js
  42. +19 −0 functions/inc.js
  43. +3 −0 functions/lt.js
  44. +3 −0 functions/lte.js
  45. +3 −0 functions/major.js
  46. +3 −0 functions/minor.js
  47. +3 −0 functions/neq.js
  48. +16 −0 functions/parse.js
  49. +3 −0 functions/patch.js
  50. +6 −0 functions/prerelease.js
  51. +3 −0 functions/rcompare.js
  52. +3 −0 functions/rsort.js
  53. +10 −0 functions/satisfies.js
  54. +3 −0 functions/sort.js
  55. +6 −0 functions/valid.js
  56. +89 −0 index.js
  57. +30 −0 internal/constants.js
  58. +9 −0 internal/debug.js
  59. +23 −0 internal/identifiers.js
  60. +15 −0 internal/parse-options.js
  61. +193 −0 internal/re.js
  62. +1 −0 map.js
  63. +0 −3,602 package-lock.json
  64. +75 −10 package.json
  65. +2 −0 preload.js
  66. +4 −0 ranges/gtr.js
  67. +7 −0 ranges/intersects.js
  68. +4 −0 ranges/ltr.js
  69. +25 −0 ranges/max-satisfying.js
  70. +24 −0 ranges/min-satisfying.js
  71. +61 −0 ranges/min-version.js
  72. +80 −0 ranges/outside.js
  73. +47 −0 ranges/simplify.js
  74. +247 −0 ranges/subset.js
  75. +8 −0 ranges/to-comparators.js
  76. +11 −0 ranges/valid.js
  77. +36 −0 release-please-config.json
  78. +0 −1,352 semver.js
  79. +477 −0 tap-snapshots/test/bin/semver.js.test.cjs
  80. +0 −31 test/big-numbers.js
  81. +82 −0 test/bin/semver.js
  82. +63 −0 test/classes/comparator.js
  83. +6 −0 test/classes/index.js
  84. +107 −0 test/classes/range.js
  85. +160 −0 test/classes/semver.js
  86. +0 −29 test/clean.js
  87. +0 −30 test/cli.js
  88. +0 −118 test/coerce.js
  89. +42 −0 test/fixtures/comparator-intersection.js
  90. +36 −0 test/fixtures/comparisons.js
  91. +41 −0 test/fixtures/equality.js
  92. +127 −0 test/fixtures/increments.js
  93. +15 −0 test/fixtures/invalid-versions.js
  94. +105 −0 test/fixtures/range-exclude.js
  95. +127 −0 test/fixtures/range-include.js
  96. +59 −0 test/fixtures/range-intersection.js
  97. +89 −0 test/fixtures/range-parse.js
  98. +60 −0 test/fixtures/version-gt-range.js
  99. +62 −0 test/fixtures/version-lt-range.js
  100. +84 −0 test/fixtures/version-not-gt-range.js
  101. +87 −0 test/fixtures/version-not-lt-range.js
  102. +25 −0 test/functions/clean.js
  103. +49 −0 test/functions/cmp.js
  104. +123 −0 test/functions/coerce.js
  105. +19 −0 test/functions/compare-build.js
  106. +30 −0 test/functions/compare-loose.js
  107. +35 −0 test/functions/compare.js
  108. +57 −0 test/functions/diff.js
  109. +26 −0 test/functions/eq.js
  110. +24 −0 test/functions/gt.js
  111. +24 −0 test/functions/gte.js
  112. +45 −0 test/functions/inc.js
  113. +24 −0 test/functions/lt.js
  114. +24 −0 test/functions/lte.js
  115. +25 −0 test/functions/major.js
  116. +25 −0 test/functions/minor.js
  117. +26 −0 test/functions/neq.js
  118. +36 −0 test/functions/parse.js
  119. +25 −0 test/functions/patch.js
  120. +24 −0 test/functions/prerelease.js
  121. +11 −0 test/functions/rcompare.js
  122. +21 −0 test/functions/rsort.js
  123. +28 −0 test/functions/satisfies.js
  124. +22 −0 test/functions/sort.js
  125. +19 −0 test/functions/valid.js
  126. +0 −173 test/gtr.js
  127. +11 −932 test/index.js
  128. +39 −0 test/integration/whitespace.js
  129. +10 −0 test/internal/constants.js
  130. +40 −0 test/internal/debug.js
  131. +19 −0 test/internal/identifiers.js
  132. +43 −0 test/internal/parse-options.js
  133. +23 −0 test/internal/re.js
  134. +0 −181 test/ltr.js
  135. +0 −72 test/major-minor-patch.js
  136. +46 −0 test/map.js
  137. +4 −0 test/preload.js
  138. +0 −26 test/prerelease.js
  139. +30 −0 test/ranges/gtr.js
  140. +58 −0 test/ranges/intersects.js
  141. +24 −0 test/ranges/ltr.js
  142. +25 −0 test/ranges/max-satisfying.js
  143. +25 −0 test/ranges/min-satisfying.js
  144. +79 −0 test/ranges/min-version.js
  145. +53 −0 test/ranges/outside.js
  146. +42 −0 test/ranges/simplify.js
  147. +142 −0 test/ranges/subset.js
  148. +87 −0 test/ranges/to-comparators.js
  149. +12 −0 test/ranges/valid.js
10 changes: 10 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* This file is automatically added by @npmcli/template-oss. Do not edit. */

module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'deps', 'chore']],
'header-max-length': [2, 'always', 80],
'subject-case': [0, 'always', ['lower-case', 'sentence-case', 'start-case']],
},
}
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* This file is automatically added by @npmcli/template-oss. Do not edit. */

'use strict'

const { readdirSync: readdir } = require('fs')

const localConfigs = readdir(__dirname)
.filter((file) => file.startsWith('.eslintrc.local.'))
.map((file) => `./${file}`)

module.exports = {
root: true,
extends: [
'@npmcli',
...localConfigs,
],
}
18 changes: 18 additions & 0 deletions .eslintrc.local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict'

module.exports = {
overrides: [
{
files: ['bin/**', 'classes/**', 'functions/**', 'internal/**', 'ranges/**'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: false,
},
],
'import/no-nodejs-modules': ['error'],
},
},
],
}
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

* @npm/cli-team
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

name: Bug
description: File a bug/issue
title: "[BUG] <title>"
labels: [ Bug, Needs Triage ]

body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please [search here](./issues) to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: A clear & concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A clear & concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
value: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **npm**: 7.6.3
- **Node**: 13.14.0
- **OS**: Ubuntu 20.04
- **platform**: Macbook Pro
value: |
- npm:
- Node:
- OS:
- platform:
validations:
required: false
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

blank_issues_enabled: true
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

version: 2

updates:
- package-ecosystem: npm
directory: /
schedule:
interval: daily
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
32 changes: 32 additions & 0 deletions .github/matchers/tap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"//@npmcli/template-oss": "This file is automatically added by @npmcli/template-oss. Do not edit.",
"problemMatcher": [
{
"owner": "tap",
"pattern": [
{
"regexp": "^\\s*not ok \\d+ - (.*)",
"message": 1
},
{
"regexp": "^\\s*---"
},
{
"regexp": "^\\s*at:"
},
{
"regexp": "^\\s*line:\\s*(\\d+)",
"line": 1
},
{
"regexp": "^\\s*column:\\s*(\\d+)",
"column": 1
},
{
"regexp": "^\\s*file:\\s*(.*)",
"file": 1
}
]
}
]
}
26 changes: 26 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

repository:
allow_merge_commit: false
allow_rebase_merge: true
allow_squash_merge: true
squash_merge_commit_title: PR_TITLE
squash_merge_commit_message: PR_BODY
delete_branch_on_merge: true
enable_automated_security_fixes: true
enable_vulnerability_alerts: true

branches:
- name: main
protection:
required_status_checks: null
enforce_admins: true
required_pull_request_reviews:
required_approving_review_count: 1
require_code_owner_reviews: true
require_last_push_approval: true
dismiss_stale_reviews: true
restrictions:
apps: []
users: []
teams: [ "cli-team" ]
39 changes: 39 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

name: Audit

on:
workflow_dispatch:
schedule:
# "At 08:00 UTC (01:00 PT) on Monday" https://crontab.guru/#0_8_*_*_1
- cron: "0 8 * * 1"

jobs:
audit:
name: Audit Dependencies
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install npm@8
run: npm i --prefer-online --no-fund --no-audit -g npm@8
- name: npm Version
run: npm -v
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Production Audit
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
Loading