Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
},
"patchedDependencies": {
"@dnd-kit/dom@0.5.0": "patches/@dnd-kit%2Fdom@0.5.0.patch",
"@ff-labs/fff-bun@0.9.3": "patches/@ff-labs%2Ffff-bun@0.9.3.patch",
"@npmcli/agent@4.0.2": "patches/@npmcli%2Fagent@4.0.2.patch",
"@silvia-odwyer/photon-node@0.3.4": "patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch",
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
Expand Down
29 changes: 29 additions & 0 deletions packages/opencode/test/patched-dependencies.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { describe, expect, test } from "bun:test"
import path from "path"

// Bun applies a patch only to the exact `name@version` named in
// `patchedDependencies`. Bumping the dependency without regenerating the patch
// does not fail `bun install`; the patch just stops applying and the runtime
// silently loses whatever the patch fixed. This pins the two together for the
// packages that ship in the CLI.
const root = path.resolve(import.meta.dir, "../../..")
const workspaces = ["packages/opencode", "packages/core"]
const patched = (await Bun.file(path.join(root, "package.json")).json()).patchedDependencies as Record<string, string>

describe("patched dependencies", () => {
for (const key of Object.keys(patched)) {
const at = key.lastIndexOf("@")
const name = key.slice(0, at)
const version = key.slice(at + 1)

test(`${key} matches the installed version`, async () => {
expect(await Bun.file(path.join(root, patched[key])).exists()).toBe(true)
for (const workspace of workspaces) {
const file = Bun.file(path.join(root, workspace, "node_modules", name, "package.json"))
if (!(await file.exists())) continue
const installed = (await file.json()).version as string
expect(installed, `${workspace} resolves ${name}@${installed}; patch is for ${version}`).toBe(version)
}
})
}
})
31 changes: 0 additions & 31 deletions patches/@ff-labs%2Ffff-bun@0.9.3.patch

This file was deleted.

Loading