Skip to content

Commit e539efe

Browse files
authored
fix: patch arborist to get around bun bug (#23460)
1 parent 687b758 commit e539efe

File tree

7 files changed

+64
-0
lines changed

7 files changed

+64
-0
lines changed

bun.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
"@types/node": "catalog:"
128128
},
129129
"patchedDependencies": {
130+
"@npmcli/agent@4.0.0": "patches/@npmcli%2Fagent@4.0.0.patch",
130131
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
131132
"solid-js@1.9.10": "patches/solid-js@1.9.10.patch"
132133
}

packages/opencode/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"@lydell/node-pty": "catalog:",
111111
"@modelcontextprotocol/sdk": "1.27.1",
112112
"@npmcli/arborist": "9.4.0",
113+
"@npmcli/config": "10.8.1",
113114
"@octokit/graphql": "9.0.2",
114115
"@octokit/rest": "catalog:",
115116
"@openauthjs/openauth": "catalog:",

packages/opencode/src/npm/config.ts

Whitespace-only changes.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
declare module "@npmcli/config" {
2+
type Data = Record<string, unknown>
3+
type Where = "default" | "builtin" | "global" | "user" | "project" | "env" | "cli"
4+
5+
namespace Config {
6+
interface Options {
7+
definitions: Data
8+
shorthands: Record<string, string | string[]>
9+
npmPath: string
10+
flatten?: (input: Data, flat?: Data) => Data
11+
nerfDarts?: string[]
12+
argv?: string[]
13+
cwd?: string
14+
env?: NodeJS.ProcessEnv
15+
execPath?: string
16+
platform?: NodeJS.Platform
17+
warn?: boolean
18+
}
19+
}
20+
21+
class Config {
22+
constructor(input: Config.Options)
23+
24+
readonly data: Map<Where, { source: string | null }>
25+
readonly flat: Data
26+
27+
load(): Promise<void>
28+
}
29+
30+
export = Config
31+
}
32+
33+
declare module "@npmcli/config/lib/definitions" {
34+
export const definitions: Record<string, unknown>
35+
export const shorthands: Record<string, string | string[]>
36+
export const flatten: (input: Record<string, unknown>, flat?: Record<string, unknown>) => Record<string, unknown>
37+
export const nerfDarts: string[]
38+
export const proxyEnv: string[]
39+
}
40+
41+
declare module "@npmcli/config/lib/definitions/index.js" {
42+
export * from "@npmcli/config/lib/definitions"
43+
}

packages/shared/src/types.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ declare module "@npmcli/arborist" {
55
progress?: boolean
66
savePrefix?: string
77
ignoreScripts?: boolean
8+
[key: string]: unknown
89
}
910

1011
export interface ArboristNode {
@@ -24,6 +25,7 @@ declare module "@npmcli/arborist" {
2425
add?: string[]
2526
save?: boolean
2627
saveType?: "prod" | "dev" | "optional" | "peer"
28+
[key: string]: unknown
2729
}
2830

2931
export class Arborist {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/lib/agents.js b/lib/agents.js
2+
index 45ec59c4c13757379095131c4f0a5ea6f7284f45..0763b031e355a755ec6a26f98461aa3f63b8339b 100644
3+
--- a/lib/agents.js
4+
+++ b/lib/agents.js
5+
@@ -32,7 +32,7 @@ module.exports = class Agent extends AgentBase {
6+
}
7+
8+
get proxy () {
9+
- return this.#proxy ? { url: this.#proxy } : {}
10+
+ return this.#proxy ? { url: this.#proxy.toString() } : {}
11+
}
12+
13+
#getProxy (options) {

0 commit comments

Comments
 (0)