From 1a9de9e5874f07202727f7206407dcfdf23aa860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Tue, 2 Jun 2026 12:18:18 +0200 Subject: [PATCH 1/4] Prevent `GitHubClient` types from being bundled --- package.json | 3 ++- pnpm-lock.yaml | 34 ++++++---------------------------- src/github/graphql/queries.ts | 7 ++++--- tsdown.config.ts | 3 +++ 4 files changed, 15 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 3db789a..ff6e362 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,8 @@ "version-packages": "pnpm changeset version && pnpm format:fix" }, "dependencies": { + "@octokit/core": "^7.0.6", + "@octokit/plugin-rest-endpoint-methods": "^17.0.0", "isomorphic-git": "^1.36.3" }, "devDependencies": { @@ -64,7 +66,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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f10247..4a33f39 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,12 @@ importers: .: dependencies: + '@octokit/core': + specifier: ^7.0.6 + version: 7.0.6 + '@octokit/plugin-rest-endpoint-methods': + specifier: ^17.0.0 + version: 17.0.0(@octokit/core@7.0.6) isomorphic-git: specifier: ^1.36.3 version: 1.36.3 @@ -25,9 +31,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 @@ -743,18 +746,10 @@ 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'} @@ -1361,9 +1356,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==} @@ -3946,20 +3938,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 @@ -4386,8 +4366,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: diff --git a/src/github/graphql/queries.ts b/src/github/graphql/queries.ts index 7dcd9d7..13af3ca 100644 --- a/src/github/graphql/queries.ts +++ b/src/github/graphql/queries.ts @@ -1,6 +1,7 @@ -export type GitHubClient = ReturnType< - typeof import("@actions/github").getOctokit ->; +import type { Octokit } from "@octokit/core" +import type { Api } from "@octokit/plugin-rest-endpoint-methods" + +export type GitHubClient = Octokit & Api 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 }, From 777058bbe33caf1d648f6efc06685943104aa8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Tue, 2 Jun 2026 12:21:06 +0200 Subject: [PATCH 2/4] just use structural typing --- package.json | 3 -- pnpm-lock.yaml | 77 ----------------------------------- src/github/graphql/queries.ts | 35 ++++++++++++++-- 3 files changed, 31 insertions(+), 84 deletions(-) diff --git a/package.json b/package.json index ff6e362..af65968 100644 --- a/package.json +++ b/package.json @@ -57,8 +57,6 @@ "version-packages": "pnpm changeset version && pnpm format:fix" }, "dependencies": { - "@octokit/core": "^7.0.6", - "@octokit/plugin-rest-endpoint-methods": "^17.0.0", "isomorphic-git": "^1.36.3" }, "devDependencies": { @@ -66,7 +64,6 @@ "@changesets/changelog-github": "^0.5.1", "@changesets/cli": "^2.27.7", "@graphql-codegen/cli": "^7.0.0", - "@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 4a33f39..fa2674b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,12 +9,6 @@ importers: .: dependencies: - '@octokit/core': - specifier: ^7.0.6 - version: 7.0.6 - '@octokit/plugin-rest-endpoint-methods': - specifier: ^17.0.0 - version: 17.0.0(@octokit/core@7.0.6) isomorphic-git: specifier: ^1.36.3 version: 1.36.3 @@ -31,9 +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/graphql': - specifier: ^8.1.1 - version: 8.1.1 '@tsconfig/node22': specifier: ^22.0.5 version: 22.0.5 @@ -754,28 +745,14 @@ packages: 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==} @@ -791,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'} @@ -803,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==} @@ -1672,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==} @@ -3950,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)': @@ -3988,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 @@ -4005,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 @@ -4623,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 13af3ca..1be4816 100644 --- a/src/github/graphql/queries.ts +++ b/src/github/graphql/queries.ts @@ -1,7 +1,34 @@ -import type { Octokit } from "@octokit/core" -import type { Api } from "@octokit/plugin-rest-endpoint-methods" - -export type GitHubClient = Octokit & Api +// 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, From 634c083337b1c0eb1414e96b1e0d6232106cb21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Tue, 2 Jun 2026 12:22:19 +0200 Subject: [PATCH 3/4] add changeset --- .changeset/curvy-lies-walk.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/curvy-lies-walk.md 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. From 1911d9626faab4b9711a6d198b437d77b2268808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Tue, 2 Jun 2026 12:24:25 +0200 Subject: [PATCH 4/4] fmt --- src/github/graphql/queries.ts | 57 ++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/github/graphql/queries.ts b/src/github/graphql/queries.ts index 1be4816..c922e7b 100644 --- a/src/github/graphql/queries.ts +++ b/src/github/graphql/queries.ts @@ -1,34 +1,37 @@ // 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; - }; + 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,