diff --git a/package.json b/package.json index 03c01cf..218b617 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ "changelog": "node ./bin/cli.js", "clean": "rimraf lib", "fix": "pnpm lint --fix", - "lint": "eslint src --ext ts --format stylish", + "lint": "pnpm run '/lint:.*/'", + "lint:js": "eslint src --ext ts --format stylish", + "lint:types": "tsc --noEmit", "prepare": "pnpm build", "prettier": "prettier --write 'src/**/*.ts'", "test": "vitest", @@ -41,17 +43,21 @@ }, "dependencies": { "@manypkg/get-packages": "^2.2.0", + "@octokit/plugin-throttling": "^9.4.0", + "@octokit/rest": "^21.1.0", "chalk": "^4.0.0", "cli-highlight": "^2.1.11", "execa": "^5.0.0", "hosted-git-info": "^4.0.0", - "make-fetch-happen": "^9.0.0", "p-map": "^3.0.0", "progress": "^2.0.0", "yargs": "^17.1.0" }, "devDependencies": { + "@types/fs-extra": "^11.0.4", + "@types/hosted-git-info": "^3.0.5", "@types/node": "22.10.10", + "@types/yargs": "^17.0.33", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "eslint": "8.55.0", @@ -62,7 +68,7 @@ "release-plan": "^0.11.0", "rimraf": "3.0.2", "typescript": "5.0.4", - "vitest": "^3.0.4" + "vitest": "^3.0.7" }, "packageManager": "pnpm@10.4.1+sha512.c753b6c3ad7afa13af388fa6d808035a008e30ea9993f58c6663e2bc5ff21679aa834db094987129aa4d488b86df57f7b634981b2f827cdcacc698cc0cfb88af", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f64b9dc..6cdd77d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,12 @@ importers: '@manypkg/get-packages': specifier: ^2.2.0 version: 2.2.2 + '@octokit/plugin-throttling': + specifier: ^9.4.0 + version: 9.4.0(@octokit/core@6.1.4) + '@octokit/rest': + specifier: ^21.1.0 + version: 21.1.1 chalk: specifier: ^4.0.0 version: 4.1.2 @@ -26,9 +32,6 @@ importers: hosted-git-info: specifier: ^4.0.0 version: 4.1.0 - make-fetch-happen: - specifier: ^9.0.0 - version: 9.1.0 p-map: specifier: ^3.0.0 version: 3.0.0 @@ -39,9 +42,18 @@ importers: specifier: ^17.1.0 version: 17.7.2 devDependencies: + '@types/fs-extra': + specifier: ^11.0.4 + version: 11.0.4 + '@types/hosted-git-info': + specifier: ^3.0.5 + version: 3.0.5 '@types/node': specifier: 22.10.10 version: 22.10.10 + '@types/yargs': + specifier: ^17.0.33 + version: 17.0.33 '@typescript-eslint/eslint-plugin': specifier: 5.62.0 version: 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.55.0)(typescript@5.0.4))(eslint@8.55.0)(typescript@5.0.4) @@ -73,158 +85,146 @@ importers: specifier: 5.0.4 version: 5.0.4 vitest: - specifier: ^3.0.4 - version: 3.0.6(@types/node@22.10.10) + specifier: ^3.0.7 + version: 3.0.7(@types/node@22.10.10) packages: - '@esbuild/aix-ppc64@0.24.2': - resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} - engines: {node: '>=18'} + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.24.2': - resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} - engines: {node: '>=18'} + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.24.2': - resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} - engines: {node: '>=18'} + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.24.2': - resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} - engines: {node: '>=18'} + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.24.2': - resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} - engines: {node: '>=18'} + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.24.2': - resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} - engines: {node: '>=18'} + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.24.2': - resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} - engines: {node: '>=18'} + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.24.2': - resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} - engines: {node: '>=18'} + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.24.2': - resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} - engines: {node: '>=18'} + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.24.2': - resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} - engines: {node: '>=18'} + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.24.2': - resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} - engines: {node: '>=18'} + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.24.2': - resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} - engines: {node: '>=18'} + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.24.2': - resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} - engines: {node: '>=18'} + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.24.2': - resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} - engines: {node: '>=18'} + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.24.2': - resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} - engines: {node: '>=18'} + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.24.2': - resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} - engines: {node: '>=18'} + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.24.2': - resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} - engines: {node: '>=18'} + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.24.2': - resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [netbsd] - - '@esbuild/netbsd-x64@0.24.2': - resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} - engines: {node: '>=18'} + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.24.2': - resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.24.2': - resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} - engines: {node: '>=18'} + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.24.2': - resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} - engines: {node: '>=18'} + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.24.2': - resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} - engines: {node: '>=18'} + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.24.2': - resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} - engines: {node: '>=18'} + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.24.2': - resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} - engines: {node: '>=18'} + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -246,9 +246,6 @@ packages: resolution: {integrity: sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@gar/promisify@1.1.3': - resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} - '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -293,18 +290,10 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@npmcli/fs@1.1.1': - resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==} - '@npmcli/git@5.0.8': resolution: {integrity: sha512-liASfw5cqhjNW9UFd+ruwwdEf/lbOAQjLL2XY2dFW/bkJheXDYZgOyul/4gVvEV4BWkTXjYGmDqMw9uegdbJNQ==} engines: {node: ^16.14.0 || >=18.0.0} - '@npmcli/move-file@1.1.2': - resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} - engines: {node: '>=10'} - deprecated: This functionality has been moved to @npmcli/fs - '@npmcli/package-json@5.2.1': resolution: {integrity: sha512-f7zYC6kQautXHvNbLEWgD/uGu1+xCn9izgqBfgItWSx22U0ZDekxN08A1vM8cTxj/cRVe0Q94Ode+tdoYmIOOQ==} engines: {node: ^16.14.0 || >=18.0.0} @@ -317,10 +306,22 @@ packages: resolution: {integrity: sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ==} engines: {node: '>= 14'} + '@octokit/auth-token@5.1.2': + resolution: {integrity: sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==} + engines: {node: '>= 18'} + '@octokit/core@4.2.4': resolution: {integrity: sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ==} engines: {node: '>= 14'} + '@octokit/core@6.1.4': + resolution: {integrity: sha512-lAS9k7d6I0MPN+gb9bKDt7X8SdxknYqAMh44S5L+lNqIN2NuV8nvv3g8rPp7MuRxcOpxpUIATWprO0C34a8Qmg==} + engines: {node: '>= 18'} + + '@octokit/endpoint@10.1.3': + resolution: {integrity: sha512-nBRBMpKPhQUxCsQQeW+rCJ/OPSMcj3g0nfHn01zGYZXuNDvvXudF/TYY6APj5THlurerpFN4a/dQAIAaM6BYhA==} + engines: {node: '>= 18'} + '@octokit/endpoint@7.0.6': resolution: {integrity: sha512-5L4fseVRUsDFGR00tMWD/Trdeeihn999rTMGRMC1G/Ldi1uWlWJzI98H4Iak5DB/RVvQuyMYKqSK/R6mbSOQyg==} engines: {node: '>= 14'} @@ -329,9 +330,22 @@ packages: resolution: {integrity: sha512-Fxyxdy/JH0MnIB5h+UQ3yCoh1FG4kWXfFKkpWqjZHw/p+Kc8Y44Hu/kCgNBT6nU1shNumEchmW/sUO1JuQnPcw==} engines: {node: '>= 14'} + '@octokit/graphql@8.2.1': + resolution: {integrity: sha512-n57hXtOoHrhwTWdvhVkdJHdhTv0JstjDbDRhJfwIRNfFqmSo1DaK/mD2syoNUoLCyqSjBpGAKOG0BuwF392slw==} + engines: {node: '>= 18'} + '@octokit/openapi-types@18.1.1': resolution: {integrity: sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==} + '@octokit/openapi-types@23.0.1': + resolution: {integrity: sha512-izFjMJ1sir0jn0ldEKhZ7xegCTj/ObmEDlEfpFrx4k/JyZSMRHbO3/rBwgE7f3m2DHt+RrNGIVw4wSmwnm3t/g==} + + '@octokit/plugin-paginate-rest@11.4.3': + resolution: {integrity: sha512-tBXaAbXkqVJlRoA/zQVe9mUdb8rScmivqtpv3ovsC5xhje/a+NOCivs7eUhWBwCApJVsR4G5HMeaLbq7PxqZGA==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '>=6' + '@octokit/plugin-paginate-rest@6.1.2': resolution: {integrity: sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==} engines: {node: '>= 14'} @@ -343,30 +357,63 @@ packages: peerDependencies: '@octokit/core': '>=3' + '@octokit/plugin-request-log@5.3.1': + resolution: {integrity: sha512-n/lNeCtq+9ofhC15xzmJCNKP2BWTv8Ih2TTy+jatNCCq/gQP/V7rK3fjIfuz0pDWDALO/o/4QY4hyOF6TQQFUw==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '>=6' + + '@octokit/plugin-rest-endpoint-methods@13.3.1': + resolution: {integrity: sha512-o8uOBdsyR+WR8MK9Cco8dCgvG13H1RlM1nWnK/W7TEACQBFux/vPREgKucxUfuDQ5yi1T3hGf4C5ZmZXAERgwQ==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '>=6' + '@octokit/plugin-rest-endpoint-methods@7.2.3': resolution: {integrity: sha512-I5Gml6kTAkzVlN7KCtjOM+Ruwe/rQppp0QU372K1GP7kNOYEKe8Xn5BW4sE62JAHdwpq95OQK/qGNyKQMUzVgA==} engines: {node: '>= 14'} peerDependencies: '@octokit/core': '>=3' + '@octokit/plugin-throttling@9.4.0': + resolution: {integrity: sha512-IOlXxXhZA4Z3m0EEYtrrACkuHiArHLZ3CvqWwOez/pURNqRuwfoFlTPbN5Muf28pzFuztxPyiUiNwz8KctdZaQ==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': ^6.1.3 + '@octokit/request-error@3.0.3': resolution: {integrity: sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ==} engines: {node: '>= 14'} + '@octokit/request-error@6.1.7': + resolution: {integrity: sha512-69NIppAwaauwZv6aOzb+VVLwt+0havz9GT5YplkeJv7fG7a40qpLt/yZKyiDxAhgz0EtgNdNcb96Z0u+Zyuy2g==} + engines: {node: '>= 18'} + '@octokit/request@6.2.8': resolution: {integrity: sha512-ow4+pkVQ+6XVVsekSYBzJC0VTVvh/FCTUUgTsboGq+DTeWdyIFV8WSCdo0RIxk6wSkBTHqIK1mYuY7nOBXOchw==} engines: {node: '>= 14'} + '@octokit/request@9.2.2': + resolution: {integrity: sha512-dZl0ZHx6gOQGcffgm1/Sf6JfEpmh34v3Af2Uci02vzUYz6qEN6zepoRtmybWXIGXFIK8K9ylE3b+duCWqhArtg==} + engines: {node: '>= 18'} + '@octokit/rest@19.0.13': resolution: {integrity: sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==} engines: {node: '>= 14'} + '@octokit/rest@21.1.1': + resolution: {integrity: sha512-sTQV7va0IUVZcntzy1q3QqPm/r8rWtDCqpRAmb8eXXnKkjoQEtFe3Nt5GTVsHft+R6jJoHeSiVLcgcvhtue/rg==} + engines: {node: '>= 18'} + '@octokit/tsconfig@1.0.2': resolution: {integrity: sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==} '@octokit/types@10.0.0': resolution: {integrity: sha512-Vm8IddVmhCgU1fxC1eyinpwqzXPEYu0NrYzD3YZjlGjyftdLBTeqNblRC0jmJmgxbJIsQlyogVeGnrNaaMVzIg==} + '@octokit/types@13.8.0': + resolution: {integrity: sha512-x7DjTIbEpEWXK99DMd01QfWy0hd5h4EN+Q7shkdKds3otGQP+oWE/y0A76i1OvH9fygo4ddvNf7ZvF0t78P98A==} + '@octokit/types@9.3.2': resolution: {integrity: sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==} @@ -481,22 +528,33 @@ packages: cpu: [x64] os: [win32] - '@tootallnate/once@1.1.2': - resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==} - engines: {node: '>= 6'} - '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + '@types/fs-extra@11.0.4': + resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} + + '@types/hosted-git-info@3.0.5': + resolution: {integrity: sha512-Dmngh7U003cOHPhKGyA7LWqrnvcTyILNgNPmNCxlx7j8MIi54iBliiT8XqVLIQ3GchoOjVAyBzNJVyuaJjqokg==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/jsonfile@6.1.4': + resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} + '@types/node@22.10.10': resolution: {integrity: sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==} '@types/semver@7.5.8': resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + + '@types/yargs@17.0.33': + resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} + '@typescript-eslint/eslint-plugin@5.62.0': resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -558,11 +616,11 @@ packages: '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} - '@vitest/expect@3.0.6': - resolution: {integrity: sha512-zBduHf/ja7/QRX4HdP1DSq5XrPgdN+jzLOwaTq/0qZjYfgETNFCKf9nOAp2j3hmom3oTbczuUzrzg9Hafh7hNg==} + '@vitest/expect@3.0.7': + resolution: {integrity: sha512-QP25f+YJhzPfHrHfYHtvRn+uvkCFCqFtW9CktfBxmB+25QqWsx7VB2As6f4GmwllHLDhXNHvqedwhvMmSnNmjw==} - '@vitest/mocker@3.0.6': - resolution: {integrity: sha512-KPztr4/tn7qDGZfqlSPQoF2VgJcKxnDNhmfR3VgZ6Fy1bO8T9Fc1stUiTXtqz0yG24VpD00pZP5f8EOFknjNuQ==} + '@vitest/mocker@3.0.7': + resolution: {integrity: sha512-qui+3BLz9Eonx4EAuR/i+QlCX6AUZ35taDQgwGkK/Tw6/WgwodSrjN1X2xf69IA/643ZX5zNKIn2svvtZDrs4w==} peerDependencies: msw: ^2.4.9 vite: ^5.0.0 || ^6.0.0 @@ -572,20 +630,20 @@ packages: vite: optional: true - '@vitest/pretty-format@3.0.6': - resolution: {integrity: sha512-Zyctv3dbNL+67qtHfRnUE/k8qxduOamRfAL1BurEIQSyOEFffoMvx2pnDSSbKAAVxY0Ej2J/GH2dQKI0W2JyVg==} + '@vitest/pretty-format@3.0.7': + resolution: {integrity: sha512-CiRY0BViD/V8uwuEzz9Yapyao+M9M008/9oMOSQydwbwb+CMokEq3XVaF3XK/VWaOK0Jm9z7ENhybg70Gtxsmg==} - '@vitest/runner@3.0.6': - resolution: {integrity: sha512-JopP4m/jGoaG1+CBqubV/5VMbi7L+NQCJTu1J1Pf6YaUbk7bZtaq5CX7p+8sY64Sjn1UQ1XJparHfcvTTdu9cA==} + '@vitest/runner@3.0.7': + resolution: {integrity: sha512-WeEl38Z0S2ZcuRTeyYqaZtm4e26tq6ZFqh5y8YD9YxfWuu0OFiGFUbnxNynwLjNRHPsXyee2M9tV7YxOTPZl2g==} - '@vitest/snapshot@3.0.6': - resolution: {integrity: sha512-qKSmxNQwT60kNwwJHMVwavvZsMGXWmngD023OHSgn873pV0lylK7dwBTfYP7e4URy5NiBCHHiQGA9DHkYkqRqg==} + '@vitest/snapshot@3.0.7': + resolution: {integrity: sha512-eqTUryJWQN0Rtf5yqCGTQWsCFOQe4eNz5Twsu21xYEcnFJtMU5XvmG0vgebhdLlrHQTSq5p8vWHJIeJQV8ovsA==} - '@vitest/spy@3.0.6': - resolution: {integrity: sha512-HfOGx/bXtjy24fDlTOpgiAEJbRfFxoX3zIGagCqACkFKKZ/TTOE6gYMKXlqecvxEndKFuNHcHqP081ggZ2yM0Q==} + '@vitest/spy@3.0.7': + resolution: {integrity: sha512-4T4WcsibB0B6hrKdAZTM37ekuyFZt2cGbEGd2+L0P8ov15J1/HUsUaqkXEQPNAWr4BtPPe1gI+FYfMHhEKfR8w==} - '@vitest/utils@3.0.6': - resolution: {integrity: sha512-18ktZpf4GQFTbf9jK543uspU03Q2qya7ZGya5yiZ0Gx0nnnalBvd5ZBislbl2EhLjM8A8rt4OilqKG7QwcGkvQ==} + '@vitest/utils@3.0.7': + resolution: {integrity: sha512-xePVpCRfooFX3rANQjwoditoXgWb1MaFbzmGuPP59MK6i13mrnDw/yEIyJudLeW6/38mCNcwCiJIGmpDPibAIg==} acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -597,14 +655,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - - agentkeepalive@4.6.0: - resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==} - engines: {node: '>= 8.0.0'} - aggregate-error@3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} @@ -651,6 +701,12 @@ packages: before-after-hook@2.2.3: resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} + before-after-hook@3.0.2: + resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} + + bottleneck@2.19.5: + resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -665,10 +721,6 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - cacache@15.3.0: - resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==} - engines: {node: '>= 10'} - callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -685,10 +737,6 @@ packages: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} - chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -774,9 +822,9 @@ packages: es-module-lexer@1.6.0: resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} - esbuild@0.24.2: - resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} - engines: {node: '>=18'} + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} hasBin: true escalade@3.2.0: @@ -861,6 +909,9 @@ packages: resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} engines: {node: '>=12.0.0'} + fast-content-type-parse@2.0.1: + resolution: {integrity: sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -877,8 +928,8 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fastq@1.19.0: - resolution: {integrity: sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==} + fastq@1.19.1: + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} @@ -899,18 +950,14 @@ packages: flatted@3.3.3: resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} - foreground-child@3.3.0: - resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} fs-extra@10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} engines: {node: '>=12'} - fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -979,17 +1026,6 @@ packages: resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} engines: {node: ^16.14.0 || >=18.0.0} - http-cache-semantics@4.1.1: - resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} - - http-proxy-agent@4.0.1: - resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==} - engines: {node: '>= 6'} - - https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - human-signals@1.1.1: resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==} engines: {node: '>=8.12.0'} @@ -998,9 +1034,6 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - humanize-ms@1.2.1: - resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} - iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -1021,9 +1054,6 @@ packages: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} - infer-owner@1.0.4: - resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==} - inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. @@ -1038,10 +1068,6 @@ packages: resolution: {integrity: sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - ip-address@9.0.5: - resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} - engines: {node: '>= 12'} - is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -1054,9 +1080,6 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} - is-lambda@1.0.1: - resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} - is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -1090,9 +1113,6 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsbn@1.1.0: - resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} - json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -1144,10 +1164,6 @@ packages: magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} - make-fetch-happen@9.1.0: - resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==} - engines: {node: '>= 10'} - merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -1173,47 +1189,10 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - minipass-collect@1.0.2: - resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==} - engines: {node: '>= 8'} - - minipass-fetch@1.4.1: - resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==} - engines: {node: '>=8'} - - minipass-flush@1.0.5: - resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} - engines: {node: '>= 8'} - - minipass-pipeline@1.2.4: - resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} - engines: {node: '>=8'} - - minipass-sized@1.0.3: - resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} - engines: {node: '>=8'} - - minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - - minipass@5.0.0: - resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} - engines: {node: '>=8'} - minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} - minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - - mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -1231,10 +1210,6 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - negotiator@0.6.4: - resolution: {integrity: sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==} - engines: {node: '>= 0.6'} - node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -1295,10 +1270,6 @@ packages: resolution: {integrity: sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==} engines: {node: '>=8'} - p-map@4.0.0: - resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} - engines: {node: '>=10'} - package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} @@ -1434,8 +1405,8 @@ packages: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} - reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} rimraf@3.0.2: @@ -1481,18 +1452,6 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - smart-buffer@4.2.0: - resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} - engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} - - socks-proxy-agent@6.2.1: - resolution: {integrity: sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==} - engines: {node: '>= 10'} - - socks@2.8.4: - resolution: {integrity: sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==} - engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} - source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -1509,13 +1468,6 @@ packages: spdx-license-ids@3.0.21: resolution: {integrity: sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==} - sprintf-js@1.1.3: - resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} - - ssri@8.0.1: - resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} - engines: {node: '>= 8'} - stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -1554,10 +1506,6 @@ packages: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} - tar@6.2.1: - resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} - engines: {node: '>=10'} - text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -1618,15 +1566,12 @@ packages: undici-types@6.20.0: resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} - unique-filename@1.1.1: - resolution: {integrity: sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==} - - unique-slug@2.0.2: - resolution: {integrity: sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==} - universal-user-agent@6.0.1: resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} + universal-user-agent@7.0.2: + resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} + universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} @@ -1641,32 +1586,27 @@ packages: resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - vite-node@3.0.6: - resolution: {integrity: sha512-s51RzrTkXKJrhNbUzQRsarjmAae7VmMPAsRT7lppVpIg6mK3zGthP9Hgz0YQQKuNcF+Ii7DfYk3Fxz40jRmePw==} + vite-node@3.0.7: + resolution: {integrity: sha512-2fX0QwX4GkkkpULXdT1Pf4q0tC1i1lFOyseKoonavXUNlQ77KpW2XqBGGNIm/J4Ows4KxgGJzDguYVPKwG/n5A==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true - vite@6.1.1: - resolution: {integrity: sha512-4GgM54XrwRfrOp297aIYspIti66k56v16ZnqHvrIM7mG+HjDlAwS7p+Srr7J6fGvEdOJ5JcQ/D9T7HhtdXDTzA==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + vite@5.4.14: + resolution: {integrity: sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - jiti: '>=1.21.0' + '@types/node': ^18.0.0 || >=20.0.0 less: '*' lightningcss: ^1.21.0 sass: '*' sass-embedded: '*' stylus: '*' sugarss: '*' - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 + terser: ^5.4.0 peerDependenciesMeta: '@types/node': optional: true - jiti: - optional: true less: optional: true lightningcss: @@ -1681,21 +1621,17 @@ packages: optional: true terser: optional: true - tsx: - optional: true - yaml: - optional: true - vitest@3.0.6: - resolution: {integrity: sha512-/iL1Sc5VeDZKPDe58oGK4HUFLhw6b5XdY1MYawjuSaDA4sEfYlY9HnS6aCEG26fX+MgUi7MwlduTBHHAI/OvMA==} + vitest@3.0.7: + resolution: {integrity: sha512-IP7gPK3LS3Fvn44x30X1dM9vtawm0aesAa2yBIZ9vQf+qB69NXC5776+Qmcr7ohUXIQuLhk7xQR0aSUIDPqavg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/debug': ^4.1.12 '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.0.6 - '@vitest/ui': 3.0.6 + '@vitest/browser': 3.0.7 + '@vitest/ui': 3.0.7 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -1779,79 +1715,73 @@ packages: snapshots: - '@esbuild/aix-ppc64@0.24.2': - optional: true - - '@esbuild/android-arm64@0.24.2': + '@esbuild/aix-ppc64@0.21.5': optional: true - '@esbuild/android-arm@0.24.2': + '@esbuild/android-arm64@0.21.5': optional: true - '@esbuild/android-x64@0.24.2': + '@esbuild/android-arm@0.21.5': optional: true - '@esbuild/darwin-arm64@0.24.2': + '@esbuild/android-x64@0.21.5': optional: true - '@esbuild/darwin-x64@0.24.2': + '@esbuild/darwin-arm64@0.21.5': optional: true - '@esbuild/freebsd-arm64@0.24.2': + '@esbuild/darwin-x64@0.21.5': optional: true - '@esbuild/freebsd-x64@0.24.2': + '@esbuild/freebsd-arm64@0.21.5': optional: true - '@esbuild/linux-arm64@0.24.2': + '@esbuild/freebsd-x64@0.21.5': optional: true - '@esbuild/linux-arm@0.24.2': + '@esbuild/linux-arm64@0.21.5': optional: true - '@esbuild/linux-ia32@0.24.2': + '@esbuild/linux-arm@0.21.5': optional: true - '@esbuild/linux-loong64@0.24.2': + '@esbuild/linux-ia32@0.21.5': optional: true - '@esbuild/linux-mips64el@0.24.2': + '@esbuild/linux-loong64@0.21.5': optional: true - '@esbuild/linux-ppc64@0.24.2': + '@esbuild/linux-mips64el@0.21.5': optional: true - '@esbuild/linux-riscv64@0.24.2': + '@esbuild/linux-ppc64@0.21.5': optional: true - '@esbuild/linux-s390x@0.24.2': + '@esbuild/linux-riscv64@0.21.5': optional: true - '@esbuild/linux-x64@0.24.2': + '@esbuild/linux-s390x@0.21.5': optional: true - '@esbuild/netbsd-arm64@0.24.2': + '@esbuild/linux-x64@0.21.5': optional: true - '@esbuild/netbsd-x64@0.24.2': + '@esbuild/netbsd-x64@0.21.5': optional: true - '@esbuild/openbsd-arm64@0.24.2': + '@esbuild/openbsd-x64@0.21.5': optional: true - '@esbuild/openbsd-x64@0.24.2': + '@esbuild/sunos-x64@0.21.5': optional: true - '@esbuild/sunos-x64@0.24.2': + '@esbuild/win32-arm64@0.21.5': optional: true - '@esbuild/win32-arm64@0.24.2': + '@esbuild/win32-ia32@0.21.5': optional: true - '@esbuild/win32-ia32@0.24.2': - optional: true - - '@esbuild/win32-x64@0.24.2': + '@esbuild/win32-x64@0.21.5': optional: true '@eslint-community/eslint-utils@4.4.1(eslint@8.55.0)': @@ -1877,8 +1807,6 @@ snapshots: '@eslint/js@8.55.0': {} - '@gar/promisify@1.1.3': {} - '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 @@ -1927,12 +1855,7 @@ snapshots: '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.19.0 - - '@npmcli/fs@1.1.1': - dependencies: - '@gar/promisify': 1.1.3 - semver: 7.7.1 + fastq: 1.19.1 '@npmcli/git@5.0.8': dependencies: @@ -1948,11 +1871,6 @@ snapshots: transitivePeerDependencies: - bluebird - '@npmcli/move-file@1.1.2': - dependencies: - mkdirp: 1.0.4 - rimraf: 3.0.2 - '@npmcli/package-json@5.2.1': dependencies: '@npmcli/git': 5.0.8 @@ -1971,6 +1889,8 @@ snapshots: '@octokit/auth-token@3.0.4': {} + '@octokit/auth-token@5.1.2': {} + '@octokit/core@4.2.4(encoding@0.1.13)': dependencies: '@octokit/auth-token': 3.0.4 @@ -1983,6 +1903,21 @@ snapshots: transitivePeerDependencies: - encoding + '@octokit/core@6.1.4': + dependencies: + '@octokit/auth-token': 5.1.2 + '@octokit/graphql': 8.2.1 + '@octokit/request': 9.2.2 + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 + before-after-hook: 3.0.2 + universal-user-agent: 7.0.2 + + '@octokit/endpoint@10.1.3': + dependencies: + '@octokit/types': 13.8.0 + universal-user-agent: 7.0.2 + '@octokit/endpoint@7.0.6': dependencies: '@octokit/types': 9.3.2 @@ -1997,8 +1932,21 @@ snapshots: transitivePeerDependencies: - encoding + '@octokit/graphql@8.2.1': + dependencies: + '@octokit/request': 9.2.2 + '@octokit/types': 13.8.0 + universal-user-agent: 7.0.2 + '@octokit/openapi-types@18.1.1': {} + '@octokit/openapi-types@23.0.1': {} + + '@octokit/plugin-paginate-rest@11.4.3(@octokit/core@6.1.4)': + dependencies: + '@octokit/core': 6.1.4 + '@octokit/types': 13.8.0 + '@octokit/plugin-paginate-rest@6.1.2(@octokit/core@4.2.4(encoding@0.1.13))': dependencies: '@octokit/core': 4.2.4(encoding@0.1.13) @@ -2009,17 +1957,36 @@ snapshots: dependencies: '@octokit/core': 4.2.4(encoding@0.1.13) + '@octokit/plugin-request-log@5.3.1(@octokit/core@6.1.4)': + dependencies: + '@octokit/core': 6.1.4 + + '@octokit/plugin-rest-endpoint-methods@13.3.1(@octokit/core@6.1.4)': + dependencies: + '@octokit/core': 6.1.4 + '@octokit/types': 13.8.0 + '@octokit/plugin-rest-endpoint-methods@7.2.3(@octokit/core@4.2.4(encoding@0.1.13))': dependencies: '@octokit/core': 4.2.4(encoding@0.1.13) '@octokit/types': 10.0.0 + '@octokit/plugin-throttling@9.4.0(@octokit/core@6.1.4)': + dependencies: + '@octokit/core': 6.1.4 + '@octokit/types': 13.8.0 + bottleneck: 2.19.5 + '@octokit/request-error@3.0.3': dependencies: '@octokit/types': 9.3.2 deprecation: 2.3.1 once: 1.4.0 + '@octokit/request-error@6.1.7': + dependencies: + '@octokit/types': 13.8.0 + '@octokit/request@6.2.8(encoding@0.1.13)': dependencies: '@octokit/endpoint': 7.0.6 @@ -2031,6 +1998,14 @@ snapshots: transitivePeerDependencies: - encoding + '@octokit/request@9.2.2': + dependencies: + '@octokit/endpoint': 10.1.3 + '@octokit/request-error': 6.1.7 + '@octokit/types': 13.8.0 + fast-content-type-parse: 2.0.1 + universal-user-agent: 7.0.2 + '@octokit/rest@19.0.13(encoding@0.1.13)': dependencies: '@octokit/core': 4.2.4(encoding@0.1.13) @@ -2040,12 +2015,23 @@ snapshots: transitivePeerDependencies: - encoding + '@octokit/rest@21.1.1': + dependencies: + '@octokit/core': 6.1.4 + '@octokit/plugin-paginate-rest': 11.4.3(@octokit/core@6.1.4) + '@octokit/plugin-request-log': 5.3.1(@octokit/core@6.1.4) + '@octokit/plugin-rest-endpoint-methods': 13.3.1(@octokit/core@6.1.4) + '@octokit/tsconfig@1.0.2': {} '@octokit/types@10.0.0': dependencies: '@octokit/openapi-types': 18.1.1 + '@octokit/types@13.8.0': + dependencies: + '@octokit/openapi-types': 23.0.1 + '@octokit/types@9.3.2': dependencies: '@octokit/openapi-types': 18.1.1 @@ -2122,18 +2108,33 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.34.8': optional: true - '@tootallnate/once@1.1.2': {} - '@types/estree@1.0.6': {} + '@types/fs-extra@11.0.4': + dependencies: + '@types/jsonfile': 6.1.4 + '@types/node': 22.10.10 + + '@types/hosted-git-info@3.0.5': {} + '@types/json-schema@7.0.15': {} + '@types/jsonfile@6.1.4': + dependencies: + '@types/node': 22.10.10 + '@types/node@22.10.10': dependencies: undici-types: 6.20.0 '@types/semver@7.5.8': {} + '@types/yargs-parser@21.0.3': {} + + '@types/yargs@17.0.33': + dependencies: + '@types/yargs-parser': 21.0.3 + '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.55.0)(typescript@5.0.4))(eslint@8.55.0)(typescript@5.0.4)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -2220,43 +2221,43 @@ snapshots: '@ungap/structured-clone@1.3.0': {} - '@vitest/expect@3.0.6': + '@vitest/expect@3.0.7': dependencies: - '@vitest/spy': 3.0.6 - '@vitest/utils': 3.0.6 + '@vitest/spy': 3.0.7 + '@vitest/utils': 3.0.7 chai: 5.2.0 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.6(vite@6.1.1(@types/node@22.10.10))': + '@vitest/mocker@3.0.7(vite@5.4.14(@types/node@22.10.10))': dependencies: - '@vitest/spy': 3.0.6 + '@vitest/spy': 3.0.7 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 6.1.1(@types/node@22.10.10) + vite: 5.4.14(@types/node@22.10.10) - '@vitest/pretty-format@3.0.6': + '@vitest/pretty-format@3.0.7': dependencies: tinyrainbow: 2.0.0 - '@vitest/runner@3.0.6': + '@vitest/runner@3.0.7': dependencies: - '@vitest/utils': 3.0.6 + '@vitest/utils': 3.0.7 pathe: 2.0.3 - '@vitest/snapshot@3.0.6': + '@vitest/snapshot@3.0.7': dependencies: - '@vitest/pretty-format': 3.0.6 + '@vitest/pretty-format': 3.0.7 magic-string: 0.30.17 pathe: 2.0.3 - '@vitest/spy@3.0.6': + '@vitest/spy@3.0.7': dependencies: tinyspy: 3.0.2 - '@vitest/utils@3.0.6': + '@vitest/utils@3.0.7': dependencies: - '@vitest/pretty-format': 3.0.6 + '@vitest/pretty-format': 3.0.7 loupe: 3.1.3 tinyrainbow: 2.0.0 @@ -2266,16 +2267,6 @@ snapshots: acorn@8.14.0: {} - agent-base@6.0.2: - dependencies: - debug: 4.4.0 - transitivePeerDependencies: - - supports-color - - agentkeepalive@4.6.0: - dependencies: - humanize-ms: 1.2.1 - aggregate-error@3.1.0: dependencies: clean-stack: 2.2.0 @@ -2312,6 +2303,10 @@ snapshots: before-after-hook@2.2.3: {} + before-after-hook@3.0.2: {} + + bottleneck@2.19.5: {} + brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -2327,29 +2322,6 @@ snapshots: cac@6.7.14: {} - cacache@15.3.0: - dependencies: - '@npmcli/fs': 1.1.1 - '@npmcli/move-file': 1.1.2 - chownr: 2.0.0 - fs-minipass: 2.1.0 - glob: 7.2.3 - infer-owner: 1.0.4 - lru-cache: 6.0.0 - minipass: 3.3.6 - minipass-collect: 1.0.2 - minipass-flush: 1.0.5 - minipass-pipeline: 1.2.4 - mkdirp: 1.0.4 - p-map: 4.0.0 - promise-inflight: 1.0.1 - rimraf: 3.0.2 - ssri: 8.0.1 - tar: 6.2.1 - unique-filename: 1.1.1 - transitivePeerDependencies: - - bluebird - callsites@3.1.0: {} chai@5.2.0: @@ -2367,8 +2339,6 @@ snapshots: check-error@2.1.1: {} - chownr@2.0.0: {} - clean-stack@2.2.0: {} cli-highlight@2.1.11: @@ -2450,33 +2420,31 @@ snapshots: es-module-lexer@1.6.0: {} - esbuild@0.24.2: + esbuild@0.21.5: optionalDependencies: - '@esbuild/aix-ppc64': 0.24.2 - '@esbuild/android-arm': 0.24.2 - '@esbuild/android-arm64': 0.24.2 - '@esbuild/android-x64': 0.24.2 - '@esbuild/darwin-arm64': 0.24.2 - '@esbuild/darwin-x64': 0.24.2 - '@esbuild/freebsd-arm64': 0.24.2 - '@esbuild/freebsd-x64': 0.24.2 - '@esbuild/linux-arm': 0.24.2 - '@esbuild/linux-arm64': 0.24.2 - '@esbuild/linux-ia32': 0.24.2 - '@esbuild/linux-loong64': 0.24.2 - '@esbuild/linux-mips64el': 0.24.2 - '@esbuild/linux-ppc64': 0.24.2 - '@esbuild/linux-riscv64': 0.24.2 - '@esbuild/linux-s390x': 0.24.2 - '@esbuild/linux-x64': 0.24.2 - '@esbuild/netbsd-arm64': 0.24.2 - '@esbuild/netbsd-x64': 0.24.2 - '@esbuild/openbsd-arm64': 0.24.2 - '@esbuild/openbsd-x64': 0.24.2 - '@esbuild/sunos-x64': 0.24.2 - '@esbuild/win32-arm64': 0.24.2 - '@esbuild/win32-ia32': 0.24.2 - '@esbuild/win32-x64': 0.24.2 + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 escalade@3.2.0: {} @@ -2599,6 +2567,8 @@ snapshots: expect-type@1.1.0: {} + fast-content-type-parse@2.0.1: {} + fast-deep-equal@3.1.3: {} fast-diff@1.3.0: {} @@ -2615,9 +2585,9 @@ snapshots: fast-levenshtein@2.0.6: {} - fastq@1.19.0: + fastq@1.19.1: dependencies: - reusify: 1.0.4 + reusify: 1.1.0 file-entry-cache@6.0.1: dependencies: @@ -2640,7 +2610,7 @@ snapshots: flatted@3.3.3: {} - foreground-child@3.3.0: + foreground-child@3.3.1: dependencies: cross-spawn: 7.0.6 signal-exit: 4.1.0 @@ -2651,10 +2621,6 @@ snapshots: jsonfile: 6.1.0 universalify: 2.0.1 - fs-minipass@2.1.0: - dependencies: - minipass: 3.3.6 - fs.realpath@1.0.0: {} fsevents@2.3.3: @@ -2678,7 +2644,7 @@ snapshots: glob@10.4.5: dependencies: - foreground-child: 3.3.0 + foreground-child: 3.3.1 jackspeak: 3.4.3 minimatch: 9.0.5 minipass: 7.1.2 @@ -2725,31 +2691,10 @@ snapshots: dependencies: lru-cache: 10.4.3 - http-cache-semantics@4.1.1: {} - - http-proxy-agent@4.0.1: - dependencies: - '@tootallnate/once': 1.1.2 - agent-base: 6.0.2 - debug: 4.4.0 - transitivePeerDependencies: - - supports-color - - https-proxy-agent@5.0.1: - dependencies: - agent-base: 6.0.2 - debug: 4.4.0 - transitivePeerDependencies: - - supports-color - human-signals@1.1.1: {} human-signals@2.1.0: {} - humanize-ms@1.2.1: - dependencies: - ms: 2.1.3 - iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -2766,8 +2711,6 @@ snapshots: indent-string@4.0.0: {} - infer-owner@1.0.4: {} - inflight@1.0.6: dependencies: once: 1.4.0 @@ -2779,11 +2722,6 @@ snapshots: ini@4.1.3: {} - ip-address@9.0.5: - dependencies: - jsbn: 1.1.0 - sprintf-js: 1.1.3 - is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} @@ -2792,8 +2730,6 @@ snapshots: dependencies: is-extglob: 2.1.1 - is-lambda@1.0.1: {} - is-number@7.0.0: {} is-path-inside@3.0.3: {} @@ -2818,8 +2754,6 @@ snapshots: dependencies: argparse: 2.0.1 - jsbn@1.1.0: {} - json-buffer@3.0.1: {} json-parse-even-better-errors@3.0.2: {} @@ -2867,28 +2801,6 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 - make-fetch-happen@9.1.0: - dependencies: - agentkeepalive: 4.6.0 - cacache: 15.3.0 - http-cache-semantics: 4.1.1 - http-proxy-agent: 4.0.1 - https-proxy-agent: 5.0.1 - is-lambda: 1.0.1 - lru-cache: 6.0.0 - minipass: 3.3.6 - minipass-collect: 1.0.2 - minipass-fetch: 1.4.1 - minipass-flush: 1.0.5 - minipass-pipeline: 1.2.4 - negotiator: 0.6.4 - promise-retry: 2.0.1 - socks-proxy-agent: 6.2.1 - ssri: 8.0.1 - transitivePeerDependencies: - - bluebird - - supports-color - merge-stream@2.0.0: {} merge2@1.4.1: {} @@ -2910,45 +2822,8 @@ snapshots: minimist@1.2.8: {} - minipass-collect@1.0.2: - dependencies: - minipass: 3.3.6 - - minipass-fetch@1.4.1: - dependencies: - minipass: 3.3.6 - minipass-sized: 1.0.3 - minizlib: 2.1.2 - optionalDependencies: - encoding: 0.1.13 - - minipass-flush@1.0.5: - dependencies: - minipass: 3.3.6 - - minipass-pipeline@1.2.4: - dependencies: - minipass: 3.3.6 - - minipass-sized@1.0.3: - dependencies: - minipass: 3.3.6 - - minipass@3.3.6: - dependencies: - yallist: 4.0.0 - - minipass@5.0.0: {} - minipass@7.1.2: {} - minizlib@2.1.2: - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - - mkdirp@1.0.4: {} - ms@2.1.3: {} mz@2.7.0: @@ -2963,8 +2838,6 @@ snapshots: natural-compare@1.4.0: {} - negotiator@0.6.4: {} - node-fetch@2.7.0(encoding@0.1.13): dependencies: whatwg-url: 5.0.0 @@ -3032,10 +2905,6 @@ snapshots: dependencies: aggregate-error: 3.1.0 - p-map@4.0.0: - dependencies: - aggregate-error: 3.1.0 - package-json-from-dist@1.0.1: {} package-json@10.0.1: @@ -3157,7 +3026,7 @@ snapshots: retry@0.12.0: {} - reusify@1.0.4: {} + reusify@1.1.0: {} rimraf@3.0.2: dependencies: @@ -3211,21 +3080,6 @@ snapshots: slash@3.0.0: {} - smart-buffer@4.2.0: {} - - socks-proxy-agent@6.2.1: - dependencies: - agent-base: 6.0.2 - debug: 4.4.0 - socks: 2.8.4 - transitivePeerDependencies: - - supports-color - - socks@2.8.4: - dependencies: - ip-address: 9.0.5 - smart-buffer: 4.2.0 - source-map-js@1.2.1: {} spdx-correct@3.2.0: @@ -3242,12 +3096,6 @@ snapshots: spdx-license-ids@3.0.21: {} - sprintf-js@1.1.3: {} - - ssri@8.0.1: - dependencies: - minipass: 3.3.6 - stackback@0.0.2: {} std-env@3.8.0: {} @@ -3282,15 +3130,6 @@ snapshots: dependencies: has-flag: 4.0.0 - tar@6.2.1: - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - text-table@0.2.0: {} thenify-all@1.6.0: @@ -3334,16 +3173,10 @@ snapshots: undici-types@6.20.0: {} - unique-filename@1.1.1: - dependencies: - unique-slug: 2.0.2 - - unique-slug@2.0.2: - dependencies: - imurmurhash: 0.1.4 - universal-user-agent@6.0.1: {} + universal-user-agent@7.0.2: {} + universalify@2.0.1: {} uri-js@4.4.1: @@ -3357,16 +3190,15 @@ snapshots: validate-npm-package-name@5.0.1: {} - vite-node@3.0.6(@types/node@22.10.10): + vite-node@3.0.7(@types/node@22.10.10): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 2.0.3 - vite: 6.1.1(@types/node@22.10.10) + vite: 5.4.14(@types/node@22.10.10) transitivePeerDependencies: - '@types/node' - - jiti - less - lightningcss - sass @@ -3375,27 +3207,25 @@ snapshots: - sugarss - supports-color - terser - - tsx - - yaml - vite@6.1.1(@types/node@22.10.10): + vite@5.4.14(@types/node@22.10.10): dependencies: - esbuild: 0.24.2 + esbuild: 0.21.5 postcss: 8.5.3 rollup: 4.34.8 optionalDependencies: '@types/node': 22.10.10 fsevents: 2.3.3 - vitest@3.0.6(@types/node@22.10.10): + vitest@3.0.7(@types/node@22.10.10): dependencies: - '@vitest/expect': 3.0.6 - '@vitest/mocker': 3.0.6(vite@6.1.1(@types/node@22.10.10)) - '@vitest/pretty-format': 3.0.6 - '@vitest/runner': 3.0.6 - '@vitest/snapshot': 3.0.6 - '@vitest/spy': 3.0.6 - '@vitest/utils': 3.0.6 + '@vitest/expect': 3.0.7 + '@vitest/mocker': 3.0.7(vite@5.4.14(@types/node@22.10.10)) + '@vitest/pretty-format': 3.0.7 + '@vitest/runner': 3.0.7 + '@vitest/snapshot': 3.0.7 + '@vitest/spy': 3.0.7 + '@vitest/utils': 3.0.7 chai: 5.2.0 debug: 4.4.0 expect-type: 1.1.0 @@ -3406,13 +3236,12 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: 6.1.1(@types/node@22.10.10) - vite-node: 3.0.6(@types/node@22.10.10) + vite: 5.4.14(@types/node@22.10.10) + vite-node: 3.0.7(@types/node@22.10.10) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.10.10 transitivePeerDependencies: - - jiti - less - lightningcss - msw @@ -3422,8 +3251,6 @@ snapshots: - sugarss - supports-color - terser - - tsx - - yaml webidl-conversions@3.0.1: {} diff --git a/src/__mocks__/@octokit/rest.ts b/src/__mocks__/@octokit/rest.ts new file mode 100644 index 0000000..f86f927 --- /dev/null +++ b/src/__mocks__/@octokit/rest.ts @@ -0,0 +1,32 @@ +import { vi } from "vitest"; + +let responses = { + prs: {} as Record, + users: {} as Record, +}; + +function throwError(status: number) { + const e = new Error(); + (e as any).status = status; + throw e; +} + +export const octokit = { + args: [] as any, + repos: { + listPullRequestsAssociatedWithCommit: vi.fn(({ commit_sha }) => ({ + data: responses.prs[commit_sha] || throwError(404), + })), + }, + users: { + getByUsername: vi.fn(({ username }) => ({ data: responses.users[username] || throwError(404) })), + }, +}; +export const Octokit = function (...args: any[]) { + octokit.args = args; + return octokit; +}; +Octokit.plugin = () => Octokit; +Octokit.octokit = octokit; +export const __setMockResponses = (res: any) => (responses = res); +export const __resetMockResponses = () => (responses = { prs: {}, users: {} }); diff --git a/src/__snapshots__/changelog.spec.js.snap b/src/__snapshots__/changelog.spec.js.snap index 3996618..2af7b4a 100644 --- a/src/__snapshots__/changelog.spec.js.snap +++ b/src/__snapshots__/changelog.spec.js.snap @@ -2,10 +2,16 @@ exports[`Changelog > getCommitInfos > parse commits with different tags 1`] = ` [ + { + "commitSHA": "a0000006", + "date": "2017-01-01", + "message": "Merge pull request #3 from my-feature-3", + "packages": [], + "tags": undefined, + }, { "commitSHA": "a0000005", "date": "2017-01-01", - "issueNumber": null, "message": "chore(release): releasing component", "packages": [], "tags": [ @@ -35,35 +41,13 @@ exports[`Changelog > getCommitInfos > parse commits with different tags 1`] = ` "name": "Test User", }, }, - "issueNumber": "2", "message": "Merge pull request #2 from my-feature", "packages": [], "tags": undefined, }, { - "categories": [ - ":rocket: New Feature", - ], "commitSHA": "a0000003", "date": "2017-01-01", - "githubIssue": { - "labels": [ - { - "name": "Type: New Feature", - }, - { - "name": "Status: In Progress", - }, - ], - "number": 2, - "title": "This is the commit title for the issue (#2)", - "user": { - "html_url": "https://github.com/test-user", - "login": "test-user", - "name": "Test User", - }, - }, - "issueNumber": "2", "message": "feat(module) Add new module (#2)", "packages": [], "tags": undefined, @@ -71,7 +55,6 @@ exports[`Changelog > getCommitInfos > parse commits with different tags 1`] = ` { "commitSHA": "a0000002", "date": "2017-01-01", - "issueNumber": null, "message": "refactor(module) Simplify implementation", "packages": [], "tags": undefined, @@ -79,7 +62,6 @@ exports[`Changelog > getCommitInfos > parse commits with different tags 1`] = ` { "commitSHA": "a0000001", "date": "2017-01-01", - "issueNumber": null, "message": "chore(release): releasing component", "packages": [], "tags": [ diff --git a/src/changelog.spec.js b/src/changelog.spec.js index 04b57d3..e827d74 100644 --- a/src/changelog.spec.js +++ b/src/changelog.spec.js @@ -1,16 +1,23 @@ import { vi, describe, it, expect, beforeEach, afterEach } from "vitest"; - +import * as MockedOctokit from "./__mocks__/@octokit/rest"; +import { Octokit } from "@octokit/rest"; import Changelog from "./changelog"; -import * as fetch from "./fetch"; import * as git from "./git"; +vi.mock("@octokit/rest"); vi.mock("../src/progress-bar"); vi.mock("../src/changelog"); vi.mock("../src/github-api"); vi.mock("./git"); -vi.mock("./fetch"); describe("Changelog", () => { + beforeEach(() => { + Octokit.mockImplementation((...args) => MockedOctokit.Octokit(...args)); + Octokit.plugin.mockImplementation(() => MockedOctokit.Octokit); + }); + afterEach(() => { + vi.resetAllMocks(); + }); describe("packageFromPath", () => { const TESTS = [ ["", ""], @@ -89,7 +96,7 @@ describe("Changelog", () => { describe("getCommitInfos", () => { beforeEach(() => { - fetch.__resetMockResponses(); + MockedOctokit.__resetMockResponses(); git.listCommits.mockImplementation(() => [ { @@ -135,7 +142,7 @@ describe("Changelog", () => { git.changedPaths.mockImplementation(() => []); const usersCache = { - "https://api.github.com/users/test-user": { + "test-user": { body: { login: "test-user", html_url: "https://github.com/test-user", @@ -143,27 +150,39 @@ describe("Changelog", () => { }, }, }; - const issuesCache = { - "https://api.github.com/repos/embroider-build/github-changelog/issues/2": { - body: { + const prCache = { + a0000001: [], + a0000002: [], + a0000003: [ + { + number: 2, + title: "feat(module) Add new module (#2)", + labels: [{ name: "Type: New Feature" }, { name: "Status: In Progress" }], + user: usersCache["test-user"].body, + }, + ], + a0000004: [ + { number: 2, title: "This is the commit title for the issue (#2)", labels: [{ name: "Type: New Feature" }, { name: "Status: In Progress" }], - user: usersCache["https://api.github.com/users/test-user"].body, + user: usersCache["test-user"].body, }, - }, + ], + a0000005: [], + a0000006: [], "https://api.github.com/repos/embroider-build/github-changelog/issues/3": { body: { number: 2, title: "This is the commit title for the issue (#2)", labels: [{ name: "ignore" }, { name: "Status: In Progress" }], - user: usersCache["https://api.github.com/users/test-user"].body, + user: usersCache["test-user"].body, }, }, }; - fetch.__setMockResponses({ - ...usersCache, - ...issuesCache, + MockedOctokit.__setMockResponses({ + users: { ...usersCache }, + prs: { ...prCache }, }); }); @@ -181,39 +200,33 @@ describe("Changelog", () => { describe("getCommitters", () => { beforeEach(() => { - fetch.__resetMockResponses(); + MockedOctokit.__resetMockResponses(); const usersCache = { - "https://api.github.com/users/test-user": { - body: { - login: "test-user", - html_url: "https://github.com/test-user", - name: "Test User", - }, + "test-user": { + login: "test-user", + html_url: "https://github.com/test-user", + name: "Test User", }, - "https://api.github.com/users/test-user-1": { - body: { - login: "test-user-1", - html_url: "https://github.com/test-user-1", - name: "Test User 1", - }, + "test-user-1": { + login: "test-user-1", + html_url: "https://github.com/test-user-1", + name: "Test User 1", }, - "https://api.github.com/users/test-user-2": { - body: { - login: "test-user-2", - html_url: "https://github.com/test-user-2", - name: "Test User 2", - }, + "test-user-2": { + login: "test-user-2", + html_url: "https://github.com/test-user-2", + name: "Test User 2", }, - "https://api.github.com/users/user-bot": { - body: { - login: "user-bot", - html_url: "https://github.com/user-bot", - name: "User Bot", - }, + "user-bot": { + login: "user-bot", + html_url: "https://github.com/user-bot", + name: "User Bot", }, }; - fetch.__setMockResponses(usersCache); + MockedOctokit.__setMockResponses({ + users: { ...usersCache }, + }); }); it("get list of valid commiters", async () => { diff --git a/src/changelog.ts b/src/changelog.ts index b24d1f1..81592a8 100644 --- a/src/changelog.ts +++ b/src/changelog.ts @@ -3,7 +3,6 @@ const { resolve, sep } = require("path"); import progressBar from "./progress-bar"; import { Configuration } from "./configuration"; -import findPullRequestId from "./find-pull-request-id"; import * as Git from "./git"; import GithubAPI, { GitHubUserResponse } from "./github-api"; import { CommitInfo, Release } from "./interfaces"; @@ -161,15 +160,12 @@ export default class Changelog { .map(ref => ref.substr(TAG_PREFIX.length)); } - const issueNumber = findPullRequestId(message); - return { commitSHA: sha, message, // Note: Only merge commits or commits referencing an issue / PR // will be kept in the changelog. tags: tagsInCommit, - issueNumber, date, } as CommitInfo; }); @@ -177,11 +173,15 @@ export default class Changelog { private async downloadIssueData(commitInfos: CommitInfo[]) { progressBar.init("Downloading issue information…", commitInfos.length); + const PRs = new Set(); await pMap( commitInfos, async (commitInfo: CommitInfo) => { - if (commitInfo.issueNumber) { - commitInfo.githubIssue = await this.github.getIssueData(this.config.repo, commitInfo.issueNumber); + const issueData = await this.github.getPullRequest(this.config.repo, commitInfo.commitSHA); + + if (issueData && !PRs.has(issueData.number)) { + PRs.add(issueData.number); + commitInfo.githubIssue = issueData; } progressBar.tick(); @@ -214,7 +214,7 @@ export default class Changelog { releaseMap[currentTag] = { name: currentTag, date, commits: [] }; } - let prUserLogin = commit.githubIssue?.user.login; + let prUserLogin = commit.githubIssue?.user!!.login; if (prUserLogin && !this.ignoreCommitter(prUserLogin)) { releaseMap[currentTag].commits.push(commit); } diff --git a/src/configuration.ts b/src/configuration.ts index 6d9152c..6474585 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -1,7 +1,7 @@ const fs = require("fs"); const path = require("path"); const hostedGitInfo = require("hosted-git-info"); -const { getPackagesSync } = require("@manypkg/get-packages"); +import { getPackagesSync } from "@manypkg/get-packages"; import ConfigurationError from "./configuration-error"; import { getRootPath } from "./git"; @@ -9,6 +9,7 @@ import { getRootPath } from "./git"; export interface Configuration { repo: string; github?: string; + branch?: string; rootPath: string; labels: { [key: string]: string }; ignoreCommitters: string[]; @@ -22,6 +23,7 @@ export interface Configuration { export interface ConfigLoaderOptions { repo?: string; + branch?: string; nextVersionFromMetadata?: boolean; } @@ -30,29 +32,9 @@ export function load(options: ConfigLoaderOptions = {}): Configuration { return fromPath(rootPath, options); } -interface PackageJson { - type: boolean; - private: boolean; - name: string; -} - -interface Package { - dir: string; - relativeDir: string; - packageJson: PackageJson; -} - -interface PackagesResult { - tool: { - type: "pnpm" | "yarn" | "npm"; - }; - packages: Package[]; - rootPackage: Package; -} - function getPackages(rootPath: string): { name: string; path: string }[] { try { - let { packages } = getPackagesSync(rootPath) as PackagesResult; + let { packages } = getPackagesSync(rootPath); return packages .filter(pkg => !pkg.packageJson.private) @@ -84,6 +66,10 @@ export function fromPath(rootPath: string, options: ConfigLoaderOptions = {}): C config.repo = options.repo; } + if (options.branch) { + config.branch = options.branch; + } + // Step 2: fill partial config with defaults let { repo, nextVersion, labels, cacheDir, ignoreCommitters, ignoreLabel, wildcardLabel, github } = config; @@ -155,14 +141,14 @@ export function fromPath(rootPath: string, options: ConfigLoaderOptions = {}): C function fromLernaConfig(rootPath: string): Partial | undefined { const lernaPath = path.join(rootPath, "lerna.json"); if (fs.existsSync(lernaPath)) { - return JSON.parse(fs.readFileSync(lernaPath)).changelog; + return JSON.parse(fs.readFileSync(lernaPath).toString()).changelog; } } function fromPackageConfig(rootPath: string): Partial | undefined { const pkgPath = path.join(rootPath, "package.json"); if (fs.existsSync(pkgPath)) { - return JSON.parse(fs.readFileSync(pkgPath)).changelog; + return JSON.parse(fs.readFileSync(pkgPath).toString()).changelog; } } @@ -172,7 +158,7 @@ function findRepo(rootPath: string): string | undefined { return; } - const pkg = JSON.parse(fs.readFileSync(pkgPath)); + const pkg = JSON.parse(fs.readFileSync(pkgPath).toString()); if (!pkg.repository) { return; } @@ -184,8 +170,8 @@ function findNextVersion(rootPath: string): string | undefined { const pkgPath = path.join(rootPath, "package.json"); const lernaPath = path.join(rootPath, "lerna.json"); - const pkg = fs.existsSync(pkgPath) ? JSON.parse(fs.readFileSync(pkgPath)) : {}; - const lerna = fs.existsSync(lernaPath) ? JSON.parse(fs.readFileSync(lernaPath)) : {}; + const pkg = fs.existsSync(pkgPath) ? JSON.parse(fs.readFileSync(pkgPath).toString()) : {}; + const lerna = fs.existsSync(lernaPath) ? JSON.parse(fs.readFileSync(lernaPath).toString()) : {}; return pkg.version ? `v${pkg.version}` : lerna.version ? `v${lerna.version}` : undefined; } @@ -199,11 +185,11 @@ export function findRepoFromPkg(pkg: any): string | undefined { // cannot detect self hosted GitHub, e.g // git@github.host.com:embroider-build/github-changelog.git // https://github.host.com/embroider-build/github-changelog.git - const matchHttps = /https:\/\/[^\/]+\/([^\/]+)\/([^\/]+)\.git/.exec(url); + const matchHttps = /https:\/\/[^/]+\/([^/]+)\/([^/]+)\.git/.exec(url); if (matchHttps && matchHttps.length === 3) { return `${matchHttps[1]}/${matchHttps[2]}`; } - const matchGit = /git@[^:]+:([^\/]+)\/([^\/]+)\.git/.exec(url); + const matchGit = /git@[^:]+:([^/]+)\/([^/]+)\.git/.exec(url); if (matchGit && matchGit.length === 3) { return `${matchGit[1]}/${matchGit[2]}`; } diff --git a/src/fetch.ts b/src/fetch.ts deleted file mode 100644 index f8a973b..0000000 --- a/src/fetch.ts +++ /dev/null @@ -1,3 +0,0 @@ -const fetch = require("make-fetch-happen"); - -export default fetch; diff --git a/src/find-pull-request-id.spec.ts b/src/find-pull-request-id.spec.ts deleted file mode 100644 index f1cbf4b..0000000 --- a/src/find-pull-request-id.spec.ts +++ /dev/null @@ -1,32 +0,0 @@ -import findPullRequestId from "./find-pull-request-id"; - -import { describe, it, expect } from "vitest"; - -describe("findPullRequestId", function () { - it("finds the id in a GitHub merge commit", function () { - const message = - 'Merge pull request #42 from Turbo87/pkg-config\n\nRead "changelog" config key from "package.json" too'; - const result = findPullRequestId(message); - expect(result).toEqual("42"); - }); - - it("finds the id in a GitHub squash-merge commit", function () { - const message = - 'Adjust "lint" script (#48)\n\n* bin/cli: Use "const" instead of "var"\n\n* package.json: Adjust "lint" script'; - const result = findPullRequestId(message); - expect(result).toEqual("48"); - }); - - it("finds the id in a homu merge commit", function () { - const message = - "Auto merge of #7056 - fixTypos:fix_typos, r=Turbo87\n\nfix_typos\n\nThis PR is part of a campaign to fix a lot of typos on github!\nYou can see the progress on https://github.com/fixTypos/fix_typos/\n\nhttps://github.com/client9/misspell"; - const result = findPullRequestId(message); - expect(result).toEqual("7056"); - }); - - it("returns null if no id could be found", function () { - const message = "This is not a merge commit 42"; - const result = findPullRequestId(message); - expect(result).toBeNull(); - }); -}); diff --git a/src/find-pull-request-id.ts b/src/find-pull-request-id.ts deleted file mode 100644 index 5f80779..0000000 --- a/src/find-pull-request-id.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default function findPullRequestId(message: string): string | null { - const lines = message.split("\n"); - const firstLine = lines[0]; - - const mergeMatch = firstLine.match(/^Merge pull request #(\d+) from /); - if (mergeMatch) { - return mergeMatch[1]; - } - - const squashMergeMatch = firstLine.match(/\(#(\d+)\)$/); - if (squashMergeMatch) { - return squashMergeMatch[1]; - } - - const homuMatch = firstLine.match(/^Auto merge of #(\d+) - /); - if (homuMatch) { - return homuMatch[1]; - } - - return null; -} diff --git a/src/functional/markdown-empty.spec.js b/src/functional/markdown-empty.spec.js index 5b07ffc..d6b7d61 100644 --- a/src/functional/markdown-empty.spec.js +++ b/src/functional/markdown-empty.spec.js @@ -1,22 +1,19 @@ -import { CommitListItem } from "../git"; - +import * as Octokit from "../__mocks__/@octokit/rest"; import { vi, describe, it, beforeEach, afterEach, expect } from "vitest"; - -import * as fetch from "../fetch"; import * as git from "../git"; import Changelog from "../changelog"; +vi.mock("@octokit/rest"); vi.mock("../../src/progress-bar"); vi.mock("../../src/changelog"); vi.mock("../../src/github-api"); vi.mock("../git"); -vi.mock("../fetch"); const listOfCommits = []; const listOfTags = ["v6.0.0", "v5.0.0", "v4.0.0", "v3.0.0", "v2.0.0", "v1.0.0", "v0.1.0"]; -const listOfPackagesForEachCommit= { +const listOfPackagesForEachCommit = { a0000001: ["packages/random/foo.js"], a0000002: ["packages/random/package.json"], a0000003: ["packages/a-new-hope/rebels.js"], @@ -53,67 +50,55 @@ const listOfFileForEachCommit = { }; const usersCache = { - "https://api.github.com/users/luke": { - body: { - login: "luke", - html_url: "https://github.com/luke", - name: "Luke Skywalker", - }, + luke: { + login: "luke", + html_url: "https://github.com/luke", + name: "Luke Skywalker", }, - "https://api.github.com/users/vader": { - body: { - login: "vader", - html_url: "https://github.com/vader", - name: "Darth Vader", - }, + vader: { + login: "vader", + html_url: "https://github.com/vader", + name: "Darth Vader", }, - "https://api.github.com/users/gtarkin": { - body: { - login: "gtarkin", - html_url: "https://github.com/gtarkin", - name: "Governor Tarkin", - }, + gtarkin: { + login: "gtarkin", + html_url: "https://github.com/gtarkin", + name: "Governor Tarkin", }, }; const issuesCache = { - "https://api.github.com/repos/embroider-build/github-changelog/issues/1": { - body: { - number: 1, - title: "feat: May the force be with you", - labels: [{ name: "Type: New Feature" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/1", - }, - user: usersCache["https://api.github.com/users/luke"], + 1: { + number: 1, + title: "feat: May the force be with you", + labels: [{ name: "Type: New Feature" }], + pull_request: { + html_url: "https://github.com/embroider-build/github-changelog/pull/1", }, + user: usersCache["luke"], }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/2": { - body: { - number: 2, - title: "chore: Terminate her... immediately!", - labels: [{ name: "Type: Breaking Change" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/2", - }, - user: usersCache["https://api.github.com/users/gtarkin"], + 2: { + number: 2, + title: "chore: Terminate her... immediately!", + labels: [{ name: "Type: Breaking Change" }], + pull_request: { + html_url: "https://github.com/embroider-build/github-changelog/pull/2", }, + user: usersCache["gtarkin"], }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/3": { - body: { - number: 3, - title: "fix: Get me the rebels base!", - labels: [{ name: "Type: Bug" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/3", - }, - user: usersCache["https://api.github.com/users/vader"], + 3: { + number: 3, + title: "fix: Get me the rebels base!", + labels: [{ name: "Type: Bug" }], + pull_request: { + html_url: "https://github.com/embroider-build/github-changelog/pull/3", }, + user: usersCache["vader"], }, }; describe("multiple tags", () => { it("outputs correct changelog", async () => { - git.changedPaths.mockImplementation((sha) => listOfPackagesForEachCommit[sha]); + git.changedPaths.mockImplementation(sha => listOfPackagesForEachCommit[sha]); git.lastTag.mockImplementation(() => "v8.0.0"); git.listCommits.mockImplementation(() => listOfCommits); git.listTagNames.mockImplementation(() => [ @@ -126,9 +111,9 @@ describe("multiple tags", () => { "the-phantom-menace@1.0.0", ]); - fetch.__setMockResponses({ - ...usersCache, - ...issuesCache, + Octokit.__setMockResponses({ + users: { ...usersCache }, + prs: { ...issuesCache }, }); const changelog = new Changelog(); @@ -141,7 +126,7 @@ describe("multiple tags", () => { describe("createMarkdown", () => { beforeEach(() => { - fetch.__resetMockResponses(); + Octokit.__resetMockResponses(); }); afterEach(() => { @@ -150,14 +135,14 @@ describe("createMarkdown", () => { describe("single tags", () => { it("outputs correct changelog", async () => { - git.changedPaths.mockImplementation((sha) => listOfPackagesForEachCommit[sha]); + git.changedPaths.mockImplementation(sha => listOfPackagesForEachCommit[sha]); git.lastTag.mockImplementation(() => "v8.0.0"); git.listCommits.mockImplementation(() => listOfCommits); git.listTagNames.mockImplementation(() => listOfTags); - fetch.__setMockResponses({ - ...usersCache, - ...issuesCache, + Octokit.__setMockResponses({ + users: { ...usersCache }, + prs: { ...issuesCache }, }); const changelog = new Changelog(); @@ -170,14 +155,14 @@ describe("createMarkdown", () => { describe("single project", () => { it("outputs correct changelog", async () => { - git.changedPaths.mockImplementation((sha) => listOfFileForEachCommit[sha]); + git.changedPaths.mockImplementation(sha => listOfFileForEachCommit[sha]); git.lastTag.mockImplementation(() => "v8.0.0"); git.listCommits.mockImplementation(() => listOfCommits); git.listTagNames.mockImplementation(() => listOfTags); - fetch.__setMockResponses({ - ...usersCache, - ...issuesCache, + Octokit.__setMockResponses({ + users: { ...usersCache }, + prs: { ...issuesCache }, }); const changelog = new Changelog(); diff --git a/src/functional/markdown-full.spec.js b/src/functional/markdown-full.spec.js index b709b98..6b7f1cc 100644 --- a/src/functional/markdown-full.spec.js +++ b/src/functional/markdown-full.spec.js @@ -1,18 +1,22 @@ -import { CommitListItem } from "../git"; - +import * as MockedOctokit from "../__mocks__/@octokit/rest"; +import { Octokit } from "@octokit/rest"; import { vi, describe, beforeEach, afterEach, it, expect } from "vitest"; - import * as git from "../git"; import Changelog from "../changelog"; -import * as fetch from "../fetch"; vi.mock("../../src/progress-bar"); vi.mock("../changelog"); vi.mock("../../src/github-api"); vi.mock("../git"); -vi.mock("../fetch"); +vi.mock("@octokit/rest"); const listOfCommits = [ + { + sha: "a0000018", + refName: "", + summary: "local testing, not pushed", + date: "2017-01-01", + }, { sha: "a0000017", refName: "", @@ -137,6 +141,7 @@ const listOfPackagesForEachCommit = { a0000015: ["packages/untitled/script.md"], a0000016: ["packages/return-of-the-jedi/package.json"], a0000017: ["packages/return-of-the-jedi/package.json"], + a0000018: ["packages/return-of-the-jedi/package.json"], }; const listOfFileForEachCommit = { @@ -157,168 +162,160 @@ const listOfFileForEachCommit = { a0000015: ["untitled/script.md"], a0000016: ["packages/return-of-the-jedi/package.json"], a0000017: ["packages/return-of-the-jedi/package.json"], + a0000018: ["packages/return-of-the-jedi/package.json"], }; const usersCache = { - "https://api.github.com/users/luke": { - body: { - login: "luke", - html_url: "https://github.com/luke", - name: "Luke Skywalker", - }, - }, - "https://api.github.com/users/princess-leia": { - body: { - login: "princess-leia", - html_url: "https://github.com/princess-leia", - name: "Princess Leia Organa", - }, - }, - "https://api.github.com/users/vader": { - body: { - login: "vader", - html_url: "https://github.com/vader", - name: "Darth Vader", - }, - }, - "https://api.github.com/users/gtarkin": { - body: { - login: "gtarkin", - html_url: "https://github.com/gtarkin", - name: "Governor Tarkin", - }, - }, - "https://api.github.com/users/han-solo": { - body: { - login: "han-solo", - html_url: "https://github.com/han-solo", - name: "Han Solo", - }, - }, - "https://api.github.com/users/chewbacca": { - body: { - login: "chewbacca", - html_url: "https://github.com/chewbacca", - name: "Chwebacca", - }, - }, - "https://api.github.com/users/rd-d2": { - body: { - login: "rd-d2", - html_url: "https://github.com/rd-d2", - name: "R2-D2", - }, - }, - "https://api.github.com/users/c-3po": { - body: { - login: "c-3po", - html_url: "https://github.com/c-3po", - name: "C-3PO", - }, - }, - "https://api.github.com/users/bot-user": { - body: { - login: "bot-user", - html_url: "https://github.com/bot-user", - name: "Bot User", - }, + luke: { + login: "luke", + html_url: "https://github.com/luke", + name: "Luke Skywalker", + }, + "princess-leia": { + login: "princess-leia", + html_url: "https://github.com/princess-leia", + name: "Princess Leia Organa", + }, + vader: { + login: "vader", + html_url: "https://github.com/vader", + name: "Darth Vader", + }, + gtarkin: { + login: "gtarkin", + html_url: "https://github.com/gtarkin", + name: "Governor Tarkin", + }, + "han-solo": { + login: "han-solo", + html_url: "https://github.com/han-solo", + name: "Han Solo", + }, + chewbacca: { + login: "chewbacca", + html_url: "https://github.com/chewbacca", + name: "Chwebacca", + }, + "rd-d2": { + login: "rd-d2", + html_url: "https://github.com/rd-d2", + name: "R2-D2", + }, + "c-3po": { + login: "c-3po", + html_url: "https://github.com/c-3po", + name: "C-3PO", + }, + "bot-user": { + login: "bot-user", + html_url: "https://github.com/bot-user", + name: "Bot User", }, }; const issuesCache = { - "https://api.github.com/repos/embroider-build/github-changelog/issues/1": { - body: { + a0000001: [], + + a0000002: [], + + a0000003: [ + { number: 1, title: "feat: May the force be with you", labels: [{ name: "Type: New Feature" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/1", - }, - user: usersCache["https://api.github.com/users/luke"].body, + html_url: "https://github.com/embroider-build/github-changelog/pull/1", + user: usersCache["luke"], }, - }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/2": { - body: { + ], + + a0000004: [], + + a0000005: [], + + a0000006: [ + { number: 2, title: "chore: Terminate her... immediately!", labels: [{ name: "Type: Breaking Change" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/2", - }, - user: usersCache["https://api.github.com/users/gtarkin"].body, + html_url: "https://github.com/embroider-build/github-changelog/pull/2", + user: usersCache["gtarkin"], }, - }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/3": { - body: { + ], + + a0000007: [], + + a0000008: [ + { number: 3, title: "fix: Get me the rebels base!", labels: [{ name: "Type: Bug" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/3", - }, - user: usersCache["https://api.github.com/users/vader"].body, + html_url: "https://github.com/embroider-build/github-changelog/pull/3", + user: usersCache["vader"], }, - }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/4": { - body: { + ], + + a0000009: [], + + a0000010: [ + { number: 4, title: "fix: RRRAARRWHHGWWR", labels: [{ name: "Type: Bug" }, { name: "Type: Maintenance" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/4", - }, - user: usersCache["https://api.github.com/users/chewbacca"].body, + html_url: "https://github.com/embroider-build/github-changelog/pull/4", + user: usersCache["chewbacca"], }, - }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/5": { - body: { + ], + + a0000011: [ + { number: 5, title: "feat: I am your father", labels: [{ name: "Type: New Feature" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/5", - }, - user: usersCache["https://api.github.com/users/vader"].body, + html_url: "https://github.com/embroider-build/github-changelog/pull/5", + user: usersCache["vader"], }, - }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/6": { - body: { + ], + + a0000012: [ + { number: 6, title: "refactor: he is my brother", labels: [{ name: "Type: Enhancement" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/6", - }, - user: usersCache["https://api.github.com/users/princess-leia"].body, + html_url: "https://github.com/embroider-build/github-changelog/pull/6", + user: usersCache["princess-leia"], }, - }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/7": { - body: { + ], + + a0000013: [], + + a0000014: [ + { number: 7, title: "feat: that is not how the Force works!", labels: [{ name: "Type: New Feature" }, { name: "Type: Enhancement" }], - pull_request: { - html_url: "https://github.com/embroider-build/github-changelog/pull/7", - }, - user: usersCache["https://api.github.com/users/han-solo"].body, + html_url: "https://github.com/embroider-build/github-changelog/pull/7", + user: usersCache["han-solo"], }, - }, - "https://api.github.com/repos/embroider-build/github-changelog/issues/8": { - body: { + ], + + a0000015: [], + + a0000016: [], + + a0000017: [ + { number: 8, title: "This is the commit title for the issue (#8)", labels: [{ name: "Type: Maintenance" }, { name: "Status: In Progress" }], - user: { - login: "bot-user", - html_url: "https://github.com/bot-user", - name: "Bot User", - }, + user: usersCache["bot-user"], }, - }, + ], }; describe("createMarkdown", () => { beforeEach(() => { - fetch.__resetMockResponses(); + MockedOctokit.__resetMockResponses(); + Octokit.mockImplementation((...args) => MockedOctokit.Octokit(...args)); + Octokit.plugin.mockImplementation(() => MockedOctokit.Octokit); }); afterEach(() => { @@ -327,16 +324,16 @@ describe("createMarkdown", () => { describe("ignore config", () => { it("ignores PRs from bot users even if they were not the (merge) committer", async () => { - git.changedPaths.mockImplementation((sha) => { + git.changedPaths.mockImplementation(sha => { return listOfPackagesForEachCommit[sha]; }); git.lastTag.mockImplementation(() => "v8.0.0"); git.listCommits.mockImplementation(() => listOfCommits); git.listTagNames.mockImplementation(() => listOfTags); - fetch.__setMockResponses({ - ...usersCache, - ...issuesCache, + MockedOctokit.__setMockResponses({ + users: { ...usersCache }, + prs: { ...issuesCache }, }); const changelog = new Changelog({ @@ -351,14 +348,14 @@ describe("createMarkdown", () => { describe("single tags", () => { it("outputs correct changelog", async () => { - git.changedPaths.mockImplementation((sha) => listOfPackagesForEachCommit[sha]); + git.changedPaths.mockImplementation(sha => listOfPackagesForEachCommit[sha]); git.lastTag.mockImplementation(() => "v8.0.0"); git.listCommits.mockImplementation(() => listOfCommits); git.listTagNames.mockImplementation(() => listOfTags); - fetch.__setMockResponses({ - ...usersCache, - ...issuesCache, + MockedOctokit.__setMockResponses({ + users: { ...usersCache }, + prs: { ...issuesCache }, }); const changelog = new Changelog(); @@ -371,7 +368,7 @@ describe("createMarkdown", () => { describe("multiple tags", () => { it("outputs correct changelog", async () => { - git.changedPaths.mockImplementation((sha) => listOfPackagesForEachCommit[sha]); + git.changedPaths.mockImplementation(sha => listOfPackagesForEachCommit[sha]); git.lastTag.mockImplementation(() => "v8.0.0"); git.listCommits.mockImplementation(() => [ { @@ -409,9 +406,9 @@ describe("createMarkdown", () => { "the-phantom-menace@1.0.0", ]); - fetch.__setMockResponses({ - ...usersCache, - ...issuesCache, + MockedOctokit.__setMockResponses({ + users: { ...usersCache }, + prs: { ...issuesCache }, }); const changelog = new Changelog(); @@ -424,14 +421,14 @@ describe("createMarkdown", () => { describe("single project", () => { it("outputs correct changelog", async () => { - git.changedPaths.mockImplementation((sha) => listOfFileForEachCommit[sha]); + git.changedPaths.mockImplementation(sha => listOfFileForEachCommit[sha]); git.lastTag.mockImplementation(() => "v8.0.0"); git.listCommits.mockImplementation(() => listOfCommits); git.listTagNames.mockImplementation(() => listOfTags); - fetch.__setMockResponses({ - ...usersCache, - ...issuesCache, + MockedOctokit.__setMockResponses({ + users: { ...usersCache }, + prs: { ...issuesCache }, }); const changelog = new Changelog(); @@ -449,7 +446,7 @@ describe("createMarkdown", () => { documentation_url: "https://developer.github.com/v3", }; beforeEach(async () => { - git.changedPaths.mockImplementation((sha) => listOfFileForEachCommit[sha]); + git.changedPaths.mockImplementation(sha => listOfFileForEachCommit[sha]); git.lastTag.mockImplementation(() => "v8.0.0"); git.listCommits.mockImplementation(() => listOfCommits); git.listTagNames.mockImplementation(() => listOfTags); @@ -461,15 +458,17 @@ describe("createMarkdown", () => { body: badCredentials, }; - fetch.__setMockResponses({ - ...usersCache, - ...Object.keys(issuesCache).reduce( - (unauthorizedIssues, issue) => ({ - ...unauthorizedIssues, - [issue]: unauthorized, - }), - {} - ), + MockedOctokit.__setMockResponses({ + users: { ...usersCache }, + prs: { + ...Object.keys(issuesCache).reduce( + (unauthorizedIssues, issue) => ({ + ...unauthorizedIssues, + [issue]: unauthorized, + }), + {} + ), + }, }); }); afterEach(() => { @@ -481,9 +480,7 @@ describe("createMarkdown", () => { try { await changelog.createMarkdown(); } catch (error) { - expect(error).toEqual( - expect.objectContaining({ message: expect.stringContaining("Fetch error: Unauthorized") }) - ); + expect(error).toEqual(expect.objectContaining({ message: expect.stringContaining("Bad credentials") })); expect(error).toEqual( expect.objectContaining({ message: expect.stringContaining(JSON.stringify(badCredentials)) }) ); diff --git a/src/git.ts b/src/git.ts index edc0a39..da589e8 100644 --- a/src/git.ts +++ b/src/git.ts @@ -55,11 +55,12 @@ export function listCommits(from: string, to: string = ""): CommitListItem[] { "--oneline", "--pretty=hash<%h> ref<%D> message<%s> date<%cd>", "--date=short", + "--merges", "--first-parent", `${from}..${to}`, ]) .stdout.split("\n") .filter(Boolean) .map(parseLogMessage) - .filter(Boolean); + .filter(Boolean) as CommitListItem[]; } diff --git a/src/github-api.spec.ts b/src/github-api.spec.ts index 842b4e6..cba8357 100644 --- a/src/github-api.spec.ts +++ b/src/github-api.spec.ts @@ -1,27 +1,51 @@ +import { Octokit } from "./__mocks__/@octokit/rest"; import GithubAPI from "./github-api"; -import { describe, it, expect } from "vitest"; +import { describe, it, expect, vi } from "vitest"; + +vi.mock("@octokit/rest", () => ({ Octokit })); describe("github api", function () { - it("should return correct api endpoint with env var set", function () { + it("should return correct api endpoint with env var set", async function () { process.env.GITHUB_AUTH = "test"; - process.env.GITHUB_DOMAIN = "github.host.com"; + process.env.GITHUB_DOMAIN = "github.host1.com"; // this is also set by GitHub actions delete process.env.GITHUB_API_URL; let github = new GithubAPI({ repo: "foo", rootPath: ".", }); - let fetchedUrl = ""; - github["_fetch"] = async function (url: string) { - fetchedUrl = url; - }; - expect(github.getBaseIssueUrl("foo")).toEqual(`https://github.host.com/foo/issues/`); - - github.getUserData("foo"); - expect(fetchedUrl).toEqual(`https://api.github.host.com/users/foo`); - - github.getIssueData("foo", "2"); - expect(fetchedUrl).toEqual(`https://api.github.host.com/repos/foo/issues/2`); + expect(github.getBaseIssueUrl("foo")).toEqual(`https://github.host1.com/foo/issues/`); + await github.getUserData("foo"); + expect((Octokit as any).octokit.args).toMatchInlineSnapshot(` + [ + { + "auth": "test", + "baseUrl": "https://api.github.host1.com", + "throttle": { + "onRateLimit": [Function], + "onSecondaryRateLimit": [Function], + }, + }, + ] + `); + expect((Octokit as any).octokit.users.getByUsername.mock.lastCall).toMatchInlineSnapshot(` + [ + { + "username": "foo", + }, + ] + `); + + await github.getPullRequest("foo/bar", "2"); + expect((Octokit as any).octokit.repos.listPullRequestsAssociatedWithCommit.mock.lastCall).toMatchInlineSnapshot(` + [ + { + "commit_sha": "2", + "owner": "foo", + "repo": "bar", + }, + ] + `); delete process.env.GITHUB_DOMAIN; @@ -31,15 +55,6 @@ describe("github api", function () { repo: "foo", rootPath: ".", }); - github["_fetch"] = async function (url: string) { - fetchedUrl = url; - }; expect(github.getBaseIssueUrl("foo")).toEqual(`https://github.com/foo/issues/`); - - github.getUserData("foo"); - expect(fetchedUrl).toEqual(`https://api.github.host2.com/users/foo`); - - github.getIssueData("foo", "2"); - expect(fetchedUrl).toEqual(`https://api.github.host2.com/repos/foo/issues/2`); }); }); diff --git a/src/github-api.ts b/src/github-api.ts index 45af424..e5d899e 100644 --- a/src/github-api.ts +++ b/src/github-api.ts @@ -1,76 +1,113 @@ -const path = require("path"); - import ConfigurationError from "./configuration-error"; -import fetch from "./fetch"; +// @ts-expect-error ts complains about this generating a require, but package is esm, but we do not care, since its a type import +import type { Octokit } from "@octokit/rest"; export interface GitHubUserResponse { login: string; - name: string; + name: string | null; html_url: string; } -export interface GitHubIssueResponse { - number: number; - title: string; - pull_request?: { - html_url: string; - }; - labels: Array<{ - name: string; - }>; - user: { - login: string; - html_url: string; - }; -} +type ExtractPromiseValue = T extends Promise ? U : never; +export type GitHubIssueResponse = NonNullable>>; export interface Options { repo: string; + branch?: string; rootPath: string; cacheDir?: string; github?: string; } export default class GithubAPI { - private cacheDir: string | undefined; private auth: string; private github: string; + private branchName: string; + private octokit!: Octokit; constructor(config: Options) { - this.cacheDir = config.cacheDir && path.join(config.rootPath, config.cacheDir, "github"); this.github = config.github || process.env.GITHUB_DOMAIN || "github.com"; + this.branchName = config.branch || process.env.GITHUB_REF_NAME || "main"; this.auth = this.getAuthToken(); if (!this.auth) { throw new ConfigurationError("Must provide GITHUB_AUTH"); } } + async initOctokit() { + if (this.octokit) { + return; + } + const baseUrl = process.env.GITHUB_API_URL || `https://api.${this.github}`; + const throttling = await import("@octokit/plugin-throttling"); + const Octokit = (await import("@octokit/rest")).Octokit.plugin(throttling.throttling); + this.octokit = new Octokit({ + auth: this.auth, + baseUrl, + throttle: { + onRateLimit: (retryAfter, options, octokit, retryCount) => { + octokit.log.warn(`Request quota exhausted for request ${options.method} ${options.url}`); + octokit.log.info(`Retrying after ${retryAfter} seconds!`); + return true; + }, + onSecondaryRateLimit: (retryAfter, options, octokit) => { + octokit.log.warn(`SecondaryRateLimit detected for request ${options.method} ${options.url}`); + octokit.log.info(`Retrying after ${retryAfter} seconds!`); + return true; + }, + }, + }); + } + public getBaseIssueUrl(repo: string): string { return `https://${this.github}/${repo}/issues/`; } - public async getIssueData(repo: string, issue: string): Promise { - const prefix = process.env.GITHUB_API_URL || `https://api.${this.github}`; - return this._fetch(`${prefix}/repos/${repo}/issues/${issue}`); + public async getPullRequest(repoFullName: string, commit: string) { + await this.initOctokit(); + const [owner, repo] = repoFullName.split("/"); + try { + const pullRequests = await this.octokit.repos.listPullRequestsAssociatedWithCommit({ + owner, + repo, + commit_sha: commit, + }); + if ((pullRequests.data as any)?.status) { + throw new Error(JSON.stringify((pullRequests.data as any).body)); + } + return pullRequests.data?.find(p => p.merged_at !== null && p.base.ref === this.branchName); + } catch (e) { + if ((e as any).status === 404) { + return null; + } + if ((e as any).status === 422) { + return null; + } + throw e; + } } - public async getUserData(login: string): Promise { - const prefix = process.env.GITHUB_API_URL || `https://api.${this.github}`; - return this._fetch(`${prefix}/users/${login}`); - } + public async getUserData(login: string) { + await this.initOctokit(); + try { + const user = await this.octokit.users.getByUsername({ + username: login, + }); - private async _fetch(url: string): Promise { - const res = await fetch(url, { - cachePath: this.cacheDir, - headers: { - Authorization: `token ${this.auth}`, - }, - }); - const parsedResponse = await res.json(); - if (res.ok) { - return parsedResponse; + if ((user.data as any)?.status) { + throw new Error(JSON.stringify((user.data as any).body)); + } + return user.data; + } catch (e) { + if ((e as any).status === 404) { + return { + login, + name: "unknown", + html_url: "", + }; + } + throw e; } - throw new ConfigurationError(`Fetch error: ${res.statusText}.\n${JSON.stringify(parsedResponse)}`); } protected getAuthToken(): string { diff --git a/src/interfaces.ts b/src/interfaces.ts index 1452cc6..ebb2889 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -5,7 +5,6 @@ export interface CommitInfo { message: string; tags?: string[]; date: string; - issueNumber: string | null; githubIssue?: GitHubIssueResponse; categories?: string[]; packages?: string[]; diff --git a/src/markdown-renderer.spec.ts b/src/markdown-renderer.spec.ts index 1659fe9..7d0624a 100644 --- a/src/markdown-renderer.spec.ts +++ b/src/markdown-renderer.spec.ts @@ -23,9 +23,7 @@ const COMMIT_WITH_NUMBER = { html_url: "http://hzoo.com", }, number: 42, - pull_request: { - html_url: "http://github.com/42", - }, + html_url: "http://github.com/42", }, } as CommitInfo; diff --git a/src/markdown-renderer.ts b/src/markdown-renderer.ts index 61544d3..8c6ad9f 100644 --- a/src/markdown-renderer.ts +++ b/src/markdown-renderer.ts @@ -99,8 +99,8 @@ export default class MarkdownRenderer { if (issue) { let markdown = ""; - if (issue.number && issue.pull_request && issue.pull_request.html_url) { - const prUrl = issue.pull_request.html_url; + if (issue && issue.html_url) { + const prUrl = issue.html_url; markdown += `[#${issue.number}](${prUrl}) `; } @@ -108,7 +108,7 @@ export default class MarkdownRenderer { issue.title = issue.title.replace(COMMIT_FIX_REGEX, `Closes [#$3](${this.options.baseIssueUrl}$3)`); } - markdown += `${issue.title} ([@${issue.user.login}](${issue.user.html_url}))`; + markdown += `${issue.title} ([@${issue.user!!.login}](${issue.user!!.html_url}))`; return markdown; } diff --git a/tests/basic-acceptance.test.js b/tests/basic-acceptance.test.js index 06c56e9..b9ae53a 100644 --- a/tests/basic-acceptance.test.js +++ b/tests/basic-acceptance.test.js @@ -7,24 +7,110 @@ if (!process.env.GITHUB_AUTH) { } describe("command line interface", () => { - it.skipIf(!process.env.GITHUB_AUTH)("can produce a result", async () => { - const { stdout } = await execa.node("./bin/cli.js", [ - "--from=ee1c697fcf871114c53e9847c43e221d3056f19d", - "--to=b20002d9760e9e212bc623c8f3f42931ddc01bda", + it.skipIf(!process.env.GITHUB_AUTH)("can produce a result when commit is a non first parent", async () => { + const from = "ee1c697fcf871114c53e9847c43e221d3056f19d"; + const to = "b20002d9760e9e212bc623c8f3f42931ddc01bda"; + const { stdout: gitOut } = execa.sync("git", [ + "log", + "--oneline", + "--date=short", + "--first-parent", + `${from}..${to}`, ]); + expect(gitOut).toMatchInlineSnapshot(` + "b20002d ignore private packages by default + c693afc allow ignoring packages + 5f49870 Merge pull request #33 from patricklx/patch-2 + d6b4ad4 Merge pull request #29 from embroider-build/release-preview" + `); + + let { stdout } = await execa.node("./bin/cli.js", [`--from=${from}`, `--to=${to}`]); + stdout = stdout.replace(/^## Release .*/, "## Release (2025-03-06)"); expect(stdout).toMatchInlineSnapshot(` " - ## Unreleased (2025-03-05) + ## Unreleased (2025-03-06) #### :rocket: Enhancement * \`github-changelog\` + * [#37](https://github.com/embroider-build/github-changelog/pull/37) ignore private packages ([@patricklx](https://github.com/patricklx)) * [#33](https://github.com/embroider-build/github-changelog/pull/33) support github enterpise url detection and env vars ([@patricklx](https://github.com/patricklx)) #### Committers: 1 - Patrick Pircher ([@patricklx](https://github.com/patricklx)) + ## v1.1.0-github-changelog (2025-01-25) + + #### :house: Internal + * \`github-changelog\` + * [#29](https://github.com/embroider-build/github-changelog/pull/29) Prepare Release ([@github-actions[bot]](https://github.com/apps/github-actions)) + + #### Committers: 1 + - [@github-actions[bot]](https://github.com/apps/github-actions)" + `); + }); + + it.skipIf(!process.env.GITHUB_AUTH)("can produce a result", async () => { + const from = "ee1c697fcf871114c53e9847c43e221d3056f19d"; + const to = "09a1017fee768a4339a5b9fd0fab729fd23aa737"; + const { stdout: gitOut } = execa.sync("git", [ + "log", + "--oneline", + "--date=short", + "--first-parent", + `${from}..${to}`, + ]); + + expect(gitOut).toMatchInlineSnapshot(` + "09a1017 Merge pull request #36 from patricklx/ignore-label + 47e597c Merge pull request #25 from embroider-build/windows-tests + c787f47 Merge pull request #32 from embroider-build/vitest + f699a55 Merge pull request #38 from embroider-build/node-16 + 0db8b15 Merge pull request #34 from embroider-build/release-preview + 5f49870 Merge pull request #33 from patricklx/patch-2 + d6b4ad4 Merge pull request #29 from embroider-build/release-preview" + `); + + let { stdout } = await execa.node("./bin/cli.js", [`--from=${from}`, `--to=${to}`, "--next-version=Release"]); + stdout = stdout.replace(/^## Release .*/, "## Release (2025-03-06)"); + expect(stdout).toMatchInlineSnapshot(` + " + ## Release (2025-03-06) + + #### :boom: Breaking Change + * \`github-changelog\` + * [#38](https://github.com/embroider-build/github-changelog/pull/38) drop support for node 16 ([@mansona](https://github.com/mansona)) + + #### :rocket: Enhancement + * \`github-changelog\` + * [#36](https://github.com/embroider-build/github-changelog/pull/36) add ignore label ([@patricklx](https://github.com/patricklx)) + + #### :house: Internal + * \`github-changelog\` + * [#25](https://github.com/embroider-build/github-changelog/pull/25) add windows tests ([@mansona](https://github.com/mansona)) + * [#32](https://github.com/embroider-build/github-changelog/pull/32) convert to vitest ([@mansona](https://github.com/mansona)) + + #### Committers: 2 + - Chris Manson ([@mansona](https://github.com/mansona)) + - Patrick Pircher ([@patricklx](https://github.com/patricklx)) + + + ## v1.2.0-github-changelog (2025-02-23) + + #### :rocket: Enhancement + * \`github-changelog\` + * [#33](https://github.com/embroider-build/github-changelog/pull/33) support github enterpise url detection and env vars ([@patricklx](https://github.com/patricklx)) + + #### :house: Internal + * \`github-changelog\` + * [#34](https://github.com/embroider-build/github-changelog/pull/34) Prepare Release ([@github-actions[bot]](https://github.com/apps/github-actions)) + + #### Committers: 2 + - Patrick Pircher ([@patricklx](https://github.com/patricklx)) + - [@github-actions[bot]](https://github.com/apps/github-actions) + + ## v1.1.0-github-changelog (2025-01-25) #### :house: Internal diff --git a/tsconfig.json b/tsconfig.json index e8bddbb..d1a8ab6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,11 @@ { "compilerOptions": { + "esModuleInterop": true, "outDir": "lib", "target": "es2015", "module": "CommonJS", "removeComments": true, + "moduleResolution": "Node16", "allowJs": true, "strict": true, "lib": ["es2015"],