diff --git a/.changeset/curvy-lies-walk.md b/.changeset/curvy-lies-walk.md new file mode 100644 index 0000000..8cc4325 --- /dev/null +++ b/.changeset/curvy-lies-walk.md @@ -0,0 +1,5 @@ +--- +"@changesets/ghcommit": patch +--- + +Fixed an issue that caused GitHub types being bundled into the package and thus creating type incompatibilities in the dependent projects. diff --git a/package.json b/package.json index 3db789a..af65968 100644 --- a/package.json +++ b/package.json @@ -64,8 +64,6 @@ "@changesets/changelog-github": "^0.5.1", "@changesets/cli": "^2.27.7", "@graphql-codegen/cli": "^7.0.0", - "@octokit/core": "^6.1.2", - "@octokit/graphql": "^8.1.1", "@tsconfig/node22": "^22.0.5", "@types/node": "^20.11.24", "dotenv": "^16.4.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f10247..fa2674b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,12 +25,6 @@ importers: '@graphql-codegen/cli': specifier: ^7.0.0 version: 7.0.0(@types/node@20.14.10)(graphql@16.14.0)(typescript@6.0.3) - '@octokit/core': - specifier: ^6.1.2 - version: 6.1.2 - '@octokit/graphql': - specifier: ^8.1.1 - version: 8.1.1 '@tsconfig/node22': specifier: ^22.0.5 version: 22.0.5 @@ -743,44 +737,22 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@octokit/auth-token@5.1.1': - resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} - engines: {node: '>= 18'} - '@octokit/auth-token@6.0.0': resolution: {integrity: sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==} engines: {node: '>= 20'} - '@octokit/core@6.1.2': - resolution: {integrity: sha512-hEb7Ma4cGJGEUNOAVmyfdB/3WirWMg5hDuNFVejGEDFqupeOysLc2sG6HJxY2etBp5YQu5Wtxwi020jS9xlUwg==} - engines: {node: '>= 18'} - '@octokit/core@7.0.6': resolution: {integrity: sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==} engines: {node: '>= 20'} - '@octokit/endpoint@10.1.4': - resolution: {integrity: sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==} - engines: {node: '>= 18'} - '@octokit/endpoint@11.0.3': resolution: {integrity: sha512-FWFlNxghg4HrXkD3ifYbS/IdL/mDHjh9QcsNyhQjN8dplUoZbejsdpmuqdA76nxj2xoWPs7p8uX2SNr9rYu0Ag==} engines: {node: '>= 20'} - '@octokit/graphql@8.1.1': - resolution: {integrity: sha512-ukiRmuHTi6ebQx/HFRCXKbDlOh/7xEV6QUXaE7MJEKGNAncGI/STSbOkl12qVXZrfZdpXctx5O9X1AIaebiDBg==} - engines: {node: '>= 18'} - '@octokit/graphql@9.0.3': resolution: {integrity: sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==} engines: {node: '>= 20'} - '@octokit/openapi-types@22.2.0': - resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} - - '@octokit/openapi-types@25.0.0': - resolution: {integrity: sha512-FZvktFu7HfOIJf2BScLKIEYjDsw6RKc7rBJCdvCTfKsVnx2GEB/Nbzjr29DUdb7vQhlzS/j8qDzdditP0OC6aw==} - '@octokit/openapi-types@27.0.0': resolution: {integrity: sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==} @@ -796,10 +768,6 @@ packages: peerDependencies: '@octokit/core': '>=6' - '@octokit/request-error@6.1.8': - resolution: {integrity: sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==} - engines: {node: '>= 18'} - '@octokit/request-error@7.1.0': resolution: {integrity: sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==} engines: {node: '>= 20'} @@ -808,16 +776,6 @@ packages: resolution: {integrity: sha512-SJZNwY9pur9Agf7l87ywFi14W+Hd9Jg6Ifivsd33+/bGUQIjNujdFiXII2/qSlN2ybqUHfp5xpekMEjIBTjlSw==} engines: {node: '>= 20'} - '@octokit/request@9.2.3': - resolution: {integrity: sha512-Ma+pZU8PXLOEYzsWf0cn/gY+ME57Wq8f49WTXA8FMHp2Ps9djKw//xYJ1je8Hm0pR2lU9FUGeJRWOtxq6olt4w==} - engines: {node: '>= 18'} - - '@octokit/types@13.5.0': - resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - - '@octokit/types@14.0.0': - resolution: {integrity: sha512-VVmZP0lEhbo2O1pdq63gZFiGCKkm8PPp8AUOijlwPO6hojEVjspA0MWKP7E4hbvGxzFKNqKr6p0IYtOH/Wf/zA==} - '@octokit/types@16.0.0': resolution: {integrity: sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==} @@ -1361,9 +1319,6 @@ packages: engines: {node: '>=6.0.0'} hasBin: true - before-after-hook@3.0.2: - resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} - before-after-hook@4.0.0: resolution: {integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==} @@ -1680,9 +1635,6 @@ packages: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} engines: {node: '>=4'} - fast-content-type-parse@2.0.1: - resolution: {integrity: sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==} - fast-content-type-parse@3.0.0: resolution: {integrity: sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==} @@ -3946,20 +3898,8 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@octokit/auth-token@5.1.1': {} - '@octokit/auth-token@6.0.0': {} - '@octokit/core@6.1.2': - dependencies: - '@octokit/auth-token': 5.1.1 - '@octokit/graphql': 8.1.1 - '@octokit/request': 9.2.3 - '@octokit/request-error': 6.1.8 - '@octokit/types': 13.5.0 - before-after-hook: 3.0.2 - universal-user-agent: 7.0.2 - '@octokit/core@7.0.6': dependencies: '@octokit/auth-token': 6.0.0 @@ -3970,32 +3910,17 @@ snapshots: before-after-hook: 4.0.0 universal-user-agent: 7.0.2 - '@octokit/endpoint@10.1.4': - dependencies: - '@octokit/types': 14.0.0 - universal-user-agent: 7.0.2 - '@octokit/endpoint@11.0.3': dependencies: '@octokit/types': 16.0.0 universal-user-agent: 7.0.2 - '@octokit/graphql@8.1.1': - dependencies: - '@octokit/request': 9.2.3 - '@octokit/types': 13.5.0 - universal-user-agent: 7.0.2 - '@octokit/graphql@9.0.3': dependencies: '@octokit/request': 10.0.8 '@octokit/types': 16.0.0 universal-user-agent: 7.0.2 - '@octokit/openapi-types@22.2.0': {} - - '@octokit/openapi-types@25.0.0': {} - '@octokit/openapi-types@27.0.0': {} '@octokit/plugin-paginate-rest@14.0.0(@octokit/core@7.0.6)': @@ -4008,10 +3933,6 @@ snapshots: '@octokit/core': 7.0.6 '@octokit/types': 16.0.0 - '@octokit/request-error@6.1.8': - dependencies: - '@octokit/types': 14.0.0 - '@octokit/request-error@7.1.0': dependencies: '@octokit/types': 16.0.0 @@ -4025,22 +3946,6 @@ snapshots: json-with-bigint: 3.5.8 universal-user-agent: 7.0.2 - '@octokit/request@9.2.3': - dependencies: - '@octokit/endpoint': 10.1.4 - '@octokit/request-error': 6.1.8 - '@octokit/types': 14.0.0 - fast-content-type-parse: 2.0.1 - universal-user-agent: 7.0.2 - - '@octokit/types@13.5.0': - dependencies: - '@octokit/openapi-types': 22.2.0 - - '@octokit/types@14.0.0': - dependencies: - '@octokit/openapi-types': 25.0.0 - '@octokit/types@16.0.0': dependencies: '@octokit/openapi-types': 27.0.0 @@ -4386,8 +4291,6 @@ snapshots: baseline-browser-mapping@2.10.31: {} - before-after-hook@3.0.2: {} - before-after-hook@4.0.0: {} better-path-resolve@1.0.0: @@ -4645,8 +4548,6 @@ snapshots: iconv-lite: 0.4.24 tmp: 0.0.33 - fast-content-type-parse@2.0.1: {} - fast-content-type-parse@3.0.0: {} fast-copy@3.0.2: {} diff --git a/src/github/graphql/queries.ts b/src/github/graphql/queries.ts index 7dcd9d7..c922e7b 100644 --- a/src/github/graphql/queries.ts +++ b/src/github/graphql/queries.ts @@ -1,6 +1,37 @@ -export type GitHubClient = ReturnType< - typeof import("@actions/github").getOctokit ->; +// Octokit types are messy. To avoid adding any (peer)dependencies we rely on TS structural typing here +export type GitHubClient = { + graphql: ( + query: string, + variables?: Record, + ) => Promise; + rest: { + git: { + createRef: (params: { + owner: string; + repo: string; + ref: string; + sha: string; + }) => Promise<{ data: { node_id?: string } }>; + updateRef: (params: { + owner: string; + repo: string; + ref: string; + sha: string; + force?: boolean; + }) => Promise<{ data: { node_id?: string } }>; + deleteRef: (params: { + owner: string; + repo: string; + ref: string; + }) => Promise; + getRef?: (params: { + owner: string; + repo: string; + ref: string; + }) => Promise; + }; + }; +}; import type { CreateCommitOnBranchMutation, diff --git a/tsdown.config.ts b/tsdown.config.ts index def403b..71760f4 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -14,6 +14,9 @@ export default defineConfig({ exports: false, // useful for running `build --watch` and `test` concurrently clean: !process.argv.includes("--watch"), + deps: { + onlyBundle: [], // require explicitly listing inlined dependencies + }, sourcemap: !isCi, dts: { enabled: true, parallel: !isCi, sourcemap: !isCi },