From a7319846e5da1c7e562936a9a2fd7a1fe7fe9592 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 02:07:03 +0000 Subject: [PATCH] Update dependency semver to v7.7.0 --- dist/index.js | 42 +++++++++++++++++++++++++----------------- package.json | 2 +- yarn.lock | 10 +++++----- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8b03a47..901acea 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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 @@ -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 @@ -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. @@ -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 { @@ -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 diff --git a/package.json b/package.json index 5ee1ea0..c7297db 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index 8520466..2fc1369 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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 @@ -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