From 65928e5324a7741375f29a57d6b404308c21f133 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Sun, 5 Nov 2023 02:11:41 +0000 Subject: [PATCH 01/11] Bump major dependencies. --- package-lock.json | 1223 +++++++++++++++++++++++++-------------------- package.json | 12 +- 2 files changed, 695 insertions(+), 540 deletions(-) diff --git a/package-lock.json b/package-lock.json index 11a0b690..0a22e4de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "make-fetch-happen": "^11.1.1", "minimatch": "^9.0.3", "p-map": "^4.0.0", - "pacote": "15.2.0", + "pacote": "17.0.4", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts-ncu": "^3.0.0", @@ -40,7 +40,7 @@ "strip-ansi": "^7.1.0", "strip-json-comments": "^5.0.1", "untildify": "^4.0.0", - "update-notifier": "^6.0.2" + "update-notifier": "^7.0.0" }, "bin": { "ncu": "build/src/bin/cli.js", @@ -70,20 +70,19 @@ "@types/rimraf": "^3.0.2", "@types/semver": "^7.5.4", "@types/semver-utils": "^1.1.2", - "@types/sinon": "^10.0.20", + "@types/sinon": "^17.0.0", "@types/update-notifier": "^6.0.6", "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", + "@typescript-eslint/parser": "^6.9.1", "c8": "^8.0.1", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", "chai-string": "^1.5.0", "cross-env": "^7.0.3", "eslint": "^8.53.0", - "eslint-config-prettier": "^8.10.0", + "eslint-config-prettier": "^9.0.0", "eslint-config-raine": "^0.5.0", "eslint-config-standard": "^17.1.0", - "eslint-plugin-fp": "^2.3.0", "eslint-plugin-import": "^2.29.0", "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-n": "^16.2.0", @@ -95,7 +94,7 @@ "npm-run-all": "^4.1.5", "prettier": "^2.8.8", "should": "^13.2.3", - "sinon": "^15.2.0", + "sinon": "^17.0.1", "strip-ansi": "^7.1.0", "ts-node": "^10.9.1", "typescript": "^5.1.3", @@ -782,6 +781,77 @@ "node": ">= 8" } }, + "node_modules/@npmcli/agent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-2.2.0.tgz", + "integrity": "sha512-2yThA1Es98orMkpSLVqlDZAMPK3jHJhifP2gnNUdk1754uZ8yI5c+ulCoVG+WlntQA6MzhrURMXjSd9Z7dJ2/Q==", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@npmcli/agent/node_modules/http-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@npmcli/agent/node_modules/https-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@npmcli/agent/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/@npmcli/agent/node_modules/socks-proxy-agent": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", + "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/@npmcli/fs": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", @@ -794,35 +864,51 @@ } }, "node_modules/@npmcli/git": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.1.0.tgz", - "integrity": "sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-5.0.3.tgz", + "integrity": "sha512-UZp9NwK+AynTrKvHn5k3KviW/hA5eENmFsu3iAPe7sWRt0lFUdsY/wXIYjpDFe7cdSNwOIzbObfwgt6eL5/2zw==", "dependencies": { - "@npmcli/promise-spawn": "^6.0.0", - "lru-cache": "^7.4.4", - "npm-pick-manifest": "^8.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", "proc-log": "^3.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", - "which": "^3.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/git/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/git/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" } }, "node_modules/@npmcli/git/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.13.0 || >=18.0.0" } }, "node_modules/@npmcli/installed-package-contents": { @@ -849,57 +935,73 @@ } }, "node_modules/@npmcli/promise-spawn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", - "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.0.tgz", + "integrity": "sha512-wBqcGsMELZna0jDblGd7UXgOby45TQaMWmbFwWX+SEotk4HV6zG2t6rT9siyLhPk4P6YYqgfL1UO8nMWDBVJXQ==", "dependencies": { - "which": "^3.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/promise-spawn/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "engines": { + "node": ">=16" } }, "node_modules/@npmcli/promise-spawn/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.13.0 || >=18.0.0" } }, "node_modules/@npmcli/run-script": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz", - "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-7.0.2.tgz", + "integrity": "sha512-Omu0rpA8WXvcGeY6DDzyRoY1i5DkCBkzyJ+m2u7PD6quzb0TvSqdIPOkTn8ZBOj7LbbcbMfZ3c5skwSu6m8y2w==", "dependencies": { "@npmcli/node-gyp": "^3.0.0", - "@npmcli/promise-spawn": "^6.0.0", - "node-gyp": "^9.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "node-gyp": "^10.0.0", "read-package-json-fast": "^3.0.0", - "which": "^3.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/run-script/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "engines": { + "node": ">=16" } }, "node_modules/@npmcli/run-script/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", "dependencies": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.13.0 || >=18.0.0" } }, "node_modules/@pkgjs/parseargs": { @@ -949,34 +1051,98 @@ } }, "node_modules/@sigstore/bundle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.0.0.tgz", - "integrity": "sha512-yLvrWDOh6uMOUlFCTJIZEnwOT9Xte7NPXUqVexEKGSF5XtBAuSg5du0kn3dRR0p47a4ah10Y0mNt8+uyeQXrBQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.1.0.tgz", + "integrity": "sha512-89uOo6yh/oxaU8AeOUnVrTdVMcGk9Q1hJa7Hkvalc6G3Z3CupWk4Xe9djSgJm9fMkH69s0P0cVHUoKSOemLdng==", "dependencies": { - "@sigstore/protobuf-specs": "^0.2.0" + "@sigstore/protobuf-specs": "^0.2.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/@sigstore/protobuf-specs": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.2.0.tgz", - "integrity": "sha512-8ZhZKAVfXjIspDWwm3D3Kvj0ddbJ0HqDZ/pOs5cx88HpT8mVsotFrg7H1UMnXOuDHz6Zykwxn4mxG3QLuN+RUg==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.2.1.tgz", + "integrity": "sha512-XTWVxnWJu+c1oCshMLwnKvz8ZQJJDVOlciMfgpJBQbThVjKTCG8dwyhgLngBD2KN0ap9F/gOV8rFDEx8uh7R2A==", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/@sigstore/sign": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.0.tgz", + "integrity": "sha512-AAbmnEHDQv6CSfrWA5wXslGtzLPtAtHZleKOgxdQYvx/s76Fk6T6ZVt7w2IGV9j1UrFeBocTTQxaXG2oRrDhYA==", + "dependencies": { + "@sigstore/bundle": "^2.1.0", + "@sigstore/protobuf-specs": "^0.2.1", + "make-fetch-happen": "^13.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/cacache": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.0.tgz", + "integrity": "sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/@sigstore/sign/node_modules/make-fetch-happen": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", + "integrity": "sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/@sigstore/tuf": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-1.0.3.tgz", - "integrity": "sha512-2bRovzs0nJZFlCN3rXirE4gwxCn97JNjMmwpecqlbgV9WcxX7WRuIrgzx/X7Ib7MYRbyUTpBYE0s2x6AmZXnlg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-2.2.0.tgz", + "integrity": "sha512-KKATZ5orWfqd9ZG6MN8PtCIx4eevWSuGRKQvofnWXRpyMyUEpmrzg5M5BrCpjM+NfZ0RbNGOh5tCz/P2uoRqOA==", "dependencies": { - "@sigstore/protobuf-specs": "^0.2.0", - "tuf-js": "^1.1.7" + "@sigstore/protobuf-specs": "^0.2.1", + "tuf-js": "^2.1.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/@sindresorhus/is": { @@ -1000,9 +1166,9 @@ } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", + "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0" @@ -1101,23 +1267,23 @@ "dev": true }, "node_modules/@tufjs/canonical-json": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz", - "integrity": "sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz", + "integrity": "sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/@tufjs/models": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.4.tgz", - "integrity": "sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-2.0.0.tgz", + "integrity": "sha512-c8nj8BaOExmZKO2DXhDfegyhSGcG9E/mPN3U13L+/PsoWm1uaGiHHjxqSHQiasDBQwDA3aHuw9+9spYAP1qvvg==", "dependencies": { - "@tufjs/canonical-json": "1.0.0", - "minimatch": "^9.0.0" + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.3" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/@types/chai": { @@ -1370,9 +1536,9 @@ "dev": true }, "node_modules/@types/sinon": { - "version": "10.0.20", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.20.tgz", - "integrity": "sha512-2APKKruFNCAZgx3daAyACGzWuJ028VVCUDk6o2rw/Z4PXT0ogwdV4KUegW0MwVs0Zu59auPXbbuBJHF12Sx1Eg==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.0.tgz", + "integrity": "sha512-oN4AeDMFCeNZrAffCjhLcwwVymRZL2c9mljUmhPnd0eiM06d4ELDg0Q0TSvnZXrCIFlSA859qIdcfu1HapswPQ==", "dev": true, "dependencies": { "@types/sinonjs__fake-timers": "*" @@ -1438,25 +1604,83 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.1.tgz", + "integrity": "sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/scope-manager": "6.9.1", + "@typescript-eslint/types": "6.9.1", + "@typescript-eslint/typescript-estree": "6.9.1", + "@typescript-eslint/visitor-keys": "6.9.1", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.1.tgz", + "integrity": "sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.9.1", + "@typescript-eslint/visitor-keys": "6.9.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.1.tgz", + "integrity": "sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.1.tgz", + "integrity": "sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.9.1", + "@typescript-eslint/visitor-keys": "6.9.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" }, "peerDependenciesMeta": { "typescript": { @@ -1464,6 +1688,23 @@ } } }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.1.tgz", + "integrity": "sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.9.1", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/scope-manager": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", @@ -1633,9 +1874,12 @@ } }, "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", + "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, "node_modules/acorn": { "version": "8.10.0", @@ -1809,11 +2053,6 @@ "node": ">= 8" } }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" - }, "node_modules/are-docs-informative": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", @@ -1823,18 +2062,6 @@ "node": ">=14" } }, - "node_modules/are-we-there-yet": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", - "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -2485,20 +2712,6 @@ "node": ">=10" } }, - "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -2686,14 +2899,6 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "bin": { - "color-support": "bin.js" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2726,7 +2931,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/config-chain": { "version": "1.1.13", @@ -2760,11 +2966,6 @@ "url": "https://github.com/yeoman/configstore?sponsor=1" } }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" - }, "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", @@ -2797,18 +2998,6 @@ } } }, - "node_modules/create-eslint-index": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/create-eslint-index/-/create-eslint-index-1.0.0.tgz", - "integrity": "sha512-nXvJjnfDytOOaPOonX0h0a1ggMoqrhdekGeZkD6hkcWYvlCWhU719tKFVh8eU04CnMwu3uwe1JjwuUF2C3k2qg==", - "dev": true, - "dependencies": { - "lodash.get": "^4.3.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -2983,11 +3172,6 @@ "node": ">=0.4.0" } }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -3275,23 +3459,10 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-ast-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-ast-utils/-/eslint-ast-utils-1.1.0.tgz", - "integrity": "sha512-otzzTim2/1+lVrlH19EfQQJEhVJSu0zOb9ygb3iapN6UlyaDtyRq4b5U1FuW0v1lRa9Fp/GJyHkSwm6NqABgCA==", - "dev": true, - "dependencies": { - "lodash.get": "^4.4.2", - "lodash.zip": "^4.2.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-config-prettier": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", - "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -3408,24 +3579,6 @@ "eslint": ">=8" } }, - "node_modules/eslint-plugin-fp": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-fp/-/eslint-plugin-fp-2.3.0.tgz", - "integrity": "sha512-3n2oHibwoIxAht9/+ZaTldhI6brXORgl8oNXqZd+d9xuAQt2SBJ2/aml0oQRMWvXrgsz2WG6wfC++NjzSG3prA==", - "dev": true, - "dependencies": { - "create-eslint-index": "^1.0.0", - "eslint-ast-utils": "^1.0.0", - "lodash": "^4.13.1", - "req-all": "^0.1.0" - }, - "engines": { - "node": ">=4.0.0" - }, - "peerDependencies": { - "eslint": ">=3" - } - }, "node_modules/eslint-plugin-import": { "version": "2.29.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz", @@ -4110,7 +4263,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -4161,61 +4315,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/gauge/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==", - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/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==" - }, - "node_modules/gauge/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==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/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==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -4551,22 +4650,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" - }, - "node_modules/has-yarn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", - "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/hasown": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", @@ -4744,6 +4827,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4752,7 +4836,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/ini": { "version": "4.1.1", @@ -4868,17 +4953,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -4932,6 +5006,20 @@ "node": ">=0.10.0" } }, + "node_modules/is-in-ci": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-in-ci/-/is-in-ci-0.1.0.tgz", + "integrity": "sha512-d9PXLEY0v1iJ64xLiQMJ51J128EYHAaOR4yZqQi8aHGfw6KgifM3/Viw1oZZ1GCVmb3gBuyhLyHj0HgR2DhSXQ==", + "bin": { + "is-in-ci": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", @@ -5125,14 +5213,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-yarn-global": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", - "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", - "engines": { - "node": ">=12" - } - }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -5602,12 +5682,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.zip": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.zip/-/lodash.zip-4.2.0.tgz", - "integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==", - "dev": true - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -5927,9 +6001,9 @@ } }, "node_modules/minipass": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz", - "integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", "engines": { "node": ">=16 || 14 >=14.17" } @@ -6280,9 +6354,9 @@ "dev": true }, "node_modules/nise": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.4.tgz", - "integrity": "sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.5.tgz", + "integrity": "sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==", "dev": true, "dependencies": { "@sinonjs/commons": "^2.0.0", @@ -6301,120 +6375,165 @@ "type-detect": "4.0.8" } }, + "node_modules/nise/node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, "node_modules/node-gyp": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.4.0.tgz", - "integrity": "sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-10.0.1.tgz", + "integrity": "sha512-gg3/bHehQfZivQVfqIyy8wTdSymF9yTyP4CJifK73imyNMU8AIGQE2pUa7dNWfmMeG9cDVF2eehiRMv0LC1iAg==", "dependencies": { "env-paths": "^2.2.0", "exponential-backoff": "^3.1.1", - "glob": "^7.1.4", + "glob": "^10.3.10", "graceful-fs": "^4.2.6", - "make-fetch-happen": "^11.0.3", - "nopt": "^6.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", + "make-fetch-happen": "^13.0.0", + "nopt": "^7.0.0", + "proc-log": "^3.0.0", "semver": "^7.3.5", "tar": "^6.1.2", - "which": "^2.0.2" + "which": "^4.0.0" }, "bin": { "node-gyp": "bin/node-gyp.js" }, "engines": { - "node": "^12.13 || ^14.13 || >=16" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/node-gyp/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/node-gyp/node_modules/cacache": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.0.tgz", + "integrity": "sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/node-gyp/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, + "node_modules/node-gyp/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=16" } }, - "node_modules/node-gyp/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/node-gyp/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/node-gyp/node_modules/make-fetch-happen": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", + "integrity": "sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==", "dependencies": { - "brace-expansion": "^1.1.7" + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" }, "engines": { - "node": "*" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/node-gyp/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "node_modules/node-gyp/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", "dependencies": { - "glob": "^7.1.3" + "isexe": "^3.1.1" }, "bin": { - "rimraf": "bin.js" + "node-which": "bin/which.js" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": "^16.13.0 || >=18.0.0" } }, "node_modules/nopt": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", - "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz", + "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==", "dependencies": { - "abbrev": "^1.0.0" + "abbrev": "^2.0.0" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/normalize-package-data": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", "dependencies": { - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^7.0.0", "is-core-module": "^2.8.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/normalize-package-data/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", "dependencies": { - "lru-cache": "^7.5.1" + "lru-cache": "^10.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/normalize-package-data/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" } }, "node_modules/normalize-path": { @@ -6449,9 +6568,9 @@ } }, "node_modules/npm-install-checks": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.1.1.tgz", - "integrity": "sha512-dH3GmQL4vsPtld59cOn8uY0iOqRmqKvV+DLGwNXV/Q7MDgD2QfOADWd/mFXcIE5LVhYYGjA3baz6W9JneqnuCw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.3.0.tgz", + "integrity": "sha512-W29RiK/xtpCGqn6f3ixfRYGk+zRyr+Ew9F2E20BfXxT5/euLdA/Nm7fO7OeTGuAmTs30cpgInyJ0cYe708YTZw==", "dependencies": { "semver": "^7.1.1" }, @@ -6468,34 +6587,42 @@ } }, "node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-11.0.1.tgz", + "integrity": "sha512-M7s1BD4NxdAvBKUPqqRW957Xwcl/4Zvo8Aj+ANrzvIPzGJZElrH7Z//rSaec2ORcND6FHHLnZeY8qgTpXDMFQQ==", "dependencies": { - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^7.0.0", "proc-log": "^3.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm-package-arg/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", "dependencies": { - "lru-cache": "^7.5.1" + "lru-cache": "^10.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-package-arg/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" } }, "node_modules/npm-packlist": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", - "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-8.0.0.tgz", + "integrity": "sha512-ErAGFB5kJUciPy1mmx/C2YFbvxoJ0QJ9uwkCZOeR6CqLLISPZBOiFModAbSXnjjlwW5lOhuhXva+fURsSGJqyw==", "dependencies": { "ignore-walk": "^6.0.0" }, @@ -6504,42 +6631,85 @@ } }, "node_modules/npm-pick-manifest": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-8.0.1.tgz", - "integrity": "sha512-mRtvlBjTsJvfCCdmPtiu2bdlx8d/KXtF7yNXNWe7G0Z36qWA9Ny5zXsI2PfBZEv7SXgoxTmNaTzGSbbzDZChoA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-9.0.0.tgz", + "integrity": "sha512-VfvRSs/b6n9ol4Qb+bDwNGUXutpy76x6MARw/XssevE0TnctIKcmklJZM5Z7nqs5z5aW+0S63pgCNbpkUNNXBg==", "dependencies": { "npm-install-checks": "^6.0.0", "npm-normalize-package-bin": "^3.0.0", - "npm-package-arg": "^10.0.0", + "npm-package-arg": "^11.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm-registry-fetch": { - "version": "14.0.5", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.5.tgz", - "integrity": "sha512-kIDMIo4aBm6xg7jOttupWZamsZRkAqMqwqqbVXnUqstY5+tapvv6bkH/qMR76jdgV+YljEUCyWx3hRYMrJiAgA==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-16.1.0.tgz", + "integrity": "sha512-PQCELXKt8Azvxnt5Y85GseQDJJlglTFM9L9U9gkv2y4e9s0k3GVDdOx3YoB6gm2Do0hlkzC39iCGXby+Wve1Bw==", "dependencies": { - "make-fetch-happen": "^11.0.0", - "minipass": "^5.0.0", + "make-fetch-happen": "^13.0.0", + "minipass": "^7.0.2", "minipass-fetch": "^3.0.0", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", - "npm-package-arg": "^10.0.0", + "npm-package-arg": "^11.0.0", "proc-log": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm-registry-fetch/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "node_modules/npm-registry-fetch/node_modules/cacache": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.0.tgz", + "integrity": "sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, "engines": { - "node": ">=8" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-registry-fetch/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/npm-registry-fetch/node_modules/make-fetch-happen": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", + "integrity": "sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm-run-all": { @@ -6700,20 +6870,6 @@ "which": "bin/which" } }, - "node_modules/npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", @@ -6809,6 +6965,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -6898,26 +7055,26 @@ } }, "node_modules/pacote": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.2.0.tgz", - "integrity": "sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==", + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-17.0.4.tgz", + "integrity": "sha512-eGdLHrV/g5b5MtD5cTPyss+JxOlaOloSMG3UwPMAvL8ywaLJ6beONPF40K4KKl/UI6q5hTKCJq5rCu8tkF+7Dg==", "dependencies": { - "@npmcli/git": "^4.0.0", + "@npmcli/git": "^5.0.0", "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/run-script": "^6.0.0", - "cacache": "^17.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "@npmcli/run-script": "^7.0.0", + "cacache": "^18.0.0", "fs-minipass": "^3.0.0", - "minipass": "^5.0.0", - "npm-package-arg": "^10.0.0", - "npm-packlist": "^7.0.0", - "npm-pick-manifest": "^8.0.0", - "npm-registry-fetch": "^14.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^11.0.0", + "npm-packlist": "^8.0.0", + "npm-pick-manifest": "^9.0.0", + "npm-registry-fetch": "^16.0.0", "proc-log": "^3.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^6.0.0", + "read-package-json": "^7.0.0", "read-package-json-fast": "^3.0.0", - "sigstore": "^1.3.0", + "sigstore": "^2.0.0", "ssri": "^10.0.0", "tar": "^6.1.11" }, @@ -6925,15 +7082,37 @@ "pacote": "lib/bin.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "node_modules/pacote/node_modules/cacache": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.0.tgz", + "integrity": "sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, "engines": { - "node": ">=8" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" } }, "node_modules/parent-module": { @@ -6995,6 +7174,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -7283,17 +7463,17 @@ } }, "node_modules/read-package-json": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.4.tgz", - "integrity": "sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-7.0.0.tgz", + "integrity": "sha512-uL4Z10OKV4p6vbdvIXB+OzhInYtIozl/VxUBPgNkBuUi2DeRonnuspmaVAMcrkmfjKGNmRndyQAbE7/AmzGwFg==", "dependencies": { "glob": "^10.2.2", "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", + "normalize-package-data": "^6.0.0", "npm-normalize-package-bin": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/read-package-json-fast": { @@ -7377,19 +7557,6 @@ "semver": "bin/semver" } }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -7452,15 +7619,6 @@ "node": ">=8" } }, - "node_modules/req-all": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/req-all/-/req-all-0.1.0.tgz", - "integrity": "sha512-ZdvPr8uXy9ujX3KujwE2P1HWkMYgogIhqeAeyb47MqWjSfyxERSm0TNbN/IapCCmWDufXab04AYrRgObaJCJ6Q==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -7637,6 +7795,7 @@ "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", @@ -7734,11 +7893,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -7841,33 +7995,30 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "node_modules/sigstore": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-1.8.0.tgz", - "integrity": "sha512-ogU8qtQ3VFBawRJ8wjsBEX/vIFeHuGs1fm4jZtjWQwjo8pfAt7T/rh+udlAN4+QUe0IzA8qRSc/YZ7dHP6kh+w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-2.1.0.tgz", + "integrity": "sha512-kPIj+ZLkyI3QaM0qX8V/nSsweYND3W448pwkDgS6CQ74MfhEkIR8ToK5Iyx46KJYRjseVcD3Rp9zAmUAj6ZjPw==", "dependencies": { - "@sigstore/bundle": "^1.0.0", - "@sigstore/protobuf-specs": "^0.2.0", - "@sigstore/tuf": "^1.0.3", - "make-fetch-happen": "^11.0.1" - }, - "bin": { - "sigstore": "bin/sigstore.js" + "@sigstore/bundle": "^2.1.0", + "@sigstore/protobuf-specs": "^0.2.1", + "@sigstore/sign": "^2.1.0", + "@sigstore/tuf": "^2.1.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/sinon": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.2.0.tgz", - "integrity": "sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-17.0.1.tgz", + "integrity": "sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^10.3.0", + "@sinonjs/fake-timers": "^11.2.2", "@sinonjs/samsam": "^8.0.0", "diff": "^5.1.0", - "nise": "^5.1.4", + "nise": "^5.1.5", "supports-color": "^7.2.0" }, "funding": { @@ -8022,14 +8173,6 @@ "node": ">=8" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -8352,6 +8495,18 @@ "node": ">=8.0" } }, + "node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", @@ -8456,16 +8611,67 @@ "dev": true }, "node_modules/tuf-js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.7.tgz", - "integrity": "sha512-i3P9Kgw3ytjELUfpuKVDNBJvk4u5bXL6gskv572mcevPbSKCV3zt3djhmlEQ65yERjIbOSncy7U4cQJaB1CBCg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-2.1.0.tgz", + "integrity": "sha512-eD7YPPjVlMzdggrOeE8zwoegUaG/rt6Bt3jwoQPunRiNVzgcCE009UDFJKJjG+Gk9wFu6W/Vi+P5d/5QpdD9jA==", "dependencies": { - "@tufjs/models": "1.0.4", + "@tufjs/models": "2.0.0", "debug": "^4.3.4", - "make-fetch-happen": "^11.1.1" + "make-fetch-happen": "^13.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/tuf-js/node_modules/cacache": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.0.tgz", + "integrity": "sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/tuf-js/node_modules/lru-cache": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", + "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/tuf-js/node_modules/make-fetch-happen": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", + "integrity": "sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/type-check": { @@ -8870,27 +9076,25 @@ } }, "node_modules/update-notifier": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", - "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-7.0.0.tgz", + "integrity": "sha512-Hv25Bh+eAbOLlsjJreVPOs4vd51rrtCrmhyOJtbpAojro34jS4KQaEp4/EvlHJX7jSO42VvEFpkastVyXyIsdQ==", "dependencies": { - "boxen": "^7.0.0", - "chalk": "^5.0.1", + "boxen": "^7.1.1", + "chalk": "^5.3.0", "configstore": "^6.0.0", - "has-yarn": "^3.0.0", "import-lazy": "^4.0.0", - "is-ci": "^3.0.1", + "is-in-ci": "^0.1.0", "is-installed-globally": "^0.4.0", "is-npm": "^6.0.0", - "is-yarn-global": "^0.4.0", "latest-version": "^7.0.0", "pupa": "^3.1.0", - "semver": "^7.3.7", + "semver": "^7.5.4", "semver-diff": "^4.0.0", "xdg-basedir": "^5.1.0" }, "engines": { - "node": ">=14.16" + "node": ">=18" }, "funding": { "url": "https://github.com/yeoman/update-notifier?sponsor=1" @@ -8905,11 +9109,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -9024,51 +9223,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/wide-align/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==", - "engines": { - "node": ">=8" - } - }, - "node_modules/wide-align/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==" - }, - "node_modules/wide-align/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==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wide-align/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==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/widest-line": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", @@ -9203,7 +9357,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/write-file-atomic": { "version": "3.0.3", diff --git a/package.json b/package.json index 8e7f215b..b9563b68 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "make-fetch-happen": "^11.1.1", "minimatch": "^9.0.3", "p-map": "^4.0.0", - "pacote": "15.2.0", + "pacote": "17.0.4", "parse-github-url": "^1.0.2", "progress": "^2.0.3", "prompts-ncu": "^3.0.0", @@ -88,7 +88,7 @@ "strip-ansi": "^7.1.0", "strip-json-comments": "^5.0.1", "untildify": "^4.0.0", - "update-notifier": "^6.0.2" + "update-notifier": "^7.0.0" }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.2.1", @@ -114,17 +114,17 @@ "@types/rimraf": "^3.0.2", "@types/semver": "^7.5.4", "@types/semver-utils": "^1.1.2", - "@types/sinon": "^10.0.20", + "@types/sinon": "^17.0.0", "@types/update-notifier": "^6.0.6", "@typescript-eslint/eslint-plugin": "^5.62.0", - "@typescript-eslint/parser": "^5.62.0", + "@typescript-eslint/parser": "^6.9.1", "c8": "^8.0.1", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", "chai-string": "^1.5.0", "cross-env": "^7.0.3", "eslint": "^8.53.0", - "eslint-config-prettier": "^8.10.0", + "eslint-config-prettier": "^9.0.0", "eslint-config-raine": "^0.5.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.0", @@ -138,7 +138,7 @@ "npm-run-all": "^4.1.5", "prettier": "^2.8.8", "should": "^13.2.3", - "sinon": "^15.2.0", + "sinon": "^17.0.1", "strip-ansi": "^7.1.0", "ts-node": "^10.9.1", "typescript": "^5.1.3", From c39c48b266401e57eaccb2cd4a83b957953c5673 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Sun, 5 Nov 2023 02:20:05 +0000 Subject: [PATCH 02/11] Upgrade @typescript-eslint/eslint-plugin. --- .eslintrc.js | 3 +- package-lock.json | 229 +++++++++++----------------------------------- package.json | 2 +- 3 files changed, 55 insertions(+), 179 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index fab9076e..df0ce73d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,7 +28,7 @@ module.exports = { '@typescript-eslint/array-type': [ 'error', { - 'array-type': 'array', + default: 'array', }, ], }, @@ -36,7 +36,6 @@ module.exports = { ], plugins: ['jsdoc'], rules: { - // jsdoc 'jsdoc/require-jsdoc': [ 'error', { diff --git a/package-lock.json b/package-lock.json index 0a22e4de..7f7c0cfd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -72,7 +72,7 @@ "@types/semver-utils": "^1.1.2", "@types/sinon": "^17.0.0", "@types/update-notifier": "^6.0.6", - "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/eslint-plugin": "^6.9.1", "@typescript-eslint/parser": "^6.9.1", "c8": "^8.0.1", "chai": "^4.3.10", @@ -1570,32 +1570,33 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.1.tgz", + "integrity": "sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.9.1", + "@typescript-eslint/type-utils": "6.9.1", + "@typescript-eslint/utils": "6.9.1", + "@typescript-eslint/visitor-keys": "6.9.1", "debug": "^4.3.4", "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1631,7 +1632,7 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "node_modules/@typescript-eslint/scope-manager": { "version": "6.9.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.1.tgz", "integrity": "sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==", @@ -1648,31 +1649,15 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.1.tgz", - "integrity": "sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "node_modules/@typescript-eslint/type-utils": { "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.1.tgz", - "integrity": "sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.1.tgz", + "integrity": "sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.1", - "@typescript-eslint/visitor-keys": "6.9.1", + "@typescript-eslint/typescript-estree": "6.9.1", + "@typescript-eslint/utils": "6.9.1", "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, "engines": { @@ -1682,66 +1667,8 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.1.tgz", - "integrity": "sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.9.1", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, "peerDependencies": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1750,12 +1677,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.1.tgz", + "integrity": "sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1763,21 +1690,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.1.tgz", + "integrity": "sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/types": "6.9.1", + "@typescript-eslint/visitor-keys": "6.9.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1790,42 +1717,41 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.1.tgz", + "integrity": "sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.9.1", + "@typescript-eslint/types": "6.9.1", + "@typescript-eslint/typescript-estree": "6.9.1", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.1.tgz", + "integrity": "sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.9.1", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -3745,19 +3671,6 @@ "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -3986,15 +3899,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -6333,12 +6237,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -8589,27 +8487,6 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/tuf-js": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-2.1.0.tgz", diff --git a/package.json b/package.json index b9563b68..0a6c1e6c 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "@types/semver-utils": "^1.1.2", "@types/sinon": "^17.0.0", "@types/update-notifier": "^6.0.6", - "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/eslint-plugin": "^6.9.1", "@typescript-eslint/parser": "^6.9.1", "c8": "^8.0.1", "chai": "^4.3.10", From 8c7c8f6ae412d887f061fd9c942fe5ef69c066e3 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Sun, 5 Nov 2023 03:24:16 +0000 Subject: [PATCH 03/11] Upgrade fp-and-or. --- package-lock.json | 10 +++++----- package.json | 2 +- src/lib/filterAndReject.ts | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f7c0cfd..a067289f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "commander": "^11.1.0", "fast-memoize": "^2.5.2", "find-up": "5.0.0", - "fp-and-or": "^0.1.4", + "fp-and-or": "^1.0.2", "get-stdin": "^8.0.0", "globby": "^11.0.4", "hosted-git-info": "^5.1.0", @@ -4138,11 +4138,11 @@ } }, "node_modules/fp-and-or": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-0.1.4.tgz", - "integrity": "sha512-+yRYRhpnFPWXSly/6V4Lw9IfOV26uu30kynGJ03PW+MnjOEQe45RZ141QcS0aJehYBYA50GfCDnsRbFJdhssRw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fp-and-or/-/fp-and-or-1.0.2.tgz", + "integrity": "sha512-jRuhDpN/8LaE2ghHYKuj11SqUcfus38Rhsd+m9EReVes4KQdLErmHoP5FAWUBg+kci56ucryVryKda7cCyHT6A==", "engines": { - "node": ">=10" + "node": "^16.10.0 || >=18.0.0" } }, "node_modules/fs-minipass": { diff --git a/package.json b/package.json index 0a6c1e6c..a1eb52c1 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "commander": "^11.1.0", "fast-memoize": "^2.5.2", "find-up": "5.0.0", - "fp-and-or": "^0.1.4", + "fp-and-or": "^1.0.2", "get-stdin": "^8.0.0", "globby": "^11.0.4", "hosted-git-info": "^5.1.0", diff --git a/src/lib/filterAndReject.ts b/src/lib/filterAndReject.ts index 52280d2f..7dec21da 100644 --- a/src/lib/filterAndReject.ts +++ b/src/lib/filterAndReject.ts @@ -2,7 +2,7 @@ import { and, or } from 'fp-and-or' import identity from 'lodash/identity' import negate from 'lodash/negate' import { minimatch } from 'minimatch' -import { SemVer, parseRange } from 'semver-utils' +import { parseRange } from 'semver-utils' import { FilterPattern } from '../types/FilterPattern' import { Maybe } from '../types/Maybe' import { VersionSpec } from '../types/VersionSpec' @@ -14,8 +14,8 @@ import { VersionSpec } from '../types/VersionSpec' * @param [filterPattern] * @returns */ -function composeFilter(filterPattern: FilterPattern): (name: string, versionSpec: VersionSpec) => boolean { - let predicate: (name: string, versionSpec: VersionSpec) => boolean +function composeFilter(filterPattern: FilterPattern): (name: string, versionSpec?: string) => boolean { + let predicate: (name: string, versionSpec?: string) => boolean // no filter if (!filterPattern) { @@ -48,7 +48,7 @@ function composeFilter(filterPattern: FilterPattern): (name: string, versionSpec } // array else if (Array.isArray(filterPattern)) { - predicate = (dependencyName: string, versionSpec: string) => + predicate = (dependencyName: string, versionSpec?: string) => filterPattern.some(subpattern => composeFilter(subpattern)(dependencyName, versionSpec)) } // raw RegExp @@ -57,8 +57,8 @@ function composeFilter(filterPattern: FilterPattern): (name: string, versionSpec } // function else if (typeof filterPattern === 'function') { - predicate = (dependencyName: string, versionSpec: string) => - filterPattern(dependencyName, parseRange(versionSpec ?? dependencyName)) + predicate = (dependencyName: string, versionSpec?: string) => + filterPattern(dependencyName, parseRange((versionSpec as string) ?? dependencyName)) } else { throw new TypeError('Invalid filter. Must be a RegExp, array, or comma-or-space-delimited list.') } @@ -82,16 +82,16 @@ function filterAndReject( ) { return and( // filter dep - (dependencyName: VersionSpec, version: SemVer[]) => - and(filter ? composeFilter(filter) : identity, reject ? negate(composeFilter(reject)) : identity)( + (dependencyName: VersionSpec, version: string) => + and(filter ? composeFilter(filter) : true, reject ? negate(composeFilter(reject)) : true)( dependencyName, version, ), // filter version - (dependencyName: VersionSpec, version: SemVer[]) => + (dependencyName: VersionSpec, version: string) => and( - filterVersion ? composeFilter(filterVersion) : identity, - rejectVersion ? negate(composeFilter(rejectVersion)) : identity, + filterVersion ? composeFilter(filterVersion) : true, + rejectVersion ? negate(composeFilter(rejectVersion)) : true, )(version), ) } From d772cc7f8111dbb9c89315dab1a661ff5b3956d6 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Sun, 5 Nov 2023 03:46:30 +0000 Subject: [PATCH 04/11] Upgrade spawn-please. --- package-lock.json | 8 ++-- package.json | 2 +- src/index.ts | 42 ++++++++++--------- src/lib/doctor.ts | 11 ++--- src/package-managers/bun.ts | 8 +++- src/package-managers/npm.ts | 4 +- src/package-managers/pnpm.ts | 6 ++- src/package-managers/yarn.ts | 21 +++++++--- src/types/SpawnOptions.ts | 2 +- src/types/SpawnPleaseOptions.ts | 6 +++ test/interactive.test.ts | 72 +++++++++++++++++++++------------ test/peer.test.ts | 6 +-- 12 files changed, 120 insertions(+), 68 deletions(-) create mode 100644 src/types/SpawnPleaseOptions.ts diff --git a/package-lock.json b/package-lock.json index a067289f..54985a21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "semver": "^7.5.4", "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", - "spawn-please": "^2.0.2", + "spawn-please": "^3.0.0", "strip-ansi": "^7.1.0", "strip-json-comments": "^5.0.1", "untildify": "^4.0.0", @@ -8008,9 +8008,9 @@ } }, "node_modules/spawn-please": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-2.0.2.tgz", - "integrity": "sha512-KM8coezO6ISQ89c1BzyWNtcn2V2kAVtwIXd3cN/V5a0xPYc1F/vydrRc01wsKFEQ/p+V1a4sw4z2yMITIXrgGw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spawn-please/-/spawn-please-3.0.0.tgz", + "integrity": "sha512-XFHEGgEG9R/MCypDDQVWoSSQoGAz5LFYcGoFpdYvnqgYDumHvapPDj54C5Xv7tqTkzEC17AY7Iz90KgrDfj7Gg==", "dependencies": { "cross-spawn": "^7.0.3" }, diff --git a/package.json b/package.json index a1eb52c1..a134851f 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "semver": "^7.5.4", "semver-utils": "^1.1.4", "source-map-support": "^0.5.21", - "spawn-please": "^2.0.2", + "spawn-please": "^3.0.0", "strip-ansi": "^7.1.0", "strip-json-comments": "^5.0.1", "untildify": "^4.0.0", diff --git a/src/index.ts b/src/index.ts index cee04ca6..1e497c5e 100755 --- a/src/index.ts +++ b/src/index.ts @@ -145,26 +145,32 @@ const install = async ( const cwd = options.cwd || path.resolve(pkgFile, '..') let stdout = '' try { - await spawn(cmd, ['install'], { - cwd, - env: { - ...process.env, - ...(options.color !== false ? { FORCE_COLOR: true } : null), - // With spawn, pnpm install will fail with ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies. - // When pnpm install is run directly from the terminal, this error does not occur. - // When pnpm install is run from a simple spawn script, this error does not occur. - // The issue only seems to be when pnpm install is executed from npm-check-updates, but it's not clear what configuration or environmental factors are causing this. - // For now, turn off strict-peer-dependencies on pnpm auto-install. - // See: https://github.com/raineorshine/npm-check-updates/issues/1191 - ...(packageManager === 'pnpm' ? { npm_config_strict_peer_dependencies: false } : null), + await spawn( + cmd, + ['install'], + { + stdout: (data: string) => { + stdout += data + }, + stderr: (data: string) => { + console.error(chalk.red(data.toString())) + }, }, - stdout: (data: string) => { - stdout += data + { + cwd, + env: { + ...process.env, + ...(options.color !== false ? { FORCE_COLOR: true } : null), + // With spawn, pnpm install will fail with ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies. + // When pnpm install is run directly from the terminal, this error does not occur. + // When pnpm install is run from a simple spawn script, this error does not occur. + // The issue only seems to be when pnpm install is executed from npm-check-updates, but it's not clear what configuration or environmental factors are causing this. + // For now, turn off strict-peer-dependencies on pnpm auto-install. + // See: https://github.com/raineorshine/npm-check-updates/issues/1191 + ...(packageManager === 'pnpm' ? { npm_config_strict_peer_dependencies: false } : null), + }, }, - stderr: (data: string) => { - console.error(chalk.red(data.toString())) - }, - }) + ) print(options, stdout) print(options, 'Done') } catch (err: any) { diff --git a/src/lib/doctor.ts b/src/lib/doctor.ts index 5edaf211..d9217069 100644 --- a/src/lib/doctor.ts +++ b/src/lib/doctor.ts @@ -11,6 +11,7 @@ import { Options } from '../types/Options' import { PackageFile } from '../types/PackageFile' import { PackageInfo } from '../types/PackageInfo' import { SpawnOptions } from '../types/SpawnOptions' +import { SpawnPleaseOptions } from '../types/SpawnPleaseOptions' import { VersionSpec } from '../types/VersionSpec' import chalk, { chalkInit } from './chalk' import loadPackageInfoFromFile from './loadPackageInfoFromFile' @@ -23,7 +24,7 @@ const npm = ( args: string[], options: Options, print?: boolean, - { spawnOptions }: { spawnOptions?: SpawnOptions } = {}, + { spawnOptions, spawnPleaseOptions }: { spawnOptions?: SpawnOptions; spawnPleaseOptions?: SpawnPleaseOptions } = {}, ): Promise => { if (print) { console.log(chalk.blue([options.packageManager, ...args].join(' '))) @@ -54,7 +55,7 @@ const npm = ( : options.packageManager === 'bun' ? spawnBun : spawnNpm - )(args, npmOptions, spawnOptionsMerged as any) + )(args, npmOptions, spawnPleaseOptions, spawnOptionsMerged) } /** Load and validate package file and tests. */ @@ -121,7 +122,7 @@ const doctor = async (run: Run, options: Options): Promise => { /** Run the tests using "npm run test" or a custom script given by --doctorTest. */ const runTests = async (): Promise => { - const spawnOptions = { + const spawnPleaseOptions = { stderr: (data: string): void => { console.error(chalk.red(data.toString())) }, @@ -141,7 +142,7 @@ const doctor = async (run: Run, options: Options): Promise => { } const [testCommand, ...testArgs] = groups console.log(chalk.blue(options.doctorTest)) - await spawn(testCommand, testArgs, spawnOptions) + await spawn(testCommand, testArgs, spawnPleaseOptions) } else { await npm( ['run', 'test'], @@ -149,7 +150,7 @@ const doctor = async (run: Run, options: Options): Promise => { packageManager: options.packageManager, }, true, - { spawnOptions }, + { spawnPleaseOptions }, ) } } diff --git a/src/package-managers/bun.ts b/src/package-managers/bun.ts index b3648a9f..e2664749 100644 --- a/src/package-managers/bun.ts +++ b/src/package-managers/bun.ts @@ -5,12 +5,14 @@ import keyValueBy from '../lib/keyValueBy' import programError from '../lib/programError' import { Index } from '../types/IndexType' import { NpmOptions } from '../types/NpmOptions' +import { SpawnPleaseOptions } from '../types/SpawnPleaseOptions' import * as npm from './npm' /** Spawn bun. */ async function spawnBun( args: string | string[], npmOptions: NpmOptions = {}, + spawnPleaseOptions: SpawnPleaseOptions = {}, spawnOptions: Index = {}, ): Promise { // Bun not yet supported on Windows. @@ -27,7 +29,7 @@ async function spawnBun( ...(npmOptions.global ? ['--global'] : []), ] - return spawn('bun', fullArgs, spawnOptions) + return spawn('bun', fullArgs, spawnPleaseOptions, spawnOptions) } /** Returns the global directory of bun. */ @@ -49,6 +51,9 @@ export const list = async (options: Options = {}): Promise = {}, ): Promise { const cmd = process.platform === 'win32' ? 'npm.cmd' : 'npm' @@ -511,7 +513,7 @@ async function spawnNpm( ...(npmOptions.prefix ? [`--prefix=${npmOptions.prefix}`] : []), '--json', ] - return spawn(cmd, fullArgs, spawnOptions) + return spawn(cmd, fullArgs, spawnPleaseOptions, spawnOptions) } /** diff --git a/src/package-managers/pnpm.ts b/src/package-managers/pnpm.ts index f6e1d87f..52974e44 100644 --- a/src/package-managers/pnpm.ts +++ b/src/package-managers/pnpm.ts @@ -12,6 +12,7 @@ import { NpmConfig } from '../types/NpmConfig' import { NpmOptions } from '../types/NpmOptions' import { Options } from '../types/Options' import { SpawnOptions } from '../types/SpawnOptions' +import { SpawnPleaseOptions } from '../types/SpawnPleaseOptions' import { Version } from '../types/Version' import { normalizeNpmConfig, @@ -71,6 +72,7 @@ const spawnPnpm = async ( args: string | string[], npmOptions: NpmOptions = {}, spawnOptions?: SpawnOptions, + spawnPleaseOptions?: SpawnPleaseOptions, ): Promise => { const cmd = process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm' @@ -80,7 +82,9 @@ const spawnPnpm = async ( ...(npmOptions.prefix ? `--prefix=${npmOptions.prefix}` : []), ] - return spawn(cmd, fullArgs, spawnOptions) + const { stdout } = await spawn(cmd, fullArgs, spawnPleaseOptions, spawnOptions) + + return stdout } /** Fetches the list of all installed packages. */ diff --git a/src/package-managers/yarn.ts b/src/package-managers/yarn.ts index 443b26b1..6483ed2b 100644 --- a/src/package-managers/yarn.ts +++ b/src/package-managers/yarn.ts @@ -16,6 +16,7 @@ import { NpmConfig } from '../types/NpmConfig' import { NpmOptions } from '../types/NpmOptions' import { Options } from '../types/Options' import { SpawnOptions } from '../types/SpawnOptions' +import { SpawnPleaseOptions } from '../types/SpawnPleaseOptions' import { VersionSpec } from '../types/VersionSpec' import { distTag as npmDistTag, @@ -197,7 +198,8 @@ function parseJsonLines(result: string): Promise<{ dependencies: Index { const cmd = process.platform === 'win32' ? 'yarn.cmd' : 'yarn' @@ -210,7 +212,9 @@ async function spawnYarn( '--no-progress', ] - return spawn(cmd, fullArgs, spawnOptions) + const { stdout } = await spawn(cmd, fullArgs, spawnPleaseOptions, spawnOptions) + + return stdout } /** @@ -260,10 +264,15 @@ export async function defaultPrefix(options: Options): Promise { * @returns */ export const list = async (options: Options = {}, spawnOptions?: SpawnOptions): Promise> => { - const jsonLines: string = await spawnYarn('list', options as Index, { - ...(options.cwd ? { cwd: options.cwd } : {}), - ...spawnOptions, - }) + const jsonLines: string = await spawnYarn( + 'list', + options as Index, + {}, + { + ...(options.cwd ? { cwd: options.cwd } : {}), + ...spawnOptions, + }, + ) const json: { dependencies: Index } = await parseJsonLines(jsonLines) const keyValues: Index = keyValueBy( json.dependencies, diff --git a/src/types/SpawnOptions.ts b/src/types/SpawnOptions.ts index 01681aa5..fff99f8c 100644 --- a/src/types/SpawnOptions.ts +++ b/src/types/SpawnOptions.ts @@ -2,6 +2,6 @@ import { Index } from './IndexType' /** Options to the spawn node built-in. */ export interface SpawnOptions { + cwd?: string env?: Index - stderr?: (s: string) => void } diff --git a/src/types/SpawnPleaseOptions.ts b/src/types/SpawnPleaseOptions.ts new file mode 100644 index 00000000..7f462e3c --- /dev/null +++ b/src/types/SpawnPleaseOptions.ts @@ -0,0 +1,6 @@ +export interface SpawnPleaseOptions { + rejectOnError?: boolean + stdin?: string + stdout?: (s: string) => void + stderr?: (s: string) => void +} diff --git a/test/interactive.test.ts b/test/interactive.test.ts index 5e9355e0..60ea12ae 100644 --- a/test/interactive.test.ts +++ b/test/interactive.test.ts @@ -37,13 +37,18 @@ describe('--interactive', () => { 'utf-8', ) try { - const stdout = await spawn('node', [bin, '--interactive'], { - cwd: tempDir, - env: { - ...process.env, - INJECT_PROMPTS: JSON.stringify([['ncu-test-v2', 'ncu-test-return-version'], true]), + const { stdout } = await spawn( + 'node', + [bin, '--interactive'], + {}, + { + cwd: tempDir, + env: { + ...process.env, + INJECT_PROMPTS: JSON.stringify([['ncu-test-v2', 'ncu-test-return-version'], true]), + }, }, - }) + ) should.equal(/^Upgrading/m.test(stdout), true) @@ -74,13 +79,18 @@ describe('--interactive', () => { 'utf-8', ) try { - await spawn('node', [bin, '--interactive', '--format', 'group'], { - cwd: tempDir, - env: { - ...process.env, - INJECT_PROMPTS: JSON.stringify([['ncu-test-v2', 'ncu-test-return-version'], true]), + await spawn( + 'node', + [bin, '--interactive', '--format', 'group'], + {}, + { + cwd: tempDir, + env: { + ...process.env, + INJECT_PROMPTS: JSON.stringify([['ncu-test-v2', 'ncu-test-return-version'], true]), + }, }, - }) + ) const upgradedPkg = JSON.parse(await fs.readFile(pkgFile, 'utf-8')) upgradedPkg.dependencies.should.deep.equal({ @@ -114,13 +124,18 @@ describe('--interactive', () => { const configFile = path.join(tempDir, '.ncurc.js') await fs.writeFile(configFile, `module.exports = { groupFunction: () => 'minor' }`, 'utf-8') try { - await spawn('node', [bin, '--interactive', '--format', 'group', '--configFilePath', tempDir], { - cwd: tempDir, - env: { - ...process.env, - INJECT_PROMPTS: JSON.stringify([['ncu-test-v2', 'ncu-test-return-version'], true]), + await spawn( + 'node', + [bin, '--interactive', '--format', 'group', '--configFilePath', tempDir], + {}, + { + cwd: tempDir, + env: { + ...process.env, + INJECT_PROMPTS: JSON.stringify([['ncu-test-v2', 'ncu-test-return-version'], true]), + }, }, - }) + ) const upgradedPkg = JSON.parse(await fs.readFile(pkgFile, 'utf-8')) upgradedPkg.dependencies.should.deep.equal({ @@ -150,16 +165,21 @@ describe('--interactive', () => { 'utf-8', ) try { - await spawn('npm', ['install'], { cwd: tempDir }) - const output = await spawn('node', [bin, '--interactive', '--format', 'repo'], { - cwd: tempDir, - env: { - ...process.env, - INJECT_PROMPTS: JSON.stringify([['modern-diacritics'], true]), + await spawn('npm', ['install'], {}, { cwd: tempDir }) + const { stdout } = await spawn( + 'node', + [bin, '--interactive', '--format', 'repo'], + {}, + { + cwd: tempDir, + env: { + ...process.env, + INJECT_PROMPTS: JSON.stringify([['modern-diacritics'], true]), + }, }, - }) + ) - output.should.include('https://github.com/Mitsunee/modern-diacritics') + stdout.should.include('https://github.com/Mitsunee/modern-diacritics') } finally { await fs.rm(tempDir, { recursive: true, force: true }) } diff --git a/test/peer.test.ts b/test/peer.test.ts index 0bdc6c3c..0392d589 100644 --- a/test/peer.test.ts +++ b/test/peer.test.ts @@ -10,7 +10,7 @@ describe('peer dependencies', function () { it('peer dependencies of installed packages are ignored by default', async () => { const cwd = path.join(__dirname, 'test-data/peer/') try { - await spawnNpm('install', {}, { cwd }) + await spawnNpm('install', {}, {}, { cwd }) const upgrades = await ncu({ cwd }) upgrades!.should.deep.equal({ 'ncu-test-return-version': '2.0.0', @@ -24,7 +24,7 @@ describe('peer dependencies', function () { it('peer dependencies of installed packages are checked when using option peer', async () => { const cwd = path.join(__dirname, 'test-data/peer/') try { - await spawnNpm('install', {}, { cwd }) + await spawnNpm('install', {}, {}, { cwd }) const upgrades = await ncu({ cwd, peer: true }) upgrades!.should.deep.equal({ 'ncu-test-return-version': '1.1.0', @@ -38,7 +38,7 @@ describe('peer dependencies', function () { it('peer dependencies of installed packages are checked iteratively when using option peer', async () => { const cwd = path.join(__dirname, 'test-data/peer-update/') try { - await spawnNpm('install', {}, { cwd }) + await spawnNpm('install', {}, {}, { cwd }) const upgrades = await ncu({ cwd, peer: true }) upgrades!.should.deep.equal({ 'ncu-test-return-version': '1.1.0', From 25f8bf44b4547b37c54a7a364c531114badd5f20 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Tue, 12 Mar 2024 23:07:18 +0000 Subject: [PATCH 05/11] Fix package.json and regenerate package-lock.json. --- package-lock.json | 411 ++++++++++++++++++++-------------------------- package.json | 65 ++++---- 2 files changed, 205 insertions(+), 271 deletions(-) diff --git a/package-lock.json b/package-lock.json index c916be95..be76a848 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,17 +16,15 @@ "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^1.0.2", - "get-stdin": "^8.0.0", - "globby": "^11.0.4", - "hosted-git-info": "^5.1.0", - "ini": "^4.1.1", + "hosted-git-info": "^7.0.1", + "ini": "^4.1.2", "js-yaml": "^4.1.0", "json-parse-helpfulerror": "^1.0.3", "jsonlines": "^0.1.1", "lodash": "^4.17.21", "make-fetch-happen": "^13.0.0", "p-map": "^4.0.0", - "pacote": "17.0.4", + "pacote": "17.0.6", "parse-github-url": "^1.0.2", "picomatch": "^4.0.1", "progress": "^2.0.3", @@ -40,52 +38,51 @@ "strip-ansi": "^7.1.0", "strip-json-comments": "^5.0.1", "untildify": "^4.0.0", - "update-notifier": "^7.0.0" + "update-notifier": "^6.0.2" }, "bin": { "ncu": "build/src/bin/cli.js", "npm-check-updates": "build/src/bin/cli.js" }, "devDependencies": { - "@trivago/prettier-plugin-sort-imports": "^4.2.1", - "@types/chai": "^4.3.9", - "@types/chai-as-promised": "^7.1.7", - "@types/chai-string": "^1.4.4", - "@types/cli-table": "^0.3.3", - "@types/hosted-git-info": "^3.0.4", - "@types/ini": "^1.3.32", - "@types/js-yaml": "^4.0.8", - "@types/json-parse-helpfulerror": "^1.0.2", - "@types/jsonlines": "^0.1.4", - "@types/lodash": "^4.14.200", - "@types/make-fetch-happen": "^10.0.3", - "@types/minimatch": "^5.1.2", - "@types/mocha": "^10.0.3", - "@types/node": "^20.8.10", - "@types/pacote": "^11.1.7", - "@types/parse-github-url": "^1.0.2", - "@types/progress": "^2.0.6", - "@types/prompts": "^2.4.7", - "@types/remote-git-tags": "^4.0.1", - "@types/rimraf": "^3.0.2", - "@types/semver": "^7.5.4", - "@types/semver-utils": "^1.1.2", - "@types/sinon": "^17.0.0", - "@types/update-notifier": "^6.0.6", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/chai": "^4.3.12", + "@types/chai-as-promised": "^7.1.8", + "@types/chai-string": "^1.4.5", + "@types/cli-table": "^0.3.4", + "@types/hosted-git-info": "^3.0.5", + "@types/ini": "^4.1.0", + "@types/js-yaml": "^4.0.9", + "@types/json-parse-helpfulerror": "^1.0.3", + "@types/jsonlines": "^0.1.5", + "@types/lodash": "^4.17.0", + "@types/make-fetch-happen": "^10.0.4", + "@types/mocha": "^10.0.6", + "@types/node": "^20.11.26", + "@types/pacote": "^11.1.8", + "@types/parse-github-url": "^1.0.3", + "@types/picomatch": "^2.3.3", + "@types/progress": "^2.0.7", + "@types/prompts": "^2.4.9", + "@types/remote-git-tags": "^4.0.2", + "@types/semver": "^7.5.8", + "@types/semver-utils": "^1.1.3", + "@types/sinon": "^17.0.3", + "@types/update-notifier": "^6.0.8", "@typescript-eslint/eslint-plugin": "^6.9.1", "@typescript-eslint/parser": "^6.9.1", - "c8": "^8.0.1", + "c8": "^9.1.0", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", "chai-string": "^1.5.0", "cross-env": "^7.0.3", - "eslint": "^8.53.0", - "eslint-config-prettier": "^9.0.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-config-raine": "^0.5.0", "eslint-config-standard": "^17.1.0", - "eslint-plugin-import": "^2.29.0", - "eslint-plugin-jsdoc": "^46.8.2", - "eslint-plugin-n": "^16.2.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^48.2.1", + "eslint-plugin-n": "^16.6.2", "eslint-plugin-promise": "^6.1.1", "lockfile-lint": "^4.13.2", "markdownlint-cli": "^0.39.0", @@ -1094,95 +1091,66 @@ } }, "node_modules/@sigstore/bundle": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.1.0.tgz", - "integrity": "sha512-89uOo6yh/oxaU8AeOUnVrTdVMcGk9Q1hJa7Hkvalc6G3Z3CupWk4Xe9djSgJm9fMkH69s0P0cVHUoKSOemLdng==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.2.0.tgz", + "integrity": "sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==", "dependencies": { - "@sigstore/protobuf-specs": "^0.2.1" + "@sigstore/protobuf-specs": "^0.3.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@sigstore/core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/core/-/core-1.0.0.tgz", + "integrity": "sha512-dW2qjbWLRKGu6MIDUTBuJwXCnR8zivcSpf5inUzk7y84zqy/dji0/uahppoIgMoKeR+6pUZucrwHfkQQtiG9Rw==", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/@sigstore/protobuf-specs": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.2.1.tgz", - "integrity": "sha512-XTWVxnWJu+c1oCshMLwnKvz8ZQJJDVOlciMfgpJBQbThVjKTCG8dwyhgLngBD2KN0ap9F/gOV8rFDEx8uh7R2A==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.3.0.tgz", + "integrity": "sha512-zxiQ66JFOjVvP9hbhGj/F/qNdsZfkGb/dVXSanNRNuAzMlr4MC95voPUBX8//ZNnmv3uSYzdfR/JSkrgvZTGxA==", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/@sigstore/sign": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.0.tgz", - "integrity": "sha512-AAbmnEHDQv6CSfrWA5wXslGtzLPtAtHZleKOgxdQYvx/s76Fk6T6ZVt7w2IGV9j1UrFeBocTTQxaXG2oRrDhYA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.3.tgz", + "integrity": "sha512-LqlA+ffyN02yC7RKszCdMTS6bldZnIodiox+IkT8B2f8oRYXCB3LQ9roXeiEL21m64CVH1wyveYAORfD65WoSw==", "dependencies": { - "@sigstore/bundle": "^2.1.0", - "@sigstore/protobuf-specs": "^0.2.1", + "@sigstore/bundle": "^2.2.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.0", "make-fetch-happen": "^13.0.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/@sigstore/sign/node_modules/cacache": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.0.tgz", - "integrity": "sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==", + "node_modules/@sigstore/tuf": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-2.3.1.tgz", + "integrity": "sha512-9Iv40z652td/QbV0o5n/x25H9w6IYRt2pIGbTX55yFDYlApDQn/6YZomjz6+KBx69rXHLzHcbtTS586mDdFD+Q==", "dependencies": { - "@npmcli/fs": "^3.1.0", - "fs-minipass": "^3.0.0", - "glob": "^10.2.2", - "lru-cache": "^10.0.1", - "minipass": "^7.0.3", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "p-map": "^4.0.0", - "ssri": "^10.0.0", - "tar": "^6.1.11", - "unique-filename": "^3.0.0" + "@sigstore/protobuf-specs": "^0.3.0", + "tuf-js": "^2.2.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/@sigstore/sign/node_modules/lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/@sigstore/sign/node_modules/make-fetch-happen": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", - "integrity": "sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==", - "dependencies": { - "@npmcli/agent": "^2.0.0", - "cacache": "^18.0.0", - "http-cache-semantics": "^4.1.1", - "is-lambda": "^1.0.1", - "minipass": "^7.0.2", - "minipass-fetch": "^3.0.0", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "ssri": "^10.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/@sigstore/tuf": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-2.2.0.tgz", - "integrity": "sha512-KKATZ5orWfqd9ZG6MN8PtCIx4eevWSuGRKQvofnWXRpyMyUEpmrzg5M5BrCpjM+NfZ0RbNGOh5tCz/P2uoRqOA==", + "node_modules/@sigstore/verify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@sigstore/verify/-/verify-1.1.0.tgz", + "integrity": "sha512-1fTqnqyTBWvV7cftUUFtDcHPdSox0N3Ub7C0lRyReYx4zZUlNTZjCV+HPy4Lre+r45dV7Qx5JLKvqqsgxuyYfg==", "dependencies": { - "@sigstore/protobuf-specs": "^0.2.1", - "tuf-js": "^2.1.0" + "@sigstore/bundle": "^2.2.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -1571,9 +1539,9 @@ "dev": true }, "node_modules/@types/sinon": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.0.tgz", - "integrity": "sha512-oN4AeDMFCeNZrAffCjhLcwwVymRZL2c9mljUmhPnd0eiM06d4ELDg0Q0TSvnZXrCIFlSA859qIdcfu1HapswPQ==", + "version": "17.0.3", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", + "integrity": "sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==", "dev": true, "dependencies": { "@types/sinonjs__fake-timers": "*" @@ -1843,6 +1811,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@yarnpkg/parsers/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/abbrev": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", @@ -2011,6 +1985,18 @@ "node": ">= 8" } }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/are-docs-informative": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", @@ -2633,6 +2619,20 @@ "node": ">=10" } }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -3131,14 +3131,6 @@ "node": ">=0.4.0" } }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -3435,10 +3427,22 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-compat-utils": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz", + "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-config-prettier": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", - "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -4690,6 +4694,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-yarn": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", + "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/hasown": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", @@ -4964,6 +4979,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-ci": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", + "dependencies": { + "ci-info": "^3.2.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -5021,20 +5047,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-in-ci": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-in-ci/-/is-in-ci-0.1.0.tgz", - "integrity": "sha512-d9PXLEY0v1iJ64xLiQMJ51J128EYHAaOR4yZqQi8aHGfw6KgifM3/Viw1oZZ1GCVmb3gBuyhLyHj0HgR2DhSXQ==", - "bin": { - "is-in-ci": "cli.js" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", @@ -5245,6 +5257,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-yarn-global": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", + "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", + "engines": { + "node": ">=12" + } + }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -7135,9 +7155,9 @@ } }, "node_modules/pacote": { - "version": "17.0.4", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-17.0.4.tgz", - "integrity": "sha512-eGdLHrV/g5b5MtD5cTPyss+JxOlaOloSMG3UwPMAvL8ywaLJ6beONPF40K4KKl/UI6q5hTKCJq5rCu8tkF+7Dg==", + "version": "17.0.6", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-17.0.6.tgz", + "integrity": "sha512-cJKrW21VRE8vVTRskJo78c/RCvwJCn1f4qgfxL4w77SOWrTCRcmfkYHlHtS0gqpgjv3zhXflRtgsrUCX5xwNnQ==", "dependencies": { "@npmcli/git": "^5.0.0", "@npmcli/installed-package-contents": "^2.0.1", @@ -7154,7 +7174,7 @@ "promise-retry": "^2.0.1", "read-package-json": "^7.0.0", "read-package-json-fast": "^3.0.0", - "sigstore": "^2.0.0", + "sigstore": "^2.2.0", "ssri": "^10.0.0", "tar": "^6.1.11" }, @@ -7165,36 +7185,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/cacache": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.0.tgz", - "integrity": "sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==", - "dependencies": { - "@npmcli/fs": "^3.1.0", - "fs-minipass": "^3.0.0", - "glob": "^10.2.2", - "lru-cache": "^10.0.1", - "minipass": "^7.0.3", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "p-map": "^4.0.0", - "ssri": "^10.0.0", - "tar": "^6.1.11", - "unique-filename": "^3.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/pacote/node_modules/lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -8145,14 +8135,16 @@ "license": "ISC" }, "node_modules/sigstore": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-2.1.0.tgz", - "integrity": "sha512-kPIj+ZLkyI3QaM0qX8V/nSsweYND3W448pwkDgS6CQ74MfhEkIR8ToK5Iyx46KJYRjseVcD3Rp9zAmUAj6ZjPw==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-2.2.2.tgz", + "integrity": "sha512-2A3WvXkQurhuMgORgT60r6pOWiCOO5LlEqY2ADxGBDGVYLSo5HN0uLtb68YpVpuL/Vi8mLTe7+0Dx2Fq8lLqEg==", "dependencies": { - "@sigstore/bundle": "^2.1.0", - "@sigstore/protobuf-specs": "^0.2.1", - "@sigstore/sign": "^2.1.0", - "@sigstore/tuf": "^2.1.0" + "@sigstore/bundle": "^2.2.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.0", + "@sigstore/sign": "^2.2.3", + "@sigstore/tuf": "^2.3.1", + "@sigstore/verify": "^1.1.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -8764,16 +8756,10 @@ "json5": "lib/cli.js" } }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true - }, "node_modules/tuf-js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-2.1.0.tgz", - "integrity": "sha512-eD7YPPjVlMzdggrOeE8zwoegUaG/rt6Bt3jwoQPunRiNVzgcCE009UDFJKJjG+Gk9wFu6W/Vi+P5d/5QpdD9jA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-2.2.0.tgz", + "integrity": "sha512-ZSDngmP1z6zw+FIkIBjvOp/II/mIub/O7Pp12j1WNsiCpg5R5wAc//i555bBQsE44O94btLt0xM/Zr2LQjwdCg==", "dependencies": { "@tufjs/models": "2.0.0", "debug": "^4.3.4", @@ -8783,57 +8769,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/tuf-js/node_modules/cacache": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.0.tgz", - "integrity": "sha512-I7mVOPl3PUCeRub1U8YoGz2Lqv9WOBpobZ8RyWFXmReuILz+3OAyTa5oH3QPdtKZD7N0Yk00aLfzn0qvp8dZ1w==", - "dependencies": { - "@npmcli/fs": "^3.1.0", - "fs-minipass": "^3.0.0", - "glob": "^10.2.2", - "lru-cache": "^10.0.1", - "minipass": "^7.0.3", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "p-map": "^4.0.0", - "ssri": "^10.0.0", - "tar": "^6.1.11", - "unique-filename": "^3.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/tuf-js/node_modules/lru-cache": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", - "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", - "engines": { - "node": "14 || >=16.14" - } - }, - "node_modules/tuf-js/node_modules/make-fetch-happen": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", - "integrity": "sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==", - "dependencies": { - "@npmcli/agent": "^2.0.0", - "cacache": "^18.0.0", - "http-cache-semantics": "^4.1.1", - "is-lambda": "^1.0.1", - "minipass": "^7.0.2", - "minipass-fetch": "^3.0.0", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.3", - "promise-retry": "^2.0.1", - "ssri": "^10.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -9266,25 +9201,27 @@ } }, "node_modules/update-notifier": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-7.0.0.tgz", - "integrity": "sha512-Hv25Bh+eAbOLlsjJreVPOs4vd51rrtCrmhyOJtbpAojro34jS4KQaEp4/EvlHJX7jSO42VvEFpkastVyXyIsdQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", + "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", "dependencies": { - "boxen": "^7.1.1", - "chalk": "^5.3.0", + "boxen": "^7.0.0", + "chalk": "^5.0.1", "configstore": "^6.0.0", + "has-yarn": "^3.0.0", "import-lazy": "^4.0.0", - "is-in-ci": "^0.1.0", + "is-ci": "^3.0.1", "is-installed-globally": "^0.4.0", "is-npm": "^6.0.0", + "is-yarn-global": "^0.4.0", "latest-version": "^7.0.0", "pupa": "^3.1.0", - "semver": "^7.5.4", + "semver": "^7.3.7", "semver-diff": "^4.0.0", "xdg-basedir": "^5.1.0" }, "engines": { - "node": ">=18" + "node": ">=14.16" }, "funding": { "url": "https://github.com/yeoman/update-notifier?sponsor=1" diff --git a/package.json b/package.json index 449de43c..dcd75a7f 100644 --- a/package.json +++ b/package.json @@ -67,17 +67,15 @@ "fast-memoize": "^2.5.2", "find-up": "5.0.0", "fp-and-or": "^1.0.2", - "get-stdin": "^8.0.0", - "globby": "^11.0.4", - "hosted-git-info": "^5.1.0", - "ini": "^4.1.1", + "hosted-git-info": "^7.0.1", + "ini": "^4.1.2", "js-yaml": "^4.1.0", "json-parse-helpfulerror": "^1.0.3", "jsonlines": "^0.1.1", "lodash": "^4.17.21", "make-fetch-happen": "^13.0.0", "p-map": "^4.0.0", - "pacote": "17.0.4", + "pacote": "17.0.6", "parse-github-url": "^1.0.2", "picomatch": "^4.0.1", "progress": "^2.0.3", @@ -91,43 +89,42 @@ "strip-ansi": "^7.1.0", "strip-json-comments": "^5.0.1", "untildify": "^4.0.0", - "update-notifier": "^7.0.0" + "update-notifier": "^6.0.2" }, "devDependencies": { - "@trivago/prettier-plugin-sort-imports": "^4.2.1", - "@types/chai": "^4.3.9", - "@types/chai-as-promised": "^7.1.7", - "@types/chai-string": "^1.4.4", - "@types/cli-table": "^0.3.3", - "@types/hosted-git-info": "^3.0.4", - "@types/ini": "^1.3.32", - "@types/js-yaml": "^4.0.8", - "@types/json-parse-helpfulerror": "^1.0.2", - "@types/jsonlines": "^0.1.4", - "@types/lodash": "^4.14.200", - "@types/make-fetch-happen": "^10.0.3", - "@types/minimatch": "^5.1.2", - "@types/mocha": "^10.0.3", - "@types/node": "^20.8.10", - "@types/pacote": "^11.1.7", - "@types/parse-github-url": "^1.0.2", - "@types/progress": "^2.0.6", - "@types/prompts": "^2.4.7", - "@types/remote-git-tags": "^4.0.1", - "@types/rimraf": "^3.0.2", - "@types/semver": "^7.5.4", - "@types/semver-utils": "^1.1.2", - "@types/sinon": "^17.0.0", - "@types/update-notifier": "^6.0.6", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/chai": "^4.3.12", + "@types/chai-as-promised": "^7.1.8", + "@types/chai-string": "^1.4.5", + "@types/cli-table": "^0.3.4", + "@types/hosted-git-info": "^3.0.5", + "@types/ini": "^4.1.0", + "@types/js-yaml": "^4.0.9", + "@types/json-parse-helpfulerror": "^1.0.3", + "@types/jsonlines": "^0.1.5", + "@types/lodash": "^4.17.0", + "@types/make-fetch-happen": "^10.0.4", + "@types/mocha": "^10.0.6", + "@types/node": "^20.11.26", + "@types/pacote": "^11.1.8", + "@types/parse-github-url": "^1.0.3", + "@types/picomatch": "^2.3.3", + "@types/progress": "^2.0.7", + "@types/prompts": "^2.4.9", + "@types/remote-git-tags": "^4.0.2", + "@types/semver": "^7.5.8", + "@types/semver-utils": "^1.1.3", + "@types/sinon": "^17.0.3", + "@types/update-notifier": "^6.0.8", "@typescript-eslint/eslint-plugin": "^6.9.1", "@typescript-eslint/parser": "^6.9.1", - "c8": "^8.0.1", + "c8": "^9.1.0", "chai": "^4.3.10", "chai-as-promised": "^7.1.1", "chai-string": "^1.5.0", "cross-env": "^7.0.3", - "eslint": "^8.53.0", - "eslint-config-prettier": "^9.0.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-config-raine": "^0.5.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.1", From ce7fa457dc3cd4e96e1f46969d59b2bfb3dcdfa7 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Tue, 12 Mar 2024 23:30:44 +0000 Subject: [PATCH 06/11] Migrate spawn-please stdout. --- src/package-managers/bun.ts | 6 +- src/package-managers/npm.ts | 3 +- src/package-managers/pnpm.ts | 3 +- src/package-managers/yarn.ts | 10 +-- src/scripts/build-options.ts | 6 +- src/types/spawn-please.d.ts | 7 +- test/bin.test.ts | 94 ++++++++++++------------ test/deep.test.ts | 15 ++-- test/doctor.test.ts | 5 +- test/filter.test.ts | 36 ++++----- test/filterVersion.test.ts | 8 +- test/format.test.ts | 12 +-- test/global.test.ts | 2 +- test/group.test.ts | 2 +- test/install.test.ts | 12 +-- test/package-managers/deno/index.test.ts | 12 +-- test/rc-config.test.ts | 40 +++++----- test/workspaces.test.ts | 78 +++++++++++--------- 18 files changed, 187 insertions(+), 164 deletions(-) diff --git a/src/package-managers/bun.ts b/src/package-managers/bun.ts index 8c13805f..9561e8e1 100644 --- a/src/package-managers/bun.ts +++ b/src/package-managers/bun.ts @@ -14,7 +14,7 @@ async function spawnBun( npmOptions: NpmOptions = {}, spawnPleaseOptions: SpawnPleaseOptions = {}, spawnOptions: Index = {}, -): Promise { +): Promise<{ stdout: string, stderr: string }> { // Bun not yet supported on Windows. // @see https://github.com/oven-sh/bun/issues/43 if (process.platform === 'win32') { @@ -33,7 +33,7 @@ async function spawnBun( /** Returns the global directory of bun. */ export const defaultPrefix = async (options: Options): Promise => options.global - ? options.prefix || process.env.BUN_INSTALL || path.dirname(await spawn('bun', ['pm', '-g', 'bin'])) + ? options.prefix || process.env.BUN_INSTALL || path.dirname((await spawn('bun', ['pm', '-g', 'bin'])).stdout) : undefined /** @@ -43,7 +43,7 @@ export const list = async (options: Options = {}): Promise ({ [name]: version, })) diff --git a/src/package-managers/yarn.ts b/src/package-managers/yarn.ts index 2fdc0372..550acc68 100644 --- a/src/package-managers/yarn.ts +++ b/src/package-managers/yarn.ts @@ -220,20 +220,20 @@ async function spawnYarn( * @param [options.prefix] * @returns */ -export async function defaultPrefix(options: Options): Promise { +export async function defaultPrefix(options: Options): Promise { if (options.prefix) { return Promise.resolve(options.prefix) } const cmd = process.platform === 'win32' ? 'yarn.cmd' : 'yarn' - const prefix = await spawn(cmd, ['global', 'dir']) + const { stdout: prefix } = await spawn(cmd, ['global', 'dir']) // yarn 2.0 does not support yarn global // catch error to prevent process from crashing // https://github.com/raineorshine/npm-check-updates/issues/873 - .catch(() => { - /* empty */ - }) + .catch(() => ({ + stdout: null + })) // FIX: for ncu -g doesn't work on homebrew or windows #146 // https://github.com/raineorshine/npm-check-updates/issues/146 diff --git a/src/scripts/build-options.ts b/src/scripts/build-options.ts index 7eb95e3a..ef77c707 100644 --- a/src/scripts/build-options.ts +++ b/src/scripts/build-options.ts @@ -103,10 +103,12 @@ export interface RunOptions { } /** Generates a JSON schema for the ncurc file. */ -const generateRunOptionsJsonSchema = async (): Promise => +const generateRunOptionsJsonSchema = async (): Promise => { // programmatic usage of typescript-json-schema does not work, at least not straightforwardly. // Use the CLI which works out-of-the-box. - spawn('typescript-json-schema', ['tsconfig.json', 'RunOptions']) + const { stdout } = await spawn('typescript-json-schema', ['tsconfig.json', 'RunOptions']) + return stdout +} ;(async () => { await fs.writeFile('README.md', await injectReadme()) diff --git a/src/types/spawn-please.d.ts b/src/types/spawn-please.d.ts index 05592f1e..73fa454e 100644 --- a/src/types/spawn-please.d.ts +++ b/src/types/spawn-please.d.ts @@ -1,2 +1,7 @@ // add to tsconfig compilerOptions.paths -declare module 'spawn-please' +declare module 'spawn-please' { + export default function(command: string, args?: string[], options?: any, spawnOptions?: any): Promise<{ + stdout: string, + stderr: string + }>; +} diff --git a/test/bin.test.ts b/test/bin.test.ts index 6611c926..d2913c6c 100644 --- a/test/bin.test.ts +++ b/test/bin.test.ts @@ -13,53 +13,53 @@ const bin = path.join(__dirname, '../build/src/bin/cli.js') describe('bin', async function () { it('fetch latest version from registry (not stubbed)', async () => { - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), ) - const pkgData = JSON.parse(output) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') }) it('output only upgraded with --jsonUpgraded', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), ) - const pkgData = JSON.parse(output) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') stub.restore() }) it('--loglevel verbose', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--loglevel', 'verbose'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), ) - output.should.containIgnoreCase('Initializing') - output.should.containIgnoreCase('Running in local mode') - output.should.containIgnoreCase('Finding package file data') + stdout.should.containIgnoreCase('Initializing') + stdout.should.containIgnoreCase('Running in local mode') + stdout.should.containIgnoreCase('Finding package file data') stub.restore() }) it('--verbose', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const output = await spawn('node', [bin, '--verbose'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } })) - output.should.containIgnoreCase('Initializing') - output.should.containIgnoreCase('Running in local mode') - output.should.containIgnoreCase('Finding package file data') + const { stdout } = await spawn('node', [bin, '--verbose'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } })) + stdout.should.containIgnoreCase('Initializing') + stdout.should.containIgnoreCase('Running in local mode') + stdout.should.containIgnoreCase('Finding package file data') stub.restore() }) it('accept stdin', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const output = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies: { express: '1' } })) - output.trim().should.startWith('express') + const { stdout } = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies: { express: '1' } })) + stdout.trim().should.startWith('express') stub.restore() }) @@ -75,7 +75,7 @@ describe('bin', async function () { it('fall back to package.json search when receiving empty content on stdin', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const stdout = await spawn('node', [bin, '--stdin']) + const { stdout } = await spawn('node', [bin, '--stdin']) stdout .toString() .trim() @@ -85,8 +85,8 @@ describe('bin', async function () { it('use package.json in cwd by default', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const output = await spawn('node', [bin, '--jsonUpgraded'], { cwd: path.join(__dirname, 'test-data/ncu') }) - const pkgData = JSON.parse(output) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded'], { cwd: path.join(__dirname, 'test-data/ncu') }) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') stub.restore() }) @@ -112,8 +112,8 @@ describe('bin', async function () { const pkgFile = path.join(tempDir, 'package.json') await fs.writeFile(pkgFile, JSON.stringify({ dependencies: { express: '1' } }), 'utf-8') try { - const text = await spawn('node', [bin, '--jsonUpgraded', '--packageFile', pkgFile]) - const pkgData = JSON.parse(text) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--packageFile', pkgFile]) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -194,8 +194,8 @@ describe('bin', async function () { it('suppress stdout when --silent is provided', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const output = await spawn('node', [bin, '--silent'], JSON.stringify({ dependencies: { express: '1' } })) - output.trim().should.equal('') + const { stdout } = await spawn('node', [bin, '--silent'], JSON.stringify({ dependencies: { express: '1' } })) + stdout.trim().should.equal('') stub.restore() }) @@ -211,8 +211,8 @@ describe('bin', async function () { const pkgFile = path.join(tempDir, 'package.json') await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - const output = await spawn('node', [bin, '--packageFile', pkgFile, '--filter', 'ncu-test-v2 ncu-test-tag']) - output.should.include('"ncu-test-v2 ncu-test-tag"') + const { stdout } = await spawn('node', [bin, '--packageFile', pkgFile, '--filter', 'ncu-test-v2 ncu-test-tag']) + stdout.should.include('"ncu-test-v2 ncu-test-tag"') } finally { await fs.rm(tempDir, { recursive: true, force: true }) stub.restore() @@ -227,20 +227,20 @@ describe('bin', async function () { event: 'link:../link', workspace: 'workspace:../workspace', } - const output = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) + const { stdout } = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) - stripAnsi(output)!.should.not.include('No package versions were returned.') + stripAnsi(stdout)!.should.not.include('No package versions were returned.') stub.restore() }) it('combine boolean flags with arguments', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--jsonUpgraded', 'ncu-test-v2'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }), ) - const upgraded = JSON.parse(output) as Index + const upgraded = JSON.parse(stdout) as Index upgraded.should.deep.equal({ 'ncu-test-v2': '99.9.9', }) @@ -261,8 +261,8 @@ describe('bin', async function () { const dependencies = { 'ncu-test-v2': 'https://github.com/raineorshine/ncu-test-v2.git#v1.0.0', } - const output = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) - stripAnsi(output) + const { stdout } = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) + stripAnsi(stdout) .trim() .should.equal('ncu-test-v2 https://github.com/raineorshine/ncu-test-v2.git#v1.0.0 → v2.0.0') }) @@ -274,41 +274,41 @@ describe('bin', async function () { const dependencies = { request: 'npm:ncu-test-v2@1.0.0', } - const output = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) - stripAnsi(output).trim().should.equal('request npm:ncu-test-v2@1.0.0 → 99.9.9') + const { stdout } = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) + stripAnsi(stdout).trim().should.equal('request npm:ncu-test-v2@1.0.0 → 99.9.9') stub.restore() }) }) describe('option-specific help', () => { it('long option', async () => { - const output = await spawn('node', [bin, '--help', '--filter']) - output.trim().should.match(/^Usage:\s+ncu --filter/) + const { stdout } = await spawn('node', [bin, '--help', '--filter']) + stdout.trim().should.match(/^Usage:\s+ncu --filter/) }) it('long option without "--" prefix', async () => { - const output = await spawn('node', [bin, '--help', '-f']) - output.trim().should.match(/^Usage:\s+ncu --filter/) + const { stdout } = await spawn('node', [bin, '--help', '-f']) + stdout.trim().should.match(/^Usage:\s+ncu --filter/) }) it('short option', async () => { - const output = await spawn('node', [bin, '--help', 'filter']) - output.trim().should.match(/^Usage:\s+ncu --filter/) + const { stdout } = await spawn('node', [bin, '--help', 'filter']) + stdout.trim().should.match(/^Usage:\s+ncu --filter/) }) it('short option without "-" prefix', async () => { - const output = await spawn('node', [bin, '--help', 'f']) - output.trim().should.match(/^Usage:\s+ncu --filter/) + const { stdout } = await spawn('node', [bin, '--help', 'f']) + stdout.trim().should.match(/^Usage:\s+ncu --filter/) }) it('option with default', async () => { - const output = await spawn('node', [bin, '--help', '--concurrency']) - output.trim().should.containIgnoreCase('Default:') + const { stdout } = await spawn('node', [bin, '--help', '--concurrency']) + stdout.trim().should.containIgnoreCase('Default:') }) it('option with extended help', async () => { - const output = await spawn('node', [bin, '--help', '--target']) - output.trim().should.containIgnoreCase('Upgrade to the highest version number') + const { stdout } = await spawn('node', [bin, '--help', '--target']) + stdout.trim().should.containIgnoreCase('Upgrade to the highest version number') // run extended help on other options for test coverage await spawn('node', [bin, '--help', 'doctor']) @@ -319,13 +319,13 @@ describe('bin', async function () { }) it('unknown option', async () => { - const output = await spawn('node', [bin, '--help', '--foo']) - output.trim().should.containIgnoreCase('Unknown option') + const { stdout } = await spawn('node', [bin, '--help', '--foo']) + stdout.trim().should.containIgnoreCase('Unknown option') }) it('special --help --help', async () => { - const output = await spawn('node', [bin, '--help', '--help']) - output.trim().should.not.include('Usage') + const { stdout } = await spawn('node', [bin, '--help', '--help']) + stdout.trim().should.not.include('Usage') }) }) }) diff --git a/test/deep.test.ts b/test/deep.test.ts index f94d0363..39e95a5c 100644 --- a/test/deep.test.ts +++ b/test/deep.test.ts @@ -57,7 +57,8 @@ describe('--deep', function () { it('output json with --jsonAll', async () => { const tempDir = await setupDeepTest() try { - const deepJsonOut = await spawn('node', [bin, '--jsonAll', '--deep'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--deep'], { cwd: tempDir }) + const deepJsonOut = JSON.parse(stdout) deepJsonOut.should.have.property('package.json') deepJsonOut.should.have.property('packages/sub1/package.json') deepJsonOut.should.have.property('packages/sub2/package.json') @@ -92,7 +93,7 @@ describe('--deep', function () { it('update multiple packages', async () => { const tempDir = await setupDeepTest() try { - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '-u', '--jsonUpgraded', '--packageFile', path.join(tempDir, '**/package.json')], '{ "dependencies": {}}', @@ -109,7 +110,7 @@ describe('--deep', function () { upgradedPkg2.dependencies.should.have.property('express') upgradedPkg2.dependencies.express.should.not.equal('1') - const json = JSON.parse(output) + const json = JSON.parse(stdout) // Make sure to fix windows paths with replace json.should.have.property(path.join(tempDir, 'packages/sub1/package.json').replace(/\\/g, '/')) json.should.have.property(path.join(tempDir, 'packages/sub2/package.json').replace(/\\/g, '/')) @@ -130,7 +131,8 @@ describe('--deep with nested ncurc files', function () { after(() => stub.restore()) it('use ncurc of nested packages', async () => { - const deepJsonOut = await spawn('node', [bin, '--jsonUpgraded', '--deep'], { cwd }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--deep'], { cwd }) + const deepJsonOut = JSON.parse(stdout) // root: reject: ['cute-animals'] deepJsonOut.should.have.property('package.json') @@ -157,9 +159,8 @@ describe('--deep with nested ncurc files', function () { }) it('use ncurc of nested packages with --mergeConfig option', async () => { - const deepJsonOut = await spawn('node', [bin, '--jsonUpgraded', '--deep', '--mergeConfig'], { cwd }).then( - JSON.parse, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--deep', '--mergeConfig'], { cwd }) + const deepJsonOut = JSON.parse(stdout) // root: reject: ['cute-animals'] deepJsonOut.should.have.property('package.json') diff --git a/test/doctor.test.ts b/test/doctor.test.ts index 447a556f..a1f9d510 100644 --- a/test/doctor.test.ts +++ b/test/doctor.test.ts @@ -21,7 +21,10 @@ const mockNpmVersions = { } /** Run the ncu CLI. */ -const ncu = (args: string[], options?: Record) => spawn('node', [bin, ...args], options) +const ncu = async (args: string[], options?: Record) => { + const { stdout } = await spawn('node', [bin, ...args], options) + return stdout +} /** Assertions for npm or yarn when tests pass. */ const testPass = ({ packageManager }: { packageManager: PackageManagerName }) => { diff --git a/test/filter.test.ts b/test/filter.test.ts index 27218de4..97c4c29c 100644 --- a/test/filter.test.ts +++ b/test/filter.test.ts @@ -207,23 +207,23 @@ describe('filter', () => { after(() => stub.restore()) it('filter by package name with --filter', async () => { - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'express'], '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', ) - const pkgData = JSON.parse(output) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') pkgData.should.not.have.property('chalk') }) it('filter by package name with -f', async () => { - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '-f', 'express'], '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', ) - const pkgData = JSON.parse(output) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') pkgData.should.not.have.property('chalk') }) @@ -248,12 +248,12 @@ describe('filter', () => { }, } - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'lodash.map lodash.filter', 'lodash.map', 'lodash.filter'], JSON.stringify(pkgData), ) - const upgraded = JSON.parse(output) + const upgraded = JSON.parse(stdout) upgraded.should.have.property('lodash.map') upgraded.should.have.property('lodash.filter') }) @@ -266,12 +266,12 @@ describe('filter', () => { }, } - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'lodash.map lodash.filter', ' '], JSON.stringify(pkgData), ) - const upgraded = JSON.parse(output) + const upgraded = JSON.parse(stdout) upgraded.should.have.property('lodash.map') upgraded.should.have.property('lodash.filter') }) @@ -284,12 +284,12 @@ describe('filter', () => { }, } - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'ncu-test-v2', '--filter', 'ncu-test-tag'], JSON.stringify(pkgData), ) - const upgraded = JSON.parse(output) + const upgraded = JSON.parse(stdout) upgraded.should.have.property('ncu-test-v2') upgraded.should.have.property('ncu-test-tag') }) @@ -303,34 +303,34 @@ describe('reject', () => { after(() => stub.restore()) it('reject by package name with --reject', async () => { - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--reject', 'chalk'], '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', ) - const pkgData = JSON.parse(output) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') pkgData.should.not.have.property('chalk') }) it('reject by package name with -x', async () => { - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '-x', 'chalk'], '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', ) - const pkgData = JSON.parse(output) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') pkgData.should.not.have.property('chalk') }) it('reject with empty string should not reject anything', async () => { - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--reject', '""', '--stdin', '-x', 'chalk'], '{ "dependencies": { "ncu-test-v2": "1.0.0", "ncu-test-tag": "1.0.0" } }', ) - const pkgData = JSON.parse(output) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') pkgData.should.have.property('ncu-test-tag') }) @@ -343,12 +343,12 @@ describe('reject', () => { }, } - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--reject', 'ncu-test-v2', '--reject', 'ncu-test-tag'], JSON.stringify(pkgData), ) - const upgraded = JSON.parse(output) + const upgraded = JSON.parse(stdout) upgraded.should.not.have.property('ncu-test-v2') upgraded.should.not.have.property('ncu-test-tag') }) diff --git a/test/filterVersion.test.ts b/test/filterVersion.test.ts index 5360f786..e97f8229 100644 --- a/test/filterVersion.test.ts +++ b/test/filterVersion.test.ts @@ -127,12 +127,12 @@ describe('filterVersion', () => { }, } - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--verbose', '--stdin', '--filterVersion', '1.0.0', '--filterVersion', '1.0.9'], JSON.stringify(pkgData), ) - const upgraded = JSON.parse(output) + const upgraded = JSON.parse(stdout) upgraded.should.have.property('ncu-test-v2') upgraded.should.have.property('ncu-test-10') stub.restore() @@ -151,12 +151,12 @@ describe('rejectVersion', () => { }, } - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--verbose', '--stdin', '--rejectVersion', '1.0.0', '--rejectVersion', '1.0.9'], JSON.stringify(pkgData), ) - const upgraded = JSON.parse(output) + const upgraded = JSON.parse(stdout) upgraded.should.not.have.property('ncu-test-v2') upgraded.should.not.have.property('ncu-test-10') stub.restore() diff --git a/test/format.test.ts b/test/format.test.ts index 5f6ea165..bf9aedff 100644 --- a/test/format.test.ts +++ b/test/format.test.ts @@ -27,8 +27,8 @@ describe('format', () => { 'ncu-test-v2': '^1.0.0', }, } - const output = await spawn('node', [bin, '--format', 'time', '--stdin'], JSON.stringify(packageData)) - expect(output).contains(timestamp) + const { stdout } = await spawn('node', [bin, '--format', 'time', '--stdin'], JSON.stringify(packageData)) + expect(stdout).contains(timestamp) stub.restore() }) @@ -46,8 +46,8 @@ describe('format', () => { ) try { await spawn('npm', ['install'], { cwd: tempDir }) - const output = await spawn('node', [bin, '--format', 'repo'], { cwd: tempDir }) - output.should.include('https://github.com/Mitsunee/modern-diacritics') + const { stdout } = await spawn('node', [bin, '--format', 'repo'], { cwd: tempDir }) + stdout.should.include('https://github.com/Mitsunee/modern-diacritics') } finally { await fs.rm(tempDir, { recursive: true, force: true }) } @@ -74,8 +74,8 @@ describe('format', () => { 'utf-8', ) try { - const output = await spawn('node', [bin, '--format', 'lines'], { cwd: tempDir }) - output.should.equals('ncu-test-v2@^2.0.0\nncu-test-tag@^1.1.0\n') + const { stdout } = await spawn('node', [bin, '--format', 'lines'], { cwd: tempDir }) + stdout.should.equals('ncu-test-v2@^2.0.0\nncu-test-tag@^1.1.0\n') } finally { await fs.rm(tempDir, { recursive: true, force: true }) stub.restore() diff --git a/test/global.test.ts b/test/global.test.ts index 38cca4bf..5baada4e 100644 --- a/test/global.test.ts +++ b/test/global.test.ts @@ -12,7 +12,7 @@ describe('global', () => { const itSkipWindows = process.platform === 'win32' ? it.skip : it itSkipWindows('global should run', async () => { // to speed up the test, only check npm (which is always installed globally) - const stdout = await spawn('node', [bin, '--jsonAll', '--global', 'npm']) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--global', 'npm']) const json = JSON.parse(stdout) expect(json).to.have.property('npm') }) diff --git a/test/group.test.ts b/test/group.test.ts index a771a345..b477e23f 100644 --- a/test/group.test.ts +++ b/test/group.test.ts @@ -41,7 +41,7 @@ async function groupTestScaffold( const configFile = path.join(tempDir, '.ncurc.js') await fs.writeFile(configFile, `module.exports = { groupFunction: ${groupFn.toString()} }`, 'utf-8') try { - const stdout = await spawn('node', [bin, '--format', 'group', '--configFilePath', tempDir], { + const { stdout } = await spawn('node', [bin, '--format', 'group', '--configFilePath', tempDir], { cwd: tempDir, }) stripAnsi(stdout).should.containIgnoreCase(expectedOutput) diff --git a/test/install.test.ts b/test/install.test.ts index af7daac0..6598541e 100644 --- a/test/install.test.ts +++ b/test/install.test.ts @@ -29,8 +29,8 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - const output = await spawn('node', [bin, '-u', '--packageFile', pkgFile]) - stripAnsi(output).should.include('Run npm install to install new versions') + const { stdout } = await spawn('node', [bin, '-u', '--packageFile', pkgFile]) + stripAnsi(stdout).should.include('Run npm install to install new versions') expect(await exists(path.join(tempDir, 'package-lock.json'))).to.be.false expect(await exists(path.join(tempDir, 'node_modules'))).to.be.false } finally { @@ -53,8 +53,8 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - const output = await spawn('node', [bin, '-u', '--packageFile', pkgFile, '--install', 'always']) - stripAnsi(output).should.not.include('Run npm install to install new versions') + const { stdout } = await spawn('node', [bin, '-u', '--packageFile', pkgFile, '--install', 'always']) + stripAnsi(stdout).should.not.include('Run npm install to install new versions') expect(await exists(path.join(tempDir, 'package-lock.json'))).to.be.true expect(await exists(path.join(tempDir, 'node_modules'))).to.be.true } finally { @@ -77,8 +77,8 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - const output = await spawn('node', [bin, '-u', '--packageFile', pkgFile, '--install', 'never']) - stripAnsi(output).should.not.include('Run npm install to install new versions') + const { stdout } = await spawn('node', [bin, '-u', '--packageFile', pkgFile, '--install', 'never']) + stripAnsi(stdout).should.not.include('Run npm install to install new versions') expect(await exists(path.join(tempDir, 'package-lock.json'))).to.be.false expect(await exists(path.join(tempDir, 'node_modules'))).to.be.false } finally { diff --git a/test/package-managers/deno/index.test.ts b/test/package-managers/deno/index.test.ts index 5b8b873a..e6e752af 100644 --- a/test/package-managers/deno/index.test.ts +++ b/test/package-managers/deno/index.test.ts @@ -20,12 +20,12 @@ describe('deno', async function () { } await fs.writeFile(pkgFile, JSON.stringify(pkg)) try { - const pkgData = await spawn( + const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--packageManager', 'deno', '--packageFile', pkgFile], undefined, ) - const pkg = jph.parse(pkgData) + const pkg = jph.parse(stdout) pkg.should.have.property('ncu-test-v2') } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -42,10 +42,10 @@ describe('deno', async function () { } await fs.writeFile(pkgFile, JSON.stringify(pkg)) try { - const pkgData = await spawn('node', [bin, '--jsonUpgraded'], undefined, { + const { stdout } = await spawn('node', [bin, '--jsonUpgraded'], undefined, { cwd: tempDir, }) - const pkg = jph.parse(pkgData) + const pkg = jph.parse(stdout) pkg.should.have.property('ncu-test-v2') } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -86,10 +86,10 @@ describe('deno', async function () { }` await fs.writeFile(pkgFile, pkgString) try { - const pkgData = await spawn('node', [bin, '--jsonUpgraded'], undefined, { + const { stdout } = await spawn('node', [bin, '--jsonUpgraded'], undefined, { cwd: tempDir, }) - const pkg = jph.parse(pkgData) + const pkg = jph.parse(stdout) pkg.should.have.property('ncu-test-v2') } finally { await fs.rm(tempDir, { recursive: true, force: true }) diff --git a/test/rc-config.test.ts b/test/rc-config.test.ts index 46a39204..11bb5cdb 100644 --- a/test/rc-config.test.ts +++ b/test/rc-config.test.ts @@ -20,12 +20,12 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, JSON.stringify({ filter: 'ncu-test-v2' }), 'utf-8') try { - const text = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }), ) - text.should.containIgnoreCase(`Using config file ${tempConfigFile}`) + stdout.should.containIgnoreCase(`Using config file ${tempConfigFile}`) } finally { await fs.rm(tempDir, { recursive: true, force: true }) } @@ -34,12 +34,12 @@ describe('rc-config', () => { it('do not print rcConfigPath when there is no rc config file', async () => { const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'npm-check-updates-')) try { - const text = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--cwd', tempDir], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), ) - text.should.not.include('Using config file') + stdout.should.not.include('Using config file') } finally { await fs.rm(tempDir, { recursive: true, force: true }) } @@ -50,12 +50,12 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, '{}', 'utf-8') try { - const text = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir], JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), ) - text.should.not.include('Using config file') + stdout.should.not.include('Using config file') } finally { await fs.rm(tempDir, { recursive: true, force: true }) } @@ -66,12 +66,12 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, JSON.stringify({ jsonUpgraded: true, filter: 'ncu-test-v2' }), 'utf-8') try { - const text = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir], JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), ) - const pkgData = JSON.parse(text) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') pkgData.should.not.have.property('ncu-test-tag') } finally { @@ -85,12 +85,12 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, tempConfigFileName) await fs.writeFile(tempConfigFile, JSON.stringify({ jsonUpgraded: true, filter: 'ncu-test-v2' }), 'utf-8') try { - const text = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir, '--configFileName', tempConfigFileName], JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), ) - const pkgData = JSON.parse(text) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') pkgData.should.not.have.property('ncu-test-tag') } finally { @@ -103,12 +103,12 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, JSON.stringify({ jsonUpgraded: true, filter: 'ncu-test-v2' }), 'utf-8') try { - const text = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir, '--filter', 'ncu-test-tag'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), ) - const pkgData = JSON.parse(text) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-tag') pkgData.should.not.have.property('ncu-test-v2') } finally { @@ -121,13 +121,13 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, JSON.stringify({ jsonUpgraded: true }), 'utf-8') try { - const output = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir, '--no-jsonUpgraded'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), ) // if the output contains "Using config file", then we know that jsonUpgraded was overridden - output.should.include('Using config file') + stdout.should.include('Using config file') } finally { await fs.rm(tempDir, { recursive: true, force: true }) } @@ -139,12 +139,12 @@ describe('rc-config', () => { // if boolean arguments are not handled as a special case, ncu will incorrectly pass "--deep false" to commander, which will interpret it as two args, i.e. --deep and --filter false await fs.writeFile(tempConfigFile, JSON.stringify({ jsonUpgraded: true, deep: false }), 'utf-8') try { - const text = await spawn( + const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir], JSON.stringify({ dependencies: { 'ncu-test-tag': '0.1.0' } }), ) - const pkgData = JSON.parse(text) + const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-tag') } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -163,8 +163,8 @@ describe('rc-config', () => { ) try { // awkwardly, we have to set mergeConfig to enable autodetecting the rcconfig because otherwise it is explicitly disabled for tests - const text = await spawn('node', [bin, '--mergeConfig'], { cwd: tempDir }) - const firstLine = text.split('\n')[0] + const { stdout } = await spawn('node', [bin, '--mergeConfig'], { cwd: tempDir }) + const firstLine = stdout.split('\n')[0] // On OSX tempDir is /var/folders/cb/12345, but npm-check-updates recieves /private/var/folders/cb/12345. // Apparently OSX symlinks /tmp to /private/tmp for historical reasons. // Therefore, ignore any directories prepended to the config file path. @@ -187,8 +187,8 @@ describe('rc-config', () => { ) try { // awkwardly, we have to set mergeConfig to enable autodetecting the rcconfig because otherwise it is explicitly disabled for tests - const text = await spawn('node', [bin, '--mergeConfig'], { cwd: tempDir }) - const firstLine = text.split('\n')[0] + const { stdout } = await spawn('node', [bin, '--mergeConfig'], { cwd: tempDir }) + const firstLine = stdout.split('\n')[0] // On OSX tempDir is /var/folders/cb/12345, but npm-check-updates recieves /private/var/folders/cb/12345. // Apparently OSX symlinks /tmp to /private/tmp for historical reasons. // Therefore, ignore any directories prepended to the config file path. diff --git a/test/workspaces.test.ts b/test/workspaces.test.ts index 3d64732d..d220777b 100644 --- a/test/workspaces.test.ts +++ b/test/workspaces.test.ts @@ -136,7 +136,8 @@ describe('workspaces', () => { it('update workspaces with --workspaces', async () => { const tempDir = await setup(['packages/a']) try { - const output = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -148,7 +149,8 @@ describe('workspaces', () => { it('update workspaces glob', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -161,7 +163,8 @@ describe('workspaces', () => { it('update workspaces with -ws', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '-ws'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '-ws'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -185,7 +188,8 @@ describe('workspaces', () => { ) try { - const output = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') output.should.not.have.property('other/package.json') @@ -201,7 +205,8 @@ describe('workspaces', () => { it('update workspaces/packages', async () => { const tempDir = await setup({ packages: ['packages/**'] }) try { - const output = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -215,9 +220,8 @@ describe('workspaces', () => { it('ignore local workspace packages', async () => { const tempDir = await setupSymlinkedPackages() try { - const upgrades = await spawn('node', [bin, '--jsonUpgraded', '--workspaces'], { cwd: tempDir }).then( - JSON.parse, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspaces'], { cwd: tempDir }) + const upgrades = JSON.parse(stdout) upgrades.should.deep.equal({ 'package.json': {}, 'packages/foo/package.json': { @@ -235,9 +239,8 @@ describe('workspaces', () => { it('ignore local workspace packages with different names than their folders', async () => { const tempDir = await setupSymlinkedPackages(['packages/**'], 'chalk') try { - const upgrades = await spawn('node', [bin, '--jsonUpgraded', '--workspaces'], { cwd: tempDir }).then( - JSON.parse, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspaces'], { cwd: tempDir }) + const upgrades = JSON.parse(stdout) upgrades.should.deep.equal({ 'package.json': {}, 'packages/foo/package.json': { @@ -267,7 +270,8 @@ describe('workspaces', () => { it('update single workspace with --workspace', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '--workspace', 'a'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -279,7 +283,8 @@ describe('workspaces', () => { it('update single workspace with -w', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '-w', 'a'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '-w', 'a'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -291,9 +296,10 @@ describe('workspaces', () => { it('update more than one workspace', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], { + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], { cwd: tempDir, - }).then(JSON.parse) + }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -307,9 +313,10 @@ describe('workspaces', () => { const tempDir = await setup() try { // when npm-check-updates is executed in a workspace directory but uses --cwd to point up to the root, make sure that the root package.json is checked for the workspaces property - const output = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--cwd', '../../'], { + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--cwd', '../../'], { cwd: path.join(tempDir, 'packages', 'a'), - }).then(JSON.parse) + }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -322,9 +329,10 @@ describe('workspaces', () => { it('update namespaced workspace', async () => { const tempDir = await setupSymlinkedPackages(['packages/**'], '@ncu/bar') try { - const upgrades = await spawn('node', [bin, '--jsonUpgraded', '--workspace', '@ncu/bar'], { + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspace', '@ncu/bar'], { cwd: tempDir, - }).then(JSON.parse) + }) + const upgrades = JSON.parse(stdout) upgrades.should.deep.equal({ 'package.json': {}, 'packages/bar/package.json': { @@ -343,9 +351,8 @@ describe('workspaces', () => { it('update root project by default', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '--workspaces', '--root'], { cwd: tempDir }).then( - JSON.parse, - ) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces', '--root'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('package.json') output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -360,9 +367,8 @@ describe('workspaces', () => { it('do not update the root project with --no-root', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '--workspaces', '--no-root'], { cwd: tempDir }).then( - JSON.parse, - ) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces', '--no-root'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.not.have.property('package.json') output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -410,7 +416,8 @@ describe('workspaces', () => { ) try { - const output = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('package.json') output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -430,7 +437,8 @@ describe('workspaces', () => { it('update root project and single workspace', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '--workspace', 'a'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('package.json') output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') @@ -444,9 +452,10 @@ describe('workspaces', () => { it('update more than one workspace', async () => { const tempDir = await setup() try { - const output = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], { + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], { cwd: tempDir, - }).then(JSON.parse) + }) + const output = JSON.parse(stdout) output.should.have.property('package.json') output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -463,7 +472,8 @@ describe('workspaces', () => { it('read packages from pnpm-workspace.yaml', async () => { const tempDir = await setup(['packages/**'], { pnpm: true }) try { - const output = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }).then(JSON.parse) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') output['packages/a/package.json'].dependencies.should.have.property('ncu-test-tag') @@ -478,18 +488,18 @@ describe('workspaces', () => { // cannot be stubbed because npm config printing occurs in viewMany describe('not stubbed', () => { // This test fails on Node v20.3.1 on Github Actions (only). - // The output fails to match the expected value: "npm config (workspace project):\n{ncutest: 'root' }" + // The stdout fails to match the expected value: "npm config (workspace project):\n{ncutest: 'root' }" // Strangely, it matches up to the single quote: "npm config (workspace project):\n{ncutest: " it.skip('merge local npm config with pnpm workspace npm config', async () => { const tempDir = await setup(['packages/**'], { pnpm: true }) try { await fs.writeFile(path.join(tempDir, '.npmrc'), 'ncutest=root') await fs.writeFile(path.join(tempDir, 'packages/a/.npmrc'), 'ncutest=a') - const output = await spawn('node', [bin, '--verbose', '--packageManager', 'pnpm'], { + const { stdout } = await spawn('node', [bin, '--verbose', '--packageManager', 'pnpm'], { cwd: path.join(tempDir, 'packages/a'), }) - output.should.include(`npm config (workspace project):\n{ ncutest: 'root' }`) - output.should.include(`Using merged npm config:\n{\n ncutest: 'a',`) + stdout.should.include(`npm config (workspace project):\n{ ncutest: 'root' }`) + stdout.should.include(`Using merged npm config:\n{\n ncutest: 'a',`) } finally { await fs.rm(tempDir, { recursive: true, force: true }) } From 05d59459790a59721b4c68a9aac1430a4dc4b7f8 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Tue, 12 Mar 2024 23:41:38 +0000 Subject: [PATCH 07/11] Migrate spawn-please options. --- src/types/spawn-please.d.ts | 7 ++++++- test/bin.test.ts | 28 +++++++++++++------------- test/deep.test.ts | 10 +++++----- test/doctor.test.ts | 2 +- test/filter.test.ts | 20 +++++++++---------- test/filterVersion.test.ts | 4 ++-- test/format.test.ts | 14 ++++++------- test/group.test.ts | 2 +- test/install.test.ts | 8 ++++---- test/rc-config.test.ts | 22 ++++++++++---------- test/timeout.test.ts | 4 ++-- test/workspaces.test.ts | 40 ++++++++++++++++++------------------- 12 files changed, 83 insertions(+), 78 deletions(-) diff --git a/src/types/spawn-please.d.ts b/src/types/spawn-please.d.ts index 73fa454e..6773c396 100644 --- a/src/types/spawn-please.d.ts +++ b/src/types/spawn-please.d.ts @@ -1,6 +1,11 @@ // add to tsconfig compilerOptions.paths declare module 'spawn-please' { - export default function(command: string, args?: string[], options?: any, spawnOptions?: any): Promise<{ + export default function(command: string, args?: string[], options?: { + rejectOnError?: boolean | undefined; + stdin?: string | undefined; + stderr?: ((data: string) => void) | undefined; + stdout?: ((data: string) => void) | undefined; +}, spawnOptions?: any): Promise<{ stdout: string, stderr: string }>; diff --git a/test/bin.test.ts b/test/bin.test.ts index d2913c6c..2a068d48 100644 --- a/test/bin.test.ts +++ b/test/bin.test.ts @@ -16,7 +16,7 @@ describe('bin', async function () { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin'], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') @@ -27,7 +27,7 @@ describe('bin', async function () { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin'], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') @@ -39,7 +39,7 @@ describe('bin', async function () { const { stdout } = await spawn( 'node', [bin, '--loglevel', 'verbose'], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }, ) stdout.should.containIgnoreCase('Initializing') stdout.should.containIgnoreCase('Running in local mode') @@ -49,7 +49,7 @@ describe('bin', async function () { it('--verbose', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn('node', [bin, '--verbose'], JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } })) + const { stdout } = await spawn('node', [bin, '--verbose'], { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }) stdout.should.containIgnoreCase('Initializing') stdout.should.containIgnoreCase('Running in local mode') stdout.should.containIgnoreCase('Finding package file data') @@ -58,7 +58,7 @@ describe('bin', async function () { it('accept stdin', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies: { express: '1' } })) + const { stdout } = await spawn('node', [bin, '--stdin'], { stdin: JSON.stringify({ dependencies: { express: '1' } }) }) stdout.trim().should.startWith('express') stub.restore() }) @@ -68,7 +68,7 @@ describe('bin', async function () { await spawn( 'node', [bin, '--stdin', '--errorLevel', '2'], - JSON.stringify({ dependencies: { express: '1' } }), + { stdin: JSON.stringify({ dependencies: { express: '1' } }) }, ).should.eventually.be.rejectedWith('Dependencies not up-to-date') stub.restore() }) @@ -85,7 +85,7 @@ describe('bin', async function () { it('use package.json in cwd by default', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn('node', [bin, '--jsonUpgraded'], { cwd: path.join(__dirname, 'test-data/ncu') }) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded'], {}, { cwd: path.join(__dirname, 'test-data/ncu') }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') stub.restore() @@ -93,7 +93,7 @@ describe('bin', async function () { it('throw error if there is no package', async () => { // run from tmp dir to avoid ncu analyzing the project's package.json - return spawn('node', [bin], { cwd: os.tmpdir() }).should.eventually.be.rejectedWith('No package.json') + return spawn('node', [bin], {}, { cwd: os.tmpdir() }).should.eventually.be.rejectedWith('No package.json') }) it('throw error if there is no package in --cwd', async () => { @@ -181,7 +181,7 @@ describe('bin', async function () { const pkgFile = path.join(tempDir, 'package.json') await fs.writeFile(pkgFile, JSON.stringify({ dependencies: { express: '1' } }), 'utf-8') try { - await spawn('node', [bin, '-u', '--stdin', '--packageFile', pkgFile], JSON.stringify({ dependencies: {} })) + await spawn('node', [bin, '-u', '--stdin', '--packageFile', pkgFile], { stdin: JSON.stringify({ dependencies: {} }) }) const upgradedPkg = JSON.parse(await fs.readFile(pkgFile, 'utf-8')) upgradedPkg.should.have.property('dependencies') upgradedPkg.dependencies.should.have.property('express') @@ -194,7 +194,7 @@ describe('bin', async function () { it('suppress stdout when --silent is provided', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn('node', [bin, '--silent'], JSON.stringify({ dependencies: { express: '1' } })) + const { stdout } = await spawn('node', [bin, '--silent'], { stdin: JSON.stringify({ dependencies: { express: '1' } }) }) stdout.trim().should.equal('') stub.restore() }) @@ -227,7 +227,7 @@ describe('bin', async function () { event: 'link:../link', workspace: 'workspace:../workspace', } - const { stdout } = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) + const { stdout } = await spawn('node', [bin, '--stdin'], { stdin: JSON.stringify({ dependencies }) }) stripAnsi(stdout)!.should.not.include('No package versions were returned.') stub.restore() @@ -238,7 +238,7 @@ describe('bin', async function () { const { stdout } = await spawn( 'node', [bin, '--stdin', '--jsonUpgraded', 'ncu-test-v2'], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }) }, ) const upgraded = JSON.parse(stdout) as Index upgraded.should.deep.equal({ @@ -261,7 +261,7 @@ describe('bin', async function () { const dependencies = { 'ncu-test-v2': 'https://github.com/raineorshine/ncu-test-v2.git#v1.0.0', } - const { stdout } = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) + const { stdout } = await spawn('node', [bin, '--stdin'], { stdin: JSON.stringify({ dependencies }) }) stripAnsi(stdout) .trim() .should.equal('ncu-test-v2 https://github.com/raineorshine/ncu-test-v2.git#v1.0.0 → v2.0.0') @@ -274,7 +274,7 @@ describe('bin', async function () { const dependencies = { request: 'npm:ncu-test-v2@1.0.0', } - const { stdout } = await spawn('node', [bin, '--stdin'], JSON.stringify({ dependencies })) + const { stdout } = await spawn('node', [bin, '--stdin'], { stdin: JSON.stringify({ dependencies }) }) stripAnsi(stdout).trim().should.equal('request npm:ncu-test-v2@1.0.0 → 99.9.9') stub.restore() }) diff --git a/test/deep.test.ts b/test/deep.test.ts index 39e95a5c..6e668f88 100644 --- a/test/deep.test.ts +++ b/test/deep.test.ts @@ -57,7 +57,7 @@ describe('--deep', function () { it('output json with --jsonAll', async () => { const tempDir = await setupDeepTest() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--deep'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--deep'], {}, { cwd: tempDir }) const deepJsonOut = JSON.parse(stdout) deepJsonOut.should.have.property('package.json') deepJsonOut.should.have.property('packages/sub1/package.json') @@ -76,7 +76,7 @@ describe('--deep', function () { await spawn( 'node', [bin, '-u', '--packageFile', path.join(tempDir, '/**/package.json')], - '{ "dependencies": {}}', + { stdin: '{ "dependencies": {}}' }, { cwd: tempDir, }, @@ -96,7 +96,7 @@ describe('--deep', function () { const { stdout } = await spawn( 'node', [bin, '-u', '--jsonUpgraded', '--packageFile', path.join(tempDir, '**/package.json')], - '{ "dependencies": {}}', + { stdin: '{ "dependencies": {}}' }, { cwd: tempDir }, ) @@ -131,7 +131,7 @@ describe('--deep with nested ncurc files', function () { after(() => stub.restore()) it('use ncurc of nested packages', async () => { - const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--deep'], { cwd }) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--deep'], {}, { cwd }) const deepJsonOut = JSON.parse(stdout) // root: reject: ['cute-animals'] @@ -159,7 +159,7 @@ describe('--deep with nested ncurc files', function () { }) it('use ncurc of nested packages with --mergeConfig option', async () => { - const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--deep', '--mergeConfig'], { cwd }) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--deep', '--mergeConfig'], {}, { cwd }) const deepJsonOut = JSON.parse(stdout) // root: reject: ['cute-animals'] diff --git a/test/doctor.test.ts b/test/doctor.test.ts index a1f9d510..bd3b9ecd 100644 --- a/test/doctor.test.ts +++ b/test/doctor.test.ts @@ -419,7 +419,7 @@ else { try { // explicitly set packageManager to avoid auto yarn detection - await spawn('npm', ['install'], { cwd: tempDir }) + await spawn('npm', ['install'], {}, { cwd: tempDir }) await ncu(['--doctor', '-u', '-p', 'npm'], { cwd: tempDir, diff --git a/test/filter.test.ts b/test/filter.test.ts index 97c4c29c..18db3103 100644 --- a/test/filter.test.ts +++ b/test/filter.test.ts @@ -210,7 +210,7 @@ describe('filter', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'express'], - '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', + { stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }' }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') @@ -221,7 +221,7 @@ describe('filter', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '-f', 'express'], - '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', + { stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }' }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') @@ -236,7 +236,7 @@ describe('filter', () => { }, } - await spawn('node', [bin, '--jsonUpgraded', '--filter', 'lodash.map', 'lodash.filter'], JSON.stringify(pkgData)) + await spawn('node', [bin, '--jsonUpgraded', '--filter', 'lodash.map', 'lodash.filter'], { stdin: JSON.stringify(pkgData) }) .should.eventually.be.rejected }) @@ -251,7 +251,7 @@ describe('filter', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'lodash.map lodash.filter', 'lodash.map', 'lodash.filter'], - JSON.stringify(pkgData), + { stdin: JSON.stringify(pkgData) }, ) const upgraded = JSON.parse(stdout) upgraded.should.have.property('lodash.map') @@ -269,7 +269,7 @@ describe('filter', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'lodash.map lodash.filter', ' '], - JSON.stringify(pkgData), + { stdin: JSON.stringify(pkgData) }, ) const upgraded = JSON.parse(stdout) upgraded.should.have.property('lodash.map') @@ -287,7 +287,7 @@ describe('filter', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'ncu-test-v2', '--filter', 'ncu-test-tag'], - JSON.stringify(pkgData), + { stdin: JSON.stringify(pkgData) }, ) const upgraded = JSON.parse(stdout) upgraded.should.have.property('ncu-test-v2') @@ -306,7 +306,7 @@ describe('reject', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--reject', 'chalk'], - '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', + { stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }' }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') @@ -317,7 +317,7 @@ describe('reject', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '-x', 'chalk'], - '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', + { stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }' }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') @@ -328,7 +328,7 @@ describe('reject', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--reject', '""', '--stdin', '-x', 'chalk'], - '{ "dependencies": { "ncu-test-v2": "1.0.0", "ncu-test-tag": "1.0.0" } }', + { stdin: '{ "dependencies": { "ncu-test-v2": "1.0.0", "ncu-test-tag": "1.0.0" } }' }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') @@ -346,7 +346,7 @@ describe('reject', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--stdin', '--reject', 'ncu-test-v2', '--reject', 'ncu-test-tag'], - JSON.stringify(pkgData), + { stdin: JSON.stringify(pkgData) }, ) const upgraded = JSON.parse(stdout) upgraded.should.not.have.property('ncu-test-v2') diff --git a/test/filterVersion.test.ts b/test/filterVersion.test.ts index e97f8229..8a3993b3 100644 --- a/test/filterVersion.test.ts +++ b/test/filterVersion.test.ts @@ -130,7 +130,7 @@ describe('filterVersion', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--verbose', '--stdin', '--filterVersion', '1.0.0', '--filterVersion', '1.0.9'], - JSON.stringify(pkgData), + { stdin: JSON.stringify(pkgData) }, ) const upgraded = JSON.parse(stdout) upgraded.should.have.property('ncu-test-v2') @@ -154,7 +154,7 @@ describe('rejectVersion', () => { const { stdout } = await spawn( 'node', [bin, '--jsonUpgraded', '--verbose', '--stdin', '--rejectVersion', '1.0.0', '--rejectVersion', '1.0.9'], - JSON.stringify(pkgData), + { stdin: JSON.stringify(pkgData) }, ) const upgraded = JSON.parse(stdout) upgraded.should.not.have.property('ncu-test-v2') diff --git a/test/format.test.ts b/test/format.test.ts index bf9aedff..6bdd4c77 100644 --- a/test/format.test.ts +++ b/test/format.test.ts @@ -27,7 +27,7 @@ describe('format', () => { 'ncu-test-v2': '^1.0.0', }, } - const { stdout } = await spawn('node', [bin, '--format', 'time', '--stdin'], JSON.stringify(packageData)) + const { stdout } = await spawn('node', [bin, '--format', 'time', '--stdin'], { stdin: JSON.stringify(packageData) }) expect(stdout).contains(timestamp) stub.restore() }) @@ -45,8 +45,8 @@ describe('format', () => { 'utf-8', ) try { - await spawn('npm', ['install'], { cwd: tempDir }) - const { stdout } = await spawn('node', [bin, '--format', 'repo'], { cwd: tempDir }) + await spawn('npm', ['install'], {},{ cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--format', 'repo'], {}, { cwd: tempDir }) stdout.should.include('https://github.com/Mitsunee/modern-diacritics') } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -74,7 +74,7 @@ describe('format', () => { 'utf-8', ) try { - const { stdout } = await spawn('node', [bin, '--format', 'lines'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--format', 'lines'], {}, { cwd: tempDir }) stdout.should.equals('ncu-test-v2@^2.0.0\nncu-test-tag@^1.1.0\n') } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -103,7 +103,7 @@ describe('format', () => { 'utf-8', ) try { - await spawn('node', [bin, '--format', 'lines', '--jsonUpgraded'], { + await spawn('node', [bin, '--format', 'lines', '--jsonUpgraded'], {}, { cwd: tempDir, }).should.eventually.be.rejectedWith('Cannot specify both --format lines and --jsonUpgraded.') } finally { @@ -133,7 +133,7 @@ describe('format', () => { 'utf-8', ) try { - await spawn('node', [bin, '--format', 'lines', '--jsonAll'], { + await spawn('node', [bin, '--format', 'lines', '--jsonAll'], {}, { cwd: tempDir, }).should.eventually.be.rejectedWith('Cannot specify both --format lines and --jsonAll.') } finally { @@ -163,7 +163,7 @@ describe('format', () => { 'utf-8', ) try { - await spawn('node', [bin, '--format', 'lines,group'], { + await spawn('node', [bin, '--format', 'lines,group'], {}, { cwd: tempDir, }).should.eventually.be.rejectedWith('Cannot use --format lines with other formatting options.') } finally { diff --git a/test/group.test.ts b/test/group.test.ts index b477e23f..1888a620 100644 --- a/test/group.test.ts +++ b/test/group.test.ts @@ -41,7 +41,7 @@ async function groupTestScaffold( const configFile = path.join(tempDir, '.ncurc.js') await fs.writeFile(configFile, `module.exports = { groupFunction: ${groupFn.toString()} }`, 'utf-8') try { - const { stdout } = await spawn('node', [bin, '--format', 'group', '--configFilePath', tempDir], { + const { stdout } = await spawn('node', [bin, '--format', 'group', '--configFilePath', tempDir], {}, { cwd: tempDir, }) stripAnsi(stdout).should.containIgnoreCase(expectedOutput) diff --git a/test/install.test.ts b/test/install.test.ts index 6598541e..921a198b 100644 --- a/test/install.test.ts +++ b/test/install.test.ts @@ -102,7 +102,7 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - await spawn('node', [bin, '-iu', '--packageFile', pkgFile], { + await spawn('node', [bin, '-iu', '--packageFile', pkgFile], {}, { env: { ...process.env, INJECT_PROMPTS: JSON.stringify([['ncu-test-v2'], true]), @@ -129,7 +129,7 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - await spawn('node', [bin, '-iu', '--packageFile', pkgFile], { + await spawn('node', [bin, '-iu', '--packageFile', pkgFile], {}, { env: { ...process.env, INJECT_PROMPTS: JSON.stringify([['ncu-test-v2'], false]), @@ -156,7 +156,7 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - await spawn('node', [bin, '-iu', '--packageFile', pkgFile, '--install', 'always'], { + await spawn('node', [bin, '-iu', '--packageFile', pkgFile, '--install', 'always'], {}, { env: { ...process.env, // NOTE: We can inject valuees, but we cannot test if the prompt was actually shown or not. @@ -185,7 +185,7 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - await spawn('node', [bin, '-iu', '--packageFile', pkgFile, '--install', 'never'], { + await spawn('node', [bin, '-iu', '--packageFile', pkgFile, '--install', 'never'], {}, { env: { ...process.env, // NOTE: We can inject valuees, but we cannot test if the prompt was actually shown or not. diff --git a/test/rc-config.test.ts b/test/rc-config.test.ts index 11bb5cdb..9c068a56 100644 --- a/test/rc-config.test.ts +++ b/test/rc-config.test.ts @@ -23,7 +23,7 @@ describe('rc-config', () => { const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }) }, ) stdout.should.containIgnoreCase(`Using config file ${tempConfigFile}`) } finally { @@ -37,7 +37,7 @@ describe('rc-config', () => { const { stdout } = await spawn( 'node', [bin, '--stdin', '--cwd', tempDir], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }, ) stdout.should.not.include('Using config file') } finally { @@ -53,7 +53,7 @@ describe('rc-config', () => { const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }) }, ) stdout.should.not.include('Using config file') } finally { @@ -69,7 +69,7 @@ describe('rc-config', () => { const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }) }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') @@ -88,7 +88,7 @@ describe('rc-config', () => { const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir, '--configFileName', tempConfigFileName], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }) }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') @@ -106,7 +106,7 @@ describe('rc-config', () => { const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir, '--filter', 'ncu-test-tag'], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }) }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-tag') @@ -124,7 +124,7 @@ describe('rc-config', () => { const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir, '--no-jsonUpgraded'], - JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }) }, ) // if the output contains "Using config file", then we know that jsonUpgraded was overridden stdout.should.include('Using config file') @@ -142,7 +142,7 @@ describe('rc-config', () => { const { stdout } = await spawn( 'node', [bin, '--stdin', '--configFilePath', tempDir], - JSON.stringify({ dependencies: { 'ncu-test-tag': '0.1.0' } }), + { stdin: JSON.stringify({ dependencies: { 'ncu-test-tag': '0.1.0' } }) }, ) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-tag') @@ -163,7 +163,7 @@ describe('rc-config', () => { ) try { // awkwardly, we have to set mergeConfig to enable autodetecting the rcconfig because otherwise it is explicitly disabled for tests - const { stdout } = await spawn('node', [bin, '--mergeConfig'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--mergeConfig'], {}, { cwd: tempDir }) const firstLine = stdout.split('\n')[0] // On OSX tempDir is /var/folders/cb/12345, but npm-check-updates recieves /private/var/folders/cb/12345. // Apparently OSX symlinks /tmp to /private/tmp for historical reasons. @@ -187,7 +187,7 @@ describe('rc-config', () => { ) try { // awkwardly, we have to set mergeConfig to enable autodetecting the rcconfig because otherwise it is explicitly disabled for tests - const { stdout } = await spawn('node', [bin, '--mergeConfig'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--mergeConfig'], {}, { cwd: tempDir }) const firstLine = stdout.split('\n')[0] // On OSX tempDir is /var/folders/cb/12345, but npm-check-updates recieves /private/var/folders/cb/12345. // Apparently OSX symlinks /tmp to /private/tmp for historical reasons. @@ -208,7 +208,7 @@ describe('rc-config', () => { try { // awkwardly, we have to set mergeConfig to enable autodetecting the rcconfig because otherwise it is explicitly disabled for tests - await spawn('node', [bin, '--mergeConfig'], { cwd: tempDir }) + await spawn('node', [bin, '--mergeConfig'], {}, { cwd: tempDir }) } finally { await fs.rm(tempDir, { recursive: true, force: true }) } diff --git a/test/timeout.test.ts b/test/timeout.test.ts index 4585bf3e..6524ee39 100644 --- a/test/timeout.test.ts +++ b/test/timeout.test.ts @@ -22,13 +22,13 @@ describe('timeout', function () { return spawn( 'node', [bin, '--timeout', '1'], - '{ "dependencies": { "express": "1" } }', + { stdin: '{ "dependencies": { "express": "1" } }' }, ).should.eventually.be.rejectedWith('Exceeded global timeout of 1ms') }) it('completes successfully with timeout', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - await spawn('node', [bin, '--timeout', '100000'], '{ "dependencies": { "express": "1" } }') + await spawn('node', [bin, '--timeout', '100000'], { stdin: '{ "dependencies": { "express": "1" } }' }) stub.restore() }) }) diff --git a/test/workspaces.test.ts b/test/workspaces.test.ts index d220777b..dbd1877f 100644 --- a/test/workspaces.test.ts +++ b/test/workspaces.test.ts @@ -136,7 +136,7 @@ describe('workspaces', () => { it('update workspaces with --workspaces', async () => { const tempDir = await setup(['packages/a']) try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') @@ -149,7 +149,7 @@ describe('workspaces', () => { it('update workspaces glob', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -163,7 +163,7 @@ describe('workspaces', () => { it('update workspaces with -ws', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '-ws'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '-ws'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -188,7 +188,7 @@ describe('workspaces', () => { ) try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -205,7 +205,7 @@ describe('workspaces', () => { it('update workspaces/packages', async () => { const tempDir = await setup({ packages: ['packages/**'] }) try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -220,7 +220,7 @@ describe('workspaces', () => { it('ignore local workspace packages', async () => { const tempDir = await setupSymlinkedPackages() try { - const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspaces'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspaces'], {}, { cwd: tempDir }) const upgrades = JSON.parse(stdout) upgrades.should.deep.equal({ 'package.json': {}, @@ -239,7 +239,7 @@ describe('workspaces', () => { it('ignore local workspace packages with different names than their folders', async () => { const tempDir = await setupSymlinkedPackages(['packages/**'], 'chalk') try { - const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspaces'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspaces'], {}, { cwd: tempDir }) const upgrades = JSON.parse(stdout) upgrades.should.deep.equal({ 'package.json': {}, @@ -270,7 +270,7 @@ describe('workspaces', () => { it('update single workspace with --workspace', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') @@ -283,7 +283,7 @@ describe('workspaces', () => { it('update single workspace with -w', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '-w', 'a'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '-w', 'a'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') @@ -296,7 +296,7 @@ describe('workspaces', () => { it('update more than one workspace', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], { + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], {}, { cwd: tempDir, }) const output = JSON.parse(stdout) @@ -313,7 +313,7 @@ describe('workspaces', () => { const tempDir = await setup() try { // when npm-check-updates is executed in a workspace directory but uses --cwd to point up to the root, make sure that the root package.json is checked for the workspaces property - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--cwd', '../../'], { + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--cwd', '../../'], {}, { cwd: path.join(tempDir, 'packages', 'a'), }) const output = JSON.parse(stdout) @@ -329,7 +329,7 @@ describe('workspaces', () => { it('update namespaced workspace', async () => { const tempDir = await setupSymlinkedPackages(['packages/**'], '@ncu/bar') try { - const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspace', '@ncu/bar'], { + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspace', '@ncu/bar'], {}, { cwd: tempDir, }) const upgrades = JSON.parse(stdout) @@ -351,7 +351,7 @@ describe('workspaces', () => { it('update root project by default', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces', '--root'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces', '--root'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('package.json') output.should.have.property('packages/a/package.json') @@ -367,7 +367,7 @@ describe('workspaces', () => { it('do not update the root project with --no-root', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces', '--no-root'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces', '--no-root'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.not.have.property('package.json') output.should.have.property('packages/a/package.json') @@ -382,7 +382,7 @@ describe('workspaces', () => { it('update root project and workspaces if errorLevel=2', async () => { const tempDir = await setup() try { - await spawn('node', [bin, '--upgrade', '--workspaces', '--errorLevel', '2'], { + await spawn('node', [bin, '--upgrade', '--workspaces', '--errorLevel', '2'], {}, { cwd: tempDir, }).should.eventually.be.rejectedWith('Dependencies not up-to-date') const upgradedPkg = JSON.parse(await fs.readFile(path.join(tempDir, 'package.json'), 'utf-8')) @@ -416,7 +416,7 @@ describe('workspaces', () => { ) try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('package.json') output.should.have.property('packages/a/package.json') @@ -437,7 +437,7 @@ describe('workspaces', () => { it('update root project and single workspace', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('package.json') output.should.have.property('packages/a/package.json') @@ -452,7 +452,7 @@ describe('workspaces', () => { it('update more than one workspace', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], { + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], {}, { cwd: tempDir, }) const output = JSON.parse(stdout) @@ -472,7 +472,7 @@ describe('workspaces', () => { it('read packages from pnpm-workspace.yaml', async () => { const tempDir = await setup(['packages/**'], { pnpm: true }) try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], { cwd: tempDir }) + const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspaces'], {}, { cwd: tempDir }) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -495,7 +495,7 @@ describe('workspaces', () => { try { await fs.writeFile(path.join(tempDir, '.npmrc'), 'ncutest=root') await fs.writeFile(path.join(tempDir, 'packages/a/.npmrc'), 'ncutest=a') - const { stdout } = await spawn('node', [bin, '--verbose', '--packageManager', 'pnpm'], { + const { stdout } = await spawn('node', [bin, '--verbose', '--packageManager', 'pnpm'], {}, { cwd: path.join(tempDir, 'packages/a'), }) stdout.should.include(`npm config (workspace project):\n{ ncutest: 'root' }`) From 7cc5b737887559a63cc86f597e5827ab09d39a86 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Tue, 12 Mar 2024 23:54:55 +0000 Subject: [PATCH 08/11] Remove spawn-please.d.ts and use provided types. --- src/types/spawn-please.d.ts | 12 ------------ tsconfig.json | 1 - 2 files changed, 13 deletions(-) delete mode 100644 src/types/spawn-please.d.ts diff --git a/src/types/spawn-please.d.ts b/src/types/spawn-please.d.ts deleted file mode 100644 index 6773c396..00000000 --- a/src/types/spawn-please.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// add to tsconfig compilerOptions.paths -declare module 'spawn-please' { - export default function(command: string, args?: string[], options?: { - rejectOnError?: boolean | undefined; - stdin?: string | undefined; - stderr?: ((data: string) => void) | undefined; - stdout?: ((data: string) => void) | undefined; -}, spawnOptions?: any): Promise<{ - stdout: string, - stderr: string - }>; -} diff --git a/tsconfig.json b/tsconfig.json index 75295128..0f1bba7c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,6 @@ "paths": { "libnpmconfig": ["./src/types/libnpmconfig"], "prompts-ncu": ["./src/types/prompts-ncu"], - "spawn-please": ["./src/types/spawn-please"] }, "resolveJsonModule": true, "outDir": "./build", From c95667de2e469b847edd442d695bfdcb9fc4e7a4 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Tue, 12 Mar 2024 23:57:26 +0000 Subject: [PATCH 09/11] prettier --- src/package-managers/bun.ts | 4 +-- src/package-managers/yarn.ts | 2 +- test/bin.test.ts | 56 ++++++++++++++--------------- test/deep.test.ts | 2 +- test/filter.test.ts | 45 ++++++++++-------------- test/format.test.ts | 35 +++++++++++++------ test/group.test.ts | 11 ++++-- test/install.test.ts | 68 +++++++++++++++++++++++------------- test/rc-config.test.ts | 48 ++++++++++--------------- test/timeout.test.ts | 8 ++--- test/workspaces.test.ts | 66 ++++++++++++++++++++++++---------- tsconfig.json | 2 +- 12 files changed, 196 insertions(+), 151 deletions(-) diff --git a/src/package-managers/bun.ts b/src/package-managers/bun.ts index 9561e8e1..b4715a9d 100644 --- a/src/package-managers/bun.ts +++ b/src/package-managers/bun.ts @@ -4,8 +4,8 @@ import keyValueBy from '../lib/keyValueBy' import programError from '../lib/programError' import { Index } from '../types/IndexType' import { NpmOptions } from '../types/NpmOptions' -import { SpawnPleaseOptions } from '../types/SpawnPleaseOptions' import { Options } from '../types/Options' +import { SpawnPleaseOptions } from '../types/SpawnPleaseOptions' import * as npm from './npm' /** Spawn bun. */ @@ -14,7 +14,7 @@ async function spawnBun( npmOptions: NpmOptions = {}, spawnPleaseOptions: SpawnPleaseOptions = {}, spawnOptions: Index = {}, -): Promise<{ stdout: string, stderr: string }> { +): Promise<{ stdout: string; stderr: string }> { // Bun not yet supported on Windows. // @see https://github.com/oven-sh/bun/issues/43 if (process.platform === 'win32') { diff --git a/src/package-managers/yarn.ts b/src/package-managers/yarn.ts index 550acc68..96c84031 100644 --- a/src/package-managers/yarn.ts +++ b/src/package-managers/yarn.ts @@ -232,7 +232,7 @@ export async function defaultPrefix(options: Options): Promise { // catch error to prevent process from crashing // https://github.com/raineorshine/npm-check-updates/issues/873 .catch(() => ({ - stdout: null + stdout: null, })) // FIX: for ncu -g doesn't work on homebrew or windows #146 diff --git a/test/bin.test.ts b/test/bin.test.ts index 2a068d48..1c0d52cf 100644 --- a/test/bin.test.ts +++ b/test/bin.test.ts @@ -13,22 +13,18 @@ const bin = path.join(__dirname, '../build/src/bin/cli.js') describe('bin', async function () { it('fetch latest version from registry (not stubbed)', async () => { - const { stdout } = await spawn( - 'node', - [bin, '--jsonUpgraded', '--stdin'], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--stdin'], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') }) it('output only upgraded with --jsonUpgraded', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn( - 'node', - [bin, '--jsonUpgraded', '--stdin'], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--stdin'], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') stub.restore() @@ -36,11 +32,9 @@ describe('bin', async function () { it('--loglevel verbose', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn( - 'node', - [bin, '--loglevel', 'verbose'], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--loglevel', 'verbose'], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + }) stdout.should.containIgnoreCase('Initializing') stdout.should.containIgnoreCase('Running in local mode') stdout.should.containIgnoreCase('Finding package file data') @@ -49,7 +43,9 @@ describe('bin', async function () { it('--verbose', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn('node', [bin, '--verbose'], { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }) + const { stdout } = await spawn('node', [bin, '--verbose'], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + }) stdout.should.containIgnoreCase('Initializing') stdout.should.containIgnoreCase('Running in local mode') stdout.should.containIgnoreCase('Finding package file data') @@ -58,18 +54,18 @@ describe('bin', async function () { it('accept stdin', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn('node', [bin, '--stdin'], { stdin: JSON.stringify({ dependencies: { express: '1' } }) }) + const { stdout } = await spawn('node', [bin, '--stdin'], { + stdin: JSON.stringify({ dependencies: { express: '1' } }), + }) stdout.trim().should.startWith('express') stub.restore() }) it('reject out-of-date stdin with errorLevel 2', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - await spawn( - 'node', - [bin, '--stdin', '--errorLevel', '2'], - { stdin: JSON.stringify({ dependencies: { express: '1' } }) }, - ).should.eventually.be.rejectedWith('Dependencies not up-to-date') + await spawn('node', [bin, '--stdin', '--errorLevel', '2'], { + stdin: JSON.stringify({ dependencies: { express: '1' } }), + }).should.eventually.be.rejectedWith('Dependencies not up-to-date') stub.restore() }) @@ -181,7 +177,9 @@ describe('bin', async function () { const pkgFile = path.join(tempDir, 'package.json') await fs.writeFile(pkgFile, JSON.stringify({ dependencies: { express: '1' } }), 'utf-8') try { - await spawn('node', [bin, '-u', '--stdin', '--packageFile', pkgFile], { stdin: JSON.stringify({ dependencies: {} }) }) + await spawn('node', [bin, '-u', '--stdin', '--packageFile', pkgFile], { + stdin: JSON.stringify({ dependencies: {} }), + }) const upgradedPkg = JSON.parse(await fs.readFile(pkgFile, 'utf-8')) upgradedPkg.should.have.property('dependencies') upgradedPkg.dependencies.should.have.property('express') @@ -194,7 +192,9 @@ describe('bin', async function () { it('suppress stdout when --silent is provided', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn('node', [bin, '--silent'], { stdin: JSON.stringify({ dependencies: { express: '1' } }) }) + const { stdout } = await spawn('node', [bin, '--silent'], { + stdin: JSON.stringify({ dependencies: { express: '1' } }), + }) stdout.trim().should.equal('') stub.restore() }) @@ -235,11 +235,9 @@ describe('bin', async function () { it('combine boolean flags with arguments', async () => { const stub = stubNpmView('99.9.9', { spawn: true }) - const { stdout } = await spawn( - 'node', - [bin, '--stdin', '--jsonUpgraded', 'ncu-test-v2'], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--stdin', '--jsonUpgraded', 'ncu-test-v2'], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }), + }) const upgraded = JSON.parse(stdout) as Index upgraded.should.deep.equal({ 'ncu-test-v2': '99.9.9', diff --git a/test/deep.test.ts b/test/deep.test.ts index 6e668f88..43a94a6a 100644 --- a/test/deep.test.ts +++ b/test/deep.test.ts @@ -132,7 +132,7 @@ describe('--deep with nested ncurc files', function () { it('use ncurc of nested packages', async () => { const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--deep'], {}, { cwd }) - const deepJsonOut = JSON.parse(stdout) + const deepJsonOut = JSON.parse(stdout) // root: reject: ['cute-animals'] deepJsonOut.should.have.property('package.json') diff --git a/test/filter.test.ts b/test/filter.test.ts index 18db3103..80b7add3 100644 --- a/test/filter.test.ts +++ b/test/filter.test.ts @@ -207,22 +207,18 @@ describe('filter', () => { after(() => stub.restore()) it('filter by package name with --filter', async () => { - const { stdout } = await spawn( - 'node', - [bin, '--jsonUpgraded', '--stdin', '--filter', 'express'], - { stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }' }, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--stdin', '--filter', 'express'], { + stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') pkgData.should.not.have.property('chalk') }) it('filter by package name with -f', async () => { - const { stdout } = await spawn( - 'node', - [bin, '--jsonUpgraded', '--stdin', '-f', 'express'], - { stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }' }, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--stdin', '-f', 'express'], { + stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') pkgData.should.not.have.property('chalk') @@ -236,8 +232,9 @@ describe('filter', () => { }, } - await spawn('node', [bin, '--jsonUpgraded', '--filter', 'lodash.map', 'lodash.filter'], { stdin: JSON.stringify(pkgData) }) - .should.eventually.be.rejected + await spawn('node', [bin, '--jsonUpgraded', '--filter', 'lodash.map', 'lodash.filter'], { + stdin: JSON.stringify(pkgData), + }).should.eventually.be.rejected }) it('allow matching --filter and arguments', async () => { @@ -303,33 +300,27 @@ describe('reject', () => { after(() => stub.restore()) it('reject by package name with --reject', async () => { - const { stdout } = await spawn( - 'node', - [bin, '--jsonUpgraded', '--stdin', '--reject', 'chalk'], - { stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }' }, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--stdin', '--reject', 'chalk'], { + stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') pkgData.should.not.have.property('chalk') }) it('reject by package name with -x', async () => { - const { stdout } = await spawn( - 'node', - [bin, '--jsonUpgraded', '--stdin', '-x', 'chalk'], - { stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }' }, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--stdin', '-x', 'chalk'], { + stdin: '{ "dependencies": { "express": "1", "chalk": "0.1.0" } }', + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('express') pkgData.should.not.have.property('chalk') }) it('reject with empty string should not reject anything', async () => { - const { stdout } = await spawn( - 'node', - [bin, '--jsonUpgraded', '--reject', '""', '--stdin', '-x', 'chalk'], - { stdin: '{ "dependencies": { "ncu-test-v2": "1.0.0", "ncu-test-tag": "1.0.0" } }' }, - ) + const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--reject', '""', '--stdin', '-x', 'chalk'], { + stdin: '{ "dependencies": { "ncu-test-v2": "1.0.0", "ncu-test-tag": "1.0.0" } }', + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') pkgData.should.have.property('ncu-test-tag') diff --git a/test/format.test.ts b/test/format.test.ts index 6bdd4c77..7a23f33d 100644 --- a/test/format.test.ts +++ b/test/format.test.ts @@ -45,7 +45,7 @@ describe('format', () => { 'utf-8', ) try { - await spawn('npm', ['install'], {},{ cwd: tempDir }) + await spawn('npm', ['install'], {}, { cwd: tempDir }) const { stdout } = await spawn('node', [bin, '--format', 'repo'], {}, { cwd: tempDir }) stdout.should.include('https://github.com/Mitsunee/modern-diacritics') } finally { @@ -103,9 +103,14 @@ describe('format', () => { 'utf-8', ) try { - await spawn('node', [bin, '--format', 'lines', '--jsonUpgraded'], {}, { - cwd: tempDir, - }).should.eventually.be.rejectedWith('Cannot specify both --format lines and --jsonUpgraded.') + await spawn( + 'node', + [bin, '--format', 'lines', '--jsonUpgraded'], + {}, + { + cwd: tempDir, + }, + ).should.eventually.be.rejectedWith('Cannot specify both --format lines and --jsonUpgraded.') } finally { await fs.rm(tempDir, { recursive: true, force: true }) stub.restore() @@ -133,9 +138,14 @@ describe('format', () => { 'utf-8', ) try { - await spawn('node', [bin, '--format', 'lines', '--jsonAll'], {}, { - cwd: tempDir, - }).should.eventually.be.rejectedWith('Cannot specify both --format lines and --jsonAll.') + await spawn( + 'node', + [bin, '--format', 'lines', '--jsonAll'], + {}, + { + cwd: tempDir, + }, + ).should.eventually.be.rejectedWith('Cannot specify both --format lines and --jsonAll.') } finally { await fs.rm(tempDir, { recursive: true, force: true }) stub.restore() @@ -163,9 +173,14 @@ describe('format', () => { 'utf-8', ) try { - await spawn('node', [bin, '--format', 'lines,group'], {}, { - cwd: tempDir, - }).should.eventually.be.rejectedWith('Cannot use --format lines with other formatting options.') + await spawn( + 'node', + [bin, '--format', 'lines,group'], + {}, + { + cwd: tempDir, + }, + ).should.eventually.be.rejectedWith('Cannot use --format lines with other formatting options.') } finally { await fs.rm(tempDir, { recursive: true, force: true }) stub.restore() diff --git a/test/group.test.ts b/test/group.test.ts index 1888a620..f2f75a16 100644 --- a/test/group.test.ts +++ b/test/group.test.ts @@ -41,9 +41,14 @@ async function groupTestScaffold( const configFile = path.join(tempDir, '.ncurc.js') await fs.writeFile(configFile, `module.exports = { groupFunction: ${groupFn.toString()} }`, 'utf-8') try { - const { stdout } = await spawn('node', [bin, '--format', 'group', '--configFilePath', tempDir], {}, { - cwd: tempDir, - }) + const { stdout } = await spawn( + 'node', + [bin, '--format', 'group', '--configFilePath', tempDir], + {}, + { + cwd: tempDir, + }, + ) stripAnsi(stdout).should.containIgnoreCase(expectedOutput) } finally { await fs.rm(tempDir, { recursive: true, force: true }) diff --git a/test/install.test.ts b/test/install.test.ts index 921a198b..0087be9d 100644 --- a/test/install.test.ts +++ b/test/install.test.ts @@ -102,12 +102,17 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - await spawn('node', [bin, '-iu', '--packageFile', pkgFile], {}, { - env: { - ...process.env, - INJECT_PROMPTS: JSON.stringify([['ncu-test-v2'], true]), + await spawn( + 'node', + [bin, '-iu', '--packageFile', pkgFile], + {}, + { + env: { + ...process.env, + INJECT_PROMPTS: JSON.stringify([['ncu-test-v2'], true]), + }, }, - }) + ) expect(await exists(path.join(tempDir, 'package-lock.json'))).to.be.true expect(await exists(path.join(tempDir, 'node_modules'))).to.be.true } finally { @@ -129,12 +134,17 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - await spawn('node', [bin, '-iu', '--packageFile', pkgFile], {}, { - env: { - ...process.env, - INJECT_PROMPTS: JSON.stringify([['ncu-test-v2'], false]), + await spawn( + 'node', + [bin, '-iu', '--packageFile', pkgFile], + {}, + { + env: { + ...process.env, + INJECT_PROMPTS: JSON.stringify([['ncu-test-v2'], false]), + }, }, - }) + ) expect(await exists(path.join(tempDir, 'package-lock.json'))).to.be.false expect(await exists(path.join(tempDir, 'node_modules'))).to.be.false } finally { @@ -156,14 +166,19 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - await spawn('node', [bin, '-iu', '--packageFile', pkgFile, '--install', 'always'], {}, { - env: { - ...process.env, - // NOTE: We can inject valuees, but we cannot test if the prompt was actually shown or not. - // i.e. Testing that the prompt is not shown with --install always must be done manually. - INJECT_PROMPTS: JSON.stringify([['ncu-test-v2']]), + await spawn( + 'node', + [bin, '-iu', '--packageFile', pkgFile, '--install', 'always'], + {}, + { + env: { + ...process.env, + // NOTE: We can inject valuees, but we cannot test if the prompt was actually shown or not. + // i.e. Testing that the prompt is not shown with --install always must be done manually. + INJECT_PROMPTS: JSON.stringify([['ncu-test-v2']]), + }, }, - }) + ) expect(await exists(path.join(tempDir, 'package-lock.json'))).to.be.true expect(await exists(path.join(tempDir, 'node_modules'))).to.be.true } finally { @@ -185,14 +200,19 @@ describe('install', () => { await fs.writeFile(pkgFile, JSON.stringify(pkgData), 'utf-8') try { - await spawn('node', [bin, '-iu', '--packageFile', pkgFile, '--install', 'never'], {}, { - env: { - ...process.env, - // NOTE: We can inject valuees, but we cannot test if the prompt was actually shown or not. - // i.e. Testing that the prompt is not shown with --install never must be done manually. - INJECT_PROMPTS: JSON.stringify([['ncu-test-v2']]), + await spawn( + 'node', + [bin, '-iu', '--packageFile', pkgFile, '--install', 'never'], + {}, + { + env: { + ...process.env, + // NOTE: We can inject valuees, but we cannot test if the prompt was actually shown or not. + // i.e. Testing that the prompt is not shown with --install never must be done manually. + INJECT_PROMPTS: JSON.stringify([['ncu-test-v2']]), + }, }, - }) + ) expect(await exists(path.join(tempDir, 'package-lock.json'))).to.be.false expect(await exists(path.join(tempDir, 'node_modules'))).to.be.false } finally { diff --git a/test/rc-config.test.ts b/test/rc-config.test.ts index 9c068a56..52b4ddd8 100644 --- a/test/rc-config.test.ts +++ b/test/rc-config.test.ts @@ -20,11 +20,9 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, JSON.stringify({ filter: 'ncu-test-v2' }), 'utf-8') try { - const { stdout } = await spawn( - 'node', - [bin, '--stdin', '--configFilePath', tempDir], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--stdin', '--configFilePath', tempDir], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0', 'ncu-test-tag': '0.1.0' } }), + }) stdout.should.containIgnoreCase(`Using config file ${tempConfigFile}`) } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -34,11 +32,9 @@ describe('rc-config', () => { it('do not print rcConfigPath when there is no rc config file', async () => { const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'npm-check-updates-')) try { - const { stdout } = await spawn( - 'node', - [bin, '--stdin', '--cwd', tempDir], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--stdin', '--cwd', tempDir], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1.0.0' } }), + }) stdout.should.not.include('Using config file') } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -50,11 +46,9 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, '{}', 'utf-8') try { - const { stdout } = await spawn( - 'node', - [bin, '--stdin', '--configFilePath', tempDir], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--stdin', '--configFilePath', tempDir], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), + }) stdout.should.not.include('Using config file') } finally { await fs.rm(tempDir, { recursive: true, force: true }) @@ -66,11 +60,9 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, JSON.stringify({ jsonUpgraded: true, filter: 'ncu-test-v2' }), 'utf-8') try { - const { stdout } = await spawn( - 'node', - [bin, '--stdin', '--configFilePath', tempDir], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--stdin', '--configFilePath', tempDir], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-v2') pkgData.should.not.have.property('ncu-test-tag') @@ -121,11 +113,9 @@ describe('rc-config', () => { const tempConfigFile = path.join(tempDir, '.ncurc.json') await fs.writeFile(tempConfigFile, JSON.stringify({ jsonUpgraded: true }), 'utf-8') try { - const { stdout } = await spawn( - 'node', - [bin, '--stdin', '--configFilePath', tempDir, '--no-jsonUpgraded'], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--stdin', '--configFilePath', tempDir, '--no-jsonUpgraded'], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-v2': '1', 'ncu-test-tag': '0.1.0' } }), + }) // if the output contains "Using config file", then we know that jsonUpgraded was overridden stdout.should.include('Using config file') } finally { @@ -139,11 +129,9 @@ describe('rc-config', () => { // if boolean arguments are not handled as a special case, ncu will incorrectly pass "--deep false" to commander, which will interpret it as two args, i.e. --deep and --filter false await fs.writeFile(tempConfigFile, JSON.stringify({ jsonUpgraded: true, deep: false }), 'utf-8') try { - const { stdout } = await spawn( - 'node', - [bin, '--stdin', '--configFilePath', tempDir], - { stdin: JSON.stringify({ dependencies: { 'ncu-test-tag': '0.1.0' } }) }, - ) + const { stdout } = await spawn('node', [bin, '--stdin', '--configFilePath', tempDir], { + stdin: JSON.stringify({ dependencies: { 'ncu-test-tag': '0.1.0' } }), + }) const pkgData = JSON.parse(stdout) pkgData.should.have.property('ncu-test-tag') } finally { diff --git a/test/timeout.test.ts b/test/timeout.test.ts index 6524ee39..08e34017 100644 --- a/test/timeout.test.ts +++ b/test/timeout.test.ts @@ -19,11 +19,9 @@ describe('timeout', function () { }) it('exit with error when timeout is exceeded', async () => { - return spawn( - 'node', - [bin, '--timeout', '1'], - { stdin: '{ "dependencies": { "express": "1" } }' }, - ).should.eventually.be.rejectedWith('Exceeded global timeout of 1ms') + return spawn('node', [bin, '--timeout', '1'], { + stdin: '{ "dependencies": { "express": "1" } }', + }).should.eventually.be.rejectedWith('Exceeded global timeout of 1ms') }) it('completes successfully with timeout', async () => { diff --git a/test/workspaces.test.ts b/test/workspaces.test.ts index dbd1877f..15cfd757 100644 --- a/test/workspaces.test.ts +++ b/test/workspaces.test.ts @@ -296,9 +296,14 @@ describe('workspaces', () => { it('update more than one workspace', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], {}, { - cwd: tempDir, - }) + const { stdout } = await spawn( + 'node', + [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], + {}, + { + cwd: tempDir, + }, + ) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.have.property('packages/b/package.json') @@ -313,9 +318,14 @@ describe('workspaces', () => { const tempDir = await setup() try { // when npm-check-updates is executed in a workspace directory but uses --cwd to point up to the root, make sure that the root package.json is checked for the workspaces property - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--cwd', '../../'], {}, { - cwd: path.join(tempDir, 'packages', 'a'), - }) + const { stdout } = await spawn( + 'node', + [bin, '--jsonAll', '--workspace', 'a', '--cwd', '../../'], + {}, + { + cwd: path.join(tempDir, 'packages', 'a'), + }, + ) const output = JSON.parse(stdout) output.should.have.property('packages/a/package.json') output.should.not.have.property('packages/b/package.json') @@ -329,9 +339,14 @@ describe('workspaces', () => { it('update namespaced workspace', async () => { const tempDir = await setupSymlinkedPackages(['packages/**'], '@ncu/bar') try { - const { stdout } = await spawn('node', [bin, '--jsonUpgraded', '--workspace', '@ncu/bar'], {}, { - cwd: tempDir, - }) + const { stdout } = await spawn( + 'node', + [bin, '--jsonUpgraded', '--workspace', '@ncu/bar'], + {}, + { + cwd: tempDir, + }, + ) const upgrades = JSON.parse(stdout) upgrades.should.deep.equal({ 'package.json': {}, @@ -382,9 +397,14 @@ describe('workspaces', () => { it('update root project and workspaces if errorLevel=2', async () => { const tempDir = await setup() try { - await spawn('node', [bin, '--upgrade', '--workspaces', '--errorLevel', '2'], {}, { - cwd: tempDir, - }).should.eventually.be.rejectedWith('Dependencies not up-to-date') + await spawn( + 'node', + [bin, '--upgrade', '--workspaces', '--errorLevel', '2'], + {}, + { + cwd: tempDir, + }, + ).should.eventually.be.rejectedWith('Dependencies not up-to-date') const upgradedPkg = JSON.parse(await fs.readFile(path.join(tempDir, 'package.json'), 'utf-8')) upgradedPkg.should.have.property('dependencies') upgradedPkg.dependencies.should.have.property('ncu-test-v2') @@ -452,9 +472,14 @@ describe('workspaces', () => { it('update more than one workspace', async () => { const tempDir = await setup() try { - const { stdout } = await spawn('node', [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], {}, { - cwd: tempDir, - }) + const { stdout } = await spawn( + 'node', + [bin, '--jsonAll', '--workspace', 'a', '--workspace', 'b'], + {}, + { + cwd: tempDir, + }, + ) const output = JSON.parse(stdout) output.should.have.property('package.json') output.should.have.property('packages/a/package.json') @@ -495,9 +520,14 @@ describe('workspaces', () => { try { await fs.writeFile(path.join(tempDir, '.npmrc'), 'ncutest=root') await fs.writeFile(path.join(tempDir, 'packages/a/.npmrc'), 'ncutest=a') - const { stdout } = await spawn('node', [bin, '--verbose', '--packageManager', 'pnpm'], {}, { - cwd: path.join(tempDir, 'packages/a'), - }) + const { stdout } = await spawn( + 'node', + [bin, '--verbose', '--packageManager', 'pnpm'], + {}, + { + cwd: path.join(tempDir, 'packages/a'), + }, + ) stdout.should.include(`npm config (workspace project):\n{ ncutest: 'root' }`) stdout.should.include(`Using merged npm config:\n{\n ncutest: 'a',`) } finally { diff --git a/tsconfig.json b/tsconfig.json index 0f1bba7c..fa5ea892 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,7 @@ "noImplicitAny": true, "paths": { "libnpmconfig": ["./src/types/libnpmconfig"], - "prompts-ncu": ["./src/types/prompts-ncu"], + "prompts-ncu": ["./src/types/prompts-ncu"] }, "resolveJsonModule": true, "outDir": "./build", From c76f14f69925ca01e5516c1854fe107c0b90fd4b Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Wed, 13 Mar 2024 00:24:02 +0000 Subject: [PATCH 10/11] Fix spawn in doctor tests. --- test/doctor.test.ts | 147 ++++++++++++++++++++++++++------------------ 1 file changed, 86 insertions(+), 61 deletions(-) diff --git a/test/doctor.test.ts b/test/doctor.test.ts index bd3b9ecd..e4cb4ef7 100644 --- a/test/doctor.test.ts +++ b/test/doctor.test.ts @@ -21,8 +21,12 @@ const mockNpmVersions = { } /** Run the ncu CLI. */ -const ncu = async (args: string[], options?: Record) => { - const { stdout } = await spawn('node', [bin, ...args], options) +const ncu = async ( + args: string[], + spawnPleaseOptions?: Parameters[2], + spawnOptions?: Parameters[3], +) => { + const { stdout } = await spawn('node', [bin, ...args], spawnPleaseOptions, spawnOptions) return stdout } @@ -56,15 +60,18 @@ const testPass = ({ packageManager }: { packageManager: PackageManagerName }) => try { // explicitly set packageManager to avoid auto yarn detection - await ncu(['--doctor', '-u', '-p', packageManager], { - cwd, - stdout: function (data: string) { - stdout += data - }, - stderr: function (data: string) { - stderr += data + await ncu( + ['--doctor', '-u', '-p', packageManager], + { + stdout: function (data: string) { + stdout += data + }, + stderr: function (data: string) { + stderr += data + }, }, - }) + { cwd }, + ) } catch (e) {} const pkgUpgraded = await fs.readFile(pkgPath, 'utf-8') @@ -124,15 +131,18 @@ const testFail = ({ packageManager }: { packageManager: PackageManagerName }) => try { // explicitly set packageManager to avoid auto yarn detection - await ncu(['--doctor', '-u', '-p', packageManager], { - cwd, - stdout: function (data: string) { - stdout += data - }, - stderr: function (data: string) { - stderr += data + await ncu( + ['--doctor', '-u', '-p', packageManager], + { + stdout: function (data: string) { + stdout += data + }, + stderr: function (data: string) { + stderr += data + }, }, - }) + { cwd }, + ) } finally { pkgUpgraded = await fs.readFile(pkgPath, 'utf-8') await fs.writeFile(pkgPath, pkgOriginal) @@ -177,7 +187,7 @@ describe('doctor', function () { await chalkInit() const { default: stripAnsi } = await import('strip-ansi') const cwd = path.join(doctorTests, 'nopackagefile') - const output = await ncu(['--doctor'], { cwd }) + const output = await ncu(['--doctor'], {}, { cwd }) return stripAnsi(output).should.equal( `Usage: ncu --doctor\n\n${stripAnsi( (cliOptionsMap.doctor.help as (options: { markdown: boolean }) => string)({ markdown: false }), @@ -187,12 +197,12 @@ describe('doctor', function () { it('throw an error if there is no package file', async () => { const cwd = path.join(doctorTests, 'nopackagefile') - return ncu(['--doctor', '-u'], { cwd }).should.eventually.be.rejectedWith('Missing or invalid package.json') + return ncu(['--doctor', '-u'], {}, { cwd }).should.eventually.be.rejectedWith('Missing or invalid package.json') }) it('throw an error if there is no test script', async () => { const cwd = path.join(doctorTests, 'notestscript') - return ncu(['--doctor', '-u'], { cwd }).should.eventually.be.rejectedWith('No npm "test" script') + return ncu(['--doctor', '-u'], {}, { cwd }).should.eventually.be.rejectedWith('No npm "test" script') }) it('throw an error if --packageData or --packageFile are supplied', async () => { @@ -222,15 +232,18 @@ describe('doctor', function () { try { // check only ncu-test-v2 (excluding ncu-return-version) - await ncu(['--doctor', '-u', '--filter', 'ncu-test-v2'], { - cwd, - stdout: function (data: string) { - stdout += data + await ncu( + ['--doctor', '-u', '--filter', 'ncu-test-v2'], + { + stdout: function (data: string) { + stdout += data + }, + stderr: function (data: string) { + stderr += data + }, }, - stderr: function (data: string) { - stderr += data - }, - }) + { cwd }, + ) } catch (e) {} const pkgUpgraded = await fs.readFile(pkgPath, 'utf-8') @@ -264,15 +277,18 @@ describe('doctor', function () { let stderr = '' try { - await ncu(['--doctor', '-u', '--doctorInstall', npmCmd + ' run myinstall'], { - cwd, - stdout: function (data: string) { - stdout += data - }, - stderr: function (data: string) { - stderr += data + await ncu( + ['--doctor', '-u', '--doctorInstall', npmCmd + ' run myinstall'], + { + stdout: function (data: string) { + stdout += data + }, + stderr: function (data: string) { + stderr += data + }, }, - }) + { cwd }, + ) } catch (e) {} const pkgUpgraded = await fs.readFile(pkgPath, 'utf-8') @@ -305,15 +321,18 @@ describe('doctor', function () { let stderr = '' try { - await ncu(['--doctor', '-u', '--doctorTest', npmCmd + ' run mytest'], { - cwd, - stdout: function (data: string) { - stdout += data - }, - stderr: function (data: string) { - stderr += data + await ncu( + ['--doctor', '-u', '--doctorTest', npmCmd + ' run mytest'], + { + stdout: function (data: string) { + stdout += data + }, + stderr: function (data: string) { + stderr += data + }, }, - }) + { cwd }, + ) } catch (e) {} const pkgUpgraded = await fs.readFile(pkgPath, 'utf-8') @@ -346,15 +365,18 @@ describe('doctor', function () { let stderr = '' try { - await ncu(['--doctor', '-u', '--doctorTest', `node ${echoPath} '123 456'`], { - cwd, - stdout: function (data: string) { - stdout += data - }, - stderr: function (data: string) { - stderr += data + await ncu( + ['--doctor', '-u', '--doctorTest', `node ${echoPath} '123 456'`], + { + stdout: function (data: string) { + stdout += data + }, + stderr: function (data: string) { + stderr += data + }, }, - }) + { cwd }, + ) } catch (e) {} const pkgUpgraded = await fs.readFile(pkgPath, 'utf-8') @@ -421,15 +443,18 @@ else { // explicitly set packageManager to avoid auto yarn detection await spawn('npm', ['install'], {}, { cwd: tempDir }) - await ncu(['--doctor', '-u', '-p', 'npm'], { - cwd: tempDir, - stdout: function (data: string) { - stdout += data - }, - stderr: function (data: string) { - stderr += data + await ncu( + ['--doctor', '-u', '-p', 'npm'], + { + stdout: function (data: string) { + stdout += data + }, + stderr: function (data: string) { + stderr += data + }, }, - }) + { cwd: tempDir }, + ) pkgUpgraded = JSON.parse(await fs.readFile(pkgPath, 'utf-8')) } finally { From a8988487b86d559426a85c8670d008fd2b40a115 Mon Sep 17 00:00:00 2001 From: Raine Revere Date: Wed, 13 Mar 2024 00:37:49 +0000 Subject: [PATCH 11/11] Fix spawn in package-managers/npm. --- src/package-managers/npm.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/package-managers/npm.ts b/src/package-managers/npm.ts index 853e1225..45fe5c24 100644 --- a/src/package-managers/npm.ts +++ b/src/package-managers/npm.ts @@ -545,7 +545,8 @@ async function spawnNpm( '--json', ...(Array.isArray(args) ? args : [args]), ] - return spawn(cmd, fullArgs, spawnPleaseOptions, spawnOptions) + const { stdout } = await spawn(cmd, fullArgs, spawnPleaseOptions, spawnOptions) + return stdout } /** @@ -663,9 +664,11 @@ export const list = async (options: Options = {}): Promise