summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2026-04-20 00:49:46 -0500
committerGitHub <[email protected]>2026-04-20 00:49:46 -0500
commite539efe2b9a627927ffcb1420098a69038d042e2 (patch)
treec2a63687ba9358aa6b2792925929971b1c623fea
parent687b7588820df02dfe7397a399f213f394aa6b09 (diff)
downloadopencode-e539efe2b9a627927ffcb1420098a69038d042e2.tar.gz
opencode-e539efe2b9a627927ffcb1420098a69038d042e2.zip
fix: patch arborist to get around bun bug (#23460)
-rw-r--r--bun.lock4
-rw-r--r--package.json1
-rw-r--r--packages/opencode/package.json1
-rw-r--r--packages/opencode/src/npm/config.ts0
-rw-r--r--packages/opencode/src/npmcli-config.d.ts43
-rw-r--r--packages/shared/src/types.d.ts2
-rw-r--r--patches/@npmcli%[email protected]13
7 files changed, 64 insertions, 0 deletions
diff --git a/bun.lock b/bun.lock
index fc9662796..6dea120fa 100644
--- a/bun.lock
+++ b/bun.lock
@@ -354,6 +354,7 @@
"@lydell/node-pty": "catalog:",
"@modelcontextprotocol/sdk": "1.27.1",
"@npmcli/arborist": "9.4.0",
+ "@npmcli/config": "10.8.1",
"@octokit/graphql": "9.0.2",
"@octokit/rest": "catalog:",
"@openauthjs/openauth": "catalog:",
@@ -660,6 +661,7 @@
"patchedDependencies": {
"@standard-community/[email protected]": "patches/@standard-community%[email protected]",
+ "@npmcli/[email protected]": "patches/@npmcli%[email protected]",
},
"overrides": {
"@types/bun": "catalog:",
@@ -1468,6 +1470,8 @@
"@npmcli/arborist": ["@npmcli/[email protected]", "", { "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/fs": "^5.0.0", "@npmcli/installed-package-contents": "^4.0.0", "@npmcli/map-workspaces": "^5.0.0", "@npmcli/metavuln-calculator": "^9.0.2", "@npmcli/name-from-folder": "^4.0.0", "@npmcli/node-gyp": "^5.0.0", "@npmcli/package-json": "^7.0.0", "@npmcli/query": "^5.0.0", "@npmcli/redact": "^4.0.0", "@npmcli/run-script": "^10.0.0", "bin-links": "^6.0.0", "cacache": "^20.0.1", "common-ancestor-path": "^2.0.0", "hosted-git-info": "^9.0.0", "json-stringify-nice": "^1.1.4", "lru-cache": "^11.2.1", "minimatch": "^10.0.3", "nopt": "^9.0.0", "npm-install-checks": "^8.0.0", "npm-package-arg": "^13.0.0", "npm-pick-manifest": "^11.0.1", "npm-registry-fetch": "^19.0.0", "pacote": "^21.0.2", "parse-conflict-json": "^5.0.1", "proc-log": "^6.0.0", "proggy": "^4.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^3.0.1", "semver": "^7.3.7", "ssri": "^13.0.0", "treeverse": "^3.0.0", "walk-up-path": "^4.0.0" }, "bin": { "arborist": "bin/index.js" } }, "sha512-4Bm8hNixJG/sii1PMnag0V9i/sGOX9VRzFrUiZMSBJpGlLR38f+Btl85d07G9GL56xO0l0OZjvrGNYsDYp0xKA=="],
+ "@npmcli/config": ["@npmcli/[email protected]", "", { "dependencies": { "@npmcli/map-workspaces": "^5.0.0", "@npmcli/package-json": "^7.0.0", "ci-info": "^4.0.0", "ini": "^6.0.0", "nopt": "^9.0.0", "proc-log": "^6.0.0", "semver": "^7.3.5", "walk-up-path": "^4.0.0" } }, "sha512-MAYk9IlIGiyC0c9fnjdBSQfIFPZT0g1MfeSiD1UXTq2zJOLX55jS9/sETJHqw/7LN18JjITrhYfgCfapbmZHiQ=="],
+
"@npmcli/fs": ["@npmcli/[email protected]", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-7OsC1gNORBEawOa5+j2pXN9vsicaIOH5cPXxoR6fJOmH6/EXpJB2CajXOu1fPRFun2m1lktEFX11+P89hqO/og=="],
"@npmcli/git": ["@npmcli/[email protected]", "", { "dependencies": { "@gar/promise-retry": "^1.0.0", "@npmcli/promise-spawn": "^9.0.0", "ini": "^6.0.0", "lru-cache": "^11.2.1", "npm-pick-manifest": "^11.0.1", "proc-log": "^6.0.0", "semver": "^7.3.5", "which": "^6.0.0" } }, "sha512-oeolHDjExNAJAnlYP2qzNjMX/Xi9bmu78C9dIGr4xjobrSKbuMYCph8lTzn4vnW3NjIqVmw/f8BCfouqyJXlRg=="],
diff --git a/package.json b/package.json
index 063226ad0..06bf9c91a 100644
--- a/package.json
+++ b/package.json
@@ -127,6 +127,7 @@
"@types/node": "catalog:"
},
"patchedDependencies": {
+ "@npmcli/[email protected]": "patches/@npmcli%[email protected]",
"@standard-community/[email protected]": "patches/@standard-community%[email protected]",
}
diff --git a/packages/opencode/package.json b/packages/opencode/package.json
index 42f30b45e..4644922fc 100644
--- a/packages/opencode/package.json
+++ b/packages/opencode/package.json
@@ -110,6 +110,7 @@
"@lydell/node-pty": "catalog:",
"@modelcontextprotocol/sdk": "1.27.1",
"@npmcli/arborist": "9.4.0",
+ "@npmcli/config": "10.8.1",
"@octokit/graphql": "9.0.2",
"@octokit/rest": "catalog:",
"@openauthjs/openauth": "catalog:",
diff --git a/packages/opencode/src/npm/config.ts b/packages/opencode/src/npm/config.ts
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/packages/opencode/src/npm/config.ts
diff --git a/packages/opencode/src/npmcli-config.d.ts b/packages/opencode/src/npmcli-config.d.ts
new file mode 100644
index 000000000..c9b20517a
--- /dev/null
+++ b/packages/opencode/src/npmcli-config.d.ts
@@ -0,0 +1,43 @@
+declare module "@npmcli/config" {
+ type Data = Record<string, unknown>
+ type Where = "default" | "builtin" | "global" | "user" | "project" | "env" | "cli"
+
+ namespace Config {
+ interface Options {
+ definitions: Data
+ shorthands: Record<string, string | string[]>
+ npmPath: string
+ flatten?: (input: Data, flat?: Data) => Data
+ nerfDarts?: string[]
+ argv?: string[]
+ cwd?: string
+ env?: NodeJS.ProcessEnv
+ execPath?: string
+ platform?: NodeJS.Platform
+ warn?: boolean
+ }
+ }
+
+ class Config {
+ constructor(input: Config.Options)
+
+ readonly data: Map<Where, { source: string | null }>
+ readonly flat: Data
+
+ load(): Promise<void>
+ }
+
+ export = Config
+}
+
+declare module "@npmcli/config/lib/definitions" {
+ export const definitions: Record<string, unknown>
+ export const shorthands: Record<string, string | string[]>
+ export const flatten: (input: Record<string, unknown>, flat?: Record<string, unknown>) => Record<string, unknown>
+ export const nerfDarts: string[]
+ export const proxyEnv: string[]
+}
+
+declare module "@npmcli/config/lib/definitions/index.js" {
+ export * from "@npmcli/config/lib/definitions"
+}
diff --git a/packages/shared/src/types.d.ts b/packages/shared/src/types.d.ts
index b5d667f1d..60e1639ad 100644
--- a/packages/shared/src/types.d.ts
+++ b/packages/shared/src/types.d.ts
@@ -5,6 +5,7 @@ declare module "@npmcli/arborist" {
progress?: boolean
savePrefix?: string
ignoreScripts?: boolean
+ [key: string]: unknown
}
export interface ArboristNode {
@@ -24,6 +25,7 @@ declare module "@npmcli/arborist" {
add?: string[]
save?: boolean
saveType?: "prod" | "dev" | "optional" | "peer"
+ [key: string]: unknown
}
export class Arborist {
diff --git a/patches/@npmcli%[email protected] b/patches/@npmcli%[email protected]
new file mode 100644
index 000000000..a3506a90e
--- /dev/null
+++ b/patches/@npmcli%[email protected]
@@ -0,0 +1,13 @@
+diff --git a/lib/agents.js b/lib/agents.js
+index 45ec59c4c13757379095131c4f0a5ea6f7284f45..0763b031e355a755ec6a26f98461aa3f63b8339b 100644
+--- a/lib/agents.js
++++ b/lib/agents.js
+@@ -32,7 +32,7 @@ module.exports = class Agent extends AgentBase {
+ }
+
+ get proxy () {
+- return this.#proxy ? { url: this.#proxy } : {}
++ return this.#proxy ? { url: this.#proxy.toString() } : {}
+ }
+
+ #getProxy (options) {