From 2729e2e6ea37255d4747dd047acbe29fa15ed991 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 24 May 2026 12:08:55 +0300 Subject: [PATCH 1/3] Replace mocha with vitest --- .c8rc.json | 7 - .mocharc.json | 8 - package-lock.json | 2230 +++++++++-------- package.json | 12 +- test/cli.test.js | 28 +- test/config.test.js | 16 +- test/formats.test.js | 49 +- ...{dependency-tree.test.js => index.test.js} | 122 +- test/node-modules.test.js | 17 +- test/resolvers.test.js | 18 +- test/setup.js | 12 + test/to-list.test.js | 24 +- vitest.config.js | 13 + xo.config.js | 10 - 14 files changed, 1360 insertions(+), 1206 deletions(-) delete mode 100644 .c8rc.json delete mode 100644 .mocharc.json rename test/{dependency-tree.test.js => index.test.js} (82%) create mode 100644 test/setup.js create mode 100644 vitest.config.js diff --git a/.c8rc.json b/.c8rc.json deleted file mode 100644 index 599b524..0000000 --- a/.c8rc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "reporter": [ - "html", - "lcovonly", - "text" - ] -} diff --git a/.mocharc.json b/.mocharc.json deleted file mode 100644 index 8f59e6e..0000000 --- a/.mocharc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "check-leaks": false, - "timeout": 10000, - "throw-deprecation": true, - "trace-deprecation": true, - "trace-warnings": true, - "use-strict": true -} diff --git a/package-lock.json b/package-lock.json index 981d8fe..1d4a5af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,12 +19,10 @@ "dependency-tree": "bin/cli.js" }, "devDependencies": { - "c8": "^11.0.0", + "@vitest/coverage-v8": "^4.1.7", "debug": "^4.4.3", - "globals": "^17.6.0", - "mocha": "^11.7.5", "mock-fs": "^5.5.0", - "sinon": "^22.0.0", + "vitest": "^4.1.7", "xo": "^2.0.2" }, "engines": { @@ -838,34 +836,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", - "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", @@ -966,6 +936,16 @@ "node": ">= 8" } }, + "node_modules/@oxc-project/types": { + "version": "0.132.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.132.0.tgz", + "integrity": "sha512-FESMOxil5Se014ui/Eq8fT5uHJo6nIRwH0PfJrZJXs6Gek3ZVFOrpUv3YIZT20m+extU98Hg1Ym72U58rlsxUQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, "node_modules/@package-json/types": { "version": "0.0.12", "resolved": "https://registry.npmjs.org/@package-json/types/-/types-0.0.12.tgz", @@ -973,17 +953,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@pkgr/core": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", @@ -997,6 +966,307 @@ "url": "https://opencollective.com/pkgr" } }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.2.tgz", + "integrity": "sha512-ZS4D1JPGn/MYQN/SYDWftIE/nVsM8j/AFOYEzAoOE2O3NktQOZru+/vYXGbR/qtdLdIfGCP0lcoJiYVzsEz+iQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.2.tgz", + "integrity": "sha512-vdFA9+C/rekyGce7WqHs/xoT0ioZEWaOFyZLIV1mEeNFaFDUQrPIo8Vs2GvJ6eetb3rzDUtUBgzto3ExpXJB3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.2.tgz", + "integrity": "sha512-BewSOwTHazv77DTYiAZXSqqKZ4KP/KonFisDMVU7PImxoWfB2aepnPhd2E4SWz3zDzYgDNbs6jBmTdgNnF02GA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.2.tgz", + "integrity": "sha512-m41o7M0YWtUdqk61Tb+jnKb2rN++iRdIASlExkUoKfIAH30DOHCB8fVLzSUpbWHHU8esmEioY62PxzexE8MBuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.2.tgz", + "integrity": "sha512-jcojB9H7W/jS29pMKWAK1N+fU99vXodHDTatS3b3y/XSOCiHo0kkA74pL3jJmkoQtYpOCxDvaKs1fo2Ij/1X5w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.2.tgz", + "integrity": "sha512-1jn6qDU5iiOgFgygDzKUuKP0maTi0/f1+sBLgvij/76C77Nm3ts6ufz9Bjg5q5dduxiUIxtq86JIoBvo1xQ4Ig==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.2.tgz", + "integrity": "sha512-QVLO/czFMdoMFSqlX3bcswcJNm/23r+qoa/jgtmFc/qEp6/jXmIkDjF/XIo8dPfGaiwy1xfQn8o77L79GeXFgw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.2.tgz", + "integrity": "sha512-hgO5Abm0w5UL6FEa2iFnZqo2KlK7TQ5QhV5x09hujBf7t5KzHQ1VmfPuTpqRy/rNlSxua3eWH374xxiVrP+lcA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.2.tgz", + "integrity": "sha512-fy8rXxuYEu602abC8MUNaPjYLIFzReOaEIEMKMUa0rFEUxNpVXhs15KSSQ4qlqSaM7B6rcj9rDZgADh/IGDzLQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.2.tgz", + "integrity": "sha512-0+bOkiQ779+r1WpoHOWHqncvyySci0vKph+myNDYb+im6meJAzHQXay6oEgnkHuUGouM1LKTZwqKpBow6Kj7CQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.2.tgz", + "integrity": "sha512-mjSkrzZK5Qsl0a9d1JgILOiuZOSDTVdKENcSXBoqbzSrspLR/4/IRVDo5wd2GgZjNss/viBFJdeq+j7qH2nypw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.2.tgz", + "integrity": "sha512-1v5vHasdfQAZoEHakBV72LIFAC9JjnymsiKxp+GEr/ma3+NJCPSaYK+qavInOovJkgwFrs7GccX2d6IgDA3Z5w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.2.tgz", + "integrity": "sha512-mb1VobWn6NheziTk5/WEaR6AKVbrwT5sOi6C7zk3gy/pD1qtJfU1j4PgTo2NJnOtbL9Dl3Aeei8w9jJ7qC2jZQ==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", + "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.2.tgz", + "integrity": "sha512-SqKonF56vA/L2yHwHYcEp2P34URpOZ7d1fS635cTkpDnUtEGdUbhI6NzsPdqeSWvAAeGDrxjWjNmibDIdFf9/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.2.tgz", + "integrity": "sha512-v7qRI7gXLRINcOGXt+7YmAZ6iFuyZVMIoXAxhd8oP+DR9dLfL9GfNIx7PLMxmhZdvq8waUJBQiWN9EKNy+TRBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, "node_modules/@sec-ant/readable-stream": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", @@ -1030,46 +1300,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "type-detect": "4.0.8" - } - }, - "node_modules/@sinonjs/fake-timers": { - "version": "15.4.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.4.0.tgz", - "integrity": "sha512-DsG+8/LscQIQg68J6Ef3dv10u6nVyetYn923s3/sus5eaGfTo1of5WMZSLf0UJc9KDuKPilPH0UDJCjvNbDNCA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1" - } - }, - "node_modules/@sinonjs/samsam": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-10.0.2.tgz", - "integrity": "sha512-8lVwD1Df1BmzoaOLhMcGGcz/Jyr5QY2KSB75/YK1QgKzoabTeLdIVyhXNZK9ojfSKSdirbXqdbsXXqP9/Ve8+A==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1", - "type-detect": "^4.1.0" - } - }, - "node_modules/@sinonjs/samsam/node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } + "license": "MIT" }, "node_modules/@stylistic/eslint-plugin": { "version": "5.10.0", @@ -1134,6 +1370,24 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/eslint": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", @@ -1159,13 +1413,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1675,47 +1922,201 @@ "node": ">=14.0.0" } }, - "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz", - "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==", - "cpu": [ - "arm64" - ], + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz", + "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz", + "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz", + "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@vitest/coverage-v8": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.7.tgz", + "integrity": "sha512-qsYPeXc5Q9dFLd1i8Ap+Bx8sQgcp+rFVQo4R0dDsWNBzl26ldVF1qOO+RL24K7FDrR6pA+50XedRLSoSG24bVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^1.0.2", + "@vitest/utils": "4.1.7", + "ast-v8-to-istanbul": "^1.0.0", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.2.0", + "magicast": "^0.5.2", + "obug": "^2.1.1", + "std-env": "^4.0.0-rc.1", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/browser": "4.1.7", + "vitest": "4.1.7" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } + } + }, + "node_modules/@vitest/expect": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.7.tgz", + "integrity": "sha512-1R+tw0ortHEbZDGMymm+pN7/AFQ/RkFFdtd7EN+VBpynKmLbP8A3rpEXdshBJ7+8hQ9zBJh/i1s0yKNtxAnU7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.7", + "@vitest/utils": "4.1.7", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.7.tgz", + "integrity": "sha512-vY7nuamKgfvpA1Koa3oYIw/k7D6kZnpGyNMZW8loow2bsBYla1TFdqTaXncWdRn4pgwNs+90RhnXhJScDwQeJA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.7", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.7.tgz", + "integrity": "sha512-umgCarTOYQWIaDMvGDRZij+6b9oVeLIyJzfN+AS88e0ZOU3QTgNNSTtjQOpcvWr3np1N0j4WgZj+sb3oYBDscw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.7.tgz", + "integrity": "sha512-BapjmAQ2aI78WdMEfeUWivnfVzB+VPGwWRQcJE0OUq7qEeEcBsCSf+0T5iREBNE5nBb4wA5Ya0W6IA+sghdEFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.7", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.7.tgz", + "integrity": "sha512-ZacLzja+TmJeZ1h14xW2FB/WpeimUD3haBXQPyJqxvo8jQTmfeA8zv58mtjN2C7EHXZDYVcVYdYmAxjkWVvKCw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "dependencies": { + "@vitest/pretty-format": "4.1.7", + "@vitest/utils": "4.1.7", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } }, - "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz", - "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==", - "cpu": [ - "ia32" - ], + "node_modules/@vitest/spy": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.7.tgz", + "integrity": "sha512-kbkI5LMWakyuTIvs6fUJ5qdIVb1XVKsYJAT4OJ938cHMROYMSfmoQdZy0aaAnjbbc8F61vkoTqz/Az+/HiIu5Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "funding": { + "url": "https://opencollective.com/vitest" + } }, - "node_modules/@unrs/resolver-binding-win32-x64-msvc": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz", - "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==", - "cpu": [ - "x64" - ], + "node_modules/@vitest/utils": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.7.tgz", + "integrity": "sha512-T532WBu791cBxJlCl6SO+J14l81DQx6uQHm1bQbmCDY7nqlEIgkza/UFnSBNaUtSf41unldDFjdOBYEQC4b5Hw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "dependencies": { + "@vitest/pretty-format": "4.1.7", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } }, "node_modules/@vue/compiler-core": { "version": "3.5.34", @@ -1848,6 +2249,7 @@ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -2022,6 +2424,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/ast-module-types": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-7.0.0.tgz", @@ -2031,6 +2443,35 @@ "node": ">=20.19.0 || >=22.12.0" } }, + "node_modules/ast-v8-to-istanbul": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.0.tgz", + "integrity": "sha512-1fSfIwuDICFA4LKkCzRPO7F0hzFf0B7+Xqrl27ynQaa+Rh0e1Es0v6kWHPott3lU10AyAr7oKHa65OppjLn3Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.31", + "estree-walker": "^3.0.3", + "js-tokens": "^10.0.0" + } + }, + "node_modules/ast-v8-to-istanbul/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/ast-v8-to-istanbul/node_modules/js-tokens": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", + "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", + "dev": true, + "license": "MIT" + }, "node_modules/async-function": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", @@ -2100,13 +2541,6 @@ "node": ">=8" } }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true, - "license": "ISC" - }, "node_modules/browserslist": { "version": "4.28.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", @@ -2170,40 +2604,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/c8": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/c8/-/c8-11.0.0.tgz", - "integrity": "sha512-e/uRViGHSVIJv7zsaDKM7VRn2390TgHXqUSvYwPHBQaU6L7E9L0n9JbdkwdYPvshDT0KymBmmlwSpms3yBaMNg==", - "dev": true, - "license": "ISC", - "dependencies": { - "@bcoe/v8-coverage": "^1.0.1", - "@istanbuljs/schema": "^0.1.3", - "find-up": "^5.0.0", - "foreground-child": "^3.1.1", - "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.1.6", - "test-exclude": "^8.0.0", - "v8-to-istanbul": "^9.0.0", - "yargs": "^17.7.2", - "yargs-parser": "^21.1.1" - }, - "bin": { - "c8": "bin/c8.js" - }, - "engines": { - "node": "20 || >=22" - }, - "peerDependencies": { - "monocart-coverage-reports": "^2" - }, - "peerDependenciesMeta": { - "monocart-coverage-reports": { - "optional": true - } - } - }, "node_modules/call-bind": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", @@ -2264,19 +2664,6 @@ "node": ">=6" } }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001793", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz", @@ -2298,12 +2685,23 @@ ], "license": "CC-BY-4.0" }, + "node_modules/chai": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2322,22 +2720,6 @@ "dev": true, "license": "MIT" }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/ci-info": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", @@ -2377,90 +2759,13 @@ "node": ">=0.8.0" } }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2648,19 +2953,6 @@ } } }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -2747,6 +3039,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/detective-amd": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-7.0.0.tgz", @@ -2879,16 +3181,6 @@ "typescript": "^5.4.4 || ^6.0.2" } }, - "node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -2917,13 +3209,6 @@ "node": ">= 0.4" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, "node_modules/electron-to-chromium": { "version": "1.5.357", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.357.tgz", @@ -2931,13 +3216,6 @@ "dev": true, "license": "ISC" }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, "node_modules/enhance-visitors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/enhance-visitors/-/enhance-visitors-1.0.0.tgz", @@ -3138,6 +3416,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz", + "integrity": "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", @@ -3998,6 +4283,16 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -4210,16 +4505,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "license": "BSD-3-Clause", - "bin": { - "flat": "cli.js" - } - }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -4257,21 +4542,19 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/function-bind": { @@ -4347,16 +4630,6 @@ "node": ">=20.19.0 || >=22.12.0" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, "node_modules/get-east-asian-width": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", @@ -4476,28 +4749,6 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/glob": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", - "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", - "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -4705,18 +4956,8 @@ "dependencies": { "function-bind": "^1.1.2" }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "license": "MIT", - "bin": { - "he": "bin/he" + "engines": { + "node": ">= 0.4" } }, "node_modules/hermes-estree": { @@ -5027,16 +5268,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-generator-function": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", @@ -5164,16 +5395,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", @@ -5308,19 +5529,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-url-superb": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", @@ -5466,22 +5674,6 @@ "node": ">= 0.4" } }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5595,6 +5787,279 @@ "node": ">= 0.8.0" } }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/line-column-path": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/line-column-path/-/line-column-path-4.0.0.tgz", @@ -5649,23 +6114,6 @@ "license": "MIT", "peer": true }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -5679,20 +6127,25 @@ "loose-envify": "cli.js" } }, - "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, - "license": "ISC" - }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/magicast": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.3.tgz", + "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.3", + "@babel/types": "^7.29.0", + "source-map-js": "^1.2.1" } }, "node_modules/make-dir": { @@ -5810,69 +6263,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mocha": { - "version": "11.7.5", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", - "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", - "dev": true, - "license": "MIT", - "dependencies": { - "browser-stdout": "^1.3.1", - "chokidar": "^4.0.1", - "debug": "^4.3.5", - "diff": "^7.0.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "glob": "^10.4.5", - "he": "^1.2.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "log-symbols": "^4.1.0", - "minimatch": "^9.0.5", - "ms": "^2.1.3", - "picocolors": "^1.1.1", - "serialize-javascript": "^6.0.2", - "strip-json-comments": "^3.1.1", - "supports-color": "^8.1.1", - "workerpool": "^9.2.0", - "yargs": "^17.7.2", - "yargs-parser": "^21.1.1", - "yargs-unparser": "^2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/mock-fs": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-5.5.0.tgz", @@ -6162,6 +6552,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/obug": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", + "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT" + }, "node_modules/open": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz", @@ -6270,13 +6671,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -6348,22 +6742,12 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "license": "MIT" }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "license": "MIT" }, "node_modules/picocolors": { "version": "1.1.1", @@ -6626,16 +7010,6 @@ "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", "license": "MIT" }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -6643,20 +7017,6 @@ "dev": true, "license": "MIT" }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -6724,16 +7084,6 @@ "regjsparser": "bin/parser" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requirejs": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.8.tgz", @@ -6821,6 +7171,40 @@ "node": ">=0.10.0" } }, + "node_modules/rolldown": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.2.tgz", + "integrity": "sha512-oZx5zVDtVB44AW3eaifgDml1gWRDZGvjcfdxonE4swNPG98PrrXjaO/KrnUjzlMnztCCRVlUueA1kCXhARGk6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.132.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.2", + "@rolldown/binding-darwin-arm64": "1.0.2", + "@rolldown/binding-darwin-x64": "1.0.2", + "@rolldown/binding-freebsd-x64": "1.0.2", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.2", + "@rolldown/binding-linux-arm64-gnu": "1.0.2", + "@rolldown/binding-linux-arm64-musl": "1.0.2", + "@rolldown/binding-linux-ppc64-gnu": "1.0.2", + "@rolldown/binding-linux-s390x-gnu": "1.0.2", + "@rolldown/binding-linux-x64-gnu": "1.0.2", + "@rolldown/binding-linux-x64-musl": "1.0.2", + "@rolldown/binding-openharmony-arm64": "1.0.2", + "@rolldown/binding-wasm32-wasi": "1.0.2", + "@rolldown/binding-win32-arm64-msvc": "1.0.2", + "@rolldown/binding-win32-x64-msvc": "1.0.2" + } + }, "node_modules/run-applescript": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", @@ -6878,27 +7262,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/safe-push-apply": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", @@ -6962,16 +7325,6 @@ "node": ">=10" } }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -7120,6 +7473,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -7133,33 +7493,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/sinon": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-22.0.0.tgz", - "integrity": "sha512-sq/6DpdXOrLyfbKlXLg/Usc7xu8YXPeLkOFZRvA3bNUSA2lhbrZ06yuXbH1fkzBPCbz9O10+7hznzUsjaYNm0Q==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1", - "@sinonjs/fake-timers": "^15.4.0", - "@sinonjs/samsam": "^10.0.2", - "diff": "^9.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/sinon" - } - }, - "node_modules/sinon/node_modules/diff": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz", - "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/slash": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", @@ -7202,6 +7535,20 @@ "node": ">=12.0.0" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.1.0.tgz", + "integrity": "sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==", + "dev": true, + "license": "MIT" + }, "node_modules/stop-iteration-iterator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", @@ -7216,70 +7563,6 @@ "node": ">= 0.4" } }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/string.prototype.matchall": { "version": "4.0.12", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", @@ -7408,30 +7691,6 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -7473,6 +7732,7 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" }, @@ -7586,122 +7846,40 @@ "dev": true, "license": "MIT", "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/tapable": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", - "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/test-exclude": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-8.0.0.tgz", - "integrity": "sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^13.0.6", - "minimatch": "^10.2.2" - }, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/test-exclude/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/test-exclude/node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "minimatch": "^10.2.2", - "minipass": "^7.1.3", - "path-scurry": "^2.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/test-exclude/node_modules/lru-cache": { - "version": "11.3.6", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.3.6.tgz", - "integrity": "sha512-Gf/KoL3C/MlI7Bt0PGI9I+TeTC/I6r/csU58N4BSNc4lppLBeKsOdFYkK+dX0ABDUMJNfCHTyPpzwwO21Awd3A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.5" - }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "license": "MIT", "engines": { - "node": "18 || 20 || >=22" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/test-exclude/node_modules/path-scurry": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", - "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.2.tgz", + "integrity": "sha512-M/Q0B2cp4K7kynaT/vnED1j8TlLY+Pp7C6Wl2bl/7u/F0mUVwdyOpwomQb8JpYLitHUssAJRmLZdMCGsrx7i+g==", + "dev": true, + "license": "MIT", "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=18" } }, "node_modules/tinyglobby": { @@ -7720,6 +7898,16 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tinyrainbow": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", + "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7803,16 +7991,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/type-fest": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.6.0.tgz", @@ -8052,19 +8230,172 @@ "punycode": "^2.1.0" } }, - "node_modules/v8-to-istanbul": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", - "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "node_modules/vite": { + "version": "8.0.14", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.14.tgz", + "integrity": "sha512-s4BJJ+5y1pYL6Otw51FHhVJQhPnuRinKig64g/1+EUNaJsd3gCKdD31IPFvswUgW9/60QT9oFHbZHbQK5imcxw==", "dev": true, - "license": "ISC", + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.15", + "rolldown": "1.0.2", + "tinyglobby": "^0.2.16" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.18", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.7.tgz", + "integrity": "sha512-flYyaFd2CgoCoU+0UKt3pxksgC+S02iTDN0n3LtqaMeXsI9SBcdNujc2k0DeFLzUn/0k538yNjOSdwgCqcrwJA==", + "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^2.0.0" + "@vitest/expect": "4.1.7", + "@vitest/mocker": "4.1.7", + "@vitest/pretty-format": "4.1.7", + "@vitest/runner": "4.1.7", + "@vitest/snapshot": "4.1.7", + "@vitest/spy": "4.1.7", + "@vitest/utils": "4.1.7", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" }, "engines": { - "node": ">=10.12.0" + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.7", + "@vitest/browser-preview": "4.1.7", + "@vitest/browser-webdriverio": "4.1.7", + "@vitest/coverage-istanbul": "4.1.7", + "@vitest/coverage-v8": "4.1.7", + "@vitest/ui": "4.1.7", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } } }, "node_modules/which": { @@ -8172,116 +8503,31 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/workerpool": { - "version": "9.3.4", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", - "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dev": true, "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "siginfo": "^2.0.0", + "stackback": "0.0.2" }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" + "bin": { + "why-is-node-running": "cli.js" }, "engines": { "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=0.10.0" } }, "node_modules/wsl-utils": { @@ -8625,16 +8871,6 @@ "node": ">=14.17" } }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -8642,106 +8878,6 @@ "dev": true, "license": "ISC" }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index c3891c4..322eeb7 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,9 @@ "check:types": "npm run generate:types && git diff HEAD --exit-code types/index.d.ts", "lint": "xo", "fix": "xo --fix", - "mocha": "mocha \"test/*.test.js\"", - "test": "npm run lint && npm run check:types && npm run mocha", - "test:ci": "c8 npm run mocha" + "vitest": "vitest", + "test": "npm run lint && npm run check:types && vitest run", + "test:ci": "vitest run --coverage" }, "repository": { "type": "git", @@ -63,12 +63,10 @@ "typescript": "^6.0.3" }, "devDependencies": { - "c8": "^11.0.0", + "@vitest/coverage-v8": "^4.1.7", "debug": "^4.4.3", - "globals": "^17.6.0", - "mocha": "^11.7.5", "mock-fs": "^5.5.0", - "sinon": "^22.0.0", + "vitest": "^4.1.7", "xo": "^2.0.2" } } diff --git a/test/cli.test.js b/test/cli.test.js index 9567ebf..386a9fe 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -1,10 +1,10 @@ -import { strict as assert } from 'node:assert'; import { spawnSync } from 'node:child_process'; import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import process from 'node:process'; import { fileURLToPath } from 'node:url'; +import { describe, it, expect } from 'vitest'; import { fixtures } from './helpers.js'; const cliPath = fileURLToPath(new URL('../bin/cli.js', import.meta.url)); @@ -15,9 +15,9 @@ describe('cli', () => { encoding: 'utf8' }); - assert.equal(result.status, 1); - assert.match(result.stderr, /error: missing required argument 'filename'/); - assert.match(result.stderr, /Usage: dependency-tree \[options] /); + expect(result.status).toBe(1); + expect(result.stderr).toMatch(/error: missing required argument 'filename'/); + expect(result.stderr).toMatch(/Usage: dependency-tree \[options] /); }); describe('--es6-mixed-imports', () => { @@ -31,13 +31,13 @@ describe('cli', () => { { encoding: 'utf8' } ); - assert.equal(result.status, 0, result.stderr); + expect(result.status).toBe(0); const lines = result.stdout.trimEnd().split('\n'); const basenames = new Set(lines.map(line => path.basename(line))); - assert.ok(basenames.has('esm.js'), 'esm.js should be detected'); - assert.ok(basenames.has('cjs.js'), 'cjs.js should be detected'); + expect(basenames).toContain('esm.js'); + expect(basenames).toContain('cjs.js'); }); }); @@ -53,19 +53,17 @@ describe('cli', () => { { encoding: 'utf8' } ); - assert.equal(result.status, 0, result.stderr); + expect(result.status).toBe(0); const lines = result.stdout.trimEnd().split('\n'); - assert.equal(lines.length, 3); - assert.equal(path.resolve(lines.at(-1)), path.resolve(entry)); + expect(lines).toHaveLength(3); + expect(path.resolve(lines.at(-1))).toBe(path.resolve(entry)); }); }); describe('default (non-list) output', () => { - it('does not crash where JSON.stringify would exceed V8 string length limits (issue #141)', function() { - this.timeout(20_000); - + it('does not crash where JSON.stringify would exceed V8 string length limits (issue #141)', () => { // Build a diamond dependency fixture: every pair at depth k requires both // files at depth k+1. traverse() memoises via config.visited and returns // the SAME JS object reference for every re-visit of a file, so @@ -104,10 +102,10 @@ describe('cli', () => { { stdio: ['ignore', 'ignore', 'pipe'], encoding: 'utf8' } ); - assert.equal(result.status, 0, result.stderr); + expect(result.status).toBe(0); } finally { fs.rmSync(tmpDir, { recursive: true, force: true }); } - }); + }, 20_000); }); }); diff --git a/test/config.test.js b/test/config.test.js index 48d2b25..be268ad 100644 --- a/test/config.test.js +++ b/test/config.test.js @@ -1,5 +1,5 @@ -import { strict as assert } from 'node:assert'; import path from 'node:path'; +import { describe, it, expect } from 'vitest'; import Config from '../lib/config.js'; import dependencyTree from '../index.js'; import { fixtures } from './helpers.js'; @@ -13,7 +13,7 @@ describe('Config', () => { tsConfig: tsConfigPath }); - assert.equal(typeof config.tsConfig, 'object'); + expect(config.tsConfig).toBeTypeOf('object'); }); it('includes tsConfigPath so filing-cabinet can resolve compilerOptions.paths', () => { @@ -24,7 +24,7 @@ describe('Config', () => { tsConfig: tsConfigPath }); - assert.equal(config.tsConfigPath, tsConfigPath); + expect(config.tsConfigPath).toBe(tsConfigPath); }); it('retains detective config in the clone', () => { @@ -42,7 +42,7 @@ describe('Config', () => { const clone = config.clone(); - assert.deepEqual(clone.detectiveConfig, detectiveConfig); + expect(clone.detectiveConfig).toStrictEqual(detectiveConfig); }); }); @@ -59,8 +59,8 @@ describe('noTypeDefinitions', () => { noTypeDefinitions: false }); - assert.equal(list.includes(dtsPath), true); - assert.equal(list.includes(jsPath), false); + expect(list).toContain(dtsPath); + expect(list).not.toContain(jsPath); }); it('resolves to JavaScript files when set to true', () => { @@ -70,7 +70,7 @@ describe('noTypeDefinitions', () => { noTypeDefinitions: true }); - assert.equal(list.includes(jsPath), true); - assert.equal(list.includes(dtsPath), false); + expect(list).toContain(jsPath); + expect(list).not.toContain(dtsPath); }); }); diff --git a/test/formats.test.js b/test/formats.test.js index 9b7063c..ce37d52 100644 --- a/test/formats.test.js +++ b/test/formats.test.js @@ -1,6 +1,12 @@ -import { strict as assert } from 'node:assert'; import path from 'node:path'; import mockfs from 'mock-fs'; +import { + describe, + it, + expect, + beforeEach, + afterEach +} from 'vitest'; import Config from '../lib/config.js'; import dependencyTree from '../index.js'; import { @@ -19,9 +25,9 @@ function testTreesForFormat(format, ext = '.js') { const tree = dependencyTree({ filename, directory }); const subTree = tree[filename]; - assert.ok(tree instanceof Object); - assert.ok(subTree instanceof Object); - assert.equal(Object.keys(subTree).length, 2); + expect(tree).toBeInstanceOf(Object); + expect(subTree).toBeInstanceOf(Object); + expect(Object.keys(subTree)).toHaveLength(2); }); } @@ -54,7 +60,7 @@ describe('module formats', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.includes(barPath), true); + expect(deps).toContain(barPath); }); }); @@ -87,7 +93,7 @@ describe('module formats', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.includes(moduleEntryPath), true); + expect(deps).toContain(moduleEntryPath); }); }); }); @@ -107,7 +113,7 @@ describe('module formats', () => { const tree = dependencyTree({ filename, directory }); const subTree = tree[filename]; - assert.ok(subTree[path.normalize(`${directory}/c.js`)]); + expect(subTree[path.normalize(`${directory}/c.js`)]).toBeDefined(); }); it('resolves files with a jsx extension', () => { @@ -116,7 +122,7 @@ describe('module formats', () => { const tree = dependencyTree({ filename, directory }); const subTree = tree[filename]; - assert.ok(subTree[path.normalize(`${directory}/b.js`)]); + expect(subTree[path.normalize(`${directory}/b.js`)]).toBeDefined(); }); it('resolves files that have es7', () => { @@ -125,7 +131,7 @@ describe('module formats', () => { const tree = dependencyTree({ filename, directory }); const subTree = tree[filename]; - assert.ok(subTree[path.normalize(`${directory}/c.js`)]); + expect(subTree[path.normalize(`${directory}/c.js`)]).toBeDefined(); }); describe('when given an es6 file using CJS lazy requires', () => { @@ -154,7 +160,7 @@ describe('module formats', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.includes(barPath), true); + expect(deps).toContain(barPath); }); it('toList includes the lazy dependency when mixedImports is on', () => { @@ -171,8 +177,7 @@ describe('module formats', () => { } }); - assert.equal(results[0], barPath); - assert.equal(results[1], filename); + expect(results).toStrictEqual([barPath, filename]); }); it('does not include the lazy dependency when mixedImports is off', () => { @@ -183,7 +188,7 @@ describe('module formats', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.includes(barPath), false); + expect(deps).not.toContain(barPath); }); }); @@ -203,7 +208,7 @@ describe('module formats', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.includes(barPath), true); + expect(deps).toContain(barPath); }); }); }); @@ -250,9 +255,7 @@ describe('module formats', () => { const depB = path.join(directory, 'b.ts'); const depC = path.join(directory, 'c.ts'); - assert.equal(results[0], depB); - assert.equal(results[1], depC); - assert.equal(results[2], filename); + expect(results).toStrictEqual([depB, depC, filename]); }); it('supports tsx files', () => { @@ -263,7 +266,7 @@ describe('module formats', () => { const depC = path.join(directory, 'c.ts'); - assert.equal(results[0], depC); + expect(results[0]).toBe(depC); }); it('excludes type-only imports when skipTypeImports is set', () => { @@ -281,9 +284,9 @@ describe('module formats', () => { const regularDep = path.join(directory, 'c.ts'); const typeOnlyDep = path.join(directory, 'b.ts'); - assert.equal(results.includes(regularDep), true); - assert.equal(results.includes(typeOnlyDep), false); - assert.equal(results.length, 2); + expect(results).toContain(regularDep); + expect(results).not.toContain(typeOnlyDep); + expect(results).toHaveLength(2); }); it('recognizes ts file import from js file when allowJs is on (#104)', () => { @@ -298,13 +301,13 @@ describe('module formats', () => { }; const parsedTsConfig = new Config(options).tsConfig; - assert.equal(parsedTsConfig.compilerOptions.allowJs, true); + expect(parsedTsConfig.compilerOptions.allowJs).toBe(true); const results = dependencyTree.toList(options); const depB = path.join(directory, 'b.ts'); - assert.equal(results[0], depB); + expect(results[0]).toBe(depB); }); }); }); diff --git a/test/dependency-tree.test.js b/test/index.test.js similarity index 82% rename from test/dependency-tree.test.js rename to test/index.test.js index 1ee2bc0..573a5ee 100644 --- a/test/dependency-tree.test.js +++ b/test/index.test.js @@ -1,10 +1,15 @@ -import { strict as assert } from 'node:assert'; import path from 'node:path'; import process from 'node:process'; import { createRequire } from 'node:module'; import mockfs from 'mock-fs'; import precinct from 'precinct'; -import sinon from 'sinon'; +import { + describe, + it, + expect, + afterEach, + vi +} from 'vitest'; import dependencyTree from '../index.js'; import { fixtures } from './helpers.js'; @@ -24,8 +29,7 @@ describe('dependencyTree', () => { const filename = `${root}/notafile.js`; const tree = dependencyTree({ filename, root }); - assert.ok(tree instanceof Object); - assert.equal(Object.keys(tree).length, 0); + expect(tree).toStrictEqual({}); }); it('handles nested tree structures', () => { @@ -37,11 +41,11 @@ describe('dependencyTree', () => { const bTree = subTree[path.normalize(`${directory}/b.js`)]; const cTree = subTree[path.normalize(`${directory}/c.js`)]; - assert.ok(tree instanceof Object); - assert.ok(subTree instanceof Object); - assert.equal(Object.keys(subTree).length, 2); // b and c - assert.equal(Object.keys(bTree).length, 2); // d and e - assert.equal(Object.keys(cTree).length, 2); // f and g + expect(tree).toBeInstanceOf(Object); + expect(subTree).toBeInstanceOf(Object); + expect(Object.keys(subTree)).toHaveLength(2); // b and c + expect(Object.keys(bTree)).toHaveLength(2); // d and e + expect(Object.keys(cTree)).toHaveLength(2); // f and g }); it('does not include files that are not real (#13)', () => { @@ -58,7 +62,7 @@ describe('dependencyTree', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.includes('notReal'), false); + expect(deps).not.toContain('notReal'); }); it('does not choke on cyclic dependencies', () => { @@ -75,7 +79,7 @@ describe('dependencyTree', () => { const tree = dependencyTree({ filename, directory }); const deps = Object.keys(tree[filename]); - assert.notEqual(deps.length, 0); + expect(deps.length).toBeGreaterThan(0); }); it('excludes Node.js core modules by default', () => { @@ -86,8 +90,8 @@ describe('dependencyTree', () => { const deps = Object.keys(tree[filename]); const firstKey = Object.keys(tree)[0]; - assert.equal(deps.length, 0); - assert.equal(firstKey.includes('b.js'), true); + expect(deps).toHaveLength(0); + expect(firstKey).toContain('b.js'); }); it('traverses installed 3rd party node modules', () => { @@ -98,7 +102,7 @@ describe('dependencyTree', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.includes(resolve('debug')), true); + expect(deps).toContain(resolve('debug')); }); it('returns a list of absolutely pathed files', () => { @@ -109,7 +113,7 @@ describe('dependencyTree', () => { for (const node in tree.nodes) { if (Object.hasOwn(tree.nodes, node)) { - assert.equal(node.includes(process.cwd()), true); + expect(node).toContain(process.cwd()); } } }); @@ -130,7 +134,7 @@ describe('dependencyTree', () => { directory: 'root' }); - assert.equal(tree.length, 3); + expect(tree).toHaveLength(3); }); it('resolves TypeScript imports to their type definition files by default', () => { @@ -141,12 +145,12 @@ describe('dependencyTree', () => { const list = dependencyTree.toList({ filename, directory }); - assert.equal(list.includes(dtsPath), true); - assert.equal(list.includes(jsPath), false); + expect(list).toContain(dtsPath); + expect(list).not.toContain(jsPath); }); it('passes detective config through to precinct', () => { - const spy = sinon.spy(precinct, 'paperwork'); + const spy = vi.spyOn(precinct, 'paperwork'); const directory = fixtures('onlyRealDeps'); const filename = path.normalize(`${directory}/a.js`); const detectiveConfig = { @@ -161,8 +165,8 @@ describe('dependencyTree', () => { detective: detectiveConfig }); - assert.equal(spy.calledWith(filename, detectiveConfig), true); - spy.restore(); + expect(spy).toHaveBeenCalledWith(filename, detectiveConfig); + spy.mockRestore(); }); it('uses the filter to determine if a file should be included in the results', () => { @@ -176,8 +180,8 @@ describe('dependencyTree', () => { filter(filePath, moduleFile) { const normalizedModuleFile = moduleFile.replaceAll('\\', '/'); const expectedPath = path.normalize('test/fixtures/onlyRealDeps/a.js').replaceAll('\\', '/'); - assert.ok(resolve('debug')); - assert.ok(normalizedModuleFile.match(expectedPath)); + expect(resolve('debug')).toBeDefined(); + expect(normalizedModuleFile).toMatch(expectedPath); return !filePath.includes('node_modules'); } }); @@ -186,8 +190,8 @@ describe('dependencyTree', () => { const deps = Object.keys(subTree); const treeKeys = Object.keys(tree); - assert.notEqual(treeKeys.length, 0); - assert.equal(deps.includes(resolve('debug')), false); + expect(treeKeys.length).toBeGreaterThan(0); + expect(deps).not.toContain(resolve('debug')); }); it('stores invalid partials in the nonExistent list', () => { @@ -203,8 +207,7 @@ describe('dependencyTree', () => { dependencyTree({ filename, directory, nonExistent }); - assert.equal(nonExistent.length, 1); - assert.equal(nonExistent[0], './notReal'); + expect(nonExistent).toStrictEqual(['./notReal']); }); it('does not add valid partials to the nonExistent list', () => { @@ -221,7 +224,7 @@ describe('dependencyTree', () => { dependencyTree({ filename, directory, nonExistent }); - assert.equal(nonExistent.length, 0); + expect(nonExistent).toStrictEqual([]); }); it('stores only invalid partials when there is a mix of valid and invalid', () => { @@ -239,8 +242,7 @@ describe('dependencyTree', () => { dependencyTree({ filename, directory, nonExistent }); - assert.equal(nonExistent.length, 1); - assert.equal(nonExistent[0], './notRealMan'); + expect(nonExistent).toStrictEqual(['./notRealMan']); }); it('only includes a non-existent partial once when referenced multiple times', () => { @@ -258,8 +260,7 @@ describe('dependencyTree', () => { dependencyTree({ filename, directory, nonExistent }); - assert.equal(nonExistent.length, 1); - assert.equal(nonExistent[0], './notRealMan'); + expect(nonExistent).toStrictEqual(['./notRealMan']); }); it('stores a Sass partial in nonExistent when the resolved path does not exist on disk', () => { @@ -275,55 +276,54 @@ describe('dependencyTree', () => { dependencyTree({ filename, directory, nonExistent }); - assert.equal(nonExistent.length, 1); - assert.equal(nonExistent[0], 'missing-partial'); + expect(nonExistent).toStrictEqual(['missing-partial']); }); describe('throws', () => { it('throws if the filename is missing', () => { - assert.throws(() => { + expect(() => { dependencyTree({ filename: undefined, directory: fixtures('commonjs') }); - }, /^Error: filename not given$/); + }).toThrow(new Error('filename not given')); }); it('throws if the root is missing', () => { - assert.throws(() => { + expect(() => { dependencyTree({ undefined }); - }, /^Error: filename not given$/); + }).toThrow(new Error('filename not given')); }); it('throws if the directory is missing', () => { - assert.throws(() => { + expect(() => { dependencyTree({ filename: 'foo.js', directory: undefined }); - }, /^Error: directory not given$/); + }).toThrow(new Error('directory not given')); }); it('throws if a supplied filter is not a function', () => { const directory = fixtures('onlyRealDeps'); const filename = path.normalize(`${directory}/a.js`); - assert.throws(() => { + expect(() => { dependencyTree({ filename, directory, filter: 'foobar' }); - }, /^Error: filter must be a function$/); + }).toThrow(new Error('filter must be a function')); }); it('does not throw on the legacy `root` option', () => { - assert.doesNotThrow(() => { + expect(() => { const directory = fixtures('onlyRealDeps'); const filename = path.normalize(`${directory}/a.js`); dependencyTree({ filename, root: directory }); - }); + }).not.toThrow(); }); }); @@ -331,24 +331,26 @@ describe('dependencyTree', () => { const directory = fixtures('commonjs'); it('does not throw', () => { - assert.doesNotThrow(() => { + expect(() => { dependencyTree({ filename: 'foo', directory }); - }); + }).not.toThrow(); }); it('returns no dependencies', () => { const tree = dependencyTree({ filename: 'foo', directory }); - assert.equal(Object.keys(tree).length, 0); + expect(tree).toStrictEqual({}); }); it('returns empty tree when precinct throws', () => { - const stub = sinon.stub(precinct, 'paperwork').throws(new Error('parse error')); + const stub = vi.spyOn(precinct, 'paperwork').mockImplementation(() => { + throw new Error('parse error'); + }); const filename = path.join(directory, 'a.js'); const tree = dependencyTree({ filename, directory }); - assert.deepEqual(tree[filename], {}); - stub.restore(); + expect(tree[filename]).toStrictEqual({}); + stub.mockRestore(); }); }); @@ -369,7 +371,7 @@ describe('dependencyTree', () => { }); const deps = Object.keys(tree[filename]); - assert.equal(deps.length, 2); + expect(deps).toHaveLength(2); }); it('returns the precomputed list of a cached entry point', () => { @@ -386,7 +388,7 @@ describe('dependencyTree', () => { visited: cache }); - assert.deepEqual(tree[filename], []); + expect(tree[filename]).toStrictEqual([]); }); }); @@ -407,8 +409,8 @@ describe('dependencyTree', () => { const list = dependencyTree.toList({ filename, directory }); - assert.equal(list.includes(helperPath), true); - assert.equal(list.includes(subPath), true); + expect(list).toContain(helperPath); + expect(list).toContain(subPath); }); it('resolves the correct root directory for a scoped package in node_modules', () => { @@ -433,8 +435,8 @@ describe('dependencyTree', () => { const list = dependencyTree.toList({ filename, directory }); - assert.equal(list.includes(indexPath), true); - assert.equal(list.includes(utilPath), true); + expect(list).toContain(indexPath); + expect(list).toContain(utilPath); }); it('resolves sub-dependencies for a package inside nested node_modules', () => { @@ -461,8 +463,8 @@ describe('dependencyTree', () => { const list = dependencyTree.toList({ filename, directory }); - assert.equal(list.includes(pkgAPath), true); - assert.equal(list.includes(pkgBPath), true); + expect(list).toContain(pkgAPath); + expect(list).toContain(pkgBPath); }); it('does not throw when a file sits directly inside node_modules/ without a package subfolder', () => { @@ -478,9 +480,9 @@ describe('dependencyTree', () => { const filename = path.join(directory, 'a.js'); - assert.doesNotThrow(() => { + expect(() => { dependencyTree.toList({ filename, directory }); - }); + }).not.toThrow(); }); }); }); diff --git a/test/node-modules.test.js b/test/node-modules.test.js index 0c04593..198724c 100644 --- a/test/node-modules.test.js +++ b/test/node-modules.test.js @@ -1,6 +1,11 @@ -import { strict as assert } from 'node:assert'; import path from 'node:path'; import mockfs from 'mock-fs'; +import { + describe, + it, + expect, + afterEach +} from 'vitest'; import dependencyTree from '../index.js'; import { fixtures } from './helpers.js'; @@ -38,7 +43,7 @@ describe('package-specific node_modules resolution', () => { isListForm: true }); - assert.equal(treeList.includes(childPath), true); + expect(treeList).toContain(childPath); }); it('uses correct version of sub package in node module package', () => { @@ -75,8 +80,8 @@ describe('package-specific node_modules resolution', () => { isListForm: true }); - assert.equal(treeList.includes(rootChildPath), false); - assert.equal(treeList.includes(nestedChildPath), true); + expect(treeList).not.toContain(rootChildPath); + expect(treeList).toContain(nestedChildPath); }); it('falls back to entry directory when a node_modules file has no package subpath', () => { @@ -97,7 +102,7 @@ describe('package-specific node_modules resolution', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.some(dep => dep.includes('flatmod')), true); + expect(deps.some(dep => dep.includes('flatmod'))).toBe(true); }); it('resolves the project path for a scoped node_modules package', () => { @@ -123,6 +128,6 @@ describe('package-specific node_modules resolution', () => { const subTree = tree[filename]; const deps = Object.keys(subTree); - assert.equal(deps.some(dep => dep.includes(path.join('@scope', 'pkg'))), true); + expect(deps.some(dep => dep.includes(path.join('@scope', 'pkg')))).toBe(true); }); }); diff --git a/test/resolvers.test.js b/test/resolvers.test.js index 6e106d4..38bad03 100644 --- a/test/resolvers.test.js +++ b/test/resolvers.test.js @@ -1,7 +1,13 @@ -import { strict as assert } from 'node:assert'; import path from 'node:path'; import process from 'node:process'; import mockfs from 'mock-fs'; +import { + describe, + it, + expect, + beforeEach, + afterEach +} from 'vitest'; import dependencyTree from '../index.js'; import { fixtures, testDir } from './helpers.js'; @@ -9,7 +15,7 @@ function assertResolvesToLodizzle(tree, entryFile) { const filename = path.resolve(process.cwd(), entryFile); const aliasedFile = path.resolve(process.cwd(), 'root/lodizzle.js').replaceAll('\\', '/'); const normalizedTreeFilename = Object.keys(tree[filename]).map(f => f.replaceAll('\\', '/')); - assert.equal(aliasedFile.includes(normalizedTreeFilename), true); + expect(aliasedFile.includes(normalizedTreeFilename)).toBe(true); } describe('webpack', () => { @@ -27,7 +33,7 @@ describe('webpack', () => { filter: filename => filename.includes('filing-cabinet') }); - assert.equal(results.some(filename => filename.includes(filingCabinetPath)), true); + expect(results.some(filename => filename.includes(filingCabinetPath))).toBe(true); }); it('resolves unaliased modules', () => { @@ -38,7 +44,7 @@ describe('webpack', () => { filter: filename => filename.includes('filing-cabinet') }); - assert.equal(results.some(filename => filename.includes(filingCabinetPath)), true); + expect(results.some(filename => filename.includes(filingCabinetPath))).toBe(true); }); it('resolves @ prefixed aliases with absolute path values', () => { @@ -51,7 +57,7 @@ describe('webpack', () => { filter: filename => filename.includes(path.join('webpack', 'src')) }); - assert.equal(results.some(filename => filename.includes(atAliasedSrcPath)), true); + expect(results.some(filename => filename.includes(atAliasedSrcPath))).toBe(true); }); }); @@ -141,6 +147,6 @@ describe('requirejs', () => { nonExistent }); - assert.equal(nonExistent.includes('phantom'), true); + expect(nonExistent).toContain('phantom'); }); }); diff --git a/test/setup.js b/test/setup.js new file mode 100644 index 0000000..b05e184 --- /dev/null +++ b/test/setup.js @@ -0,0 +1,12 @@ +import { createRequire } from 'node:module'; + +const req = createRequire(import.meta.url); + +// Pre-load modules that filing-cabinet requires lazily at call time. +// When mock-fs intercepts the filesystem, require() for unloaded modules +// fails because node_modules is not in the mock. Loading them here ensures +// they are in Node's module cache before any test activates mock-fs. +req('filing-cabinet'); +req('module-definition'); +req('module-lookup-amd'); +req('resolve'); diff --git a/test/to-list.test.js b/test/to-list.test.js index 7363c93..cba8946 100644 --- a/test/to-list.test.js +++ b/test/to-list.test.js @@ -1,6 +1,12 @@ -import { strict as assert } from 'node:assert'; import path from 'node:path'; import mockfs from 'mock-fs'; +import { + describe, + it, + expect, + beforeEach, + afterEach +} from 'vitest'; import dependencyTree from '../index.js'; import { fixtures, @@ -16,8 +22,8 @@ function testToList(format, ext = '.js') { const filename = path.normalize(`${directory}/a${ext}`); const list = dependencyTree.toList({ filename, directory }); - assert.equal(Array.isArray(list), true); - assert.notEqual(list.length, 0); + expect(list).toBeInstanceOf(Array); + expect(list.length).toBeGreaterThan(0); }); } @@ -35,8 +41,7 @@ describe('toList', () => { const filename = path.normalize(`${directory}/notafile.js`); const list = dependencyTree.toList({ filename, directory }); - assert.equal(Array.isArray(list), true); - assert.equal(list.length, 0); + expect(list).toStrictEqual([]); }); it('orders the visited files by last visited', () => { @@ -44,10 +49,11 @@ describe('toList', () => { const filename = path.normalize(`${directory}/a.js`); const list = dependencyTree.toList({ filename, directory }); - assert.equal(list.length, 3); - assert.equal(path.normalize(list[0]), path.normalize(`${directory}/c.js`)); - assert.equal(path.normalize(list[1]), path.normalize(`${directory}/b.js`)); - assert.equal(list.at(-1), filename); + expect(list.map(p => path.normalize(p))).toStrictEqual([ + path.normalize(`${directory}/c.js`), + path.normalize(`${directory}/b.js`), + filename + ]); }); describe('module formats', () => { diff --git a/vitest.config.js b/vitest.config.js new file mode 100644 index 0000000..46e63c1 --- /dev/null +++ b/vitest.config.js @@ -0,0 +1,13 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + setupFiles: ['test/setup.js'], + include: ['test/**/*.test.js'], + coverage: { + provider: 'v8', + reporter: ['html', 'lcovonly', 'text'], + exclude: ['test/**'] + } + } +}); diff --git a/xo.config.js b/xo.config.js index 94fb6a0..6eacacb 100644 --- a/xo.config.js +++ b/xo.config.js @@ -1,5 +1,3 @@ -import globals from 'globals'; - export default [ { ignores: [ @@ -50,13 +48,5 @@ export default [ 'unicorn/prefer-top-level-await': 'off', 'unicorn/prevent-abbreviations': 'off' } - }, - { - files: [ - 'test/**/*.js' - ], - languageOptions: { - globals: globals.mocha - } } ]; From d220b310ee3e490b1ba30aaad65648f53b277185 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 24 May 2026 13:05:59 +0300 Subject: [PATCH 2/3] tests: drop mock-fs --- package-lock.json | 11 -- package.json | 1 - test/fixtures/cjs/bar.js | 1 + test/fixtures/cjs/foo.js | 1 + test/fixtures/cyclic/a.js | 1 + test/fixtures/cyclic/b.js | 1 + test/fixtures/directNodeModules/a.js | 1 + .../directNodeModules/node_modules/direct.js | 1 + test/fixtures/duplicateModules/a.js | 2 + test/fixtures/duplicateModules/b.js | 1 + test/fixtures/duplicateModules/c.js | 1 + test/fixtures/es6/a.js | 2 + test/fixtures/es6/b.js | 1 + test/fixtures/es6/c.js | 1 + test/fixtures/es6/dynamicImports/bar.js | 1 + test/fixtures/es6/dynamicImports/foo.js | 1 + test/fixtures/es6/es7.js | 2 + test/fixtures/es6/foo.jsx | 3 + test/fixtures/es6/jsx.js | 2 + test/fixtures/es6/lazyRequires/bar.js | 1 + test/fixtures/es6/lazyRequires/foo.js | 1 + test/fixtures/es6/moduleEntry/module.entry.js | 1 + .../node_modules/module.entry/index.main.js | 1 + .../node_modules/module.entry/index.module.js | 1 + .../node_modules/module.entry/package.json | 4 + test/fixtures/es6/parentChild/module.entry.js | 1 + .../child_node_module/index.main.js | 1 + .../child_node_module/package.json | 4 + .../parent_module_a/index.main.js | 2 + .../child_node_module/index.main.js | 1 + .../child_node_module/package.json | 4 + .../node_modules/parent_module_a/package.json | 3 + test/fixtures/flat-nm/a.js | 1 + test/fixtures/flat-nm/node_modules/flatmod.js | 1 + test/fixtures/imaginary/.gitkeep | 0 test/fixtures/less/a.less | 2 + test/fixtures/less/b.css | 1 + test/fixtures/less/c.less | 1 + test/fixtures/missingSassPartial/a.scss | 1 + test/fixtures/mixedPartials/a.js | 1 + test/fixtures/mixedPartials/b.js | 1 + test/fixtures/mixedPartials/c.js | 1 + test/fixtures/nestedNodeModules/a.js | 1 + .../node_modules/pkg-a/index.js | 1 + .../pkg-a/node_modules/pkg-b/index.js | 1 + test/fixtures/nodeModulesInName/a.js | 1 + .../nodeModulesInName/node_modules.helper.js | 1 + test/fixtures/nodeModulesInName/sub.js | 1 + test/fixtures/onlyMissingDep/a.js | 1 + test/fixtures/repeatedMissing/a.js | 2 + test/fixtures/repeatedMissing/b.js | 1 + test/fixtures/repeatedMissing/c.js | 1 + test/fixtures/requirejs/phantom/a.js | 1 + .../requirejs/phantom/require.config.js | 6 + test/fixtures/requirejs/root/a.js | 5 + test/fixtures/requirejs/root/b.js | 5 + test/fixtures/requirejs/root/lodizzle.js | 1 + .../fixtures/requirejs/root/require.config.js | 6 + test/fixtures/sass/_b.scss | 1 + test/fixtures/sass/_c.scss | 1 + test/fixtures/sass/a.scss | 2 + test/fixtures/scoped-nm/a.js | 1 + .../node_modules/@scope/pkg/index.js | 1 + .../node_modules/@scope/pkg/package.json | 3 + test/fixtures/scopedPackage/a.js | 1 + .../node_modules/@scope/pkg/index.js | 1 + .../node_modules/@scope/pkg/util.js | 1 + test/fixtures/stylus/a.styl | 2 + test/fixtures/stylus/b.styl | 1 + test/fixtures/stylus/c.styl | 1 + test/fixtures/validPartials/a.js | 1 + test/fixtures/validPartials/b.js | 1 + test/formats.test.js | 99 ++----------- test/helpers.js | 56 -------- test/index.test.js | 133 ++---------------- test/node-modules.test.js | 91 +----------- test/resolvers.test.js | 75 ++-------- test/setup.js | 12 -- test/to-list.test.js | 41 +----- vitest.config.js | 1 - 80 files changed, 152 insertions(+), 479 deletions(-) create mode 100644 test/fixtures/cjs/bar.js create mode 100644 test/fixtures/cjs/foo.js create mode 100644 test/fixtures/cyclic/a.js create mode 100644 test/fixtures/cyclic/b.js create mode 100644 test/fixtures/directNodeModules/a.js create mode 100644 test/fixtures/directNodeModules/node_modules/direct.js create mode 100644 test/fixtures/duplicateModules/a.js create mode 100644 test/fixtures/duplicateModules/b.js create mode 100644 test/fixtures/duplicateModules/c.js create mode 100644 test/fixtures/es6/a.js create mode 100644 test/fixtures/es6/b.js create mode 100644 test/fixtures/es6/c.js create mode 100644 test/fixtures/es6/dynamicImports/bar.js create mode 100644 test/fixtures/es6/dynamicImports/foo.js create mode 100644 test/fixtures/es6/es7.js create mode 100644 test/fixtures/es6/foo.jsx create mode 100644 test/fixtures/es6/jsx.js create mode 100644 test/fixtures/es6/lazyRequires/bar.js create mode 100644 test/fixtures/es6/lazyRequires/foo.js create mode 100644 test/fixtures/es6/moduleEntry/module.entry.js create mode 100644 test/fixtures/es6/moduleEntry/node_modules/module.entry/index.main.js create mode 100644 test/fixtures/es6/moduleEntry/node_modules/module.entry/index.module.js create mode 100644 test/fixtures/es6/moduleEntry/node_modules/module.entry/package.json create mode 100644 test/fixtures/es6/parentChild/module.entry.js create mode 100644 test/fixtures/es6/parentChild/node_modules/child_node_module/index.main.js create mode 100644 test/fixtures/es6/parentChild/node_modules/child_node_module/package.json create mode 100644 test/fixtures/es6/parentChild/node_modules/parent_module_a/index.main.js create mode 100644 test/fixtures/es6/parentChild/node_modules/parent_module_a/node_modules/child_node_module/index.main.js create mode 100644 test/fixtures/es6/parentChild/node_modules/parent_module_a/node_modules/child_node_module/package.json create mode 100644 test/fixtures/es6/parentChild/node_modules/parent_module_a/package.json create mode 100644 test/fixtures/flat-nm/a.js create mode 100644 test/fixtures/flat-nm/node_modules/flatmod.js create mode 100644 test/fixtures/imaginary/.gitkeep create mode 100644 test/fixtures/less/a.less create mode 100644 test/fixtures/less/b.css create mode 100644 test/fixtures/less/c.less create mode 100644 test/fixtures/missingSassPartial/a.scss create mode 100644 test/fixtures/mixedPartials/a.js create mode 100644 test/fixtures/mixedPartials/b.js create mode 100644 test/fixtures/mixedPartials/c.js create mode 100644 test/fixtures/nestedNodeModules/a.js create mode 100644 test/fixtures/nestedNodeModules/node_modules/pkg-a/index.js create mode 100644 test/fixtures/nestedNodeModules/node_modules/pkg-a/node_modules/pkg-b/index.js create mode 100644 test/fixtures/nodeModulesInName/a.js create mode 100644 test/fixtures/nodeModulesInName/node_modules.helper.js create mode 100644 test/fixtures/nodeModulesInName/sub.js create mode 100644 test/fixtures/onlyMissingDep/a.js create mode 100644 test/fixtures/repeatedMissing/a.js create mode 100644 test/fixtures/repeatedMissing/b.js create mode 100644 test/fixtures/repeatedMissing/c.js create mode 100644 test/fixtures/requirejs/phantom/a.js create mode 100644 test/fixtures/requirejs/phantom/require.config.js create mode 100644 test/fixtures/requirejs/root/a.js create mode 100644 test/fixtures/requirejs/root/b.js create mode 100644 test/fixtures/requirejs/root/lodizzle.js create mode 100644 test/fixtures/requirejs/root/require.config.js create mode 100644 test/fixtures/sass/_b.scss create mode 100644 test/fixtures/sass/_c.scss create mode 100644 test/fixtures/sass/a.scss create mode 100644 test/fixtures/scoped-nm/a.js create mode 100644 test/fixtures/scoped-nm/node_modules/@scope/pkg/index.js create mode 100644 test/fixtures/scoped-nm/node_modules/@scope/pkg/package.json create mode 100644 test/fixtures/scopedPackage/a.js create mode 100644 test/fixtures/scopedPackage/node_modules/@scope/pkg/index.js create mode 100644 test/fixtures/scopedPackage/node_modules/@scope/pkg/util.js create mode 100644 test/fixtures/stylus/a.styl create mode 100644 test/fixtures/stylus/b.styl create mode 100644 test/fixtures/stylus/c.styl create mode 100644 test/fixtures/validPartials/a.js create mode 100644 test/fixtures/validPartials/b.js delete mode 100644 test/setup.js diff --git a/package-lock.json b/package-lock.json index 1d4a5af..2006266 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,6 @@ "devDependencies": { "@vitest/coverage-v8": "^4.1.7", "debug": "^4.4.3", - "mock-fs": "^5.5.0", "vitest": "^4.1.7", "xo": "^2.0.2" }, @@ -6263,16 +6262,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/mock-fs": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-5.5.0.tgz", - "integrity": "sha512-d/P1M/RacgM3dB0sJ8rjeRNXxtapkPCUnMGmIN0ixJ16F/E4GUZCvWcSGfWGz8eaXYvn1s9baUwNjI4LOPEjiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/module-definition": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-7.0.0.tgz", diff --git a/package.json b/package.json index 322eeb7..260beb4 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "devDependencies": { "@vitest/coverage-v8": "^4.1.7", "debug": "^4.4.3", - "mock-fs": "^5.5.0", "vitest": "^4.1.7", "xo": "^2.0.2" } diff --git a/test/fixtures/cjs/bar.js b/test/fixtures/cjs/bar.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/test/fixtures/cjs/bar.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/test/fixtures/cjs/foo.js b/test/fixtures/cjs/foo.js new file mode 100644 index 0000000..c3208c5 --- /dev/null +++ b/test/fixtures/cjs/foo.js @@ -0,0 +1 @@ +module.exports = function(bar = require("./bar")) {}; diff --git a/test/fixtures/cyclic/a.js b/test/fixtures/cyclic/a.js new file mode 100644 index 0000000..58fd5fb --- /dev/null +++ b/test/fixtures/cyclic/a.js @@ -0,0 +1 @@ +var b = require("./b"); diff --git a/test/fixtures/cyclic/b.js b/test/fixtures/cyclic/b.js new file mode 100644 index 0000000..3043adb --- /dev/null +++ b/test/fixtures/cyclic/b.js @@ -0,0 +1 @@ +var a = require("./a"); diff --git a/test/fixtures/directNodeModules/a.js b/test/fixtures/directNodeModules/a.js new file mode 100644 index 0000000..f1377e9 --- /dev/null +++ b/test/fixtures/directNodeModules/a.js @@ -0,0 +1 @@ +var x = require("./node_modules/direct"); diff --git a/test/fixtures/directNodeModules/node_modules/direct.js b/test/fixtures/directNodeModules/node_modules/direct.js new file mode 100644 index 0000000..aef2224 --- /dev/null +++ b/test/fixtures/directNodeModules/node_modules/direct.js @@ -0,0 +1 @@ +export default 1; diff --git a/test/fixtures/duplicateModules/a.js b/test/fixtures/duplicateModules/a.js new file mode 100644 index 0000000..ee5dbbd --- /dev/null +++ b/test/fixtures/duplicateModules/a.js @@ -0,0 +1,2 @@ +import b from "./b"; +import c from "./c"; diff --git a/test/fixtures/duplicateModules/b.js b/test/fixtures/duplicateModules/b.js new file mode 100644 index 0000000..4a98f6f --- /dev/null +++ b/test/fixtures/duplicateModules/b.js @@ -0,0 +1 @@ +import c from "./c"; diff --git a/test/fixtures/duplicateModules/c.js b/test/fixtures/duplicateModules/c.js new file mode 100644 index 0000000..aef2224 --- /dev/null +++ b/test/fixtures/duplicateModules/c.js @@ -0,0 +1 @@ +export default 1; diff --git a/test/fixtures/es6/a.js b/test/fixtures/es6/a.js new file mode 100644 index 0000000..b7c7498 --- /dev/null +++ b/test/fixtures/es6/a.js @@ -0,0 +1,2 @@ +import b from './b'; +import c from './c'; diff --git a/test/fixtures/es6/b.js b/test/fixtures/es6/b.js new file mode 100644 index 0000000..6ab80bc --- /dev/null +++ b/test/fixtures/es6/b.js @@ -0,0 +1 @@ +export default function() {} diff --git a/test/fixtures/es6/c.js b/test/fixtures/es6/c.js new file mode 100644 index 0000000..6ab80bc --- /dev/null +++ b/test/fixtures/es6/c.js @@ -0,0 +1 @@ +export default function() {} diff --git a/test/fixtures/es6/dynamicImports/bar.js b/test/fixtures/es6/dynamicImports/bar.js new file mode 100644 index 0000000..aef2224 --- /dev/null +++ b/test/fixtures/es6/dynamicImports/bar.js @@ -0,0 +1 @@ +export default 1; diff --git a/test/fixtures/es6/dynamicImports/foo.js b/test/fixtures/es6/dynamicImports/foo.js new file mode 100644 index 0000000..710dbe0 --- /dev/null +++ b/test/fixtures/es6/dynamicImports/foo.js @@ -0,0 +1 @@ +import("./bar"); diff --git a/test/fixtures/es6/es7.js b/test/fixtures/es6/es7.js new file mode 100644 index 0000000..36e625f --- /dev/null +++ b/test/fixtures/es6/es7.js @@ -0,0 +1,2 @@ +import c from "./c"; +export default async function foo() {} diff --git a/test/fixtures/es6/foo.jsx b/test/fixtures/es6/foo.jsx new file mode 100644 index 0000000..5331fd0 --- /dev/null +++ b/test/fixtures/es6/foo.jsx @@ -0,0 +1,3 @@ +import React from "react"; +import b from "./b"; +export default ; diff --git a/test/fixtures/es6/jsx.js b/test/fixtures/es6/jsx.js new file mode 100644 index 0000000..bbcce3d --- /dev/null +++ b/test/fixtures/es6/jsx.js @@ -0,0 +1,2 @@ +import c from "./c"; +export default ; diff --git a/test/fixtures/es6/lazyRequires/bar.js b/test/fixtures/es6/lazyRequires/bar.js new file mode 100644 index 0000000..aef2224 --- /dev/null +++ b/test/fixtures/es6/lazyRequires/bar.js @@ -0,0 +1 @@ +export default 1; diff --git a/test/fixtures/es6/lazyRequires/foo.js b/test/fixtures/es6/lazyRequires/foo.js new file mode 100644 index 0000000..5e25f36 --- /dev/null +++ b/test/fixtures/es6/lazyRequires/foo.js @@ -0,0 +1 @@ +export default function(bar = require("./bar")) {}; diff --git a/test/fixtures/es6/moduleEntry/module.entry.js b/test/fixtures/es6/moduleEntry/module.entry.js new file mode 100644 index 0000000..d37b5ec --- /dev/null +++ b/test/fixtures/es6/moduleEntry/module.entry.js @@ -0,0 +1 @@ +import * as module from "module.entry" diff --git a/test/fixtures/es6/moduleEntry/node_modules/module.entry/index.main.js b/test/fixtures/es6/moduleEntry/node_modules/module.entry/index.main.js new file mode 100644 index 0000000..0a55f34 --- /dev/null +++ b/test/fixtures/es6/moduleEntry/node_modules/module.entry/index.main.js @@ -0,0 +1 @@ +module.exports = function() {}; diff --git a/test/fixtures/es6/moduleEntry/node_modules/module.entry/index.module.js b/test/fixtures/es6/moduleEntry/node_modules/module.entry/index.module.js new file mode 100644 index 0000000..0a55f34 --- /dev/null +++ b/test/fixtures/es6/moduleEntry/node_modules/module.entry/index.module.js @@ -0,0 +1 @@ +module.exports = function() {}; diff --git a/test/fixtures/es6/moduleEntry/node_modules/module.entry/package.json b/test/fixtures/es6/moduleEntry/node_modules/module.entry/package.json new file mode 100644 index 0000000..f635211 --- /dev/null +++ b/test/fixtures/es6/moduleEntry/node_modules/module.entry/package.json @@ -0,0 +1,4 @@ +{ + "main": "index.main.js", + "module": "index.module.js" +} diff --git a/test/fixtures/es6/parentChild/module.entry.js b/test/fixtures/es6/parentChild/module.entry.js new file mode 100644 index 0000000..71aa35a --- /dev/null +++ b/test/fixtures/es6/parentChild/module.entry.js @@ -0,0 +1 @@ +import * as module from "parent_module_a" diff --git a/test/fixtures/es6/parentChild/node_modules/child_node_module/index.main.js b/test/fixtures/es6/parentChild/node_modules/child_node_module/index.main.js new file mode 100644 index 0000000..8ba7376 --- /dev/null +++ b/test/fixtures/es6/parentChild/node_modules/child_node_module/index.main.js @@ -0,0 +1 @@ +module.exports = "child_node_module" diff --git a/test/fixtures/es6/parentChild/node_modules/child_node_module/package.json b/test/fixtures/es6/parentChild/node_modules/child_node_module/package.json new file mode 100644 index 0000000..42e11c0 --- /dev/null +++ b/test/fixtures/es6/parentChild/node_modules/child_node_module/package.json @@ -0,0 +1,4 @@ +{ + "main": "index.main.js", + "version": "2.0.0" +} diff --git a/test/fixtures/es6/parentChild/node_modules/parent_module_a/index.main.js b/test/fixtures/es6/parentChild/node_modules/parent_module_a/index.main.js new file mode 100644 index 0000000..41366ac --- /dev/null +++ b/test/fixtures/es6/parentChild/node_modules/parent_module_a/index.main.js @@ -0,0 +1,2 @@ +import * as child_module from "child_node_module"; +module.exports = child_module; diff --git a/test/fixtures/es6/parentChild/node_modules/parent_module_a/node_modules/child_node_module/index.main.js b/test/fixtures/es6/parentChild/node_modules/parent_module_a/node_modules/child_node_module/index.main.js new file mode 100644 index 0000000..2090158 --- /dev/null +++ b/test/fixtures/es6/parentChild/node_modules/parent_module_a/node_modules/child_node_module/index.main.js @@ -0,0 +1 @@ +module.exports = "child_node_module_of_parent_a" diff --git a/test/fixtures/es6/parentChild/node_modules/parent_module_a/node_modules/child_node_module/package.json b/test/fixtures/es6/parentChild/node_modules/parent_module_a/node_modules/child_node_module/package.json new file mode 100644 index 0000000..2c3cf98 --- /dev/null +++ b/test/fixtures/es6/parentChild/node_modules/parent_module_a/node_modules/child_node_module/package.json @@ -0,0 +1,4 @@ +{ + "main": "index.main.js", + "version": "1.0.0" +} diff --git a/test/fixtures/es6/parentChild/node_modules/parent_module_a/package.json b/test/fixtures/es6/parentChild/node_modules/parent_module_a/package.json new file mode 100644 index 0000000..9f0df9b --- /dev/null +++ b/test/fixtures/es6/parentChild/node_modules/parent_module_a/package.json @@ -0,0 +1,3 @@ +{ + "main": "index.main.js" +} diff --git a/test/fixtures/flat-nm/a.js b/test/fixtures/flat-nm/a.js new file mode 100644 index 0000000..47eedd9 --- /dev/null +++ b/test/fixtures/flat-nm/a.js @@ -0,0 +1 @@ +var x = require("flatmod"); diff --git a/test/fixtures/flat-nm/node_modules/flatmod.js b/test/fixtures/flat-nm/node_modules/flatmod.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/test/fixtures/flat-nm/node_modules/flatmod.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/test/fixtures/imaginary/.gitkeep b/test/fixtures/imaginary/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/less/a.less b/test/fixtures/less/a.less new file mode 100644 index 0000000..bb512f6 --- /dev/null +++ b/test/fixtures/less/a.less @@ -0,0 +1,2 @@ +@import "b.css"; +@import "c.less"; diff --git a/test/fixtures/less/b.css b/test/fixtures/less/b.css new file mode 100644 index 0000000..7614dc7 --- /dev/null +++ b/test/fixtures/less/b.css @@ -0,0 +1 @@ +body { color: blue; } diff --git a/test/fixtures/less/c.less b/test/fixtures/less/c.less new file mode 100644 index 0000000..77557c7 --- /dev/null +++ b/test/fixtures/less/c.less @@ -0,0 +1 @@ +body { color: pink; } diff --git a/test/fixtures/missingSassPartial/a.scss b/test/fixtures/missingSassPartial/a.scss new file mode 100644 index 0000000..14b2755 --- /dev/null +++ b/test/fixtures/missingSassPartial/a.scss @@ -0,0 +1 @@ +@import "missing-partial"; diff --git a/test/fixtures/mixedPartials/a.js b/test/fixtures/mixedPartials/a.js new file mode 100644 index 0000000..58fd5fb --- /dev/null +++ b/test/fixtures/mixedPartials/a.js @@ -0,0 +1 @@ +var b = require("./b"); diff --git a/test/fixtures/mixedPartials/b.js b/test/fixtures/mixedPartials/b.js new file mode 100644 index 0000000..f741a73 --- /dev/null +++ b/test/fixtures/mixedPartials/b.js @@ -0,0 +1 @@ +var c = require("./c"); export default 1; diff --git a/test/fixtures/mixedPartials/c.js b/test/fixtures/mixedPartials/c.js new file mode 100644 index 0000000..bac3481 --- /dev/null +++ b/test/fixtures/mixedPartials/c.js @@ -0,0 +1 @@ +var crap = require("./notRealMan"); diff --git a/test/fixtures/nestedNodeModules/a.js b/test/fixtures/nestedNodeModules/a.js new file mode 100644 index 0000000..1ac0edb --- /dev/null +++ b/test/fixtures/nestedNodeModules/a.js @@ -0,0 +1 @@ +var x = require("./node_modules/pkg-a/index"); diff --git a/test/fixtures/nestedNodeModules/node_modules/pkg-a/index.js b/test/fixtures/nestedNodeModules/node_modules/pkg-a/index.js new file mode 100644 index 0000000..56c81a8 --- /dev/null +++ b/test/fixtures/nestedNodeModules/node_modules/pkg-a/index.js @@ -0,0 +1 @@ +var y = require("./node_modules/pkg-b/index"); diff --git a/test/fixtures/nestedNodeModules/node_modules/pkg-a/node_modules/pkg-b/index.js b/test/fixtures/nestedNodeModules/node_modules/pkg-a/node_modules/pkg-b/index.js new file mode 100644 index 0000000..aef2224 --- /dev/null +++ b/test/fixtures/nestedNodeModules/node_modules/pkg-a/node_modules/pkg-b/index.js @@ -0,0 +1 @@ +export default 1; diff --git a/test/fixtures/nodeModulesInName/a.js b/test/fixtures/nodeModulesInName/a.js new file mode 100644 index 0000000..4b5ec14 --- /dev/null +++ b/test/fixtures/nodeModulesInName/a.js @@ -0,0 +1 @@ +var x = require("./node_modules.helper"); diff --git a/test/fixtures/nodeModulesInName/node_modules.helper.js b/test/fixtures/nodeModulesInName/node_modules.helper.js new file mode 100644 index 0000000..979a9d5 --- /dev/null +++ b/test/fixtures/nodeModulesInName/node_modules.helper.js @@ -0,0 +1 @@ +var y = require("./sub"); diff --git a/test/fixtures/nodeModulesInName/sub.js b/test/fixtures/nodeModulesInName/sub.js new file mode 100644 index 0000000..aef2224 --- /dev/null +++ b/test/fixtures/nodeModulesInName/sub.js @@ -0,0 +1 @@ +export default 1; diff --git a/test/fixtures/onlyMissingDep/a.js b/test/fixtures/onlyMissingDep/a.js new file mode 100644 index 0000000..fa472f2 --- /dev/null +++ b/test/fixtures/onlyMissingDep/a.js @@ -0,0 +1 @@ +var notReal = require("./notReal"); diff --git a/test/fixtures/repeatedMissing/a.js b/test/fixtures/repeatedMissing/a.js new file mode 100644 index 0000000..9669300 --- /dev/null +++ b/test/fixtures/repeatedMissing/a.js @@ -0,0 +1,2 @@ +var b = require("./b"); +var crap = require("./notRealMan"); diff --git a/test/fixtures/repeatedMissing/b.js b/test/fixtures/repeatedMissing/b.js new file mode 100644 index 0000000..f741a73 --- /dev/null +++ b/test/fixtures/repeatedMissing/b.js @@ -0,0 +1 @@ +var c = require("./c"); export default 1; diff --git a/test/fixtures/repeatedMissing/c.js b/test/fixtures/repeatedMissing/c.js new file mode 100644 index 0000000..bac3481 --- /dev/null +++ b/test/fixtures/repeatedMissing/c.js @@ -0,0 +1 @@ +var crap = require("./notRealMan"); diff --git a/test/fixtures/requirejs/phantom/a.js b/test/fixtures/requirejs/phantom/a.js new file mode 100644 index 0000000..eaafe6f --- /dev/null +++ b/test/fixtures/requirejs/phantom/a.js @@ -0,0 +1 @@ +define(["phantom"], function(p) {}); diff --git a/test/fixtures/requirejs/phantom/require.config.js b/test/fixtures/requirejs/phantom/require.config.js new file mode 100644 index 0000000..6d16576 --- /dev/null +++ b/test/fixtures/requirejs/phantom/require.config.js @@ -0,0 +1,6 @@ +requirejs.config({ + baseUrl: './', + paths: { + phantom: './phantom-module' + } +}); diff --git a/test/fixtures/requirejs/root/a.js b/test/fixtures/requirejs/root/a.js new file mode 100644 index 0000000..ecd03b1 --- /dev/null +++ b/test/fixtures/requirejs/root/a.js @@ -0,0 +1,5 @@ +define([ + 'F' +], function(F) { + +}); diff --git a/test/fixtures/requirejs/root/b.js b/test/fixtures/requirejs/root/b.js new file mode 100644 index 0000000..0709fcb --- /dev/null +++ b/test/fixtures/requirejs/root/b.js @@ -0,0 +1,5 @@ +define([ + './lodizzle' +], function(F) { + +}); diff --git a/test/fixtures/requirejs/root/lodizzle.js b/test/fixtures/requirejs/root/lodizzle.js new file mode 100644 index 0000000..962ddd2 --- /dev/null +++ b/test/fixtures/requirejs/root/lodizzle.js @@ -0,0 +1 @@ +define({}) diff --git a/test/fixtures/requirejs/root/require.config.js b/test/fixtures/requirejs/root/require.config.js new file mode 100644 index 0000000..35d02ab --- /dev/null +++ b/test/fixtures/requirejs/root/require.config.js @@ -0,0 +1,6 @@ +requirejs.config({ + baseUrl: './', + paths: { + F: './lodizzle.js' + } +}); diff --git a/test/fixtures/sass/_b.scss b/test/fixtures/sass/_b.scss new file mode 100644 index 0000000..7614dc7 --- /dev/null +++ b/test/fixtures/sass/_b.scss @@ -0,0 +1 @@ +body { color: blue; } diff --git a/test/fixtures/sass/_c.scss b/test/fixtures/sass/_c.scss new file mode 100644 index 0000000..77557c7 --- /dev/null +++ b/test/fixtures/sass/_c.scss @@ -0,0 +1 @@ +body { color: pink; } diff --git a/test/fixtures/sass/a.scss b/test/fixtures/sass/a.scss new file mode 100644 index 0000000..7b00a2c --- /dev/null +++ b/test/fixtures/sass/a.scss @@ -0,0 +1,2 @@ +@import "_b"; +@import "_c.scss"; diff --git a/test/fixtures/scoped-nm/a.js b/test/fixtures/scoped-nm/a.js new file mode 100644 index 0000000..0b82306 --- /dev/null +++ b/test/fixtures/scoped-nm/a.js @@ -0,0 +1 @@ +var x = require("@scope/pkg"); diff --git a/test/fixtures/scoped-nm/node_modules/@scope/pkg/index.js b/test/fixtures/scoped-nm/node_modules/@scope/pkg/index.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/test/fixtures/scoped-nm/node_modules/@scope/pkg/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/test/fixtures/scoped-nm/node_modules/@scope/pkg/package.json b/test/fixtures/scoped-nm/node_modules/@scope/pkg/package.json new file mode 100644 index 0000000..14ab704 --- /dev/null +++ b/test/fixtures/scoped-nm/node_modules/@scope/pkg/package.json @@ -0,0 +1,3 @@ +{ + "main": "index.js" +} diff --git a/test/fixtures/scopedPackage/a.js b/test/fixtures/scopedPackage/a.js new file mode 100644 index 0000000..0a82e31 --- /dev/null +++ b/test/fixtures/scopedPackage/a.js @@ -0,0 +1 @@ +var x = require("./node_modules/@scope/pkg/index"); diff --git a/test/fixtures/scopedPackage/node_modules/@scope/pkg/index.js b/test/fixtures/scopedPackage/node_modules/@scope/pkg/index.js new file mode 100644 index 0000000..9568234 --- /dev/null +++ b/test/fixtures/scopedPackage/node_modules/@scope/pkg/index.js @@ -0,0 +1 @@ +var y = require("./util"); diff --git a/test/fixtures/scopedPackage/node_modules/@scope/pkg/util.js b/test/fixtures/scopedPackage/node_modules/@scope/pkg/util.js new file mode 100644 index 0000000..aef2224 --- /dev/null +++ b/test/fixtures/scopedPackage/node_modules/@scope/pkg/util.js @@ -0,0 +1 @@ +export default 1; diff --git a/test/fixtures/stylus/a.styl b/test/fixtures/stylus/a.styl new file mode 100644 index 0000000..177fc08 --- /dev/null +++ b/test/fixtures/stylus/a.styl @@ -0,0 +1,2 @@ +@import "b" +@require "c.styl" diff --git a/test/fixtures/stylus/b.styl b/test/fixtures/stylus/b.styl new file mode 100644 index 0000000..4cbbf92 --- /dev/null +++ b/test/fixtures/stylus/b.styl @@ -0,0 +1 @@ +@import "c" diff --git a/test/fixtures/stylus/c.styl b/test/fixtures/stylus/c.styl new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/test/fixtures/stylus/c.styl @@ -0,0 +1 @@ + diff --git a/test/fixtures/validPartials/a.js b/test/fixtures/validPartials/a.js new file mode 100644 index 0000000..58fd5fb --- /dev/null +++ b/test/fixtures/validPartials/a.js @@ -0,0 +1 @@ +var b = require("./b"); diff --git a/test/fixtures/validPartials/b.js b/test/fixtures/validPartials/b.js new file mode 100644 index 0000000..aef2224 --- /dev/null +++ b/test/fixtures/validPartials/b.js @@ -0,0 +1 @@ +export default 1; diff --git a/test/formats.test.js b/test/formats.test.js index ce37d52..6df1d0d 100644 --- a/test/formats.test.js +++ b/test/formats.test.js @@ -1,21 +1,8 @@ import path from 'node:path'; -import mockfs from 'mock-fs'; -import { - describe, - it, - expect, - beforeEach, - afterEach -} from 'vitest'; +import { describe, it, expect } from 'vitest'; import Config from '../lib/config.js'; import dependencyTree from '../index.js'; -import { - fixtures, - mockEs6, - mockSass, - mockStylus, - mockLess -} from './helpers.js'; +import { fixtures } from './helpers.js'; function testTreesForFormat(format, ext = '.js') { it('returns an object form of the dependency tree for a file', () => { @@ -32,10 +19,6 @@ function testTreesForFormat(format, ext = '.js') { } describe('module formats', () => { - afterEach(() => { - mockfs.restore(); - }); - describe('amd', () => { testTreesForFormat('amd'); }); @@ -46,13 +29,6 @@ describe('module formats', () => { describe('when given a CJS file with lazy requires', () => { it('includes the lazy dependency', () => { const directory = fixtures('cjs'); - mockfs({ - [directory]: { - 'foo.js': 'module.exports = function(bar = require("./bar")) {};', - 'bar.js': 'module.exports = 1;' - } - }); - const filename = path.normalize(`${directory}/foo.js`); const barPath = path.normalize(`${directory}/bar.js`); @@ -66,20 +42,7 @@ describe('module formats', () => { describe('when given a CJS file with module property in package.json', () => { it('includes the module entry as dependency', () => { - const directory = fixtures('es6'); - mockfs({ - [directory]: { - 'module.entry.js': 'import * as module from "module.entry"', - node_modules: { - 'module.entry': { - 'index.main.js': 'module.exports = function() {};', - 'index.module.js': 'module.exports = function() {};', - 'package.json': '{ "main": "index.main.js", "module": "index.module.js" }' - } - } - } - }); - + const directory = fixtures('es6', 'moduleEntry'); const filename = path.normalize(`${directory}/module.entry.js`); const moduleEntryPath = path.normalize(`${directory}/node_modules/module.entry/index.module.js`); @@ -99,10 +62,6 @@ describe('module formats', () => { }); describe('es6', () => { - beforeEach(() => { - mockEs6(); - }); - const directory = fixtures('es6'); testTreesForFormat('es6'); @@ -135,22 +94,14 @@ describe('module formats', () => { }); describe('when given an es6 file using CJS lazy requires', () => { - beforeEach(() => { - mockfs({ - [directory]: { - 'foo.js': 'export default function(bar = require("./bar")) {};', - 'bar.js': 'export default 1;' - } - }); - }); + const lazyDir = fixtures('es6', 'lazyRequires'); + const filename = path.normalize(`${lazyDir}/foo.js`); + const barPath = path.normalize(`${lazyDir}/bar.js`); it('includes the lazy dependency when mixedImports is on', () => { - const filename = path.normalize(`${directory}/foo.js`); - const barPath = path.normalize(`${directory}/bar.js`); - const tree = dependencyTree({ filename, - directory, + directory: lazyDir, detective: { es6: { mixedImports: true @@ -164,12 +115,9 @@ describe('module formats', () => { }); it('toList includes the lazy dependency when mixedImports is on', () => { - const filename = path.normalize(`${directory}/foo.js`); - const barPath = path.normalize(`${directory}/bar.js`); - const results = dependencyTree.toList({ filename, - directory, + directory: lazyDir, detective: { es6: { mixedImports: true @@ -181,10 +129,7 @@ describe('module formats', () => { }); it('does not include the lazy dependency when mixedImports is off', () => { - const filename = path.normalize(`${directory}/foo.js`); - const barPath = path.normalize(`${directory}/bar.js`); - - const tree = dependencyTree({ filename, directory }); + const tree = dependencyTree({ filename, directory: lazyDir }); const subTree = tree[filename]; const deps = Object.keys(subTree); @@ -194,17 +139,11 @@ describe('module formats', () => { describe('when given an es6 file using dynamic imports', () => { it('includes the dynamic import', () => { - mockfs({ - [directory]: { - 'foo.js': 'import("./bar");', - 'bar.js': 'export default 1;' - } - }); + const dynamicDir = fixtures('es6', 'dynamicImports'); + const filename = path.normalize(`${dynamicDir}/foo.js`); + const barPath = path.normalize(`${dynamicDir}/bar.js`); - const filename = path.normalize(`${directory}/foo.js`); - const barPath = path.normalize(`${directory}/bar.js`); - - const tree = dependencyTree({ filename, directory }); + const tree = dependencyTree({ filename, directory: dynamicDir }); const subTree = tree[filename]; const deps = Object.keys(subTree); @@ -214,26 +153,14 @@ describe('module formats', () => { }); describe('sass', () => { - beforeEach(() => { - mockSass(); - }); - testTreesForFormat('sass', '.scss'); }); describe('stylus', () => { - beforeEach(() => { - mockStylus(); - }); - testTreesForFormat('stylus', '.styl'); }); describe('less', () => { - beforeEach(() => { - mockLess(); - }); - testTreesForFormat('less', '.less'); }); diff --git a/test/helpers.js b/test/helpers.js index 8306f3a..a00d346 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -1,64 +1,8 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import mockfs from 'mock-fs'; export const testDir = path.dirname(fileURLToPath(import.meta.url)); export function fixtures(...parts) { return path.join(testDir, 'fixtures', ...parts); } - -export function mockStylus() { - mockfs({ - [fixtures('stylus')]: { - 'a.styl': ` - @import "b" - @require "c.styl" - `, - 'b.styl': '@import "c"', - 'c.styl': '' - } - }); -} - -export function mockSass() { - mockfs({ - [fixtures('sass')]: { - 'a.scss': ` - @import "_b"; - @import "_c.scss"; - `, - '_b.scss': 'body { color: blue; }', - '_c.scss': 'body { color: pink; }' - } - }); -} - -export function mockLess() { - mockfs({ - [fixtures('less')]: { - 'a.less': ` - @import "b.css"; - @import "c.less"; - `, - 'b.css': 'body { color: blue; }', - 'c.less': 'body { color: pink; }' - } - }); -} - -export function mockEs6() { - mockfs({ - [fixtures('es6')]: { - 'a.js': ` - import b from './b'; - import c from './c'; - `, - 'b.js': 'export default function() {};', - 'c.js': 'export default function() {};', - 'jsx.js': 'import c from "./c";\n export default ;', - 'foo.jsx': 'import React from "react";\n import b from "b";\n export default ;', - 'es7.js': 'import c from "./c";\n export default async function foo() {};' - } - }); -} diff --git a/test/index.test.js b/test/index.test.js index 573a5ee..3358207 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,13 +1,11 @@ import path from 'node:path'; import process from 'node:process'; import { createRequire } from 'node:module'; -import mockfs from 'mock-fs'; import precinct from 'precinct'; import { describe, it, expect, - afterEach, vi } from 'vitest'; import dependencyTree from '../index.js'; @@ -16,16 +14,8 @@ import { fixtures } from './helpers.js'; const { resolve } = createRequire(import.meta.url); describe('dependencyTree', () => { - afterEach(() => { - mockfs.restore(); - }); - it('returns an empty object for a non-existent filename', () => { const root = fixtures('imaginary'); - mockfs({ - [root]: {} - }); - const filename = `${root}/notafile.js`; const tree = dependencyTree({ filename, root }); @@ -49,13 +39,7 @@ describe('dependencyTree', () => { }); it('does not include files that are not real (#13)', () => { - const directory = fixtures('onlyRealDeps'); - mockfs({ - [directory]: { - 'a.js': 'var notReal = require("./notReal");' - } - }); - + const directory = fixtures('onlyMissingDep'); const filename = path.normalize(`${directory}/a.js`); const tree = dependencyTree({ filename, directory }); @@ -67,13 +51,6 @@ describe('dependencyTree', () => { it('does not choke on cyclic dependencies', () => { const directory = fixtures('cyclic'); - mockfs({ - [directory]: { - 'a.js': 'var b = require("./b");', - 'b.js': 'var a = require("./a");' - } - }); - const filename = path.normalize(`${directory}/a.js`); const tree = dependencyTree({ filename, directory }); @@ -119,20 +96,10 @@ describe('dependencyTree', () => { }); it('excludes duplicate modules from the tree', () => { - mockfs({ - root: { - // More than one module includes c - 'a.js': `import b from "b"; - import c from "c";`, - 'b.js': 'import c from "c";', - 'c.js': 'export default 1;' - } - }); + const directory = fixtures('duplicateModules'); + const filename = path.normalize(`${directory}/a.js`); - const tree = dependencyTree.toList({ - filename: 'root/a.js', - directory: 'root' - }); + const tree = dependencyTree.toList({ filename, directory }); expect(tree).toHaveLength(3); }); @@ -195,13 +162,7 @@ describe('dependencyTree', () => { }); it('stores invalid partials in the nonExistent list', () => { - const directory = fixtures('onlyRealDeps'); - mockfs({ - [directory]: { - 'a.js': 'var notReal = require("./notReal");' - } - }); - + const directory = fixtures('onlyMissingDep'); const filename = path.normalize(`${directory}/a.js`); const nonExistent = []; @@ -211,14 +172,7 @@ describe('dependencyTree', () => { }); it('does not add valid partials to the nonExistent list', () => { - const directory = fixtures('onlyRealDeps'); - mockfs({ - [directory]: { - 'a.js': 'var b = require("./b");', - 'b.js': 'export default 1;' - } - }); - + const directory = fixtures('validPartials'); const filename = path.normalize(`${directory}/a.js`); const nonExistent = []; @@ -228,15 +182,7 @@ describe('dependencyTree', () => { }); it('stores only invalid partials when there is a mix of valid and invalid', () => { - const directory = fixtures('onlyRealDeps'); - mockfs({ - [directory]: { - 'a.js': 'var b = require("./b");', - 'b.js': 'var c = require("./c"); export default 1;', - 'c.js': 'var crap = require("./notRealMan");' - } - }); - + const directory = fixtures('mixedPartials'); const filename = path.normalize(`${directory}/a.js`); const nonExistent = []; @@ -246,15 +192,7 @@ describe('dependencyTree', () => { }); it('only includes a non-existent partial once when referenced multiple times', () => { - const directory = fixtures('onlyRealDeps'); - mockfs({ - [directory]: { - 'a.js': 'var b = require("./b");\nvar crap = require("./notRealMan");', - 'b.js': 'var c = require("./c"); export default 1;', - 'c.js': 'var crap = require("./notRealMan");' - } - }); - + const directory = fixtures('repeatedMissing'); const filename = path.normalize(`${directory}/a.js`); const nonExistent = []; @@ -264,13 +202,7 @@ describe('dependencyTree', () => { }); it('stores a Sass partial in nonExistent when the resolved path does not exist on disk', () => { - const directory = fixtures('sass'); - mockfs({ - [directory]: { - 'a.scss': '@import "missing-partial";' - } - }); - + const directory = fixtures('missingSassPartial'); const filename = path.normalize(`${directory}/a.scss`); const nonExistent = []; @@ -395,14 +327,6 @@ describe('dependencyTree', () => { describe('getLocalConfigDirectory', () => { it('resolves sub-dependencies of a file whose name contains "node_modules" but whose directory does not', () => { const directory = fixtures('nodeModulesInName'); - mockfs({ - [directory]: { - 'a.js': 'var x = require("./node_modules.helper");', - 'node_modules.helper.js': 'var y = require("./sub");', - 'sub.js': 'export default 1;' - } - }); - const filename = path.join(directory, 'a.js'); const helperPath = path.join(directory, 'node_modules.helper.js'); const subPath = path.join(directory, 'sub.js'); @@ -415,20 +339,6 @@ describe('dependencyTree', () => { it('resolves the correct root directory for a scoped package in node_modules', () => { const directory = fixtures('scopedPackage'); - mockfs({ - [directory]: { - 'a.js': 'var x = require("./node_modules/@scope/pkg/index");', - node_modules: { - '@scope': { - pkg: { - 'index.js': 'var y = require("./util");', - 'util.js': 'export default 1;' - } - } - } - } - }); - const filename = path.join(directory, 'a.js'); const indexPath = path.join(directory, 'node_modules', '@scope', 'pkg', 'index.js'); const utilPath = path.join(directory, 'node_modules', '@scope', 'pkg', 'util.js'); @@ -441,22 +351,6 @@ describe('dependencyTree', () => { it('resolves sub-dependencies for a package inside nested node_modules', () => { const directory = fixtures('nestedNodeModules'); - mockfs({ - [directory]: { - 'a.js': 'var x = require("./node_modules/pkg-a/index");', - node_modules: { - 'pkg-a': { - 'index.js': 'var y = require("./node_modules/pkg-b/index");', - node_modules: { - 'pkg-b': { - 'index.js': 'export default 1;' - } - } - } - } - } - }); - const filename = path.join(directory, 'a.js'); const pkgAPath = path.join(directory, 'node_modules', 'pkg-a', 'index.js'); const pkgBPath = path.join(directory, 'node_modules', 'pkg-a', 'node_modules', 'pkg-b', 'index.js'); @@ -469,15 +363,6 @@ describe('dependencyTree', () => { it('does not throw when a file sits directly inside node_modules/ without a package subfolder', () => { const directory = fixtures('directNodeModules'); - mockfs({ - [directory]: { - 'a.js': 'var x = require("./node_modules/direct");', - node_modules: { - 'direct.js': 'export default 1;' - } - } - }); - const filename = path.join(directory, 'a.js'); expect(() => { diff --git a/test/node-modules.test.js b/test/node-modules.test.js index 198724c..9db37eb 100644 --- a/test/node-modules.test.js +++ b/test/node-modules.test.js @@ -1,79 +1,25 @@ import path from 'node:path'; -import mockfs from 'mock-fs'; -import { - describe, - it, - expect, - afterEach -} from 'vitest'; +import { describe, it, expect } from 'vitest'; import dependencyTree from '../index.js'; import { fixtures } from './helpers.js'; describe('package-specific node_modules resolution', () => { - afterEach(() => { - mockfs.restore(); - }); + const directory = fixtures('es6', 'parentChild'); + const filename = path.normalize(`${directory}/module.entry.js`); + const rootChildPath = path.normalize(`${directory}/node_modules/child_node_module/index.main.js`); + const nestedChildPath = path.normalize(`${directory}/node_modules/parent_module_a/node_modules/child_node_module/index.main.js`); it('finds sub package in node module package', () => { - const directory = fixtures('es6'); - mockfs({ - [directory]: { - 'module.entry.js': 'import * as module from "parent_module_a"', - node_modules: { - parent_module_a: { - 'index.main.js': 'import * as child_module from "child_node_module"; module.exports = child_module;', - 'package.json': '{ "main": "index.main.js"}', - node_modules: { - child_node_module: { - 'index.main.js': 'module.exports = "child_node_module_of_parent_a"', - 'package.json': '{ "main": "index.main.js"}' - } - } - } - } - } - }); - - const filename = path.normalize(`${directory}/module.entry.js`); - const childPath = path.normalize(`${directory}/node_modules/parent_module_a/node_modules/child_node_module/index.main.js`); - const treeList = dependencyTree({ filename, directory, isListForm: true }); - expect(treeList).toContain(childPath); + expect(treeList).toContain(nestedChildPath); }); it('uses correct version of sub package in node module package', () => { - const directory = fixtures('es6'); - mockfs({ - [directory]: { - 'module.entry.js': 'import * as module from "parent_module_a"', - node_modules: { - child_node_module: { - 'index.main.js': 'module.exports = "child_node_module"', - 'package.json': '{ "main": "index.main.js", "version": "2.0.0"}' - }, - parent_module_a: { - 'index.main.js': 'import * as child_module from "child_node_module"; module.exports = child_module;', - 'package.json': '{ "main": "index.main.js"}', - node_modules: { - child_node_module: { - 'index.main.js': 'module.exports = "child_node_module_of_parent_a"', - 'package.json': '{ "main": "index.main.js", "version": "1.0.0"}' - } - } - } - } - } - }); - - const filename = path.normalize(`${directory}/module.entry.js`); - const rootChildPath = path.normalize(`${directory}/node_modules/child_node_module/index.main.js`); - const nestedChildPath = path.normalize(`${directory}/node_modules/parent_module_a/node_modules/child_node_module/index.main.js`); - const treeList = dependencyTree({ filename, directory, @@ -86,16 +32,6 @@ describe('package-specific node_modules resolution', () => { it('falls back to entry directory when a node_modules file has no package subpath', () => { const baseDir = fixtures('flat-nm'); - - mockfs({ - [baseDir]: { - 'a.js': 'var x = require("flatmod");', - node_modules: { - 'flatmod.js': 'module.exports = 1;' - } - } - }); - const filename = path.normalize(`${baseDir}/a.js`); const tree = dependencyTree({ filename, directory: baseDir }); @@ -107,21 +43,6 @@ describe('package-specific node_modules resolution', () => { it('resolves the project path for a scoped node_modules package', () => { const baseDir = fixtures('scoped-nm'); - - mockfs({ - [baseDir]: { - 'a.js': 'var x = require("@scope/pkg");', - node_modules: { - '@scope': { - pkg: { - 'index.js': 'module.exports = 1;', - 'package.json': '{ "main": "index.js" }' - } - } - } - } - }); - const filename = path.normalize(`${baseDir}/a.js`); const tree = dependencyTree({ filename, directory: baseDir }); diff --git a/test/resolvers.test.js b/test/resolvers.test.js index 38bad03..e159a96 100644 --- a/test/resolvers.test.js +++ b/test/resolvers.test.js @@ -1,19 +1,12 @@ import path from 'node:path'; import process from 'node:process'; -import mockfs from 'mock-fs'; -import { - describe, - it, - expect, - beforeEach, - afterEach -} from 'vitest'; +import { describe, it, expect } from 'vitest'; import dependencyTree from '../index.js'; import { fixtures, testDir } from './helpers.js'; function assertResolvesToLodizzle(tree, entryFile) { const filename = path.resolve(process.cwd(), entryFile); - const aliasedFile = path.resolve(process.cwd(), 'root/lodizzle.js').replaceAll('\\', '/'); + const aliasedFile = path.resolve(process.cwd(), entryFile, '..', 'lodizzle.js').replaceAll('\\', '/'); const normalizedTreeFilename = Object.keys(tree[filename]).map(f => f.replaceAll('\\', '/')); expect(aliasedFile.includes(normalizedTreeFilename)).toBe(true); } @@ -62,45 +55,11 @@ describe('webpack', () => { }); describe('requirejs', () => { - const directory = 'root'; - const requireConfig = 'root/require.config.js'; - - beforeEach(() => { - mockfs({ - [directory]: { - 'lodizzle.js': 'define({})', - 'require.config.js': ` - requirejs.config({ - baseUrl: './', - paths: { - F: './lodizzle.js' - } - }); - `, - 'a.js': ` - define([ - 'F' - ], function(F) { - - }); - `, - 'b.js': ` - define([ - './lodizzle' - ], function(F) { - - }); - ` - } - }); - }); - - afterEach(() => { - mockfs.restore(); - }); + const directory = fixtures('requirejs', 'root'); + const requireConfig = path.join(directory, 'require.config.js'); it('resolves aliased modules', () => { - const filename = 'root/a.js'; + const filename = path.join(directory, 'a.js'); const tree = dependencyTree({ filename, @@ -112,7 +71,7 @@ describe('requirejs', () => { }); it('resolves non-aliased paths', () => { - const filename = 'root/b.js'; + const filename = path.join(directory, 'b.js'); const tree = dependencyTree({ filename, @@ -124,26 +83,14 @@ describe('requirejs', () => { }); it('adds to nonExistent when the alias resolves to a path that does not exist on disk', () => { - mockfs({ - [directory]: { - 'a.js': 'define(["phantom"], function(p) {});', - 'require.config.js': ` - requirejs.config({ - baseUrl: './', - paths: { - phantom: './phantom-module' - } - }); - ` - } - }); - + const phantomDir = fixtures('requirejs', 'phantom'); + const phantomConfig = path.join(phantomDir, 'require.config.js'); const nonExistent = []; dependencyTree({ - filename: 'root/a.js', - directory, - config: requireConfig, + filename: path.join(phantomDir, 'a.js'), + directory: phantomDir, + config: phantomConfig, nonExistent }); diff --git a/test/setup.js b/test/setup.js deleted file mode 100644 index b05e184..0000000 --- a/test/setup.js +++ /dev/null @@ -1,12 +0,0 @@ -import { createRequire } from 'node:module'; - -const req = createRequire(import.meta.url); - -// Pre-load modules that filing-cabinet requires lazily at call time. -// When mock-fs intercepts the filesystem, require() for unloaded modules -// fails because node_modules is not in the mock. Loading them here ensures -// they are in Node's module cache before any test activates mock-fs. -req('filing-cabinet'); -req('module-definition'); -req('module-lookup-amd'); -req('resolve'); diff --git a/test/to-list.test.js b/test/to-list.test.js index cba8946..cd3a989 100644 --- a/test/to-list.test.js +++ b/test/to-list.test.js @@ -1,20 +1,7 @@ import path from 'node:path'; -import mockfs from 'mock-fs'; -import { - describe, - it, - expect, - beforeEach, - afterEach -} from 'vitest'; +import { describe, it, expect } from 'vitest'; import dependencyTree from '../index.js'; -import { - fixtures, - mockEs6, - mockSass, - mockStylus, - mockLess -} from './helpers.js'; +import { fixtures } from './helpers.js'; function testToList(format, ext = '.js') { it('returns a post-order list form of the dependency tree', () => { @@ -28,16 +15,8 @@ function testToList(format, ext = '.js') { } describe('toList', () => { - afterEach(() => { - mockfs.restore(); - }); - it('returns an empty list on a non-existent filename', () => { const directory = fixtures('imaginary'); - mockfs({ - [directory]: {} - }); - const filename = path.normalize(`${directory}/notafile.js`); const list = dependencyTree.toList({ filename, directory }); @@ -66,34 +45,18 @@ describe('toList', () => { }); describe('es6', () => { - beforeEach(() => { - mockEs6(); - }); - testToList('es6'); }); describe('sass', () => { - beforeEach(() => { - mockSass(); - }); - testToList('sass', '.scss'); }); describe('stylus', () => { - beforeEach(() => { - mockStylus(); - }); - testToList('stylus', '.styl'); }); describe('less', () => { - beforeEach(() => { - mockLess(); - }); - testToList('less', '.less'); }); diff --git a/vitest.config.js b/vitest.config.js index 46e63c1..f3cb229 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -2,7 +2,6 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { - setupFiles: ['test/setup.js'], include: ['test/**/*.test.js'], coverage: { provider: 'v8', From 86f27da7c73f53b7ef40940dea8f25b011a34236 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 24 May 2026 15:15:28 +0300 Subject: [PATCH 3/3] tests: minor deduplication --- test/config.test.js | 17 +++----- test/formats.test.js | 36 ++++++++--------- test/index.test.js | 84 +++++++++++++++++++-------------------- test/node-modules.test.js | 42 ++++++++++---------- 4 files changed, 88 insertions(+), 91 deletions(-) diff --git a/test/config.test.js b/test/config.test.js index be268ad..4f78ac7 100644 --- a/test/config.test.js +++ b/test/config.test.js @@ -5,7 +5,7 @@ import dependencyTree from '../index.js'; import { fixtures } from './helpers.js'; describe('Config', () => { - it('pre-parses tsconfig for performance', () => { + describe('with a tsConfig path', () => { const tsConfigPath = fixtures('ts', '.tsconfig'); const config = new Config({ filename: 'foo', @@ -13,18 +13,13 @@ describe('Config', () => { tsConfig: tsConfigPath }); - expect(config.tsConfig).toBeTypeOf('object'); - }); - - it('includes tsConfigPath so filing-cabinet can resolve compilerOptions.paths', () => { - const tsConfigPath = fixtures('ts', '.tsconfig'); - const config = new Config({ - filename: 'foo', - directory: 'bar', - tsConfig: tsConfigPath + it('pre-parses tsconfig for performance', () => { + expect(config.tsConfig).toBeTypeOf('object'); }); - expect(config.tsConfigPath).toBe(tsConfigPath); + it('includes tsConfigPath so filing-cabinet can resolve compilerOptions.paths', () => { + expect(config.tsConfigPath).toBe(tsConfigPath); + }); }); it('retains detective config in the clone', () => { diff --git a/test/formats.test.js b/test/formats.test.js index 6df1d0d..783799b 100644 --- a/test/formats.test.js +++ b/test/formats.test.js @@ -166,6 +166,8 @@ describe('module formats', () => { describe('typescript', () => { const directory = fixtures('ts'); + const depB = path.join(directory, 'b.ts'); + const depC = path.join(directory, 'c.ts'); testTreesForFormat('ts', '.ts'); @@ -179,9 +181,6 @@ describe('module formats', () => { tsConfig: tsConfigPath }); - const depB = path.join(directory, 'b.ts'); - const depC = path.join(directory, 'c.ts'); - expect(results).toStrictEqual([depB, depC, filename]); }); @@ -191,8 +190,6 @@ describe('module formats', () => { directory }); - const depC = path.join(directory, 'c.ts'); - expect(results[0]).toBe(depC); }); @@ -216,25 +213,28 @@ describe('module formats', () => { expect(results).toHaveLength(2); }); - it('recognizes ts file import from js file when allowJs is on (#104)', () => { + describe('mixedTsJs', () => { const directory = fixtures('ts', 'mixedTsJs'); - const filename = path.join(directory, 'a.js'); - const tsConfigPath = path.join(directory, '.tsconfig'); - const options = { - filename, - directory, - tsConfig: tsConfigPath - }; - const parsedTsConfig = new Config(options).tsConfig; + it('recognizes ts file import from js file when allowJs is on (#104)', () => { + const filename = path.join(directory, 'a.js'); + const tsConfigPath = path.join(directory, '.tsconfig'); - expect(parsedTsConfig.compilerOptions.allowJs).toBe(true); + const options = { + filename, + directory, + tsConfig: tsConfigPath + }; + const parsedTsConfig = new Config(options).tsConfig; - const results = dependencyTree.toList(options); + expect(parsedTsConfig.compilerOptions.allowJs).toBe(true); - const depB = path.join(directory, 'b.ts'); + const results = dependencyTree.toList(options); - expect(results[0]).toBe(depB); + const depB = path.join(directory, 'b.ts'); + + expect(results[0]).toBe(depB); + }); }); }); }); diff --git a/test/index.test.js b/test/index.test.js index 3358207..c1e4a63 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -161,54 +161,56 @@ describe('dependencyTree', () => { expect(deps).not.toContain(resolve('debug')); }); - it('stores invalid partials in the nonExistent list', () => { - const directory = fixtures('onlyMissingDep'); - const filename = path.normalize(`${directory}/a.js`); - const nonExistent = []; + describe('nonExistent option', () => { + it('stores invalid partials in the nonExistent list', () => { + const directory = fixtures('onlyMissingDep'); + const filename = path.normalize(`${directory}/a.js`); + const nonExistent = []; - dependencyTree({ filename, directory, nonExistent }); + dependencyTree({ filename, directory, nonExistent }); - expect(nonExistent).toStrictEqual(['./notReal']); - }); + expect(nonExistent).toStrictEqual(['./notReal']); + }); - it('does not add valid partials to the nonExistent list', () => { - const directory = fixtures('validPartials'); - const filename = path.normalize(`${directory}/a.js`); - const nonExistent = []; + it('does not add valid partials to the nonExistent list', () => { + const directory = fixtures('validPartials'); + const filename = path.normalize(`${directory}/a.js`); + const nonExistent = []; - dependencyTree({ filename, directory, nonExistent }); + dependencyTree({ filename, directory, nonExistent }); - expect(nonExistent).toStrictEqual([]); - }); + expect(nonExistent).toStrictEqual([]); + }); - it('stores only invalid partials when there is a mix of valid and invalid', () => { - const directory = fixtures('mixedPartials'); - const filename = path.normalize(`${directory}/a.js`); - const nonExistent = []; + it('stores only invalid partials when there is a mix of valid and invalid', () => { + const directory = fixtures('mixedPartials'); + const filename = path.normalize(`${directory}/a.js`); + const nonExistent = []; - dependencyTree({ filename, directory, nonExistent }); + dependencyTree({ filename, directory, nonExistent }); - expect(nonExistent).toStrictEqual(['./notRealMan']); - }); + expect(nonExistent).toStrictEqual(['./notRealMan']); + }); - it('only includes a non-existent partial once when referenced multiple times', () => { - const directory = fixtures('repeatedMissing'); - const filename = path.normalize(`${directory}/a.js`); - const nonExistent = []; + it('only includes a non-existent partial once when referenced multiple times', () => { + const directory = fixtures('repeatedMissing'); + const filename = path.normalize(`${directory}/a.js`); + const nonExistent = []; - dependencyTree({ filename, directory, nonExistent }); + dependencyTree({ filename, directory, nonExistent }); - expect(nonExistent).toStrictEqual(['./notRealMan']); - }); + expect(nonExistent).toStrictEqual(['./notRealMan']); + }); - it('stores a Sass partial in nonExistent when the resolved path does not exist on disk', () => { - const directory = fixtures('missingSassPartial'); - const filename = path.normalize(`${directory}/a.scss`); - const nonExistent = []; + it('stores a Sass partial in nonExistent when the resolved path does not exist on disk', () => { + const directory = fixtures('missingSassPartial'); + const filename = path.normalize(`${directory}/a.scss`); + const nonExistent = []; - dependencyTree({ filename, directory, nonExistent }); + dependencyTree({ filename, directory, nonExistent }); - expect(nonExistent).toStrictEqual(['missing-partial']); + expect(nonExistent).toStrictEqual(['missing-partial']); + }); }); describe('throws', () => { @@ -250,10 +252,10 @@ describe('dependencyTree', () => { }); it('does not throw on the legacy `root` option', () => { - expect(() => { - const directory = fixtures('onlyRealDeps'); - const filename = path.normalize(`${directory}/a.js`); + const directory = fixtures('onlyRealDeps'); + const filename = path.normalize(`${directory}/a.js`); + expect(() => { dependencyTree({ filename, root: directory }); }).not.toThrow(); }); @@ -287,9 +289,10 @@ describe('dependencyTree', () => { }); describe('memoization (#2)', () => { + const directory = fixtures('amd'); + const filename = path.join(directory, 'a.js'); + it('accepts a cache object for memoization (#2)', () => { - const directory = fixtures('amd'); - const filename = path.join(directory, 'a.js'); const bFile = path.join(directory, 'b.js'); const cFile = path.join(directory, 'c.js'); const cache = { @@ -307,9 +310,6 @@ describe('dependencyTree', () => { }); it('returns the precomputed list of a cached entry point', () => { - const directory = fixtures('amd'); - const filename = path.join(directory, 'a.js'); - const cache = { [filename]: [] // Shouldn't process the first file's tree }; diff --git a/test/node-modules.test.js b/test/node-modules.test.js index 9db37eb..9f39ccd 100644 --- a/test/node-modules.test.js +++ b/test/node-modules.test.js @@ -4,30 +4,32 @@ import dependencyTree from '../index.js'; import { fixtures } from './helpers.js'; describe('package-specific node_modules resolution', () => { - const directory = fixtures('es6', 'parentChild'); - const filename = path.normalize(`${directory}/module.entry.js`); - const rootChildPath = path.normalize(`${directory}/node_modules/child_node_module/index.main.js`); - const nestedChildPath = path.normalize(`${directory}/node_modules/parent_module_a/node_modules/child_node_module/index.main.js`); - - it('finds sub package in node module package', () => { - const treeList = dependencyTree({ - filename, - directory, - isListForm: true + describe('with a nested parent/child package layout', () => { + const directory = fixtures('es6', 'parentChild'); + const filename = path.normalize(`${directory}/module.entry.js`); + const rootChildPath = path.normalize(`${directory}/node_modules/child_node_module/index.main.js`); + const nestedChildPath = path.normalize(`${directory}/node_modules/parent_module_a/node_modules/child_node_module/index.main.js`); + + it('finds sub package in node module package', () => { + const treeList = dependencyTree({ + filename, + directory, + isListForm: true + }); + + expect(treeList).toContain(nestedChildPath); }); - expect(treeList).toContain(nestedChildPath); - }); + it('uses correct version of sub package in node module package', () => { + const treeList = dependencyTree({ + filename, + directory, + isListForm: true + }); - it('uses correct version of sub package in node module package', () => { - const treeList = dependencyTree({ - filename, - directory, - isListForm: true + expect(treeList).not.toContain(rootChildPath); + expect(treeList).toContain(nestedChildPath); }); - - expect(treeList).not.toContain(rootChildPath); - expect(treeList).toContain(nestedChildPath); }); it('falls back to entry directory when a node_modules file has no package subpath', () => {