diff --git a/README.md b/README.md index 15cb53203c..c9cc97af70 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,8 @@ Cybozu, Inc. ## Contributors -- Isao Yoshikoshi [@latica-jp](https://github.com/latica-jp) -- Yohei Murayama [@mura-](https://github.com/mura-) -- Kosuke Kawachi [@kosuke-k](https://github.com/kosuke-k) -- Shohei Ihaya [@Climber22](https://github.com/Climber22) -- Yonashiro Yuu [@cloneko](https://github.com/cloneko) -- akira345 [@akira345](https://github.com/akira345) -- potaracom [@potaracom](https://github.com/potaracom) -- r3-yamauchi [@r3-yamauchi](https://github.com/r3-yamauchi) + + +[koba04 avatar](https://github.com/koba04) [zaki-yama avatar](https://github.com/zaki-yama) [shintaroNagata avatar](https://github.com/shintaroNagata) [tasshi-me avatar](https://github.com/tasshi-me) [chick-p avatar](https://github.com/chick-p) [teppeis avatar](https://github.com/teppeis) [shisama avatar](https://github.com/shisama) [hung-cybo avatar](https://github.com/hung-cybo) [yokotaso avatar](https://github.com/yokotaso) [tuanphamcybozu avatar](https://github.com/tuanphamcybozu) [toshi-toma avatar](https://github.com/toshi-toma) [sakit0 avatar](https://github.com/sakit0) [pirosikick avatar](https://github.com/pirosikick) [b4h0-c4t avatar](https://github.com/b4h0-c4t) [mmiyahara avatar](https://github.com/mmiyahara) [nakajmg avatar](https://github.com/nakajmg) [kjmnmt avatar](https://github.com/kjmnmt) [ksm-cy avatar](https://github.com/ksm-cy) [ueokande avatar](https://github.com/ueokande) [sosukesuzuki avatar](https://github.com/sosukesuzuki) [niki-cy avatar](https://github.com/niki-cy) [potaracom avatar](https://github.com/potaracom) [will-yama avatar](https://github.com/will-yama) [minh-nguyen1985 avatar](https://github.com/minh-nguyen1985) [shohei-ihaya avatar](https://github.com/shohei-ihaya) [ryounasso avatar](https://github.com/ryounasso) [amishiratori avatar](https://github.com/amishiratori) [akira345 avatar](https://github.com/akira345) [gorohash avatar](https://github.com/gorohash) [snyk-bot avatar](https://github.com/snyk-bot) [Kyome22 avatar](https://github.com/Kyome22) [jgdevroman avatar](https://github.com/jgdevroman) [cy-takeuchi avatar](https://github.com/cy-takeuchi) [kosuke-k avatar](https://github.com/kosuke-k) [latica-jp avatar](https://github.com/latica-jp) [shinsenman avatar](https://github.com/shinsenman) [the-red avatar](https://github.com/the-red) [r3-yamauchi avatar](https://github.com/r3-yamauchi) [mura- avatar](https://github.com/mura-) [cloneko avatar](https://github.com/cloneko) + + diff --git a/package.json b/package.json index 3c89229291..557aa4bb3d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "start": "pnpm build --watch", "test": "pnpm test:root && pnpm -r --parallel run test", "test:ci": "pnpm test:root && pnpm -r --stream run test:ci", - "test:e2e": "pnpm -r --parallel run test:e2e" + "test:e2e": "pnpm -r --parallel run test:e2e", + "update-contributors": "ts-node ./scripts/update-contributors.ts" }, "repository": { "type": "git", @@ -39,6 +40,7 @@ "@babel/preset-typescript": "^7.24.7", "@cybozu/eslint-config": "^23.0.0", "@cybozu/license-manager": "^1.2.1", + "@octokit/rest": "^20.1.1", "@types/jest": "^29.5.12", "@types/node": "^18.19.34", "babel-jest": "^29.7.0", @@ -48,6 +50,7 @@ "npm-run-all": "^4.1.5", "prettier": "^3.3.2", "rimraf": "^5.0.7", + "ts-node": "^10.9.2", "typescript": "^5.4.5" }, "packageManager": "pnpm@8.15.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4224f21e59..16a474ed01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,6 +27,9 @@ importers: '@cybozu/license-manager': specifier: ^1.2.1 version: 1.2.1 + '@octokit/rest': + specifier: ^20.1.1 + version: 20.1.1 '@types/jest': specifier: ^29.5.12 version: 29.5.12 @@ -44,7 +47,7 @@ importers: version: 8.57.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@18.19.34) + version: 29.7.0(@types/node@18.19.34)(ts-node@10.9.2) npm-run-all: specifier: ^4.1.5 version: 4.1.5 @@ -54,6 +57,9 @@ importers: rimraf: specifier: ^5.0.7 version: 5.0.7 + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@18.19.34)(typescript@5.4.5) typescript: specifier: ^5.4.5 version: 5.4.5 @@ -2296,7 +2302,7 @@ packages: slash: 3.0.0 dev: true - /@jest/core@29.7.0: + /@jest/core@29.7.0(ts-node@10.9.2): resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -2317,7 +2323,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@18.19.34) + jest-config: 29.7.0(@types/node@18.19.34)(ts-node@10.9.2) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -2469,7 +2475,7 @@ packages: dependencies: '@babel/core': 7.24.7 '@jest/types': 29.6.3 - '@jridgewell/trace-mapping': 0.3.22 + '@jridgewell/trace-mapping': 0.3.25 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 @@ -2528,13 +2534,6 @@ packages: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.22: - resolution: {integrity: sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==} - dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - /@jridgewell/trace-mapping@0.3.25: resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} dependencies: @@ -2575,6 +2574,109 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 + /@octokit/auth-token@4.0.0: + resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} + engines: {node: '>= 18'} + dev: true + + /@octokit/core@5.2.0: + resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} + engines: {node: '>= 18'} + dependencies: + '@octokit/auth-token': 4.0.0 + '@octokit/graphql': 7.1.0 + '@octokit/request': 8.4.0 + '@octokit/request-error': 5.1.0 + '@octokit/types': 13.5.0 + before-after-hook: 2.2.3 + universal-user-agent: 6.0.1 + dev: true + + /@octokit/endpoint@9.0.5: + resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} + engines: {node: '>= 18'} + dependencies: + '@octokit/types': 13.5.0 + universal-user-agent: 6.0.1 + dev: true + + /@octokit/graphql@7.1.0: + resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} + engines: {node: '>= 18'} + dependencies: + '@octokit/request': 8.4.0 + '@octokit/types': 13.5.0 + universal-user-agent: 6.0.1 + dev: true + + /@octokit/openapi-types@22.2.0: + resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} + dev: true + + /@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0): + resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '5' + dependencies: + '@octokit/core': 5.2.0 + '@octokit/types': 13.5.0 + dev: true + + /@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0): + resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '5' + dependencies: + '@octokit/core': 5.2.0 + dev: true + + /@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0): + resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': ^5 + dependencies: + '@octokit/core': 5.2.0 + '@octokit/types': 13.5.0 + dev: true + + /@octokit/request-error@5.1.0: + resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} + engines: {node: '>= 18'} + dependencies: + '@octokit/types': 13.5.0 + deprecation: 2.3.1 + once: 1.4.0 + dev: true + + /@octokit/request@8.4.0: + resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} + engines: {node: '>= 18'} + dependencies: + '@octokit/endpoint': 9.0.5 + '@octokit/request-error': 5.1.0 + '@octokit/types': 13.5.0 + universal-user-agent: 6.0.1 + dev: true + + /@octokit/rest@20.1.1: + resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} + engines: {node: '>= 18'} + dependencies: + '@octokit/core': 5.2.0 + '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) + '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) + '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) + dev: true + + /@octokit/types@13.5.0: + resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} + dependencies: + '@octokit/openapi-types': 22.2.0 + dev: true + /@pkgjs/parseargs@0.11.0: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -4152,6 +4254,10 @@ packages: resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} dev: true + /before-after-hook@2.2.3: + resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} + dev: true + /big-integer@1.6.52: resolution: {integrity: sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==} engines: {node: '>=0.6'} @@ -4764,7 +4870,7 @@ packages: sha.js: 2.4.11 dev: true - /create-jest@29.7.0(@types/node@18.19.34): + /create-jest@29.7.0(@types/node@18.19.34)(ts-node@10.9.2): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -4773,7 +4879,7 @@ packages: chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@18.19.34) + jest-config: 29.7.0(@types/node@18.19.34)(ts-node@10.9.2) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -5211,6 +5317,10 @@ packages: engines: {node: '>= 0.6.0'} dev: true + /deprecation@2.3.1: + resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} + dev: true + /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -7564,7 +7674,7 @@ packages: - supports-color dev: true - /jest-cli@29.7.0(@types/node@18.19.34): + /jest-cli@29.7.0(@types/node@18.19.34)(ts-node@10.9.2): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -7574,14 +7684,14 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.7.0 + '@jest/core': 29.7.0(ts-node@10.9.2) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@18.19.34) + create-jest: 29.7.0(@types/node@18.19.34)(ts-node@10.9.2) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@18.19.34) + jest-config: 29.7.0(@types/node@18.19.34)(ts-node@10.9.2) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -7592,7 +7702,7 @@ packages: - ts-node dev: true - /jest-config@29.7.0(@types/node@18.19.34): + /jest-config@29.7.0(@types/node@18.19.34)(ts-node@10.9.2): resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -7627,6 +7737,7 @@ packages: pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 + ts-node: 10.9.2(@types/node@18.19.34)(typescript@5.4.5) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -7947,7 +8058,7 @@ packages: supports-color: 8.1.1 dev: true - /jest@29.7.0(@types/node@18.19.34): + /jest@29.7.0(@types/node@18.19.34)(ts-node@10.9.2): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -7957,10 +8068,10 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.7.0 + '@jest/core': 29.7.0(ts-node@10.9.2) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@18.19.34) + jest-cli: 29.7.0(@types/node@18.19.34)(ts-node@10.9.2) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -11306,6 +11417,10 @@ packages: object-keys: 1.1.1 dev: true + /universal-user-agent@6.0.1: + resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} + dev: true + /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} diff --git a/scripts/update-contributors.ts b/scripts/update-contributors.ts new file mode 100644 index 0000000000..df642f5f08 --- /dev/null +++ b/scripts/update-contributors.ts @@ -0,0 +1,50 @@ +// eslint-disable-next-line node/no-unpublished-import +import { Octokit } from "@octokit/rest"; +import * as fs from "fs/promises"; + +const ignoredUsers = [ + "renovate[bot]", + "github-actions[bot]", + "trigger-github-actions-release[bot]", + "renovate-bot", +]; + +const file = "README.md"; + +(async () => { + const octokit = new Octokit(); + + // We use stats because the response of octokit.repos.listContributors is missing some contributors. + const resp = await octokit.repos.getContributorsStats({ + owner: "kintone", + repo: "js-sdk", + }); + + const contributors = resp.data + .filter( + (c) => + c.author?.type === "User" && !ignoredUsers.includes(c.author.login), + ) + .sort((c1, c2) => c2.total - c1.total) + .map((c) => ({ + login: c.author?.login, + avatar_url: c.author?.avatar_url, + html_url: c.author?.html_url, + })); + + const contributorIcons = contributors + .map( + (contributor) => + `[${contributor.login} avatar](${contributor.html_url})`, + ) + .join(" "); + const newCredits = `\n\n${contributorIcons}\n\n`; + + const content = await fs.readFile(file, { encoding: "utf-8" }); + const newContent = content.replace( + /.+/gs, + newCredits, + ); + + await fs.writeFile(file, newContent); +})();