From 5d758817f3d37f5641f2a24024304c608fda22b1 Mon Sep 17 00:00:00 2001 From: Erek Speed Date: Thu, 19 Dec 2024 20:27:53 +0900 Subject: [PATCH] build(deps): Replace @esm-bundle/chai with chai and sinon-chai at their latest versions (#2335) - Due to change in imports, we need to update all the test files as well to use straight chai. - We can also remove the chai types now that we're using the real version that ships with them. --- extension/test/background_test.ts | 2 +- extension/test/data_test.ts | 2 +- extension/test/docs-annotate-canvas_test.ts | 2 +- extension/test/e2e_visual_test.ts | 2 +- extension/test/parse-word-dict-entry_test.ts | 2 +- extension/test/rikaicontent_test.ts | 2 +- package-lock.json | 201 +++++++------------ package.json | 5 +- 8 files changed, 80 insertions(+), 138 deletions(-) diff --git a/extension/test/background_test.ts b/extension/test/background_test.ts index d8afb9adb..574ec8390 100644 --- a/extension/test/background_test.ts +++ b/extension/test/background_test.ts @@ -1,6 +1,6 @@ import { Config } from '../configuration'; import { RcxMain } from '../rikaichan'; -import { expect, use } from '@esm-bundle/chai'; +import { expect, use } from 'chai'; import chrome from 'sinon-chrome'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; diff --git a/extension/test/data_test.ts b/extension/test/data_test.ts index 6ab5e35fc..cf011b039 100644 --- a/extension/test/data_test.ts +++ b/extension/test/data_test.ts @@ -1,6 +1,6 @@ import { Config } from '../configuration'; import { RcxDict } from '../data'; -import { expect, use } from '@esm-bundle/chai'; +import { expect, use } from 'chai'; import chaiLike from 'chai-like'; import chaiThings from 'chai-things'; import sinonChrome from 'sinon-chrome'; diff --git a/extension/test/docs-annotate-canvas_test.ts b/extension/test/docs-annotate-canvas_test.ts index 3754c77ef..4b9219493 100644 --- a/extension/test/docs-annotate-canvas_test.ts +++ b/extension/test/docs-annotate-canvas_test.ts @@ -1,4 +1,4 @@ -import { expect } from '@esm-bundle/chai'; +import { expect } from 'chai'; declare global { interface Window { diff --git a/extension/test/e2e_visual_test.ts b/extension/test/e2e_visual_test.ts index c8d58db16..79d68e9fb 100644 --- a/extension/test/e2e_visual_test.ts +++ b/extension/test/e2e_visual_test.ts @@ -2,7 +2,7 @@ import { Config } from '../configuration'; import { TestOnlyRcxContent } from '../rikaicontent'; import { resetMouse, sendKeys, sendMouse } from '@web/test-runner-commands'; import { stubbedChrome as sinonChrome } from './chrome_stubs'; -import { use } from '@esm-bundle/chai'; +import { use } from 'chai'; import { visualDiff } from '@web/test-runner-visual-regression'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; diff --git a/extension/test/parse-word-dict-entry_test.ts b/extension/test/parse-word-dict-entry_test.ts index 50533e31e..4f7fc2d3a 100644 --- a/extension/test/parse-word-dict-entry_test.ts +++ b/extension/test/parse-word-dict-entry_test.ts @@ -1,4 +1,4 @@ -import { expect, use } from '@esm-bundle/chai'; +import { expect, use } from 'chai'; import { parseWordDictEntry } from '../parse-word-dict-entry'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; diff --git a/extension/test/rikaicontent_test.ts b/extension/test/rikaicontent_test.ts index 7bbace8ac..166835797 100644 --- a/extension/test/rikaicontent_test.ts +++ b/extension/test/rikaicontent_test.ts @@ -1,7 +1,7 @@ import { Config } from '../configuration'; import { DictEntryData } from '../data'; import { TestOnlyRcxContent } from '../rikaicontent'; -import { expect, use } from '@esm-bundle/chai'; +import { expect, use } from 'chai'; import { html, render } from 'lit-html'; import chrome from 'sinon-chrome'; import simulant from 'simulant'; diff --git a/package-lock.json b/package-lock.json index ff5e10997..0e1eb95cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,14 +17,12 @@ "@commitlint/cli": "^19.6.0", "@commitlint/config-conventional": "^19.6.0", "@eslint/js": "^9.16.0", - "@esm-bundle/chai": "^4.3.4", "@remcovaes/web-test-runner-vite-plugin": "^1.2.2", "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", "@stylelint/postcss-css-in-js": "^0.38.0", "@types/byline": "^4.2.36", - "@types/chai": "^4.3.19", "@types/chai-like": "^1.1.3", "@types/chai-things": "^0.0.38", "@types/chrome": "^0.0.270", @@ -40,6 +38,7 @@ "@web/test-runner-puppeteer": "^0.17.0", "@web/test-runner-visual-regression": "^0.10.0", "byline": "^5.0.0", + "chai": "^5.1.2", "chai-like": "^1.1.3", "chai-things": "^0.2.0", "conventional-changelog-conventionalcommits": "~8.0.0", @@ -69,7 +68,7 @@ "semantic-release-chrome": "^3.2.0", "simulant": "^0.2.2", "sinon": "^19.0.2", - "sinon-chai": "^3.7.0", + "sinon-chai": "^4.0.0", "sinon-chrome": "^3.0.1", "stylelint": "^16.11.0", "stylelint-config-standard": "^36.0.1", @@ -1220,15 +1219,6 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@esm-bundle/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@esm-bundle/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-6Tx35wWiNw7X0nLY9RMx8v3EL8SacCFW+eEZOE9Hc+XxmU5HFE2AFEg+GehUZpiyDGwVvPH75ckGlqC7coIPnA==", - "dev": true, - "dependencies": { - "@types/chai": "^4.2.12" - } - }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -4947,13 +4937,13 @@ } }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, - "peer": true, + "license": "MIT", "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/ast-types": { @@ -5450,22 +5440,20 @@ ] }, "node_modules/chai": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", - "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, - "peer": true, + "license": "MIT", "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chai-like": { @@ -5557,13 +5545,13 @@ } }, "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "peer": true, + "license": "MIT", "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/chokidar": { @@ -6418,16 +6406,13 @@ } }, "node_modules/deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "peer": true, - "dependencies": { - "type-detect": "^4.0.0" - }, + "license": "MIT", "engines": { - "node": ">=0.12" + "node": ">=6" } }, "node_modules/deep-equal": { @@ -8325,16 +8310,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true, - "peer": true, - "engines": { - "node": "*" - } - }, "node_modules/get-intrinsic": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", @@ -10437,14 +10412,11 @@ "dev": true }, "node_modules/loupe": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", - "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", "dev": true, - "peer": true, - "dependencies": { - "get-func-name": "^2.0.0" - } + "license": "MIT" }, "node_modules/lowercase-keys": { "version": "2.0.0", @@ -14851,13 +14823,13 @@ } }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, - "peer": true, + "license": "MIT", "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/pause-stream": { @@ -16545,12 +16517,13 @@ } }, "node_modules/sinon-chai": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz", - "integrity": "sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-4.0.0.tgz", + "integrity": "sha512-cWqO7O2I4XfJDWyWElAQ9D/dtdh5Mo0RHndsfiiYyjWnlPzBJdIvjCVURO4EjyYaC3BjV+ISNXCfTXPXTEIEWA==", "dev": true, + "license": "(BSD-2-Clause OR WTFPL)", "peerDependencies": { - "chai": "^4.0.0", + "chai": "^5.0.0", "sinon": ">=4.0.0" } }, @@ -20481,15 +20454,6 @@ "levn": "^0.4.1" } }, - "@esm-bundle/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@esm-bundle/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-6Tx35wWiNw7X0nLY9RMx8v3EL8SacCFW+eEZOE9Hc+XxmU5HFE2AFEg+GehUZpiyDGwVvPH75ckGlqC7coIPnA==", - "dev": true, - "requires": { - "@types/chai": "^4.2.12" - } - }, "@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -23236,11 +23200,10 @@ "dev": true }, "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "peer": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true }, "ast-types": { "version": "0.13.4", @@ -23596,19 +23559,16 @@ "dev": true }, "chai": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", - "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, - "peer": true, "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" } }, "chai-like": { @@ -23673,11 +23633,10 @@ "dev": true }, "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true, - "peer": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true }, "chokidar": { "version": "3.6.0", @@ -24294,14 +24253,10 @@ } }, "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "peer": true, - "requires": { - "type-detect": "^4.0.0" - } + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true }, "deep-equal": { "version": "1.0.1", @@ -25640,13 +25595,6 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true, - "peer": true - }, "get-intrinsic": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", @@ -27266,14 +27214,10 @@ "dev": true }, "loupe": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", - "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", - "dev": true, - "peer": true, - "requires": { - "get-func-name": "^2.0.0" - } + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", + "dev": true }, "lowercase-keys": { "version": "2.0.0", @@ -30185,11 +30129,10 @@ "dev": true }, "pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, - "peer": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "dev": true }, "pause-stream": { "version": "0.0.11", @@ -31418,9 +31361,9 @@ } }, "sinon-chai": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz", - "integrity": "sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-4.0.0.tgz", + "integrity": "sha512-cWqO7O2I4XfJDWyWElAQ9D/dtdh5Mo0RHndsfiiYyjWnlPzBJdIvjCVURO4EjyYaC3BjV+ISNXCfTXPXTEIEWA==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index d9fa46d8f..61e5ee75d 100644 --- a/package.json +++ b/package.json @@ -55,14 +55,12 @@ "@commitlint/cli": "^19.6.0", "@commitlint/config-conventional": "^19.6.0", "@eslint/js": "^9.16.0", - "@esm-bundle/chai": "^4.3.4", "@remcovaes/web-test-runner-vite-plugin": "^1.2.2", "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", "@stylelint/postcss-css-in-js": "^0.38.0", "@types/byline": "^4.2.36", - "@types/chai": "^4.3.19", "@types/chai-like": "^1.1.3", "@types/chai-things": "^0.0.38", "@types/chrome": "^0.0.270", @@ -78,6 +76,7 @@ "@web/test-runner-puppeteer": "^0.17.0", "@web/test-runner-visual-regression": "^0.10.0", "byline": "^5.0.0", + "chai": "^5.1.2", "chai-like": "^1.1.3", "chai-things": "^0.2.0", "conventional-changelog-conventionalcommits": "~8.0.0", @@ -107,7 +106,7 @@ "semantic-release-chrome": "^3.2.0", "simulant": "^0.2.2", "sinon": "^19.0.2", - "sinon-chai": "^3.7.0", + "sinon-chai": "^4.0.0", "sinon-chrome": "^3.0.1", "stylelint": "^16.11.0", "stylelint-config-standard": "^36.0.1",