Skip to content

Commit

Permalink
Update dependency semver to v7.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and smorimoto committed Jan 30, 2025
1 parent 7556ebc commit a731984
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
42 changes: 25 additions & 17 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10678,7 +10678,7 @@ class SemVer {

if (version instanceof SemVer) {
if (version.loose === !!options.loose &&
version.includePrerelease === !!options.includePrerelease) {
version.includePrerelease === !!options.includePrerelease) {
return version
} else {
version = version.version
Expand Down Expand Up @@ -10844,6 +10844,19 @@ class SemVer {
// preminor will bump the version up to the next minor release, and immediately
// down to pre-release. premajor and prepatch work the same way.
inc (release, identifier, identifierBase) {
if (release.startsWith('pre')) {
if (!identifier && identifierBase === false) {
throw new Error('invalid increment argument: identifier is empty')
}
// Avoid an invalid semver results
if (identifier) {
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
if (!match || match[1] !== identifier) {
throw new Error(`invalid identifier: ${identifier}`)
}
}
}

switch (release) {
case 'premajor':
this.prerelease.length = 0
Expand Down Expand Up @@ -10874,6 +10887,12 @@ class SemVer {
}
this.inc('pre', identifier, identifierBase)
break
case 'release':
if (this.prerelease.length === 0) {
throw new Error(`version ${this.raw} is not a prerelease`)
}
this.prerelease.length = 0
break

case 'major':
// If this is a pre-major version, bump up to the same major version.
Expand Down Expand Up @@ -10917,10 +10936,6 @@ class SemVer {
case 'pre': {
const base = Number(identifierBase) ? 1 : 0

if (!identifier && identifierBase === false) {
throw new Error('invalid increment argument: identifier is empty')
}

if (this.prerelease.length === 0) {
this.prerelease = [base]
} else {
Expand Down Expand Up @@ -11179,20 +11194,13 @@ const diff = (version1, version2) => {
return 'major'
}

// Otherwise it can be determined by checking the high version

if (highVersion.patch) {
// anything higher than a patch bump would result in the wrong version
// If the main part has no difference
if (lowVersion.compareMain(highVersion) === 0) {
if (lowVersion.minor && !lowVersion.patch) {
return 'minor'
}
return 'patch'
}

if (highVersion.minor) {
// anything higher than a minor bump would result in the wrong version
return 'minor'
}

// bumping major/minor/patch all have same result
return 'major'
}

// add the `pre` prefix if we are going to a prerelease version
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@actions/github": "6.0.0",
"@actions/tool-cache": "2.0.2",
"@vercel/ncc": "0.38.3",
"semver": "7.6.3"
"semver": "7.7.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ __metadata:
"@types/node": "npm:22.12.0"
"@types/semver": "npm:7.5.8"
"@vercel/ncc": "npm:0.38.3"
semver: "npm:7.6.3"
semver: "npm:7.7.0"
typescript: "npm:5.7.3"
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -971,12 +971,12 @@ __metadata:
languageName: node
linkType: hard

"semver@npm:7.6.3, semver@npm:^7.3.5":
version: 7.6.3
resolution: "semver@npm:7.6.3"
"semver@npm:7.7.0, semver@npm:^7.3.5":
version: 7.7.0
resolution: "semver@npm:7.7.0"
bin:
semver: bin/semver.js
checksum: 10c0/88f33e148b210c153873cb08cfe1e281d518aaa9a666d4d148add6560db5cd3c582f3a08ccb91f38d5f379ead256da9931234ed122057f40bb5766e65e58adaf
checksum: 10c0/bcd1c03209b4be7d8ca86c976a0410beba7d4ec1d49d846a4be154b958db1ff5eaee50760c1d4f4070b19dee3236b8672d3e09642c53ea23740398bba2538a2d
languageName: node
linkType: hard

Expand Down

0 comments on commit a731984

Please sign in to comment.