GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(opencode): guard patched dependency versions (#46673) · chid/opencode@c066339

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • package.json
  • packages/opencode/test
    • patched-dependencies.test.ts
  • patches
    • @ff-labs%[email protected]
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@
146146
},
147147
"patchedDependencies": {
148148
"@dnd-kit/[email protected]": "patches/@dnd-kit%[email protected]",
149-
"@ff-labs/[email protected]": "patches/@ff-labs%[email protected]",
150149
"@npmcli/[email protected]": "patches/@npmcli%[email protected]",
151150
"@silvia-odwyer/[email protected]": "patches/@silvia-odwyer%[email protected]",
152151
"@standard-community/[email protected]": "patches/@standard-community%[email protected]",
Collapse file

‎packages/opencode/test/patched-dependencies.test.ts‎

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { describe, expect, test } from "bun:test"
2+
import path from "path"
3+
4+
// Bun applies a patch only to the exact `name@version` named in
5+
// `patchedDependencies`. Bumping the dependency without regenerating the patch
6+
// does not fail `bun install`; the patch just stops applying and the runtime
7+
// silently loses whatever the patch fixed. This pins the two together for the
8+
// packages that ship in the CLI.
9+
const root = path.resolve(import.meta.dir, "../../..")
10+
const workspaces = ["packages/opencode", "packages/core"]
11+
const patched = (await Bun.file(path.join(root, "package.json")).json()).patchedDependencies as Record<string, string>
12+
13+
describe("patched dependencies", () => {
14+
for (const key of Object.keys(patched)) {
15+
const at = key.lastIndexOf("@")
16+
const name = key.slice(0, at)
17+
const version = key.slice(at + 1)
18+
19+
test(`${key} matches the installed version`, async () => {
20+
expect(await Bun.file(path.join(root, patched[key])).exists()).toBe(true)
21+
for (const workspace of workspaces) {
22+
const file = Bun.file(path.join(root, workspace, "node_modules", name, "package.json"))
23+
if (!(await file.exists())) continue
24+
const installed = (await file.json()).version as string
25+
expect(installed, `${workspace} resolves ${name}@${installed}; patch is for ${version}`).toBe(version)
26+
}
27+
})
28+
}
29+
})
Collapse file

‎patches/@ff-labs%[email protected]‎

Copy file name to clipboardExpand all lines: patches/@ff-labs%[email protected]
-31Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.