diff --git a/bun.lock b/bun.lock index 55ee01db..f5509e58 100644 --- a/bun.lock +++ b/bun.lock @@ -11,6 +11,7 @@ "@tscircuit/circuit-json-routing-analysis": "^0.0.1", "@tscircuit/fake-snippets": "^0.0.182", "@tscircuit/file-server": "^0.0.32", + "@tscircuit/image-utils": "^0.0.3", "@tscircuit/math-utils": "0.0.36", "@tscircuit/props": "^0.0.496", "@tscircuit/runframe": "^0.0.1748", @@ -49,7 +50,6 @@ "kicadts": "^0.0.24", "kleur": "^4.1.5", "ky": "^1.7.4", - "looks-same": "^9.0.1", "make-vfs": "^1.0.15", "md5": "^2.3.0", "perfect-cli": "^1.0.21", @@ -58,7 +58,6 @@ "prompts": "^2.4.2", "redaxios": "^0.5.1", "semver": "^7.6.3", - "sharp": "0.32.6", "tempy": "^3.1.0", "tscircuit": "0.0.1519-libonly", "tsx": "^4.7.1", @@ -313,6 +312,8 @@ "@tscircuit/high-density-a01": ["@tscircuit/high-density-a01@0.0.21", "", { "dependencies": { "flatbush": "^4.5.0" }, "peerDependencies": { "typescript": "^5" } }, "sha512-t9hKwXENhpMMvE29Z+B3hCdRD6ysY0BeFYQ+58PtqsAEVNA8GrPfuOyxbHbH1VJ8Tblbrkx5VoM05saLigjzbQ=="], + "@tscircuit/image-utils": ["@tscircuit/image-utils@0.0.3", "", { "dependencies": { "color-diff": "^1.4.0", "fast-png": "^8.0.0" } }, "sha512-ChgW1GHCm0EPQKaJeMdjSgHz6EXgugGJ3qKjqtbTGDzJvfgMmXn9y6/5cEAFCaKZwttr/aQ4nFGSbZFQXa8Z2A=="], + "@tscircuit/infer-cable-insertion-point": ["@tscircuit/infer-cable-insertion-point@0.0.2", "", { "peerDependencies": { "typescript": "^5" } }, "sha512-k3JwlGtsdHRRZELJzjXBKP+9xdzn+v4dqllhJIFMcrMvlBIaOTt8CbxLO+vcxPvz8Csf+yFChnTos8/vYcSgNg=="], "@tscircuit/infgrid-ijump-astar": ["@tscircuit/infgrid-ijump-astar@0.0.35", "", {}, "sha512-PZx3GyD7mDNEhLJn8+7n8NjrieOvrX03g7Gx1cvwXv9mmgSC4M+yTA0WC4DgOvcRdTnarf0R8xvwtDeJ4tMK9Q=="], @@ -609,6 +610,8 @@ "fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="], + "fast-png": ["fast-png@8.0.0", "", { "dependencies": { "fflate": "^0.8.2", "iobuffer": "^6.0.1" } }, "sha512-gCysNasJ8KEMgfdYIKd/wTDo6ENK1PWT0RJO7O+0pgmuHPw2O6tA1WvdxFRJoLf9V8yFYpG0FA1YgI8X97OhJA=="], + "fast-uri": ["fast-uri@3.1.0", "", {}, "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA=="], "fast-xml-builder": ["fast-xml-builder@1.1.3", "", { "dependencies": { "path-expression-matcher": "^1.1.3" } }, "sha512-1o60KoFw2+LWKQu3IdcfcFlGTW4dpqEWmjhYec6H82AYZU2TVBXep6tMl8Z1Y+wM+ZrzCwe3BZ9Vyd9N2rIvmg=="], @@ -679,6 +682,8 @@ "ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="], + "iobuffer": ["iobuffer@6.0.1", "", {}, "sha512-SZWYkWNfjIXIBYSDpXDYIgshqtbOPsi4lviawAEceR1Kqk+sHDlcQjWrzNQsii80AyBY0q5c8HCTNjqo74ul+Q=="], + "is-arrayish": ["is-arrayish@0.2.1", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="], "is-buffer": ["is-buffer@1.1.6", "", {}, "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="], diff --git a/lib/shared/compare-images.ts b/lib/shared/compare-images.ts index 57687853..16b68004 100644 --- a/lib/shared/compare-images.ts +++ b/lib/shared/compare-images.ts @@ -1,4 +1,4 @@ -import looksSame from "looks-same" +import looksSame from "@tscircuit/image-utils/looks-same" import fs from "node:fs/promises" export const compareAndCreateDiff = async ( diff --git a/package.json b/package.json index 395b97d2..d68f2d51 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@tscircuit/circuit-json-routing-analysis": "^0.0.1", "@tscircuit/fake-snippets": "^0.0.182", "@tscircuit/file-server": "^0.0.32", + "@tscircuit/image-utils": "^0.0.3", "@tscircuit/math-utils": "0.0.36", "@tscircuit/props": "^0.0.496", "@tscircuit/runframe": "^0.0.1748", @@ -51,7 +52,6 @@ "kicadts": "^0.0.24", "kleur": "^4.1.5", "ky": "^1.7.4", - "looks-same": "^9.0.1", "make-vfs": "^1.0.15", "md5": "^2.3.0", "perfect-cli": "^1.0.21", @@ -60,7 +60,6 @@ "prompts": "^2.4.2", "redaxios": "^0.5.1", "semver": "^7.6.3", - "sharp": "0.32.6", "tempy": "^3.1.0", "tscircuit": "0.0.1519-libonly", "tsx": "^4.7.1", diff --git a/scripts/bun-build.ts b/scripts/bun-build.ts index 266b7709..a4aad997 100644 --- a/scripts/bun-build.ts +++ b/scripts/bun-build.ts @@ -18,8 +18,6 @@ const result = await Bun.build({ external: [ ...tscircuitPackageJsonDeps.filter((dep) => !ALLOW_BUNDLING.includes(dep)), "zod", - "looks-same", - "sharp", "tscircuit", "typescript", "circuit-to-svg", diff --git a/scripts/check-for-dependencies.ts b/scripts/check-for-dependencies.ts index 75d37dfe..8cba6a34 100644 --- a/scripts/check-for-dependencies.ts +++ b/scripts/check-for-dependencies.ts @@ -3,7 +3,7 @@ import { readFileSync } from "node:fs" import { exit } from "node:process" -const ALLOWED_DEPENDENCIES = ["looks-same", "sharp"] // Add more allowed runtime deps here +const ALLOWED_DEPENDENCIES: string[] = [] console.log("Checking for non-dev dependencies...")