diff --git a/package.json b/package.json index 586da16..57fa024 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ }, "dependencies": { "bumpp": "npm:@hyoban/bumpp@9.4.0-1", - "changelogithub": "^0.13.6", + "changelogithub": "npm:@hyoban/changelogithub@0.13.6-0", "conventional-changelog": "^5.1.0", "conventional-recommended-bump": "^9.0.0", "kolorist": "^1.8.0", @@ -86,10 +86,5 @@ "typescript": "^5.4.5", "vitest": "^1.5.0" }, - "prettier": "prettier-config-hyoban", - "pnpm": { - "patchedDependencies": { - "changelogithub@0.13.6": "patches/changelogithub@0.13.6.patch" - } - } + "prettier": "prettier-config-hyoban" } diff --git a/patches/changelogithub@0.13.6.patch b/patches/changelogithub@0.13.6.patch deleted file mode 100644 index 3022e97..0000000 --- a/patches/changelogithub@0.13.6.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff --git a/dist/index.cjs b/dist/index.cjs -index 58583c81c7d53430a0fa0ec4272835d0612a9e0e..33ff484c72ddd5d987ac650eb74a97c2ba57ea65 100644 ---- a/dist/index.cjs -+++ b/dist/index.cjs -@@ -138,14 +138,18 @@ async function isRepoShallow() { - async function getGitTags() { - return (await execCommand("git", ["--no-pager", "tag", "-l", "--sort=creatordate"]).then((r) => r.split("\n"))).reverse(); - } -+function getTagWithoutPrefix(tag) { -+ return tag.replace(/^v/, '') -+} - async function getLastMatchingTag(inputTag) { -- const isVersion = semver__default.valid(semver__default.coerce(inputTag)); -+ const inputTagWithoutPrefix = getTagWithoutPrefix(inputTag) -+ const isVersion = semver__default.valid(inputTagWithoutPrefix); - const isPrerelease2 = semver__default.prerelease(inputTag) !== null; - const tags = await getGitTags(); - let tag; - if (!isPrerelease2 && isVersion) -- tag = tags.find((tag2) => tag2 !== inputTag && tag2[0] === "v" && !tag2.includes("-")); -- tag || (tag = tags.find((tag2) => tag2 !== inputTag)); -+ tag = tags.find((tag2) => getTagWithoutPrefix(tag2) !== inputTagWithoutPrefix && semver__default.valid(getTagWithoutPrefix(tag2)) && semver__default.prerelease(getTagWithoutPrefix(tag2)) === null); -+ tag || (tag = tags.find((tag2) => getTagWithoutPrefix(tag2) !== inputTagWithoutPrefix && semver__default.valid(getTagWithoutPrefix(tag2)))); - return tag; - } - async function isRefGitTag(to) { -diff --git a/dist/index.mjs b/dist/index.mjs -index 2aa6747fdfa40e0980f7cfc9480c99536e7c636b..369ded9ef08336e737ead8e97e70fb86b07bb695 100644 ---- a/dist/index.mjs -+++ b/dist/index.mjs -@@ -132,14 +132,18 @@ async function isRepoShallow() { - async function getGitTags() { - return (await execCommand("git", ["--no-pager", "tag", "-l", "--sort=creatordate"]).then((r) => r.split("\n"))).reverse(); - } -+function getTagWithoutPrefix(tag) { -+ return tag.replace(/^v/, '') -+} - async function getLastMatchingTag(inputTag) { -- const isVersion = semver.valid(semver.coerce(inputTag)); -+ const inputTagWithoutPrefix = getTagWithoutPrefix(inputTag) -+ const isVersion = semver.valid(inputTagWithoutPrefix); - const isPrerelease2 = semver.prerelease(inputTag) !== null; - const tags = await getGitTags(); - let tag; - if (!isPrerelease2 && isVersion) -- tag = tags.find((tag2) => tag2 !== inputTag && tag2[0] === "v" && !tag2.includes("-")); -- tag || (tag = tags.find((tag2) => tag2 !== inputTag)); -+ tag = tags.find((tag2) => getTagWithoutPrefix(tag2) !== inputTagWithoutPrefix && semver.valid(getTagWithoutPrefix(tag2)) && semver.prerelease(getTagWithoutPrefix(tag2)) === null); -+ tag || (tag = tags.find((tag2) => getTagWithoutPrefix(tag2) !== inputTagWithoutPrefix && semver.valid(getTagWithoutPrefix(tag2)))); - return tag; - } - async function isRefGitTag(to) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9701f0a..f13af76 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,11 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -patchedDependencies: - changelogithub@0.13.6: - hash: rpij3wbubwaa773btbmhrvqmxu - path: patches/changelogithub@0.13.6.patch - importers: .: @@ -17,8 +12,8 @@ importers: specifier: npm:@hyoban/bumpp@9.4.0-1 version: /@hyoban/bumpp@9.4.0-1 changelogithub: - specifier: ^0.13.6 - version: 0.13.6(patch_hash=rpij3wbubwaa773btbmhrvqmxu) + specifier: npm:@hyoban/changelogithub@0.13.6-0 + version: /@hyoban/changelogithub@0.13.6-0 conventional-changelog: specifier: ^5.1.0 version: 5.1.0 @@ -522,6 +517,22 @@ packages: semver: 7.6.0 dev: false + /@hyoban/changelogithub@0.13.6-0: + resolution: {integrity: sha512-P3Fcb1hxcNOnypxVcXgFAJAwD72CpqsDpSKB5D00VQwbmUqfUEEav3hzsM/yaO26/HBKEBjn2+6GyNe7hTVT5g==} + engines: {node: '>=12.0.0'} + hasBin: true + dependencies: + '@antfu/utils': 0.7.7 + c12: 1.10.0 + cac: 6.7.14 + changelogen: 0.5.5 + convert-gitmoji: 0.1.3 + execa: 8.0.1 + kolorist: 1.8.0 + ofetch: 1.3.4 + semver: 7.6.0 + dev: false + /@iarna/toml@2.2.5: resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} dev: true @@ -1710,23 +1721,6 @@ packages: yaml: 2.4.1 dev: false - /changelogithub@0.13.6(patch_hash=rpij3wbubwaa773btbmhrvqmxu): - resolution: {integrity: sha512-cxkPxGSG51gDX0rjSNbsBAPbM4elTjpTcvmQGqTQ4GPoA6H2/iIbhgo4Dr/SzOsthw+sChrfgPnwIYadA2xmlg==} - engines: {node: '>=12.0.0'} - hasBin: true - dependencies: - '@antfu/utils': 0.7.7 - c12: 1.10.0 - cac: 6.7.14 - changelogen: 0.5.5 - convert-gitmoji: 0.1.3 - execa: 8.0.1 - kolorist: 1.8.0 - ofetch: 1.3.4 - semver: 7.6.0 - dev: false - patched: true - /chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true