diff --git a/package.json b/package.json index e4b08b1e4..a9b595153 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ }, "devDependencies": { "@babel/core": "^7.16.0", + "@blazediff/core": "^1.10.0", "@eslint-community/eslint-utils": "^4.4.0", "@testing-library/cypress": "^10.1.3", "@types/jest": "^27.0.2", @@ -68,7 +69,6 @@ "lerna": "^9.0.7", "lint-staged": "^17.0.4", "nodemon": "^3.1.14", - "pixelmatch": "^7.1.0", "playwright": "^1.40.0", "pngjs": "^7.0.0", "prettier": "^3.2.5", diff --git a/scripts/sitemap-visual-diff.ts b/scripts/sitemap-visual-diff.ts index 708cd756c..eab679583 100644 --- a/scripts/sitemap-visual-diff.ts +++ b/scripts/sitemap-visual-diff.ts @@ -9,8 +9,8 @@ import fs from "fs"; import path from "path"; +import blazediff from "@blazediff/core"; import { XMLParser } from "fast-xml-parser"; -import pixelmatch from "pixelmatch"; import { chromium } from "playwright"; import { PNG } from "pngjs"; @@ -245,7 +245,7 @@ function compareImages( prev = cropImage(prev, width, height); } const diff = new PNG({ width: prod.width, height: prod.height }); - const numDiff = pixelmatch( + const numDiff = blazediff( prod.data, prev.data, diff.data, diff --git a/yarn.lock b/yarn.lock index 8701d14c5..b492e9ba8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1306,6 +1306,11 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@blazediff/core@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@blazediff/core/-/core-1.10.0.tgz#cad0666655ed0a81517e5cea68b4013fe8e44459" + integrity sha512-AOQff0zgR7cGsZL+4E7hVkmujoPUpm0J9xzWGWZj5wCjd3gmxESXAPfKyuzs93VdpQNFhHlBhfOjrcZ+XTERtQ== + "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -14539,13 +14544,6 @@ pixelmatch@^4.0.2: dependencies: pngjs "^3.0.0" -pixelmatch@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/pixelmatch/-/pixelmatch-7.2.0.tgz#59f4e6faca733f763756d175e2579ed71369fd72" - integrity sha512-xhcb4yHu9sM/G7foGzoLtXYcC0zHEaOXXjRKhGup0fw78Nf2Tkiapv4EQyMzrbcmQPsllAI7DbFY2UT7PlI9Pg== - dependencies: - pngjs "^7.0.0" - pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"