Skip to content

Commit 92d9e94

Browse files
authored
Merge pull request #1127 from arduino/dependabot/npm_and_yarn/semver-7.7.0
build(deps): bump semver from 7.6.3 to 7.7.0
2 parents 2233770 + 6bec8fa commit 92d9e94

File tree

4 files changed

+35
-26
lines changed

4 files changed

+35
-26
lines changed

.licenses/npm/semver-7.6.3.dep.yml renamed to .licenses/npm/semver-7.7.0.dep.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: semver
3-
version: 7.6.3
3+
version: 7.7.0
44
type: npm
55
summary: The semantic version parser used by npm.
66
homepage:

dist/index.js

+25-17
Original file line numberDiff line numberDiff line change
@@ -8980,7 +8980,7 @@ class SemVer {
89808980

89818981
if (version instanceof SemVer) {
89828982
if (version.loose === !!options.loose &&
8983-
version.includePrerelease === !!options.includePrerelease) {
8983+
version.includePrerelease === !!options.includePrerelease) {
89848984
return version
89858985
} else {
89868986
version = version.version
@@ -9146,6 +9146,19 @@ class SemVer {
91469146
// preminor will bump the version up to the next minor release, and immediately
91479147
// down to pre-release. premajor and prepatch work the same way.
91489148
inc (release, identifier, identifierBase) {
9149+
if (release.startsWith('pre')) {
9150+
if (!identifier && identifierBase === false) {
9151+
throw new Error('invalid increment argument: identifier is empty')
9152+
}
9153+
// Avoid an invalid semver results
9154+
if (identifier) {
9155+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
9156+
if (!match || match[1] !== identifier) {
9157+
throw new Error(`invalid identifier: ${identifier}`)
9158+
}
9159+
}
9160+
}
9161+
91499162
switch (release) {
91509163
case 'premajor':
91519164
this.prerelease.length = 0
@@ -9176,6 +9189,12 @@ class SemVer {
91769189
}
91779190
this.inc('pre', identifier, identifierBase)
91789191
break
9192+
case 'release':
9193+
if (this.prerelease.length === 0) {
9194+
throw new Error(`version ${this.raw} is not a prerelease`)
9195+
}
9196+
this.prerelease.length = 0
9197+
break
91799198

91809199
case 'major':
91819200
// If this is a pre-major version, bump up to the same major version.
@@ -9219,10 +9238,6 @@ class SemVer {
92199238
case 'pre': {
92209239
const base = Number(identifierBase) ? 1 : 0
92219240

9222-
if (!identifier && identifierBase === false) {
9223-
throw new Error('invalid increment argument: identifier is empty')
9224-
}
9225-
92269241
if (this.prerelease.length === 0) {
92279242
this.prerelease = [base]
92289243
} else {
@@ -9481,20 +9496,13 @@ const diff = (version1, version2) => {
94819496
return 'major'
94829497
}
94839498

9484-
// Otherwise it can be determined by checking the high version
9485-
9486-
if (highVersion.patch) {
9487-
// anything higher than a patch bump would result in the wrong version
9499+
// If the main part has no difference
9500+
if (lowVersion.compareMain(highVersion) === 0) {
9501+
if (lowVersion.minor && !lowVersion.patch) {
9502+
return 'minor'
9503+
}
94889504
return 'patch'
94899505
}
9490-
9491-
if (highVersion.minor) {
9492-
// anything higher than a minor bump would result in the wrong version
9493-
return 'minor'
9494-
}
9495-
9496-
// bumping major/minor/patch all have same result
9497-
return 'major'
94989506
}
94999507

95009508
// add the `pre` prefix if we are going to a prerelease version

package-lock.json

+8-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dependencies": {
1919
"@actions/core": "^1.11.1",
2020
"@actions/tool-cache": "^2.0.2",
21-
"semver": "^7.6.3",
21+
"semver": "^7.7.0",
2222
"typed-rest-client": "^2.1.0"
2323
},
2424
"devDependencies": {

0 commit comments

Comments
 (0)