π OpenHands: AI-Driven Development
Pin exact dependency versions (#1455)
Rohit Malhotra089ecc45f359
diff --git a/__tests__/package-library.test.ts b/__tests__/package-library.test.tsindex 6296fbc8fb..8fd4bbf75b 100644--- a/__tests__/package-library.test.ts+++ b/__tests__/package-library.test.ts@@ -16,6 +16,9 @@ const packageJson = JSON.parse(devDependencies?: Record<string, string>;};+const EXACT_SEMVER_PATTERN =+ /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;+describe("package library metadata", () => {it("publishes the agent-canvas package entrypoints", () => {expect(packageJson.name).toBe("@openhands/agent-canvas");@@ -81,10 +84,26 @@ describe("package library metadata", () => {expect(violations).toEqual([]);});+ it("pins direct dependency versions exactly", () => {+ const allDepsBySection = {+ dependencies: packageJson.dependencies,+ devDependencies: packageJson.devDependencies,+ };++ const violations = Object.entries(allDepsBySection).flatMap(+ ([section, dependencies]) =>+ Object.entries(dependencies ?? {})+ .filter(([, version]) => !EXACT_SEMVER_PATTERN.test(version))+ .map(([name, version]) => `${section}.${name}: ${version}`),+ );++ expect(violations).toEqual([]);+ });+it("ships runtime logger dependencies for the published CLI", () => {expect(packageJson.dependencies).toMatchObject({- winston: "^3.19.0",- "winston-daily-rotate-file": "^5.0.0",+ winston: "3.19.0",+ "winston-daily-rotate-file": "5.0.0",});expect(packageJson.devDependencies?.winston).toBeUndefined();expect(diff --git a/package-lock.json b/package-lock.jsonindex a7722930bf..4d1218ea19 100644--- a/package-lock.json+++ b/package-lock.json@@ -18,7 +18,7 @@"@react-router/serve": "7.17.0","@tailwindcss/vite": "4.2.4","@tanstack/react-query": "5.100.9",- "@types/shell-quote": "^1.7.5",+ "@types/shell-quote": "1.7.5","@uidotdev/usehooks": "2.4.1","@xterm/addon-fit": "0.11.0","@xterm/xterm": "6.0.0",@@ -46,7 +46,7 @@"rehype-sanitize": "6.0.0","remark-breaks": "4.0.0","remark-gfm": "4.0.1",- "shell-quote": "^1.8.3",+ "shell-quote": "1.8.4","sirv-cli": "3.0.1","socket.io-client": "4.8.3","tailwind-merge": "3.5.0",@@ -54,8 +54,8 @@"unist-util-visit": "5.1.0","uuid": "14.0.0","vite": "8.0.10",- "winston": "^3.19.0",- "winston-daily-rotate-file": "^5.0.0",+ "winston": "3.19.0",+ "winston-daily-rotate-file": "5.0.0","zustand": "5.0.12"},"bin": {diff --git a/package.json b/package.jsonindex 8babcbf31c..4ac7bce54a 100644--- a/package.json+++ b/package.json@@ -29,7 +29,7 @@"@react-router/serve": "7.17.0","@tailwindcss/vite": "4.2.4","@tanstack/react-query": "5.100.9",- "@types/shell-quote": "^1.7.5",+ "@types/shell-quote": "1.7.5","@uidotdev/usehooks": "2.4.1","@xterm/addon-fit": "0.11.0","@xterm/xterm": "6.0.0",@@ -57,7 +57,7 @@"rehype-sanitize": "6.0.0","remark-breaks": "4.0.0","remark-gfm": "4.0.1",- "shell-quote": "^1.8.3",+ "shell-quote": "1.8.4","sirv-cli": "3.0.1","socket.io-client": "4.8.3","tailwind-merge": "3.5.0",@@ -65,8 +65,8 @@"unist-util-visit": "5.1.0","uuid": "14.0.0","vite": "8.0.10",- "winston": "^3.19.0",- "winston-daily-rotate-file": "^5.0.0",+ "winston": "3.19.0",+ "winston-daily-rotate-file": "5.0.0","zustand": "5.0.12"},"scripts": {