diff --git a/package-lock.json b/package-lock.json index 1b827cd5f..1707ec63b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,17 +29,17 @@ "@types/proper-lockfile": "^4.1.2", "@types/selfsigned": "^2.0.1", "@types/vscode": "^1.66.0", - "@typescript-eslint/eslint-plugin": "^5.17.0", - "@typescript-eslint/parser": "^5.17.0", + "@typescript-eslint/eslint-plugin": "^6.5.0", + "@typescript-eslint/parser": "^6.5.0", "@vscode/test-electron": "^2.1.3", "cmd-shim": "^6.0.0", "esbuild": "^0.18.16", - "eslint": "^8.15.0", - "eslint-plugin-no-only-tests": "^3.0.0", + "eslint": "^8.48.0", + "eslint-plugin-no-only-tests": "^3.1.0", "jsonc-parser": "^3.0.0", "jsonschema": "^1.4.0", "pnpm": "^7.0.0", - "prettier": "^2.6.2", + "prettier": "^3.0.3", "selfsigned": "^2.0.1", "typescript": "^5.2.2", "uvu": "^0.5.3", @@ -768,9 +768,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", - "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -783,18 +783,18 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", - "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.0.tgz", + "integrity": "sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -815,18 +815,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", + "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -1075,9 +1075,9 @@ "integrity": "sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==" }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, "node_modules/@types/keygrip": { @@ -1196,9 +1196,9 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==", "dev": true }, "node_modules/@types/send": { @@ -1234,32 +1234,33 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.6.tgz", - "integrity": "sha512-sXtOgJNEuRU5RLwPUb1jxtToZbgvq3M6FPpY4QENxoOggK+UpTxUBpj6tD8+Qh2g46Pi9We87E+eHnUw8YcGsw==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.5.0.tgz", + "integrity": "sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/type-utils": "5.59.6", - "@typescript-eslint/utils": "5.59.6", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/type-utils": "6.5.0", + "@typescript-eslint/utils": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "graphemer": "^1.4.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": { @@ -1268,25 +1269,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.6.tgz", - "integrity": "sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.5.0.tgz", + "integrity": "sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/typescript-estree": "5.59.6", + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/typescript-estree": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", "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": { @@ -1295,16 +1297,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.6.tgz", - "integrity": "sha512-gLbY3Le9Dxcb8KdpF0+SJr6EQ+hFGYFl6tVY8VxLPFDfUZC7BHFw+Vq7bM5lE9DwWPfx4vMWWTLGXgpc0mAYyQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.5.0.tgz", + "integrity": "sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/visitor-keys": "5.59.6" + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1312,25 +1314,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.6.tgz", - "integrity": "sha512-A4tms2Mp5yNvLDlySF+kAThV9VTBPCvGf0Rp8nl/eoDX9Okun8byTKoj3fJ52IJitjWOk0fKPNQhXEB++eNozQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.5.0.tgz", + "integrity": "sha512-f7OcZOkRivtujIBQ4yrJNIuwyCQO1OjocVqntl9dgSIZAdKqicj3xFDqDOzHDlGCZX990LqhLQXWRnQvsapq8A==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.6", - "@typescript-eslint/utils": "5.59.6", + "@typescript-eslint/typescript-estree": "6.5.0", + "@typescript-eslint/utils": "6.5.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "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": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1339,12 +1341,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.6.tgz", - "integrity": "sha512-tH5lBXZI7T2MOUgOWFdVNUILsI02shyQvfzG9EJkoONWugCG77NDDa1EeDGw7oJ5IvsTAAGVV8I3Tk2PNu9QfA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.5.0.tgz", + "integrity": "sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -1352,21 +1354,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.6.tgz", - "integrity": "sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.5.0.tgz", + "integrity": "sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/visitor-keys": "5.59.6", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", "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", @@ -1379,42 +1381,41 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.6.tgz", - "integrity": "sha512-vzaaD6EXbTS29cVH0JjXBdzMt6VBlv+hE31XktDRMX1j3462wZCJa7VzO2AxXEXcIl8GQqZPcOPuW/Z1tZVogg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.5.0.tgz", + "integrity": "sha512-9nqtjkNykFzeVtt9Pj6lyR9WEdd8npPhhIPM992FWVkZuS6tmxHfGVnlUcjpUP2hv8r4w35nT33mlxd+Be1ACQ==", "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.59.6", - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/typescript-estree": "5.59.6", - "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.5.0", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/typescript-estree": "6.5.0", + "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.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.6.tgz", - "integrity": "sha512-zEfbFLzB9ETcEJ4HZEEsCR9HHeNku5/Qw1jSS5McYJv5BR+ftYXwFFAH5Al+xkGaZEqowMwl7uoJjQb1YSPF8Q==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.5.0.tgz", + "integrity": "sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.6", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.5.0", + "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", @@ -2611,27 +2612,27 @@ } }, "node_modules/eslint": { - "version": "8.45.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", - "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", + "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.48.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -2674,23 +2675,14 @@ } }, "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==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -2698,15 +2690,11 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", - "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -2714,15 +2702,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -2776,15 +2755,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -2797,7 +2767,7 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", @@ -2806,15 +2776,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/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -3015,16 +2976,17 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", + "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.7", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=12.0.0" } }, "node_modules/flatted": { @@ -3131,9 +3093,9 @@ } }, "node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -3170,12 +3132,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -3759,6 +3715,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3837,6 +3799,15 @@ "prebuild-install": "^7.0.1" } }, + "node_modules/keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -4352,12 +4323,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", @@ -4911,15 +4876,15 @@ } }, "node_modules/prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -5802,11 +5767,17 @@ "node": ">=12" } }, - "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/ts-api-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", + "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } }, "node_modules/tsscmp": { "version": "1.0.6", @@ -5816,21 +5787,6 @@ "node": ">=0.6.x" } }, - "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/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -6870,24 +6826,24 @@ "optional": true }, "@eslint-community/eslint-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", - "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "requires": { "eslint-visitor-keys": "^3.3.0" } }, "@eslint-community/regexpp": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.0.tgz", - "integrity": "sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.0.tgz", + "integrity": "sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==", "dev": true }, "@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -6902,15 +6858,15 @@ } }, "@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", + "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", "dev": true }, "@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -7102,9 +7058,9 @@ "integrity": "sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==" }, "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, "@types/keygrip": { @@ -7223,9 +7179,9 @@ "dev": true }, "@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==", "dev": true }, "@types/send": { @@ -7261,102 +7217,103 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.6.tgz", - "integrity": "sha512-sXtOgJNEuRU5RLwPUb1jxtToZbgvq3M6FPpY4QENxoOggK+UpTxUBpj6tD8+Qh2g46Pi9We87E+eHnUw8YcGsw==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.5.0.tgz", + "integrity": "sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw==", "dev": true, "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/type-utils": "5.59.6", - "@typescript-eslint/utils": "5.59.6", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/type-utils": "6.5.0", + "@typescript-eslint/utils": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/parser": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.6.tgz", - "integrity": "sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.5.0.tgz", + "integrity": "sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/typescript-estree": "5.59.6", + "@typescript-eslint/scope-manager": "6.5.0", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/typescript-estree": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.6.tgz", - "integrity": "sha512-gLbY3Le9Dxcb8KdpF0+SJr6EQ+hFGYFl6tVY8VxLPFDfUZC7BHFw+Vq7bM5lE9DwWPfx4vMWWTLGXgpc0mAYyQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.5.0.tgz", + "integrity": "sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/visitor-keys": "5.59.6" + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0" } }, "@typescript-eslint/type-utils": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.6.tgz", - "integrity": "sha512-A4tms2Mp5yNvLDlySF+kAThV9VTBPCvGf0Rp8nl/eoDX9Okun8byTKoj3fJ52IJitjWOk0fKPNQhXEB++eNozQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.5.0.tgz", + "integrity": "sha512-f7OcZOkRivtujIBQ4yrJNIuwyCQO1OjocVqntl9dgSIZAdKqicj3xFDqDOzHDlGCZX990LqhLQXWRnQvsapq8A==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.59.6", - "@typescript-eslint/utils": "5.59.6", + "@typescript-eslint/typescript-estree": "6.5.0", + "@typescript-eslint/utils": "6.5.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.6.tgz", - "integrity": "sha512-tH5lBXZI7T2MOUgOWFdVNUILsI02shyQvfzG9EJkoONWugCG77NDDa1EeDGw7oJ5IvsTAAGVV8I3Tk2PNu9QfA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.5.0.tgz", + "integrity": "sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.6.tgz", - "integrity": "sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.5.0.tgz", + "integrity": "sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/visitor-keys": "5.59.6", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/visitor-keys": "6.5.0", "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" } }, "@typescript-eslint/utils": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.6.tgz", - "integrity": "sha512-vzaaD6EXbTS29cVH0JjXBdzMt6VBlv+hE31XktDRMX1j3462wZCJa7VzO2AxXEXcIl8GQqZPcOPuW/Z1tZVogg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.5.0.tgz", + "integrity": "sha512-9nqtjkNykFzeVtt9Pj6lyR9WEdd8npPhhIPM992FWVkZuS6tmxHfGVnlUcjpUP2hv8r4w35nT33mlxd+Be1ACQ==", "dev": true, "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.6", - "@typescript-eslint/types": "5.59.6", - "@typescript-eslint/typescript-estree": "5.59.6", - "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.5.0", + "@typescript-eslint/types": "6.5.0", + "@typescript-eslint/typescript-estree": "6.5.0", + "semver": "^7.5.4" } }, "@typescript-eslint/visitor-keys": { - "version": "5.59.6", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.6.tgz", - "integrity": "sha512-zEfbFLzB9ETcEJ4HZEEsCR9HHeNku5/Qw1jSS5McYJv5BR+ftYXwFFAH5Al+xkGaZEqowMwl7uoJjQb1YSPF8Q==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.5.0.tgz", + "integrity": "sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.59.6", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.5.0", + "eslint-visitor-keys": "^3.4.1" } }, "@vscode/test-electron": { @@ -8245,27 +8202,27 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "eslint": { - "version": "8.45.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz", - "integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", + "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.48.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -8289,22 +8246,6 @@ "text-table": "^0.2.0" }, "dependencies": { - "eslint-scope": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", - "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, "glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -8323,19 +8264,19 @@ "dev": true }, "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==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "requires": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" } }, "eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true }, "espree": { @@ -8361,14 +8302,6 @@ "dev": true, "requires": { "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } } }, "esrecurse": { @@ -8378,20 +8311,12 @@ "dev": true, "requires": { "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } } }, "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, "estree-walker": { @@ -8562,12 +8487,13 @@ } }, "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", + "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", "dev": true, "requires": { - "flatted": "^3.1.0", + "flatted": "^3.2.7", + "keyv": "^4.5.3", "rimraf": "^3.0.2" } }, @@ -8647,9 +8573,9 @@ } }, "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -8674,12 +8600,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -9087,6 +9007,12 @@ "argparse": "^2.0.1" } }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -9155,6 +9081,15 @@ "prebuild-install": "^7.0.1" } }, + "keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -9555,12 +9490,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "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 - }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -9964,9 +9893,9 @@ "dev": true }, "prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true }, "prism-themes": { @@ -10633,26 +10562,18 @@ "punycode": "^2.1.1" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "ts-api-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", + "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "dev": true, + "requires": {} }, "tsscmp": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==" }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", diff --git a/package.json b/package.json index 185231673..af86a70cd 100644 --- a/package.json +++ b/package.json @@ -398,17 +398,17 @@ "@types/proper-lockfile": "^4.1.2", "@types/selfsigned": "^2.0.1", "@types/vscode": "^1.66.0", - "@typescript-eslint/eslint-plugin": "^5.17.0", - "@typescript-eslint/parser": "^5.17.0", + "@typescript-eslint/eslint-plugin": "^6.5.0", + "@typescript-eslint/parser": "^6.5.0", "@vscode/test-electron": "^2.1.3", "cmd-shim": "^6.0.0", "esbuild": "^0.18.16", - "eslint": "^8.15.0", - "eslint-plugin-no-only-tests": "^3.0.0", + "eslint": "^8.48.0", + "eslint-plugin-no-only-tests": "^3.1.0", "jsonc-parser": "^3.0.0", "jsonschema": "^1.4.0", "pnpm": "^7.0.0", - "prettier": "^2.6.2", + "prettier": "^3.0.3", "selfsigned": "^2.0.1", "typescript": "^5.2.2", "uvu": "^0.5.3", diff --git a/src/analyzer.ts b/src/analyzer.ts index 333cfd503..761d9d583 100644 --- a/src/analyzer.ts +++ b/src/analyzer.ts @@ -171,7 +171,7 @@ export class Analyzer { // This starts analysis of each of the scripts in our root files. this._getPlaceholder({name: script.name, packageDir}); } - }) + }), ); await this._waitForAnalysisToComplete(); // Check for cycles. @@ -184,7 +184,7 @@ export class Analyzer { this._checkForCyclesAndSortDependencies( info.placeholder, new Set(), - true + true, ); } @@ -202,7 +202,7 @@ export class Analyzer { */ async analyze( root: ScriptReference, - extraArgs: string[] | undefined + extraArgs: string[] | undefined, ): Promise { this._logger?.log({ type: 'info', @@ -223,7 +223,7 @@ export class Analyzer { private async _actuallyAnalyze( root: ScriptReference, - extraArgs: string[] | undefined + extraArgs: string[] | undefined, ): Promise { // We do 2 walks through the dependency graph: // @@ -265,13 +265,13 @@ export class Analyzer { const rootConfig = rootPlaceholder.placeholder; if (rootConfig.state === 'unvalidated') { throw new Error( - `Internal error: script ${root.name} in ${root.packageDir} is still unvalidated but had no failures` + `Internal error: script ${root.name} in ${root.packageDir} is still unvalidated but had no failures`, ); } const cycleResult = this._checkForCyclesAndSortDependencies( rootConfig, new Set(), - true + true, ); if (!cycleResult.ok) { return { @@ -288,7 +288,7 @@ export class Analyzer { } async analyzeIgnoringErrors( - scriptReference: ScriptReference + scriptReference: ScriptReference, ): Promise { await this.analyze(scriptReference, []); return this._getPlaceholder(scriptReference).placeholder; @@ -374,7 +374,7 @@ export class Analyzer { * upgraded; dependencies are upgraded asynchronously. */ private async _upgradePlaceholder( - placeholder: UnvalidatedConfig + placeholder: UnvalidatedConfig, ): Promise { const packageJsonResult = await this.getPackageJson(placeholder.packageDir); if (!packageJsonResult.ok) { @@ -390,13 +390,13 @@ export class Analyzer { placeholder, packageJson, syntaxInfo, - syntaxInfo.wireitConfigNode + syntaxInfo.wireitConfigNode, ); } else if (syntaxInfo?.scriptNode !== undefined) { this._handlePlainNpmScript( placeholder, packageJson, - syntaxInfo.scriptNode + syntaxInfo.scriptNode, ); } else { placeholder.failures.push({ @@ -419,7 +419,7 @@ export class Analyzer { private _handlePlainNpmScript( placeholder: UnvalidatedConfig, packageJson: PackageJson, - scriptCommand: NamedAstNode + scriptCommand: NamedAstNode, ): void { if (isValidWireitScriptCommand(scriptCommand.value)) { placeholder.failures.push({ @@ -466,7 +466,7 @@ export class Analyzer { placeholder: UnvalidatedConfig, packageJson: PackageJson, syntaxInfo: ScriptSyntaxInfo, - wireitConfig: NamedAstNode + wireitConfig: NamedAstNode, ): Promise { const scriptCommand = syntaxInfo.scriptNode; if ( @@ -529,14 +529,14 @@ export class Analyzer { const allowUsuallyExcludedPaths = this._processAllowUsuallyExcludedPaths( placeholder, packageJson, - syntaxInfo + syntaxInfo, ); const files = this._processFiles( placeholder, packageJson, syntaxInfo, - allowUsuallyExcludedPaths + allowUsuallyExcludedPaths, ); if ( @@ -569,7 +569,7 @@ export class Analyzer { packageJson, syntaxInfo, command, - allowUsuallyExcludedPaths + allowUsuallyExcludedPaths, ); const clean = this._processClean(placeholder, packageJson, syntaxInfo); const service = this._processService( @@ -577,13 +577,13 @@ export class Analyzer { packageJson, syntaxInfo, command, - output + output, ); await this._processPackageLocks( placeholder, packageJson, syntaxInfo, - files + files, ); const env = this._processEnv(placeholder, packageJson, syntaxInfo, command); @@ -614,7 +614,7 @@ export class Analyzer { private _processDependencies( placeholder: UnvalidatedConfig, packageJson: PackageJson, - scriptInfo: ScriptSyntaxInfo + scriptInfo: ScriptSyntaxInfo, ): { dependencies: Array>; encounteredError: boolean; @@ -649,7 +649,7 @@ export class Analyzer { if (maybeUnresolved.type === 'string') { specifierResult = failUnlessNonBlankString( maybeUnresolved, - packageJson.jsonFile + packageJson.jsonFile, ); if (!specifierResult.ok) { encounteredError = true; @@ -680,7 +680,7 @@ export class Analyzer { } specifierResult = failUnlessNonBlankString( specifierResult, - packageJson.jsonFile + packageJson.jsonFile, ); if (!specifierResult.ok) { encounteredError = true; @@ -737,7 +737,7 @@ export class Analyzer { const result = this._resolveDependency( unresolved, placeholder, - packageJson.jsonFile + packageJson.jsonFile, ); if (!result.ok) { encounteredError = true; @@ -818,7 +818,7 @@ export class Analyzer { diagnostic: { severity: 'error', message: `Cannot find script named ${JSON.stringify( - resolved.name + resolved.name, )} in package "${resolved.packageDir}"`, location: { file: packageJson.jsonFile, @@ -846,7 +846,7 @@ export class Analyzer { severity: 'error', message: `package.json file missing: "${pathlib.join( resolved.packageDir, - 'package.json' + 'package.json', )}"`, location: {file: packageJson.jsonFile, range}, }, @@ -854,7 +854,7 @@ export class Analyzer { } } return undefined; - })() + })(), ); } } @@ -864,7 +864,7 @@ export class Analyzer { private _processAllowUsuallyExcludedPaths( placeholder: UnvalidatedConfig, packageJson: PackageJson, - syntaxInfo: ScriptSyntaxInfo + syntaxInfo: ScriptSyntaxInfo, ): boolean { const defaultValue = false; if (syntaxInfo.wireitConfigNode == null) { @@ -899,7 +899,7 @@ export class Analyzer { placeholder: UnvalidatedConfig, packageJson: PackageJson, syntaxInfo: ScriptSyntaxInfo, - allowUsuallyExcludedPaths: boolean + allowUsuallyExcludedPaths: boolean, ): undefined | ArrayNode { if (syntaxInfo.wireitConfigNode === undefined) { return; @@ -937,7 +937,7 @@ export class Analyzer { packageJson: PackageJson, syntaxInfo: ScriptSyntaxInfo, command: JsonAstNode | undefined, - allowUsuallyExcludedPaths: boolean + allowUsuallyExcludedPaths: boolean, ): undefined | ArrayNode { if (syntaxInfo.wireitConfigNode === undefined) { return; @@ -992,7 +992,7 @@ export class Analyzer { private _processClean( placeholder: UnvalidatedConfig, packageJson: PackageJson, - syntaxInfo: ScriptSyntaxInfo + syntaxInfo: ScriptSyntaxInfo, ): boolean | 'if-file-deleted' { const defaultValue = true; if (syntaxInfo.wireitConfigNode == null) { @@ -1030,7 +1030,7 @@ export class Analyzer { packageJson: PackageJson, syntaxInfo: ScriptSyntaxInfo, command: JsonAstNode | undefined, - output: ArrayNode | undefined + output: ArrayNode | undefined, ): ServiceConfig | undefined { if (syntaxInfo.wireitConfigNode === undefined) { return undefined; @@ -1173,7 +1173,7 @@ export class Analyzer { placeholder: UnvalidatedConfig, packageJson: PackageJson, syntaxInfo: ScriptSyntaxInfo, - files: undefined | ArrayNode + files: undefined | ArrayNode, ): Promise { if (syntaxInfo.wireitConfigNode === undefined) { return; @@ -1193,7 +1193,7 @@ export class Analyzer { const maybeFilename = children[i]; const result = failUnlessNonBlankString( maybeFilename, - packageJson.jsonFile + packageJson.jsonFile, ); if (!result.ok) { placeholder.failures.push(result.error); @@ -1258,7 +1258,7 @@ export class Analyzer { } catch { return undefined; } - }) + }), ); for (const path of existing) { if (path !== undefined) { @@ -1272,7 +1272,7 @@ export class Analyzer { placeholder: UnvalidatedConfig, packageJson: PackageJson, syntaxInfo: ScriptSyntaxInfo, - command: JsonAstNode | undefined + command: JsonAstNode | undefined, ): Record { if (syntaxInfo.wireitConfigNode === undefined) { return {}; @@ -1318,13 +1318,13 @@ export class Analyzer { for (const propNode of envNode.children) { if (propNode.children === undefined || propNode.children.length !== 2) { throw new Error( - 'Internal error: expected object JSON node children to be key/val pairs' + 'Internal error: expected object JSON node children to be key/val pairs', ); } const [key, val] = propNode.children; if (key.type !== 'string') { throw new Error( - 'Internal error: expected object JSON node child key to be string' + 'Internal error: expected object JSON node child key to be string', ); } const keyStr = key.value as string; @@ -1384,7 +1384,7 @@ export class Analyzer { private _checkForCyclesAndSortDependencies( config: LocallyValidScriptConfig | ScriptConfig | InvalidScriptConfig, trail: Set, - isPersistent: boolean + isPersistent: boolean, ): Result { if (config.state === 'valid') { // Already validated. @@ -1411,7 +1411,7 @@ export class Analyzer { const placeholderInfo = this._placeholders.get(key); if (placeholderInfo === undefined) { throw new Error( - `Internal error: placeholder not found for ${key} during cycle detection` + `Internal error: placeholder not found for ${key} during cycle detection`, ); } return placeholderInfo.placeholder; @@ -1426,7 +1426,7 @@ export class Analyzer { continue; } const nextNode = current.dependencies.find( - (dep) => dep.config === next + (dep) => dep.config === next, ); // Use the actual value in the array, because this could refer to // a script in another package. @@ -1437,10 +1437,10 @@ export class Analyzer { const message = next === trailArray[cycleStart] ? `${JSON.stringify(current.name)} points back to ${JSON.stringify( - nextName + nextName, )}` : `${JSON.stringify(current.name)} points to ${JSON.stringify( - nextName + nextName, )}`; const culpritNode = @@ -1463,7 +1463,7 @@ export class Analyzer { const diagnostic: Diagnostic = { severity: 'error', message: `Cycle detected in dependencies of ${JSON.stringify( - config.name + config.name, )}.`, location: { file: config.declaringFile, @@ -1511,14 +1511,14 @@ export class Analyzer { // Walk through no-command scripts and services when determining if // something is persistent. isPersistent && - (config.command === undefined || config.service !== undefined) + (config.command === undefined || config.service !== undefined), ); if (!validDependencyConfigResult.ok) { return { ok: false, error: this._markAsInvalid( config, - validDependencyConfigResult.error.dependencyFailure + validDependencyConfigResult.error.dependencyFailure, ), }; } @@ -1556,7 +1556,7 @@ export class Analyzer { // is guaranteed. if (config.command === undefined) { throw new Error( - 'Internal error: Supposedly valid service did not have command' + 'Internal error: Supposedly valid service did not have command', ); } validConfig = { @@ -1606,7 +1606,7 @@ export class Analyzer { private _markAsInvalid( config: LocallyValidScriptConfig, - failure: Failure + failure: Failure, ): InvalidScriptConfig { const invalidConfig: InvalidScriptConfig = { ...config, @@ -1628,7 +1628,7 @@ export class Analyzer { private _resolveDependency( dependency: JsonAstNode, context: ScriptReference, - referencingFile: JsonFile + referencingFile: JsonFile, ): Result, Failure> { // TODO(aomarks) Implement $WORKSPACES syntax. if (dependency.value.startsWith('.')) { @@ -1637,7 +1637,7 @@ export class Analyzer { const result = this._resolveCrossPackageDependency( dependency, context, - referencingFile + referencingFile, ); if (!result.ok) { return result; @@ -1657,7 +1657,7 @@ export class Analyzer { private _resolveCrossPackageDependency( dependency: JsonAstNode, context: ScriptReference, - referencingFile: JsonFile + referencingFile: JsonFile, ): Result { // TODO(aomarks) On some file systems, it is valid to have a ":" in a file // path. We should support that edge case with backslash escaping. @@ -1708,7 +1708,7 @@ export class Analyzer { const relativePackageDir = dependency.value.slice(0, firstColonIdx); const absolutePackageDir = pathlib.resolve( context.packageDir, - relativePackageDir + relativePackageDir, ); if (absolutePackageDir === context.packageDir) { return { @@ -1743,15 +1743,15 @@ export class Analyzer { */ export function failUnlessNonBlankString( astNode: NamedAstNode, - file: JsonFile + file: JsonFile, ): Result, Failure>; export function failUnlessNonBlankString( astNode: JsonAstNode, - file: JsonFile + file: JsonFile, ): Result, Failure>; export function failUnlessNonBlankString( astNode: JsonAstNode, - file: JsonFile + file: JsonFile, ): Result, Failure> { if (astNode.type !== 'string') { return { @@ -1803,7 +1803,7 @@ export function failUnlessNonBlankString( */ const failUnlessArray = ( astNode: JsonAstNode, - file: JsonFile + file: JsonFile, ): Result => { if (astNode.type !== 'array') { return { @@ -1834,7 +1834,7 @@ const failUnlessArray = ( */ export const failUnlessJsonObject = ( astNode: JsonAstNode, - file: JsonFile + file: JsonFile, ): Failure | void => { if (astNode.type !== 'object') { return { diff --git a/src/caching/cache.ts b/src/caching/cache.ts index 77254152d..1de2d659d 100644 --- a/src/caching/cache.ts +++ b/src/caching/cache.ts @@ -25,7 +25,7 @@ export interface Cache { */ get( script: ScriptReference, - fingerprint: Fingerprint + fingerprint: Fingerprint, ): Promise; /** @@ -43,7 +43,7 @@ export interface Cache { set( script: ScriptReference, fingerprint: Fingerprint, - absoluteFiles: AbsoluteEntry[] + absoluteFiles: AbsoluteEntry[], ): Promise; } diff --git a/src/caching/github-actions-cache.ts b/src/caching/github-actions-cache.ts index 02a1a9032..0896b322a 100644 --- a/src/caching/github-actions-cache.ts +++ b/src/caching/github-actions-cache.ts @@ -47,7 +47,7 @@ export class GitHubActionsCache implements Cache { } static create( - logger: Logger + logger: Logger, ): Result { // The ACTIONS_CACHE_URL and ACTIONS_RUNTIME_TOKEN environment variables are // automatically provided to GitHub Actions re-usable workflows. However, @@ -78,7 +78,7 @@ export class GitHubActionsCache implements Cache { error: { reason: 'invalid-usage', message: `The ACTIONS_CACHE_URL must end in a forward-slash, got ${JSON.stringify( - baseUrl + baseUrl, )}.`, }, }; @@ -107,7 +107,7 @@ export class GitHubActionsCache implements Cache { async get( script: ScriptReference, - fingerprint: Fingerprint + fingerprint: Fingerprint, ): Promise { if (this._serviceIsDown) { return undefined; @@ -140,14 +140,14 @@ export class GitHubActionsCache implements Cache { throw new Error( `GitHub Cache check HTTP ${String(response.statusCode)} error: ` + - (await readBody(response)) + (await readBody(response)), ); } async set( script: ScriptReference, fingerprint: Fingerprint, - absFiles: AbsoluteEntry[] + absFiles: AbsoluteEntry[], ): Promise { if (this._serviceIsDown) { return false; @@ -157,12 +157,12 @@ export class GitHubActionsCache implements Cache { try { const tarballPath = await this._makeTarball( absFiles.map((file) => file.path), - tempDir + tempDir, ); return await this._reserveUploadAndCommitTarball( script, fingerprint, - tarballPath + tarballPath, ); } finally { await fs.rm(tempDir, {recursive: true}); @@ -177,7 +177,7 @@ export class GitHubActionsCache implements Cache { private async _reserveUploadAndCommitTarball( script: ScriptReference, fingerprint: Fingerprint, - tarballPath: string + tarballPath: string, ): Promise { const tarballStats = await fs.stat(tarballPath); const tarballBytes = tarballStats.size; @@ -201,7 +201,7 @@ export class GitHubActionsCache implements Cache { script, this._computeCacheKey(script), this._computeVersion(fingerprint), - tarballBytes + tarballBytes, ); // It's likely that we'll occasionally fail to reserve an entry and get // undefined here, especially when running multiple GitHub Action jobs in @@ -228,7 +228,7 @@ export class GitHubActionsCache implements Cache { script: ScriptReference, id: number, tarballPath: string, - tarballBytes: number + tarballBytes: number, ): Promise { const url = new URL(`_apis/artifactcache/caches/${id}`, this._baseUrl); // Reference: @@ -276,10 +276,10 @@ export class GitHubActionsCache implements Cache { if (!isOk(response)) { throw new Error( `GitHub Cache upload HTTP ${String( - response.statusCode + response.statusCode, )} error: ${await readBody(response)}\nopts: ${JSON.stringify( - opts - )}` + opts, + )}`, ); } } @@ -297,11 +297,11 @@ export class GitHubActionsCache implements Cache { private async _commit( script: ScriptReference, id: number, - tarballBytes: number + tarballBytes: number, ): Promise { const url = new URL( `_apis/artifactcache/caches/${String(id)}`, - this._baseUrl + this._baseUrl, ); const reqBody = JSON.stringify({ size: tarballBytes, @@ -323,8 +323,8 @@ export class GitHubActionsCache implements Cache { if (!isOk(response)) { throw new Error( `GitHub Cache commit HTTP ${String( - response.statusCode - )} error: ${await readBody(response)}` + response.statusCode, + )} error: ${await readBody(response)}`, ); } @@ -333,7 +333,7 @@ export class GitHubActionsCache implements Cache { private _request( url: URL, - options?: http.RequestOptions + options?: http.RequestOptions, ): { req: http.ClientRequest; resPromise: Promise>; @@ -357,7 +357,7 @@ export class GitHubActionsCache implements Cache { */ private _maybeHandleServiceDown( res: Result, - script: ScriptReference + script: ScriptReference, ): res is {ok: true; value: http.IncomingMessage} { if (!res.ok) { if (!this._serviceIsDown) { @@ -433,7 +433,7 @@ export class GitHubActionsCache implements Cache { ]; return createHash('sha256') .update( - parts.join('\x1E') // ASCII record seperator + parts.join('\x1E'), // ASCII record seperator ) .digest('hex'); } @@ -445,7 +445,7 @@ export class GitHubActionsCache implements Cache { */ private async _makeTarball( paths: string[], - tempDir: string + tempDir: string, ): Promise { // Create a manifest file so that we can pass a large number of files to // tar. @@ -486,7 +486,7 @@ export class GitHubActionsCache implements Cache { } else { resolve(); } - } + }, ); }); return tarballPath; @@ -503,7 +503,7 @@ export class GitHubActionsCache implements Cache { script: ScriptReference, key: string, version: string, - cacheSize: number + cacheSize: number, ): Promise { const url = new URL('_apis/artifactcache/caches', this._baseUrl); const reqBody = JSON.stringify({ @@ -538,8 +538,8 @@ export class GitHubActionsCache implements Cache { throw new Error( `GitHub Cache reserve HTTP ${String( - response.statusCode - )} error: ${await readBody(response)}` + response.statusCode, + )} error: ${await readBody(response)}`, ); } } @@ -580,7 +580,7 @@ class GitHubActionsCacheHit implements CacheHit { const response = result.value; if (!isOk(response)) { throw new Error( - `GitHub Cache download HTTP ${String(response.statusCode)} error` + `GitHub Cache download HTTP ${String(response.statusCode)} error`, ); } const writeTarballStream = await fs.createWriteStream(tarballPath); @@ -605,7 +605,7 @@ class GitHubActionsCacheHit implements CacheHit { } else { resolve(); } - } + }, ); }); } @@ -613,7 +613,7 @@ class GitHubActionsCacheHit implements CacheHit { function request( url: URL | string, - options?: http.RequestOptions + options?: http.RequestOptions, ): { req: http.ClientRequest; resPromise: Promise>; @@ -645,7 +645,7 @@ function request( } }); }); - } + }, ); return {req, resPromise}; } diff --git a/src/caching/local-cache.ts b/src/caching/local-cache.ts index cac622560..85d1273aa 100644 --- a/src/caching/local-cache.ts +++ b/src/caching/local-cache.ts @@ -23,7 +23,7 @@ import type {AbsoluteEntry} from '../util/glob.js'; export class LocalCache implements Cache { async get( script: ScriptReference, - fingerprint: Fingerprint + fingerprint: Fingerprint, ): Promise { const cacheDir = this._getCacheDir(script, fingerprint); try { @@ -40,7 +40,7 @@ export class LocalCache implements Cache { async set( script: ScriptReference, fingerprint: Fingerprint, - absoluteFiles: AbsoluteEntry[] + absoluteFiles: AbsoluteEntry[], ): Promise { // TODO(aomarks) A script's cache directory currently just grows forever. // We'll have the "clean" command to help with manual cleanup, but we'll @@ -63,12 +63,12 @@ export class LocalCache implements Cache { private _getCacheDir( script: ScriptReference, - fingerprint: Fingerprint + fingerprint: Fingerprint, ): string { return pathlib.join( getScriptDataDir(script), 'cache', - createHash('sha256').update(fingerprint.string).digest('hex') + createHash('sha256').update(fingerprint.string).digest('hex'), ); } } diff --git a/src/cli-options.ts b/src/cli-options.ts index 8522dabff..7d30a9557 100644 --- a/src/cli-options.ts +++ b/src/cli-options.ts @@ -235,7 +235,7 @@ export const getOptions = (): Result => { */ function getArgvOptions( script: ScriptReference, - agent: Agent + agent: Agent, ): Pick { // The way command-line arguments are handled in npm, yarn, and pnpm are all // different. Our goal here is for ` --watch -- --extra` to behave the @@ -267,7 +267,7 @@ function getArgvOptions( // but unlike npm 6, it reflects the first script in a chain of scripts, instead // of the last. return parseRemainingArgs( - findRemainingArgsFromNpmConfigArgv(script, agent) + findRemainingArgsFromNpmConfigArgv(script, agent), ); } case 'yarnBerry': @@ -304,7 +304,7 @@ function getNpmUserAgent(): Agent { console.error( '⚠️ Wireit could not identify the npm user agent, ' + 'assuming it behaves like npm. ' + - 'Arguments may not be interpreted correctly.' + 'Arguments may not be interpreted correctly.', ); return 'npm'; } @@ -316,13 +316,13 @@ function getNpmUserAgent(): Agent { */ function findRemainingArgsFromNpmConfigArgv( script: ScriptReference, - agent: Agent + agent: Agent, ): string[] { const configArgvStr = process.env['npm_config_argv']; if (!configArgvStr) { console.error( '⚠️ The "npm_config_argv" environment variable was not set. ' + - 'Arguments may not be interpreted correctly.' + 'Arguments may not be interpreted correctly.', ); return []; } @@ -343,7 +343,7 @@ function findRemainingArgsFromNpmConfigArgv( console.error( '⚠️ Wireit could not parse the "npm_config_argv" ' + 'environment variable as JSON. ' + - 'Arguments may not be interpreted correctly.' + 'Arguments may not be interpreted correctly.', ); return []; } @@ -375,7 +375,7 @@ function findRemainingArgsFromNpmConfigArgv( (agent === 'yarnClassic' ? `See https://github.com/yarnpkg/yarn/issues/8905, ` + `and please consider upgrading to yarn 3.x or switching to npm.` - : '') + : ''), ); return process.argv.slice(2); } @@ -389,7 +389,7 @@ function findRemainingArgsFromNpmConfigArgv( * as `extraArgs` to be passed down to the script. */ function parseRemainingArgs( - args: string[] + args: string[], ): Pick { let watch = false; let extraArgs: string[] = []; @@ -410,7 +410,7 @@ function parseRemainingArgs( `⚠️ Unrecognized Wireit argument(s): ` + unrecognized.map((arg) => JSON.stringify(arg)).join(', ') + `. To pass arguments to the script, use a double-dash, ` + - `e.g. "npm run build -- --extra".` + `e.g. "npm run build -- --extra".`, ); } return { diff --git a/src/cli.ts b/src/cli.ts index 7bfb53f3d..c2b0bad70 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -47,8 +47,8 @@ const run = async (options: Options): Promise> => { const never: never = cacheResult.error.reason; throw new Error( `Internal error: unexpected cache result error reason: ${String( - never - )}` + never, + )}`, ); } } @@ -61,7 +61,7 @@ const run = async (options: Options): Promise> => { } default: { throw new Error( - `Unhandled cache: ${unreachable(options.cache) as string}` + `Unhandled cache: ${unreachable(options.cache) as string}`, ); } } @@ -75,7 +75,7 @@ const run = async (options: Options): Promise> => { workerPool, cache, options.failureMode, - options.agent + options.agent, ); process.on('SIGINT', () => { watcher.abort(); @@ -95,7 +95,7 @@ const run = async (options: Options): Promise> => { cache, options.failureMode, undefined, - false + false, ); process.on('SIGINT', () => { executor.abort(); diff --git a/src/config.ts b/src/config.ts index 9420caa72..5bb35515f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -50,7 +50,7 @@ export interface ScriptReferenceWithCommand extends ScriptReference { } export interface Dependency< - Config extends PotentiallyValidScriptConfig = ScriptConfig + Config extends PotentiallyValidScriptConfig = ScriptConfig, > { config: Config; specifier: JsonAstNode; @@ -228,7 +228,7 @@ export const scriptReferenceToString = ({ * Inverse of {@link scriptReferenceToString}. */ export const stringToScriptReference = ( - str: ScriptReferenceString + str: ScriptReferenceString, ): ScriptReference => { const [packageDir, name] = JSON.parse(str) as [string, string]; return {packageDir, name}; diff --git a/src/error.ts b/src/error.ts index 0d817b8ab..fb7972478 100644 --- a/src/error.ts +++ b/src/error.ts @@ -49,7 +49,7 @@ export class DiagnosticPrinter { print(diagnostic: Diagnostic) { if (diagnostic.location.range.length < 0) { throw new Error( - `Internal error: got a negative length squiggle for ${diagnostic.message}: ${diagnostic.location.range.length}` + `Internal error: got a negative length squiggle for ${diagnostic.message}: ${diagnostic.location.range.length}`, ); } @@ -74,7 +74,7 @@ ${drawSquiggle(diagnostic.location, 4)}`; const relPath = pathlib.relative(this._cwd, location.file.path); const {line, character} = this._offsetToPosition( location.file, - location.range.offset + location.range.offset, ); return `${CYAN}${relPath}${RESET}:${YELLOW}${line}${RESET}:${YELLOW}${character}${RESET}`; } @@ -205,7 +205,7 @@ export const offsetInsideRange = (offset: number, range: Range): boolean => export const offsetInsideNamedNode = ( offset: number, - namedNode: NamedAstNode + namedNode: NamedAstNode, ): boolean => { const valueEnd = namedNode.offset + namedNode.length; const totalLength = valueEnd - namedNode.name.offset; @@ -221,7 +221,7 @@ export const offsetInsideNamedNode = ( */ export function convertExceptionToFailure( error: unknown, - script: ScriptReference + script: ScriptReference, ): {ok: false; error: [UnknownErrorThrown]} { return { ok: false, diff --git a/src/event.ts b/src/event.ts index 8755bc392..8f7aafeef 100644 --- a/src/event.ts +++ b/src/event.ts @@ -97,8 +97,6 @@ export type Failure = | DependencyOnMissingScript | Cycle | UnknownErrorThrown - | DependencyOnMissingPackageJson - | DependencyOnMissingScript | DependencyInvalid | ServiceExitedUnexpectedly | DependencyServiceExitedUnexpectedly diff --git a/src/execution/base.ts b/src/execution/base.ts index 47a6fcb26..5a8bc46a3 100644 --- a/src/execution/base.ts +++ b/src/execution/base.ts @@ -35,7 +35,7 @@ let executionConstructorHook: * constructed. */ export function registerExecutionConstructorHook( - fn: typeof executionConstructorHook + fn: typeof executionConstructorHook, ) { executionConstructorHook = fn; } @@ -80,7 +80,7 @@ export abstract class BaseExecution { const dependencyResults = await Promise.all( this._config.dependencies.map((dependency) => { return this._executor.getExecution(dependency.config).execute(); - }) + }), ); const results: Array<[Dependency, Fingerprint]> = []; const errors = new Set(); @@ -107,7 +107,7 @@ export abstract class BaseExecution { export abstract class BaseExecutionWithCommand< T extends ScriptConfig & { command: Exclude; - } + }, > extends BaseExecution { protected readonly _servicesNotNeeded = new Deferred(); @@ -124,8 +124,8 @@ export abstract class BaseExecutionWithCommand< */ protected readonly _anyServiceTerminated = Promise.race( this._config.services.map( - (service) => this._executor.getExecution(service).terminated - ) + (service) => this._executor.getExecution(service).terminated, + ), ); /** @@ -135,8 +135,8 @@ export abstract class BaseExecutionWithCommand< if (this._config.services.length > 0) { const results = await Promise.all( this._config.services.map((service) => - this._executor.getExecution(service).start() - ) + this._executor.getExecution(service).start(), + ), ); const errors: Failure[] = []; for (const result of results) { diff --git a/src/execution/no-command.ts b/src/execution/no-command.ts index 5bbe2f502..cc0fd728c 100644 --- a/src/execution/no-command.ts +++ b/src/execution/no-command.ts @@ -21,7 +21,7 @@ export class NoCommandScriptExecution extends BaseExecution, adoptee: ServiceScriptExecution | undefined, - isWatchMode: boolean + isWatchMode: boolean, ) { super(config, executor, logger); this._isWatchMode = isWatchMode; @@ -352,8 +352,8 @@ export class ServiceScriptExecution extends BaseExecutionWithCommand - this._executor.getExecution(consumer).servicesNotNeeded - ) + this._executor.getExecution(consumer).servicesNotNeeded, + ), ); const abort = this._config.isPersistent ? Promise.all([this._state.entireExecutionAborted, allConsumersDone]) @@ -399,7 +399,7 @@ export class ServiceScriptExecution extends BaseExecutionWithCommand + depFingerprints: Array<[Dependency, Fingerprint]>, ): void { switch (this._state.id) { case 'executingDeps': { @@ -411,7 +411,7 @@ export class ServiceScriptExecution extends BaseExecutionWithCommand { this._onFingerprinted(result); - } + }, ); return; } @@ -613,7 +613,7 @@ export class ServiceScriptExecution extends BaseExecutionWithCommand { @@ -1052,7 +1052,7 @@ export class ServiceScriptExecution extends BaseExecutionWithCommand { diff --git a/src/execution/standard.ts b/src/execution/standard.ts index e260da4b5..496c6eba7 100644 --- a/src/execution/standard.ts +++ b/src/execution/standard.ts @@ -46,7 +46,7 @@ export class StandardScriptExecution extends BaseExecutionWithCommand( - workFn: () => Promise + workFn: () => Promise, ): Promise { if (this._config.output?.values.length === 0) { return workFn(); @@ -232,7 +232,7 @@ export class StandardScriptExecution extends BaseExecutionWithCommand { if (!fingerprint.data.fullyTracked) { return false; @@ -258,7 +258,7 @@ export class StandardScriptExecution extends BaseExecutionWithCommand { // Optimization: early signal that services are not needed while we're still // restoring from cache. @@ -289,7 +289,7 @@ export class StandardScriptExecution extends BaseExecutionWithCommand { // Check if we should clean before we delete the fingerprint file, because // we sometimes need to read the previous fingerprint file to determine @@ -367,7 +367,7 @@ export class StandardScriptExecution extends BaseExecutionWithCommand { @@ -444,7 +444,7 @@ export class StandardScriptExecution extends BaseExecutionWithCommand> { if (this._cache === undefined) { return {ok: true, value: undefined}; @@ -634,8 +634,8 @@ export class StandardScriptExecution extends BaseExecutionWithCommand { outputEntries.sort((a, b) => a.path.localeCompare(b.path)); const stats = await Promise.all( - outputEntries.map((entry) => fs.lstat(entry.path)) + outputEntries.map((entry) => fs.lstat(entry.path)), ); const manifest: Record = {}; for (let i = 0; i < outputEntries.length; i++) { @@ -716,7 +716,7 @@ export class StandardScriptExecution extends BaseExecutionWithCommand { await fs.mkdir(this._dataDir, {recursive: true}); await fs.writeFile(this._outputManifestFilePath, outputManifest, 'utf8'); diff --git a/src/executor.ts b/src/executor.ts index 4bf3ef206..286ffe7aa 100644 --- a/src/executor.ts +++ b/src/executor.ts @@ -58,7 +58,7 @@ let executorConstructorHook: ((executor: Executor) => void) | undefined; * constructed. */ export function registerExecutorConstructorHook( - fn: typeof executorConstructorHook + fn: typeof executorConstructorHook, ) { executorConstructorHook = fn; } @@ -97,7 +97,7 @@ export class Executor { failureMode: FailureMode, previousIterationServices: ServiceMap | undefined, isWatchMode: boolean, - previousWatchIterationFailures?: Map + previousWatchIterationFailures?: Map, ) { executorConstructorHook?.(this); this._rootConfig = rootConfig; @@ -134,7 +134,7 @@ export class Executor { default: { const never: never = failureMode; throw new Error( - `Internal error: unexpected failure mode: ${String(never)}` + `Internal error: unexpected failure mode: ${String(never)}`, ); } } @@ -187,7 +187,7 @@ export class Executor { const errors: Failure[] = []; const rootExecutionResult = await this.getExecution( - this._rootConfig + this._rootConfig, ).execute(); if (!rootExecutionResult.ok) { errors.push(...rootExecutionResult.error); @@ -204,7 +204,7 @@ export class Executor { // Wait for all ephemeral services to have terminated (either started and // stopped, or never needed to start). const ephemeralServiceResults = await Promise.all( - this._ephemeralServices.map((service) => service.terminated) + this._ephemeralServices.map((service) => service.terminated), ); for (const result of ephemeralServiceResults) { if (!result.ok) { @@ -264,7 +264,7 @@ export class Executor { this._logger, this._stopServices.promise, this._previousIterationServices?.get(key), - this._isWatchMode + this._isWatchMode, ); if (config.isPersistent) { this._persistentServices.set(key, execution); @@ -277,7 +277,7 @@ export class Executor { this, this._workerPool, this._cache, - this._logger + this._logger, ); } this._executions.set(key, execution); @@ -294,13 +294,13 @@ export class Executor { */ failedInPreviousWatchIteration( script: ScriptReference, - fingerprint: Fingerprint + fingerprint: Fingerprint, ): boolean { if (this._previousWatchIterationFailures === undefined) { return false; } const previous = this._previousWatchIterationFailures.get( - scriptReferenceToString(script) + scriptReferenceToString(script), ); if (previous === undefined) { return false; @@ -315,11 +315,11 @@ export class Executor { */ registerWatchIterationFailure( script: ScriptReference, - fingerprint: Fingerprint + fingerprint: Fingerprint, ): void { this._previousWatchIterationFailures?.set( scriptReferenceToString(script), - fingerprint + fingerprint, ); } } diff --git a/src/fingerprint.ts b/src/fingerprint.ts index 6cd97ee9f..21369fc8b 100644 --- a/src/fingerprint.ts +++ b/src/fingerprint.ts @@ -130,7 +130,7 @@ export class Fingerprint { */ static async compute( script: ScriptConfig, - dependencyFingerprints: Array<[Dependency, Fingerprint]> + dependencyFingerprints: Array<[Dependency, Fingerprint]>, ): Promise { let allDependenciesAreFullyTracked = true; const filteredDependencyFingerprints: Array< @@ -180,7 +180,7 @@ export class Fingerprint { hash.update(chunk as Buffer); } return [file.path, hash.digest('hex') as FileSha256HexDigest]; - }) + }), ); } else { fileHashes = []; @@ -213,13 +213,13 @@ export class Fingerprint { extraArgs: script.extraArgs ?? [], clean: script.clean, files: Object.fromEntries( - fileHashes.sort(([aFile], [bFile]) => aFile.localeCompare(bFile)) + fileHashes.sort(([aFile], [bFile]) => aFile.localeCompare(bFile)), ), output: script.output?.values ?? [], dependencies: Object.fromEntries( filteredDependencyFingerprints.sort(([aRef], [bRef]) => - aRef.localeCompare(bRef) - ) + aRef.localeCompare(bRef), + ), ), service: script.service === undefined diff --git a/src/ide.ts b/src/ide.ts index ca5a356f2..04098c86b 100644 --- a/src/ide.ts +++ b/src/ide.ts @@ -124,7 +124,7 @@ export class IdeAnalyzer { async getCodeActions( path: string, - range: PositionRange + range: PositionRange, ): Promise { const codeActions: CodeAction[] = []; // file isn't open @@ -140,11 +140,11 @@ export class IdeAnalyzer { } const packageJson = packageJsonResult.value; const ourRange = OffsetToPositionConverter.get( - packageJson.jsonFile + packageJson.jsonFile, ).ideRangeToRange(range); const scriptInfo = await this._getInfoAboutLocation( packageJson, - ourRange.offset + ourRange.offset, ); if (scriptInfo === undefined) { return codeActions; @@ -278,7 +278,7 @@ export class IdeAnalyzer { async getDefinition( path: string, - position: Position + position: Position, ): Promise { const packageDir = pathlib.dirname(path); const packageJsonResult = await this._analyzer.getPackageJson(packageDir); @@ -287,11 +287,11 @@ export class IdeAnalyzer { } const packageJson = packageJsonResult.value; const ourPosition = OffsetToPositionConverter.get( - packageJson.jsonFile + packageJson.jsonFile, ).idePositionToOffset(position); const scriptInfo = await this._getInfoAboutLocation( packageJson, - ourPosition + ourPosition, ); if (scriptInfo?.kind === 'dependency') { const dep = scriptInfo.dependency; @@ -303,12 +303,12 @@ export class IdeAnalyzer { const targetConverter = OffsetToPositionConverter.get(targetFile); const sourceConverter = OffsetToPositionConverter.get( - packageJson.jsonFile + packageJson.jsonFile, ); return [ { originSelectionRange: sourceConverter.toIdeRange( - scriptInfo.dependency.specifier + scriptInfo.dependency.specifier, ), targetUri: url.pathToFileURL(targetFile.path).toString(), targetRange: targetConverter.toIdeRange( @@ -316,7 +316,7 @@ export class IdeAnalyzer { // So we preview the whole thing when looking at the definition: // "build": {"command": "tsc"} // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - targetNode.parent ?? targetNode + targetNode.parent ?? targetNode, ), targetSelectionRange: targetConverter.toIdeRange(targetNode.name), }, @@ -324,7 +324,7 @@ export class IdeAnalyzer { } if (scriptInfo?.kind === 'scripts-section-script') { const sourceConverter = OffsetToPositionConverter.get( - packageJson.jsonFile + packageJson.jsonFile, ); const syntaxInfo = scriptInfo.scriptSyntaxInfo; if (syntaxInfo.scriptNode && syntaxInfo.wireitConfigNode) { @@ -332,14 +332,14 @@ export class IdeAnalyzer { return [ { originSelectionRange: sourceConverter.toIdeRange( - syntaxInfo.scriptNode.parent ?? syntaxInfo.scriptNode + syntaxInfo.scriptNode.parent ?? syntaxInfo.scriptNode, ), targetUri: url.pathToFileURL(packageJson.jsonFile.path).toString(), targetRange: sourceConverter.toIdeRange( - syntaxInfo.wireitConfigNode.parent ?? syntaxInfo.wireitConfigNode + syntaxInfo.wireitConfigNode.parent ?? syntaxInfo.wireitConfigNode, ), targetSelectionRange: sourceConverter.toIdeRange( - syntaxInfo.wireitConfigNode.name + syntaxInfo.wireitConfigNode.name, ), }, ]; @@ -348,7 +348,7 @@ export class IdeAnalyzer { } async getPackageJsonForTest( - filename: string + filename: string, ): Promise { const packageDir = pathlib.dirname(filename); const packageJsonResult = await this._analyzer.getPackageJson(packageDir); @@ -360,7 +360,7 @@ export class IdeAnalyzer { private async _getInfoAboutLocation( packageJson: PackageJson, - offset: number + offset: number, ) { const locationInfo = packageJson.getInfoAboutLocation(offset); if (locationInfo === undefined) { @@ -400,8 +400,8 @@ function getEdit(file: JsonFile, modifications: Modification[]): WorkspaceEdit { file.contents, path, value, - inferModificationOptions(file) - ) + inferModificationOptions(file), + ), ); } const converter = OffsetToPositionConverter.get(file); @@ -415,7 +415,7 @@ function getEdit(file: JsonFile, modifications: Modification[]): WorkspaceEdit { } function inferModificationOptions( - file: JsonFile + file: JsonFile, ): jsonParser.ModificationOptions { const firstPostNewlineWhitespace = file.contents.match(/\n(\s+)/)?.[1]; if (firstPostNewlineWhitespace === undefined) { @@ -464,7 +464,7 @@ function convertDiagnostic(d: Diagnostic): IdeDiagnostic { } function convertSeverity( - severity: 'error' | 'warning' | 'info' + severity: 'error' | 'warning' | 'info', ): DiagnosticSeverity { switch (severity) { case 'error': diff --git a/src/logging/default-logger.ts b/src/logging/default-logger.ts index 059294121..d9c595bd7 100644 --- a/src/logging/default-logger.ts +++ b/src/logging/default-logger.ts @@ -58,7 +58,7 @@ export class DefaultLogger implements Logger { switch (reason) { default: { throw new Error( - `Unknown success reason: ${unreachable(reason) as string}` + `Unknown success reason: ${unreachable(reason) as string}`, ); } case 'exit-zero': { @@ -90,19 +90,19 @@ export class DefaultLogger implements Logger { switch (reason) { default: { throw new Error( - `Unknown failure reason: ${unreachable(reason) as string}` + `Unknown failure reason: ${unreachable(reason) as string}`, ); } case 'launched-incorrectly': { console.error( - `❌${prefix} wireit must be launched with "npm run" or a compatible command.` + `❌${prefix} wireit must be launched with "npm run" or a compatible command.`, ); console.error(` More info: ${event.detail}`); break; } case 'missing-package-json': { console.error( - `❌${prefix} No package.json was found in ${event.script.packageDir}` + `❌${prefix} No package.json was found in ${event.script.packageDir}`, ); break; } @@ -115,7 +115,7 @@ export class DefaultLogger implements Logger { case 'no-scripts-in-package-json': { console.error( - `❌${prefix} No "scripts" section defined in package.json in ${event.script.packageDir}` + `❌${prefix} No "scripts" section defined in package.json in ${event.script.packageDir}`, ); break; } @@ -136,7 +136,7 @@ export class DefaultLogger implements Logger { } case 'exit-non-zero': { console.error( - `❌${prefix} Failed with exit status ${event.status}` + `❌${prefix} Failed with exit status ${event.status}`, ); break; } @@ -165,8 +165,8 @@ export class DefaultLogger implements Logger { case 'unknown-error-thrown': { console.error( `❌${prefix} Internal error! Please file a bug at https://github.com/google/wireit/issues/new, mention this message, that you encountered it in wireit version ${getWireitVersion()}, and give information about your package.json files.\n Unknown error thrown: ${String( - event.error - )}` + event.error, + )}`, ); const maybeError = event.error as Partial | undefined; if (maybeError?.stack) { @@ -178,8 +178,8 @@ export class DefaultLogger implements Logger { console.error( `❌${prefix} Depended, perhaps indirectly, on ${labelForScript( this._rootPackageDir, - event.dependency - )} which could not be validated. Please file a bug at https://github.com/google/wireit/issues/new, mention this message, that you encountered it in wireit version ${getWireitVersion()}, and give information about your package.json files.` + event.dependency, + )} which could not be validated. Please file a bug at https://github.com/google/wireit/issues/new, mention this message, that you encountered it in wireit version ${getWireitVersion()}, and give information about your package.json files.`, ); break; } @@ -202,7 +202,7 @@ export class DefaultLogger implements Logger { switch (stream) { default: { throw new Error( - `Unknown output stream: ${unreachable(stream) as string}` + `Unknown output stream: ${unreachable(stream) as string}`, ); } // TODO(aomarks) More advanced handling of output streams so that @@ -224,26 +224,26 @@ export class DefaultLogger implements Logger { switch (detail) { default: { throw new Error( - `Unknown info event detail: ${unreachable(detail) as string}` + `Unknown info event detail: ${unreachable(detail) as string}`, ); } case 'running': { console.log( `🏃${prefix} Running command "${ event.script.command?.value ?? '' - }"` + }"`, ); break; } case 'locked': { console.log( - `💤${prefix} Waiting for another process which is already running this script.` + `💤${prefix} Waiting for another process which is already running this script.`, ); break; } case 'output-modified': { console.log( - `ℹ️${prefix} Output files were modified since the previous run.` + `ℹ️${prefix} Output files were modified since the previous run.`, ); break; } @@ -306,7 +306,7 @@ export class DefaultLogger implements Logger { */ export function labelForScript( rootPackageDir: string, - script: ScriptReference | PackageReference + script: ScriptReference | PackageReference, ) { const packageDir = script.packageDir; const scriptName = 'name' in script ? script.name : undefined; diff --git a/src/logging/quiet-logger.ts b/src/logging/quiet-logger.ts index e79a8516f..6efe8c5b8 100644 --- a/src/logging/quiet-logger.ts +++ b/src/logging/quiet-logger.ts @@ -27,7 +27,7 @@ export class QuietLogger implements Logger { this._rootPackage = rootPackage; this.runTracker = new QuietRunLogger( this._rootPackage, - this._writeoverLine + this._writeoverLine, ); } diff --git a/src/logging/quiet/run-tracker.ts b/src/logging/quiet/run-tracker.ts index ca68ac058..f86df5f9e 100644 --- a/src/logging/quiet/run-tracker.ts +++ b/src/logging/quiet/run-tracker.ts @@ -33,7 +33,7 @@ class ScriptState { constructor( scriptReference: ScriptReference, service: boolean, - isRootScript: boolean + isRootScript: boolean, ) { this.scriptReference = scriptReference; this.service = service; @@ -170,7 +170,7 @@ export class QuietRunLogger { constructor( rootPackage: string, writeoverLine: WriteoverLine, - defaultLogger?: DefaultLogger + defaultLogger?: DefaultLogger, ) { this._rootPackage = rootPackage; this._writeoverLine = writeoverLine; @@ -186,7 +186,7 @@ export class QuietRunLogger { const instance = new QuietRunLogger( this._rootPackage, this._writeoverLine, - this._defaultLogger + this._defaultLogger, ); // Persistent services stay running between runs, so pass along what we // know. @@ -263,7 +263,7 @@ export class QuietRunLogger { if (this._scriptsWithAlreadyReportedErrors.size > 0) { const s = this._scriptsWithAlreadyReportedErrors.size === 1 ? '' : 's'; process.stderr.write( - `❌ ${this._scriptsWithAlreadyReportedErrors.size.toLocaleString()} script${s} failed.\n` + `❌ ${this._scriptsWithAlreadyReportedErrors.size.toLocaleString()} script${s} failed.\n`, ); } else { process.stderr.write(`❌ Failed.\n`); @@ -277,13 +277,13 @@ export class QuietRunLogger { const count = this._ran + this._servicesStarted; const s = count === 1 ? '' : 's'; console.log( - `✅ Ran ${count.toLocaleString()} script${s} and skipped ${this._skipped.toLocaleString()} in ${elapsed.toLocaleString()}s.` + `✅ Ran ${count.toLocaleString()} script${s} and skipped ${this._skipped.toLocaleString()} in ${elapsed.toLocaleString()}s.`, ); } private _reportOutputForFailingScript( script: ScriptReference, - cause?: Failure + cause?: Failure, ) { const state = this._running.get(scriptReferenceToString(script)); if (!state) { @@ -293,7 +293,7 @@ export class QuietRunLogger { } for script without a start event. Events delivered out of order? Script with failure: ${scriptReferenceToString(script)} Known scripts: ${inspect([...this._running.keys()])} -` +`, ); } state.replayAndEmptyBuffer(); @@ -325,14 +325,14 @@ export class QuietRunLogger { } private _getExecutionStatusLine( - analysisInfo: AnalysisInfo + analysisInfo: AnalysisInfo, ): StatusLineResult { const peekResult = this._running.peek()?.[1]; let mostRecentScript = ''; if (peekResult !== undefined) { mostRecentScript = labelForScript( this._rootPackage, - peekResult.scriptReference + peekResult.scriptReference, ); } const done = this._finishedScriptsWithCommands.size; @@ -378,8 +378,8 @@ export class QuietRunLogger { console.log( `info: ${event.detail} ${labelForScript( this._rootPackage, - event.script - )}` + event.script, + )}`, ); } switch (event.detail) { @@ -390,8 +390,8 @@ export class QuietRunLogger { new ScriptState( event.script, false, - this._analysisInfo?.rootScript === key - ) + this._analysisInfo?.rootScript === key, + ), ); return this._getStatusLine(); } @@ -405,8 +405,8 @@ export class QuietRunLogger { new ScriptState( event.script, true, - this._analysisInfo?.rootScript === key - ) + this._analysisInfo?.rootScript === key, + ), ); this._markScriptAsFinished(event.script); return this._getStatusLine(); @@ -446,7 +446,7 @@ export class QuietRunLogger { } else { this._statusLineState = 'executing'; this._analysisInfo = this._countScriptsWithCommands( - event.rootScriptConfig + event.rootScriptConfig, ); for (const finished of this._finishedScriptsWithCommands) { if (!this._analysisInfo.scriptsWithCommands.has(finished)) { @@ -468,8 +468,8 @@ export class QuietRunLogger { console.log( `success: ${event.reason} ${labelForScript( this._rootPackage, - event.script - )}` + event.script, + )}`, ); } switch (event.reason) { @@ -504,8 +504,8 @@ export class QuietRunLogger { console.log( `failure: ${event.reason} ${labelForScript( this._rootPackage, - event.script - )}` + event.script, + )}`, ); } this._encounteredFailures = true; @@ -593,8 +593,8 @@ export class QuietRunLogger { `Internal error: could not find state for failing script. Events delivered out of order? Script with output: ${labelForScript(this._rootPackage, script)} ${this._running.size.toLocaleString()} known running scripts: ${inspect( - [...this._running.keys()] - )}` + [...this._running.keys()], + )}`, ); } return state.hasBufferedOutput; @@ -608,8 +608,8 @@ export class QuietRunLogger { `Internal error: Got output event for unknown script. Events delivered out of order? Script with output: ${labelForScript(this._rootPackage, event.script)} ${this._running.size.toLocaleString()} known running scripts: ${inspect( - [...this._running.keys()] - )}` + [...this._running.keys()], + )}`, ); } if (state.service) { diff --git a/src/script-child-process.ts b/src/script-child-process.ts index 7a3e1e33c..d03aa43cb 100644 --- a/src/script-child-process.ts +++ b/src/script-child-process.ts @@ -34,7 +34,7 @@ const PATH_ENV_SUFFIX = (() => { const entries = path.split(pathlib.delimiter); const nodeModulesBinSuffix = pathlib.join('node_modules', '.bin'); const endOfNodeModuleBins = entries.findIndex( - (entry) => !entry.endsWith(nodeModulesBinSuffix) + (entry) => !entry.endsWith(nodeModulesBinSuffix), ); return entries.slice(endOfNodeModuleBins).join(pathlib.delimiter); })(); @@ -142,7 +142,7 @@ export class ScriptChildProcess { case 'stopped': { const exception = new Error( `Internal error: Expected ScriptChildProcessState ` + - `to be "started" or "killing" but was "${this._state}"` + `to be "started" or "killing" but was "${this._state}"`, ); this._started.reject(exception); this._completed.reject(exception); @@ -152,8 +152,8 @@ export class ScriptChildProcess { const never: never = this._state; const exception = new Error( `Internal error: unexpected ScriptChildProcessState: ${String( - never - )}` + never, + )}`, ); this._started.reject(exception); this._completed.reject(exception); @@ -245,7 +245,9 @@ export class ScriptChildProcess { default: { const never: never = this._state; throw new Error( - `Internal error: unexpected ScriptChildProcessState: ${String(never)}` + `Internal error: unexpected ScriptChildProcessState: ${String( + never, + )}`, ); } } @@ -255,7 +257,7 @@ export class ScriptChildProcess { if (this._child.pid === undefined) { throw new Error( `Internal error: Can't kill child process because it has no pid. ` + - `Command: ${JSON.stringify(this._script.command)}.` + `Command: ${JSON.stringify(this._script.command)}.`, ); } if (IS_WINDOWS) { diff --git a/src/test/analysis.test.ts b/src/test/analysis.test.ts index 591401538..e18ada011 100644 --- a/src/test/analysis.test.ts +++ b/src/test/analysis.test.ts @@ -156,7 +156,7 @@ test( packageDir: rig.temp, name: 'build', }, - [] + [], ); if (!result.config.ok) { console.log(result.config.error); @@ -184,7 +184,7 @@ test( '!CVS/', '!node_modules/', ]); - } + }, ); test( @@ -216,7 +216,7 @@ test( packageDir: rig.temp, name: 'build', }, - [] + [], ); if (!result.config.ok) { console.log(result.config.error); @@ -226,7 +226,7 @@ test( const build = result.config.value; assert.equal(build.files?.values, ['**/*.ts']); assert.equal(build.output?.values, ['**/*.js']); - } + }, ); test('Default excluded paths are not present when files and output are empty', async ({ @@ -254,7 +254,7 @@ test('Default excluded paths are not present when files and output are empty', a packageDir: rig.temp, name: 'build', }, - [] + [], ); if (!result.config.ok) { console.log(result.config.error); diff --git a/src/test/basic.test.ts b/src/test/basic.test.ts index 83428f56d..1dff1033e 100644 --- a/src/test/basic.test.ts +++ b/src/test/basic.test.ts @@ -79,7 +79,7 @@ test( assert.equal(resA1.code, 42); assert.equal(resA2.code, 43); assert.equal(resB1.code, 44); - }) + }), ); test( @@ -115,7 +115,7 @@ test( checkScriptOutput(res.stderr, 'a stderr\n'); assert.match(res.stdout, 'a stdout\n'); assert.match(res.stdout, '✅ Ran 1 script and skipped 0 in'); - }) + }), ); test( @@ -157,7 +157,7 @@ test( checkScriptOutput(res.stderr, 'a stderr\n'); assert.match(res.stdout, 'a stdout\n'); assert.match(res.stdout, '✅ Ran 1 script and skipped 0 in'); - }) + }), ); test( @@ -221,7 +221,7 @@ test( assert.match(res.stdout, /Ran 3 scripts and skipped 0/s); // we only see the output of the root command checkScriptOutput(res.stderr, 'a stderr\n'); - }) + }), ); test( @@ -283,7 +283,7 @@ test( assert.match(res.stdout, /Ran 3 scripts and skipped 0/s); // we only see the output of the root command checkScriptOutput(res.stderr, 'a stderr\n'); - }) + }), ); test( @@ -351,7 +351,7 @@ test( assert.equal(cmdC.numInvocations, 1); assert.equal(cmdD.numInvocations, 1); assert.match(res.stdout, /Ran 4 scripts and skipped 0/s); - }) + }), ); test( @@ -397,7 +397,7 @@ test( assert.equal(cmdA.numInvocations, 1); assert.equal(cmdB.numInvocations, 1); assert.match(res.stdout, /Ran 2 scripts and skipped 0/s); - }) + }), ); test( @@ -447,7 +447,7 @@ test( assert.equal(cmdA.numInvocations, 1); assert.equal(cmdB.numInvocations, 1); assert.match(res.stdout, /Ran 2 scripts and skipped 0/s); - }) + }), ); test( @@ -506,7 +506,7 @@ test( assert.equal(cmdB.numInvocations, 1); assert.equal(cmdC.numInvocations, 1); assert.match(res.stdout, /Ran 3 scripts and skipped 0/s); - }) + }), ); test( @@ -535,7 +535,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmd.numInvocations, 1); - }) + }), ); test( @@ -564,7 +564,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmd.numInvocations, 1); - }) + }), ); test( @@ -603,7 +603,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmd.numInvocations, 1); - }) + }), ); test( @@ -642,7 +642,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmd.numInvocations, 1); - }) + }), ); test( @@ -684,9 +684,9 @@ test( res.stderr, IS_WINDOWS ? "'test-binary' is not recognized" - : 'exited with exit code 127' + : 'exited with exit code 127', ); - }) + }), ); // Node workspaces are only supported in npm 7+, which shipped with Node v15. @@ -741,7 +741,7 @@ test( assert.equal(cmdA.numInvocations, 2); assert.equal(cmdB.numInvocations, 1); } - }) + }), ); test( @@ -773,13 +773,13 @@ test( env: { npm_lifecycle_event: 'a', }, - } + }, ); (await cmdA.nextInvocation()).exit(0); const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -805,7 +805,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); assert.match(res.stdout, /Ran 1 script and skipped 0/s); - }) + }), ); test( @@ -831,7 +831,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); assert.match(res.stdout, /Ran 1 script and skipped 0/s); - }) + }), ); test( @@ -893,7 +893,7 @@ test( assert.equal(cmdA.numInvocations, 2); assert.equal(cmdB.numInvocations, 1); } - }) + }), ); test( @@ -948,7 +948,7 @@ test( assert.equal(cmdA.numInvocations, 2); assert.equal(cmdB.numInvocations, 1); } - }) + }), ); test( @@ -993,7 +993,7 @@ test( const exec = rig.exec('npm run a', {cwd: 'foo'}); await exec.waitForLog( - /0% \[0 \/ 3\] \[2 running\] (\.\.\/bar:b|\.\.\/baz:c)/ + /0% \[0 \/ 3\] \[2 running\] (\.\.\/bar:b|\.\.\/baz:c)/, ); const invC = await cmdC.nextInvocation(); @@ -1013,7 +1013,7 @@ test( assert.equal(cmdB.numInvocations, 1); assert.equal(cmdC.numInvocations, 1); assert.match(res.stdout, /Ran 3 scripts and skipped 0/s); - }) + }), ); test( @@ -1044,7 +1044,7 @@ test( await wireit.waitForLog(/❌ \[main\] killed/); await wireit.waitForLog(/❌ 1 script failed/); } - }) + }), ); for (const agent of ['npm', 'yarn', 'pnpm']) { @@ -1103,7 +1103,7 @@ for (const agent of ['npm', 'yarn', 'pnpm']) { assert.equal((await wireit.exit).code, 0); await wireit.waitForLog(/Ran 1 script and skipped 0/s); // } - }) + }), ); } @@ -1205,7 +1205,7 @@ test( assert.equal(b.numInvocations, 3); assert.equal(c.numInvocations, 2); } - }) + }), ); test( @@ -1257,7 +1257,7 @@ test( const wireit = rig.exec('npm run 0'); assert.equal((await wireit.exit).code, 0); - }) + }), ); test( @@ -1302,7 +1302,7 @@ test( assert.equal(env.BAZ, 'baz-good'); inv.exit(0); assert.equal((await wireit.exit).code, 0); - }) + }), ); test( @@ -1339,7 +1339,7 @@ test( const {code} = await wireit.exit; assert.equal(code, 0); await wireit.waitForLog(/Ran 2 scripts and skipped 0/); - }) + }), ); test.run(); diff --git a/src/test/cache-common.ts b/src/test/cache-common.ts index 30483a3a3..a8a6a021e 100644 --- a/src/test/cache-common.ts +++ b/src/test/cache-common.ts @@ -18,7 +18,7 @@ import type {WireitTestRig} from './util/test-rig.js'; */ export const registerCommonCacheTests = ( test: Test<{rig: WireitTestRig}>, - cacheMode: 'local' | 'github' + cacheMode: 'local' | 'github', ) => { test( 'caches single file', @@ -84,7 +84,7 @@ export const registerCommonCacheTests = ( assert.equal(cmdA.numInvocations, 2); assert.equal(await rig.read('output'), 'v1'); } - }) + }), ); test( @@ -179,7 +179,7 @@ export const registerCommonCacheTests = ( assert.equal(await rig.read('output/1/c/d/e'), 'v1'); assert.equal(await rig.read('output/excluded/foo'), 'excluded'); } - }) + }), ); test( @@ -274,7 +274,7 @@ export const registerCommonCacheTests = ( assert.equal(await rig.read('output/subdir/excluded'), 'v0'); assert.equal(await rig.read('output/subdir/reincluded'), 'v1'); } - }) + }), ); test( @@ -357,7 +357,7 @@ export const registerCommonCacheTests = ( assert.not(await rig.exists('output/only-v0')); assert.equal(await rig.read('output/only-v1'), 'v1'); } - }) + }), ); test( @@ -411,7 +411,7 @@ export const registerCommonCacheTests = ( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 3); } - }) + }), ); test( @@ -464,7 +464,7 @@ export const registerCommonCacheTests = ( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -534,7 +534,7 @@ export const registerCommonCacheTests = ( await rig.write({target: 'bar'}); assert.equal(await rig.read('symlink'), 'bar'); } - }) + }), ); test( @@ -613,7 +613,7 @@ export const registerCommonCacheTests = ( // symlink to the directory. assert.equal(await rig.readlink('output/symlink'), `..${sep}target`); } - }) + }), ); test( @@ -673,7 +673,7 @@ export const registerCommonCacheTests = ( assert.equal(cmdA.numInvocations, 3); assert.equal(await rig.read('output'), 'v0'); } - }) + }), ); test( @@ -739,7 +739,7 @@ export const registerCommonCacheTests = ( assert.equal(cmdA.numInvocations, 3); assert.equal(await rig.read('output'), 'v0'); } - }) + }), ); test( @@ -814,7 +814,7 @@ export const registerCommonCacheTests = ( assert.equal(cmdA.numInvocations, 2); assert.equal(await rig.read('output'), 'v1'); } - }) + }), ); test( @@ -893,7 +893,7 @@ export const registerCommonCacheTests = ( assert.ok(await rig.isDirectory('with-exclusion')); assert.not(await rig.exists('with-exclusion/excluded')); } - }) + }), ); test( @@ -960,7 +960,7 @@ export const registerCommonCacheTests = ( assert.equal(cmdA.numInvocations, 2); assert.equal(await rig.read('output'), 'v1'); } - }) + }), ); test( @@ -993,19 +993,19 @@ export const registerCommonCacheTests = ( res.stderr, ` ❌ package.json:9:17 Output files must be within the package: ${JSON.stringify( - pathlib.join(rig.temp, 'outside') + pathlib.join(rig.temp, 'outside'), )} was outside ${JSON.stringify(pathlib.join(rig.temp, 'foo'))} "output": [ ~ "../outside" ~~~~~~~~~~~~~~~~~~~~ ], - ~~~~~~~` + ~~~~~~~`, ); assert.equal(cmdA.numInvocations, 0); // The outside file should not have been deleted. assert.ok(await rig.exists('outside')); - }) + }), ); }; diff --git a/src/test/cache-github.test.ts b/src/test/cache-github.test.ts index 2db5861d9..8a649f691 100644 --- a/src/test/cache-github.test.ts +++ b/src/test/cache-github.test.ts @@ -26,12 +26,12 @@ const SELF_SIGNED_CERT = selfsigned.generate( // More recent versions of TLS require a larger minimum key size than the // default of this library (1024). Let's also upgrade from sha1 to sha256 // while we're at it. - {keySize: 2048, algorithm: 'sha256'} + {keySize: 2048, algorithm: 'sha256'}, ); const SELF_SIGNED_CERT_PATH = pathlib.resolve( repoRoot, 'temp', - 'self-signed.cert' + 'self-signed.cert', ); const test = suite<{ @@ -143,7 +143,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 3); } - }) + }), ); test( @@ -219,7 +219,7 @@ test( commit: 1, download: 1, }); - }) + }), ); for (const code of [429, 503, 'ECONNRESET'] as const) { @@ -310,117 +310,120 @@ for (const code of [429, 503, 'ECONNRESET'] as const) { // might not really be a problem in reality, because tarballs come from a // different CDN server, so probably have a separate rate limit from the // rest of the caching APIs. - }) + }), ); } test( 'uploads large tarball in multiple chunks', - timeout(async ({rig, server}) => { - const cmdA = await rig.newCommand(); + timeout( + async ({rig, server}) => { + const cmdA = await rig.newCommand(); - await rig.write({ - 'package.json': { - scripts: { - a: 'wireit', - }, - wireit: { - a: { - command: cmdA.command, - files: ['input'], - output: ['output'], + await rig.write({ + 'package.json': { + scripts: { + a: 'wireit', + }, + wireit: { + a: { + command: cmdA.command, + files: ['input'], + output: ['output'], + }, }, }, - }, - }); - - // Generate a random file which is big enough to exceed the maximum chunk - // size, so that it gets split into 2 separate upload requests. - // - // The maximum chunk size is defined here: - // https://github.com/actions/toolkit/blob/500d0b42fee2552ae9eeb5933091fe2fbf14e72d/packages/cache/src/options.ts#L59 - // - // This needs to be actually random data, not just arbitrary, because the - // tarball will be compressed, and we need a poor compression ratio in order - // to hit our target size. - const MB = 1024 * 1024; - const maxChunkBytes = 32 * MB; - const compressionHeadroomBytes = 8 * MB; // Found experimentally. - const totalBytes = maxChunkBytes + compressionHeadroomBytes; - const fileContent = crypto.randomBytes(totalBytes).toString(); - - // On the initial run a large file is created and should be cached. - { - await rig.write('input', 'v0'); - server.resetMetrics(); - - const exec = rig.exec('npm run a'); - const inv = await cmdA.nextInvocation(); - await rig.write('output', fileContent); - inv.exit(0); - - // Note here is when we are creating the compressed tarball, which is the - // slowest part of this test. - - assert.equal((await exec.exit).code, 0); - assert.equal(cmdA.numInvocations, 1); - assert.equal(server.metrics, { - check: 1, - reserve: 1, - // Since we had a file that was larger than the maximum chunk size, we - // should have 2 upload requests. - upload: 2, - commit: 1, - download: 0, - }); - } - - // Invalidate cache by changing input. - { - await rig.write('input', 'v1'); - server.resetMetrics(); - - const exec = rig.exec('npm run a'); - const inv = await cmdA.nextInvocation(); - assert.not(await rig.exists('output')); - inv.exit(0); - - assert.equal((await exec.exit).code, 0); - assert.equal(cmdA.numInvocations, 2); - assert.equal(server.metrics, { - check: 1, - reserve: 1, - upload: 1, - commit: 1, - download: 0, }); - } - // Change input back to v0. The large file should be restored from cache. - { - await rig.write('input', 'v0'); - server.resetMetrics(); - - const exec = rig.exec('npm run a'); - - assert.equal((await exec.exit).code, 0); - assert.equal(cmdA.numInvocations, 2); - assert.equal(server.metrics, { - check: 1, - reserve: 0, - upload: 0, - commit: 0, - download: 1, - }); - assert.equal(await rig.read('output'), fileContent); - } - }, Math.max(DEFAULT_UVU_TIMEOUT, 15_000)) + // Generate a random file which is big enough to exceed the maximum chunk + // size, so that it gets split into 2 separate upload requests. + // + // The maximum chunk size is defined here: + // https://github.com/actions/toolkit/blob/500d0b42fee2552ae9eeb5933091fe2fbf14e72d/packages/cache/src/options.ts#L59 + // + // This needs to be actually random data, not just arbitrary, because the + // tarball will be compressed, and we need a poor compression ratio in order + // to hit our target size. + const MB = 1024 * 1024; + const maxChunkBytes = 32 * MB; + const compressionHeadroomBytes = 8 * MB; // Found experimentally. + const totalBytes = maxChunkBytes + compressionHeadroomBytes; + const fileContent = crypto.randomBytes(totalBytes).toString(); + + // On the initial run a large file is created and should be cached. + { + await rig.write('input', 'v0'); + server.resetMetrics(); + + const exec = rig.exec('npm run a'); + const inv = await cmdA.nextInvocation(); + await rig.write('output', fileContent); + inv.exit(0); + + // Note here is when we are creating the compressed tarball, which is the + // slowest part of this test. + + assert.equal((await exec.exit).code, 0); + assert.equal(cmdA.numInvocations, 1); + assert.equal(server.metrics, { + check: 1, + reserve: 1, + // Since we had a file that was larger than the maximum chunk size, we + // should have 2 upload requests. + upload: 2, + commit: 1, + download: 0, + }); + } + + // Invalidate cache by changing input. + { + await rig.write('input', 'v1'); + server.resetMetrics(); + + const exec = rig.exec('npm run a'); + const inv = await cmdA.nextInvocation(); + assert.not(await rig.exists('output')); + inv.exit(0); + + assert.equal((await exec.exit).code, 0); + assert.equal(cmdA.numInvocations, 2); + assert.equal(server.metrics, { + check: 1, + reserve: 1, + upload: 1, + commit: 1, + download: 0, + }); + } + + // Change input back to v0. The large file should be restored from cache. + { + await rig.write('input', 'v0'); + server.resetMetrics(); + + const exec = rig.exec('npm run a'); + + assert.equal((await exec.exit).code, 0); + assert.equal(cmdA.numInvocations, 2); + assert.equal(server.metrics, { + check: 1, + reserve: 0, + upload: 0, + commit: 0, + download: 1, + }); + assert.equal(await rig.read('output'), fileContent); + } + }, + Math.max(DEFAULT_UVU_TIMEOUT, 15_000), + ), ); if (NODE_MAJOR_VERSION === 19) { console.error( 'Skipping GitHub caching tests on Node 19 due to performance issue, ' + - 'see https://github.com/google/wireit/issues/554' + 'see https://github.com/google/wireit/issues/554', ); } else { test.run(); diff --git a/src/test/clean.test.ts b/src/test/clean.test.ts index 842b34807..5d05d85ef 100644 --- a/src/test/clean.test.ts +++ b/src/test/clean.test.ts @@ -68,7 +68,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -104,7 +104,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -137,7 +137,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -172,7 +172,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -209,7 +209,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -241,7 +241,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -275,7 +275,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -304,20 +304,20 @@ test( done.stderr, ` ❌ package.json:8:17 Output files must be within the package: ${JSON.stringify( - pathlib.join(rig.temp, 'outside') + pathlib.join(rig.temp, 'outside'), )} was outside ${JSON.stringify(pathlib.join(rig.temp, 'foo'))} "output": [ ~ "../outside" ~~~~~~~~~~~~~~~~~~~~ ] - ~~~~~~~` + ~~~~~~~`, ); assert.equal(cmdA.numInvocations, 0); // The outside file should not have been deleted. assert.ok(await rig.exists('outside')); - }) + }), ); test( @@ -462,7 +462,7 @@ test( } assert.equal(cmdA.numInvocations, 5); - }) + }), ); test( @@ -527,7 +527,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -562,7 +562,7 @@ test( const res = await exec.exit; assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test.run(); diff --git a/src/test/cli-options.test.ts b/src/test/cli-options.test.ts index 442419b82..d535b1768 100644 --- a/src/test/cli-options.test.ts +++ b/src/test/cli-options.test.ts @@ -42,14 +42,14 @@ const TEST_BINARY_COMMAND = `node ${pathlib.join( 'lib', 'test', 'util', - 'cli-options-test-binary.js' + 'cli-options-test-binary.js', )}`; async function getOptionsResult( rig: WireitTestRig, command: string, env?: Record, - extraScripts?: Record + extraScripts?: Record, ): Promise> { await rig.write({ 'package.json': { @@ -71,7 +71,7 @@ async function assertOptions( expected: Omit, 'logger'> & Pick & {logger?: string}, env?: Record, - extraScripts?: Record + extraScripts?: Record, ) { const result = await getOptionsResult(rig, command, env, extraScripts); assert.equal(result, { @@ -105,7 +105,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { name: 'main', }, }); - }) + }), ); test( @@ -118,7 +118,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { name: 'test', }, }); - }) + }), ); test( @@ -131,7 +131,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { name: 'start', }, }); - }) + }), ); test( @@ -145,7 +145,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { }, extraArgs: ['--extra'], }); - }) + }), ); // Does not work in pnpm, see https://github.com/pnpm/pnpm/issues/4821. @@ -160,7 +160,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { }, extraArgs: ['--extra'], }); - }) + }), ); test( @@ -174,7 +174,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { }, extraArgs: ['--extra'], }); - }) + }), ); test( @@ -188,7 +188,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { }, watch: true, }); - }) + }), ); // Does not work in pnpm, see https://github.com/pnpm/pnpm/issues/4821. @@ -203,7 +203,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { }, watch: true, }); - }) + }), ); test( @@ -217,7 +217,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { }, watch: true, }); - }) + }), ); test( @@ -232,7 +232,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { extraArgs: ['--extra'], watch: true, }); - }) + }), ); // Does not work in pnpm, see https://github.com/pnpm/pnpm/issues/4821. @@ -248,7 +248,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { extraArgs: ['--extra'], watch: true, }); - }) + }), ); test( @@ -263,7 +263,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { extraArgs: ['--extra'], watch: true, }); - }) + }), ); test( @@ -284,9 +284,9 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { undefined, { recurse: `${command} run start --watch`, - } + }, ); - }) + }), ); test(`WIREIT_LOGGER=simple ${command} run main`, async ({rig}) => { @@ -303,7 +303,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { }, { WIREIT_LOGGER: 'simple', - } + }, ); }); @@ -321,7 +321,7 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { }, { WIREIT_LOGGER: 'quiet', - } + }, ); }); @@ -348,9 +348,9 @@ for (const command of ['npm', 'yarn', 'pnpm'] as const) { undefined, { recurse: `${command} run start --watch -- --extra`, - } + }, ); - }) + }), ); } diff --git a/src/test/codeactions.test.ts b/src/test/codeactions.test.ts index 6a8b16de0..2cb75accf 100644 --- a/src/test/codeactions.test.ts +++ b/src/test/codeactions.test.ts @@ -62,7 +62,7 @@ async function getCodeActions(options: { OffsetToPositionConverter.createUncachedForTest(contents).toIdeRange({ offset, length: 0, - }) + }), ); return {contents, actions}; } @@ -96,7 +96,9 @@ async function assertCodeAction(options: { assert.equal( actions.map((a) => a.title), [options.expectedTitle], - `Error getting code actions for ${JSON.stringify(options.contentsWithPipe)}` + `Error getting code actions for ${JSON.stringify( + options.contentsWithPipe, + )}`, ); const [action] = actions; const newContents = applyEdit(options.rig, contents, action); @@ -115,14 +117,14 @@ async function assertNoCodeActions(options: { assert.equal( actions.map((a) => a.title), [], - `Expected no code action in: ${JSON.stringify(options.contentsWithPipe)}\n` + `Expected no code action in: ${JSON.stringify(options.contentsWithPipe)}\n`, ); } function applyEdit( rig: WireitTestRig, before: string, - action: CodeAction + action: CodeAction, ): string { if (action.edit === undefined) { throw new Error(`Action ${action.title} had no edit`); @@ -143,7 +145,7 @@ function applyEdit( content: e.newText, ...converter.ideRangeToRange(e.range), }; - }) + }), ); } diff --git a/src/test/copy.test.ts b/src/test/copy.test.ts index d2bdc39a4..d503b0c58 100644 --- a/src/test/copy.test.ts +++ b/src/test/copy.test.ts @@ -44,7 +44,7 @@ test.before.each(async (ctx) => { isDirectory: () => false, isSymbolicLink: () => false, }, - } as AbsoluteEntry); + }) as AbsoluteEntry; ctx.dir = (path) => ({ @@ -54,7 +54,7 @@ test.before.each(async (ctx) => { isDirectory: () => true, isSymbolicLink: () => false, }, - } as AbsoluteEntry); + }) as AbsoluteEntry; ctx.symlink = (path) => ({ @@ -64,7 +64,7 @@ test.before.each(async (ctx) => { isDirectory: () => false, isSymbolicLink: () => true, }, - } as AbsoluteEntry); + }) as AbsoluteEntry; } catch (error) { // Uvu has a bug where it silently ignores failures in before and after, // see https://github.com/lukeed/uvu/issues/191. diff --git a/src/test/delete.test.ts b/src/test/delete.test.ts index 10aa8c89f..9464d0df7 100644 --- a/src/test/delete.test.ts +++ b/src/test/delete.test.ts @@ -40,7 +40,7 @@ test.before.each(async (ctx) => { isDirectory: () => false, isSymbolicLink: () => false, }, - } as AbsoluteEntry); + }) as AbsoluteEntry; ctx.dir = (path) => ({ @@ -50,7 +50,7 @@ test.before.each(async (ctx) => { isDirectory: () => true, isSymbolicLink: () => false, }, - } as AbsoluteEntry); + }) as AbsoluteEntry; ctx.symlink = (path) => ({ @@ -60,7 +60,7 @@ test.before.each(async (ctx) => { isDirectory: () => false, isSymbolicLink: () => true, }, - } as AbsoluteEntry); + }) as AbsoluteEntry; } catch (error) { // Uvu has a bug where it silently ignores failures in before and after, // see https://github.com/lukeed/uvu/issues/191. @@ -224,7 +224,7 @@ test('stress test', async ({rig, file, dir}) => { shuffle(entries); await deleteEntries(entries); await Promise.all( - entries.map(async (entry) => assert.not(await rig.exists(entry.path))) + entries.map(async (entry) => assert.not(await rig.exists(entry.path))), ); }); diff --git a/src/test/diagnostic.test.ts b/src/test/diagnostic.test.ts index 9c2be04fc..64a771725 100644 --- a/src/test/diagnostic.test.ts +++ b/src/test/diagnostic.test.ts @@ -17,7 +17,7 @@ function assertSquiggleAndPosition( indent, }: {offset: number; length: number; contents: string; indent?: number}, expectedSquiggle: string, - expectedPosition: Position + expectedPosition: Position, ) { const squiggle = drawSquiggle( { @@ -27,15 +27,15 @@ function assertSquiggleAndPosition( contents, }, }, - indent ?? 0 + indent ?? 0, ); const position = OffsetToPositionConverter.createUncachedForTest(contents).toPosition( - offset + offset, ); if (expectedSquiggle[0] !== '\n') { throw new Error( - `Test authoring error: write the expected squiggle as a template string with a leading newline.` + `Test authoring error: write the expected squiggle as a template string with a leading newline.`, ); } assert.equal(removeAnsiColors(squiggle), expectedSquiggle.slice(1)); @@ -52,7 +52,7 @@ test('drawing squiggles under ranges in single-line files', () => { ` H `, - {line: 1, character: 1} + {line: 1, character: 1}, ); assertSquiggleAndPosition( @@ -64,7 +64,7 @@ H ` aaabbbccc ~~~`, - {line: 1, character: 4} + {line: 1, character: 4}, ); assertSquiggleAndPosition( @@ -77,7 +77,7 @@ aaabbbccc ` aaabbbccc ~~~`, - {line: 1, character: 4} + {line: 1, character: 4}, ); }); @@ -91,7 +91,7 @@ test('drawing squiggles single-line ranges at the end of multi-line files', () = ` H `, - {line: 2, character: 1} + {line: 2, character: 1}, ); assertSquiggleAndPosition( @@ -103,7 +103,7 @@ H ` H ~`, - {line: 2, character: 1} + {line: 2, character: 1}, ); assertSquiggleAndPosition( @@ -115,7 +115,7 @@ H ` H ~`, - {line: 2, character: 1} + {line: 2, character: 1}, ); assertSquiggleAndPosition( @@ -123,7 +123,7 @@ H ` aaabbbccc ~~~`, - {line: 2, character: 4} + {line: 2, character: 4}, ); assertSquiggleAndPosition( @@ -137,7 +137,7 @@ aaabbbccc ` aaabbbccc ~~~`, - {line: 2, character: 4} + {line: 2, character: 4}, ); }); @@ -151,7 +151,7 @@ test('drawing squiggles under multi-line ranges', () => { ` H `, - {line: 1, character: 1} + {line: 1, character: 1}, ); assertSquiggleAndPosition( @@ -163,7 +163,7 @@ H ` H ~`, - {line: 1, character: 1} + {line: 1, character: 1}, ); assertSquiggleAndPosition( @@ -175,7 +175,7 @@ H ` aaabbbccc ~~~`, - {line: 1, character: 4} + {line: 1, character: 4}, ); assertSquiggleAndPosition( @@ -188,7 +188,7 @@ aaabbbccc ` aaabbbccc ~~~`, - {line: 1, character: 4} + {line: 1, character: 4}, ); }); @@ -198,7 +198,7 @@ test('drawing squiggles under one line of a multi-line input', () => { ` abc `, - {line: 1, character: 1} + {line: 1, character: 1}, ); assertSquiggleAndPosition( @@ -208,7 +208,7 @@ abc ~~~ def ~`, - {line: 1, character: 1} + {line: 1, character: 1}, ); // include the newline at the end of the first line @@ -219,7 +219,7 @@ abc ~~~ def `, - {line: 1, character: 1} + {line: 1, character: 1}, ); // include _only_ the newline at the end of the first line @@ -230,7 +230,7 @@ abc ${' '} def `, - {line: 1, character: 4} + {line: 1, character: 4}, ); assertSquiggleAndPosition( @@ -240,7 +240,7 @@ abc ${' '} def ~`, - {line: 1, character: 4} + {line: 1, character: 4}, ); assertSquiggleAndPosition( @@ -252,7 +252,7 @@ def ~~~ hij ~`, - {line: 1, character: 3} + {line: 1, character: 3}, ); }); diff --git a/src/test/errors-analysis.test.ts b/src/test/errors-analysis.test.ts index 80bff2870..c16da5257 100644 --- a/src/test/errors-analysis.test.ts +++ b/src/test/errors-analysis.test.ts @@ -59,9 +59,9 @@ test( ~~ ❌ package.json:3:10 This script is configured to run wireit but it has no config in the wireit section of this package.json file "a": "wireit" - ~~~~~~~~` + ~~~~~~~~`, ); - }) + }), ); test( @@ -88,9 +88,9 @@ test( ~~ ❌ package.json:3:10 This script is configured to run wireit but it has no config in the wireit section of this package.json file "a": "wireit" - ~~~~~~~~` + ~~~~~~~~`, ); - }) + }), ); test( @@ -116,9 +116,9 @@ test( ` ❌ package.json:7:23 Expected an array, but was object. "dependencies": {} - ~~` + ~~`, ); - }) + }), ); test( @@ -144,9 +144,9 @@ test( ` ❌ package.json:8:9 Expected a string or object, but was array. [] - ~~` + ~~`, ); - }) + }), ); test(`dependencies.script is not a string (object form)`, async ({rig}) => { @@ -172,7 +172,7 @@ test(`dependencies.script is not a string (object form)`, async ({rig}) => { ` ❌ package.json:9:21 Expected a string, but was array. "script": [] - ~~` + ~~`, ); }); @@ -199,9 +199,9 @@ test( ` ❌ package.json:8:9 Expected this field to be nonempty " " - ~~~` + ~~~`, ); - }) + }), ); test(`dependencies.script is empty or blank (object form)`, async ({rig}) => { @@ -232,7 +232,7 @@ test(`dependencies.script is empty or blank (object form)`, async ({rig}) => { ` ❌ package.json:14:21 Expected this field to be nonempty "script": "" - ~~` + ~~`, ); }); @@ -260,7 +260,7 @@ test(`dependencies.script is missing (object form)`, async ({rig}) => { ` ❌ package.json:13:9 Dependency object must set a "script" property. {} - ~~` + ~~`, ); }); @@ -287,9 +287,9 @@ test( ` ❌ package.json:7:18 Expected a string, but was array. "command": [] - ~~` + ~~`, ); - }) + }), ); test( @@ -315,9 +315,9 @@ test( ` ❌ package.json:7:18 Expected this field to be nonempty "command": "" - ~~` + ~~`, ); - }) + }), ); test( @@ -344,9 +344,9 @@ test( ` ❌ package.json:8:16 Expected an array, but was object. "files": {} - ~~` + ~~`, ); - }) + }), ); test( @@ -373,9 +373,9 @@ test( ` ❌ package.json:9:9 Expected a string, but was number. 0 - ~` + ~`, ); - }) + }), ); test( @@ -402,9 +402,9 @@ test( ` ❌ package.json:9:9 Expected this field to be nonempty "" - ~~` + ~~`, ); - }) + }), ); test( @@ -431,9 +431,9 @@ test( ` ❌ package.json:8:17 Expected an array, but was object. "output": {} - ~~` + ~~`, ); - }) + }), ); test( @@ -460,9 +460,9 @@ test( ` ❌ package.json:9:9 Expected a string, but was number. 0 - ~` + ~`, ); - }) + }), ); test( @@ -489,9 +489,9 @@ test( ` ❌ package.json:9:9 Expected this field to be nonempty " \\t\\n " - ~~~~~~~~` + ~~~~~~~~`, ); - }) + }), ); test( @@ -518,9 +518,9 @@ test( ` ❌ package.json:8:16 The "clean" property must be either true, false, or "if-file-deleted". "clean": 0 - ~` + ~`, ); - }) + }), ); test( @@ -547,9 +547,9 @@ test( ` ❌ package.json:8:36 Must be true or false "allowUsuallyExcludedPaths": 1 - ~` + ~`, ); - }) + }), ); test( @@ -576,9 +576,9 @@ test( ` ❌ package.json:8:23 Expected an array, but was number. "packageLocks": 0 - ~` + ~`, ); - }) + }), ); test( @@ -605,9 +605,9 @@ test( ` ❌ package.json:9:9 Expected a string, but was number. 0 - ~` + ~`, ); - }) + }), ); test( @@ -634,9 +634,9 @@ test( ` ❌ package.json:9:9 Expected this field to be nonempty " " - ~~~` + ~~~`, ); - }) + }), ); test( @@ -663,9 +663,9 @@ test( ` ❌ package.json:9:9 A package lock must be a filename, not a path "../package-lock.json" - ~~~~~~~~~~~~~~~~~~~~~~` + ~~~~~~~~~~~~~~~~~~~~~~`, ); - }) + }), ); test( @@ -691,9 +691,9 @@ test( ` ❌ package.json:8:9 Cannot find script named "missing" in package "${rig.temp}" "missing" - ~~~~~~~~~` + ~~~~~~~~~`, ); - }) + }), ); test( @@ -721,12 +721,12 @@ test( done.stderr, ` ❌ package.json:8:18 Cannot find script named "missing" in package "${rig.resolve( - 'child' + 'child', )}" "./child:missing" - ~~~~~~~` + ~~~~~~~`, ); - }) + }), ); test( @@ -754,12 +754,12 @@ test( done.stderr, ` ❌ package.json:9:30 Cannot find script named "missing" in package "${rig.resolve( - 'child' + 'child', )}" "script": "./child:missing" - ~~~~~~~` + ~~~~~~~`, ); - }) + }), ); test( @@ -785,9 +785,9 @@ test( ` ❌ package.json:8:9 Cannot find script named "test:missing" in package "${rig.temp}" "test:missing" - ~~~~~~~~~~~~~~` + ~~~~~~~~~~~~~~`, ); - }) + }), ); test( 'missing cross package dependency with complicated escaped names', @@ -818,12 +818,12 @@ test( done.stderr, String.raw` ❌ package.json:8:23 Cannot find script named "mis\t\\ sing" in package "${rig.resolve( - 'ch\t\\ ild' + 'ch\t\\ ild', )}" "./ch\t\\ ild:mis\t\\ sing" - ~~~~~~~~~~~~` + ~~~~~~~~~~~~`, ); - }) + }), ); test( @@ -848,12 +848,12 @@ test( done.stderr, String.raw` ❌ package.json:8:10 package.json file missing: "${rig.resolve( - 'b\t\\ ar/package.json' + 'b\t\\ ar/package.json', )}" "../b\t\\ ar:b" - ~~~~~~~~~~~` + ~~~~~~~~~~~`, ); - }) + }), ); test( @@ -884,9 +884,9 @@ test( package.json:9:9 The dependency was first listed here. "b", - ~~~` + ~~~`, ); - }) + }), ); test( @@ -921,9 +921,9 @@ test( package.json:12:5 The wireit config is here. "b": { ~~~ -`.trimStart() +`.trimStart(), ); - }) + }), ); test( @@ -946,9 +946,9 @@ test( ❌ package.json:3:10 This script is configured to run wireit but it has no config in the wireit section of this package.json file "a": "wireit" ~~~~~~~~ -` +`, ); - }) + }), ); test( @@ -972,9 +972,9 @@ test( ` ❌ package.json:6:5 A wireit config must set at least one of "command", "dependencies", or "files". Otherwise there is nothing for wireit to do. "a": {} - ~~~` + ~~~`, ); - }) + }), ); test( @@ -1001,9 +1001,9 @@ test( ` ❌ package.json:6:5 A wireit config must set at least one of "command", "dependencies", or "files". Otherwise there is nothing for wireit to do. "a": { - ~~~` + ~~~`, ); - }) + }), ); test( @@ -1030,9 +1030,9 @@ test( ❌ package.json:8:9 Cross-package dependency must use syntax ":", but there's no ":" character in "../foo". "../foo" ~~~~~~~~ -` +`, ); - }) + }), ); test( @@ -1059,9 +1059,9 @@ test( ❌ package.json:8:9 Cross-package dependency must use syntax ":", but there's no script name in "../foo:". "../foo:" ~~~~~~~~~ -` +`, ); - }) + }), ); test( @@ -1088,9 +1088,9 @@ test( ❌ package.json:8:9 Cross-package dependency ".:b" resolved to the same package. ".:b" ~~~~~ -` +`, ); - }) + }), ); test( @@ -1117,9 +1117,9 @@ test( ❌ package.json:8:9 Cross-package dependency "../foo:b" resolved to the same package. "../foo:b" ~~~~~~~~~~ -` +`, ); - }) + }), ); test( @@ -1144,12 +1144,12 @@ test( done.stderr, ` ❌ package.json:8:10 package.json file missing: "${rig.resolve( - 'bar/package.json' + 'bar/package.json', )}" "../bar:b" - ~~~~~~` + ~~~~~~`, ); - }) + }), ); test( @@ -1180,9 +1180,9 @@ test( ❌ ..${pathlib.sep}bar${pathlib.sep}package.json:1:16 JSON syntax error {"scripts": {},} ~ -` +`, ); - }) + }), ); test( @@ -1217,9 +1217,9 @@ test( package.json:8:9 "a" points back to "a" "a" ~~~ -` +`, ); - }) + }), ); test( @@ -1262,9 +1262,9 @@ test( package.json:14:9 "b" points back to "a" "a" ~~~ -` +`, ); - }) + }), ); test( @@ -1315,9 +1315,9 @@ test( package.json:20:9 "c" points back to "a" "a" ~~~ -` +`, ); - }) + }), ); test( @@ -1356,9 +1356,9 @@ test( package.json:9:9 "a" points back to "a" "a", ~~~ - ` + `, ); - }) + }), ); test( @@ -1416,9 +1416,9 @@ test( package.json:28:9 "d" points back to "b" "b" - ~~~` + ~~~`, ); - }) + }), ); test( @@ -1477,9 +1477,9 @@ test( package.json:28:9 "d" points back to "b" "b" ~~~ - ` + `, ); - }) + }), ); test( @@ -1540,9 +1540,9 @@ test( package.json:28:9 "d" points back to "b" "b" ~~~ - ` + `, ); - }) + }), ); test( @@ -1591,9 +1591,9 @@ test( ..${pathlib.sep}bar${pathlib.sep}package.json:8:9 "b" points back to "../foo:a" "../foo:a" ~~~~~~~~~~ -` +`, ); - }) + }), ); test( @@ -1627,9 +1627,9 @@ test( ~~~ ❌ package.json:16:5 A wireit config must set at least one of "command", "dependencies", or "files". Otherwise there is nothing for wireit to do. "c": {} - ~~~` + ~~~`, ); - }) + }), ); test(`we don't produce a duplicate analysis error for the same dependency`, async ({ @@ -1667,7 +1667,7 @@ test(`we don't produce a duplicate analysis error for the same dependency`, asyn ` ❌ package.json:26:18 Expected a string, but was object. "command": {} - ~~` + ~~`, ); }); @@ -1693,10 +1693,10 @@ test(`we don't produce a duplicate not found error when there's multiple deps in done.stderr, ` ❌ package.json:8:10 package.json file missing: "${rig.resolve( - 'child/package.json' + 'child/package.json', )}" "./child:error1", - ~~~~~~~` + ~~~~~~~`, ); }); @@ -1728,10 +1728,10 @@ test(`we don't produce a duplicate error when there's multiple deps into the sam "scripts": "bad" ~~~~~ ❌ package.json:8:18 Cannot find script named "error1" in package "${rig.resolve( - 'child' + 'child', )}" "./child:error1", - ~~~~~~` + ~~~~~~`, ); }); @@ -1773,7 +1773,7 @@ test(`we don't produce a duplicate error when there's multiple deps on a script done.stderr, ` ❌ [errors] exited with exit code 1. -❌ 1 script failed.` +❌ 1 script failed.`, ); }); @@ -1805,7 +1805,7 @@ test(`repro an issue with looking for a colon in missing dependency`, async ({ ` ❌ package.json:9:9 Cannot find script named "c" in package "${rig.temp}" "c" - ~~~` + ~~~`, ); }); @@ -1841,9 +1841,9 @@ test( "foo" ~~~~~~~~~~~~~ ] - ~~~~~~~` + ~~~~~~~`, ); - }) + }), ); test( @@ -1870,9 +1870,9 @@ test( ` ❌ package.json:8:18 The "service" property must be either true, false, or an object. "service": 1 - ~` + ~`, ); - }) + }), ); test( @@ -1903,9 +1903,9 @@ test( ` ❌ package.json:8:18 A "service" script must have a "command". "service": true, - ~~~~` + ~~~~`, ); - }) + }), ); test( @@ -1937,9 +1937,9 @@ test( "foo" ~~~~~~~~~~~~~ ] - ~~~~~~~` + ~~~~~~~`, ); - }) + }), ); test( @@ -1974,9 +1974,9 @@ test( ` ❌ package.json:11:22 The "cascade" property must be either true or false. "cascade": 1 - ~` + ~`, ); - }) + }), ); test( @@ -2009,9 +2009,9 @@ test( "readyWhen": 1 ~~~~~~~~~~~~~~~~~~~~~~ } - ~~~~~~~` + ~~~~~~~`, ); - }) + }), ); test( @@ -2042,9 +2042,9 @@ test( ` ❌ package.json:10:26 Expected a string. "lineMatches": 1 - ~` + ~`, ); - }) + }), ); test( @@ -2075,9 +2075,9 @@ test( ` ❌ package.json:10:26 SyntaxError: Invalid regular expression: /invalid[/: Unterminated character class "lineMatches": "invalid[" - ~~~~~~~~~~` + ~~~~~~~~~~`, ); - }) + }), ); test( @@ -2104,9 +2104,9 @@ test( ` ❌ package.json:8:14 Expected an object "env": [] - ~~` + ~~`, ); - }) + }), ); test( @@ -2135,9 +2135,9 @@ test( ` ❌ package.json:9:16 Expected a string or object "FOO": 1 - ~` + ~`, ); - }) + }), ); test( @@ -2172,9 +2172,9 @@ test( "EXTERNAL": true ~~~~~~~~~~~~~~~~~~~~~~~~~~ } - ~~~~~~~~~` + ~~~~~~~~~`, ); - }) + }), ); test( @@ -2205,9 +2205,9 @@ test( ` ❌ package.json:10:23 Expected "external" to be true "external": false - ~~~~~` + ~~~~~`, ); - }) + }), ); test( @@ -2240,9 +2240,9 @@ test( "FOO": "foo" ~~~~~~~~~~~~~~~~~~~~ } - ~~~~~~~` + ~~~~~~~`, ); - }) + }), ); test.run(); diff --git a/src/test/errors-usage.test.ts b/src/test/errors-usage.test.ts index b2622faef..ae0be12ef 100644 --- a/src/test/errors-usage.test.ts +++ b/src/test/errors-usage.test.ts @@ -40,7 +40,7 @@ test( 'invoked directly', timeout(async ({rig}) => { const result = rig.exec( - `node ${pathlib.join('..', '..', 'bin', 'wireit.js')}` + `node ${pathlib.join('..', '..', 'bin', 'wireit.js')}`, ); const done = await result.exit; assert.equal(done.code, 1); @@ -48,9 +48,9 @@ test( done.stderr, ` ❌ wireit must be launched with "npm run" or a compatible command. - More info: Wireit could not identify the script to run.`.trim() + More info: Wireit could not identify the script to run.`.trim(), ); - }) + }), ); test( @@ -70,9 +70,9 @@ test( done.stderr, ` ❌ wireit must be launched with "npm run" or a compatible command. - More info: ${detail}`.trim() + More info: ${detail}`.trim(), ); - }) + }), ); test( @@ -94,9 +94,9 @@ test( assert.match( done.stderr, ` -❌ [main] Invalid usage: Expected the WIREIT_PARALLEL env variable to be a positive integer, got "-1"`.trim() +❌ [main] Invalid usage: Expected the WIREIT_PARALLEL env variable to be a positive integer, got "-1"`.trim(), ); - }) + }), ); test( @@ -118,9 +118,9 @@ test( assert.match( done.stderr, ` -❌ [main] Invalid usage: Expected the WIREIT_PARALLEL env variable to be a positive integer, got "0"`.trim() +❌ [main] Invalid usage: Expected the WIREIT_PARALLEL env variable to be a positive integer, got "0"`.trim(), ); - }) + }), ); test( @@ -144,9 +144,9 @@ test( assert.match( done.stderr, ` -❌ [main] Invalid usage: Expected the WIREIT_PARALLEL env variable to be a positive integer, got "aklsdjflajsdkflj"`.trim() +❌ [main] Invalid usage: Expected the WIREIT_PARALLEL env variable to be a positive integer, got "aklsdjflajsdkflj"`.trim(), ); - }) + }), ); test( @@ -170,9 +170,9 @@ test( assert.match( done.stderr, ` -❌ [main] Invalid usage: Expected the WIREIT_CACHE env variable to be "local", "github", or "none", got "aklsdjflajsdkflj"`.trim() +❌ [main] Invalid usage: Expected the WIREIT_CACHE env variable to be "local", "github", or "none", got "aklsdjflajsdkflj"`.trim(), ); - }) + }), ); test( @@ -196,9 +196,9 @@ test( assert.match( done.stderr, ` -❌ [main] Invalid usage: Expected the WIREIT_FAILURES env variable to be "no-new", "continue", or "kill", got "aklsdjflajsdkflj"`.trim() +❌ [main] Invalid usage: Expected the WIREIT_FAILURES env variable to be "no-new", "continue", or "kill", got "aklsdjflajsdkflj"`.trim(), ); - }) + }), ); test( @@ -226,9 +226,9 @@ test( assert.match( done.stderr, ` -❌ [main] Invalid usage: The ACTIONS_CACHE_URL variable was not set, but is required when WIREIT_CACHE=github. Use the google/wireit@setup-github-cache/v1 action to automatically set environment variables.`.trim() +❌ [main] Invalid usage: The ACTIONS_CACHE_URL variable was not set, but is required when WIREIT_CACHE=github. Use the google/wireit@setup-github-cache/v1 action to automatically set environment variables.`.trim(), ); - }) + }), ); test( @@ -256,9 +256,9 @@ test( assert.match( done.stderr, ` -❌ [main] Invalid usage: The ACTIONS_CACHE_URL must end in a forward-slash, got "http://example.com".`.trim() +❌ [main] Invalid usage: The ACTIONS_CACHE_URL must end in a forward-slash, got "http://example.com".`.trim(), ); - }) + }), ); test( @@ -286,9 +286,9 @@ test( assert.match( done.stderr, ` -❌ [main] Invalid usage: The ACTIONS_RUNTIME_TOKEN variable was not set, but is required when WIREIT_CACHE=github. Use the google/wireit@setup-github-cache/v1 action to automatically set environment variables.`.trim() +❌ [main] Invalid usage: The ACTIONS_RUNTIME_TOKEN variable was not set, but is required when WIREIT_CACHE=github. Use the google/wireit@setup-github-cache/v1 action to automatically set environment variables.`.trim(), ); - }) + }), ); test.run(); diff --git a/src/test/failures.test.ts b/src/test/failures.test.ts index f97613310..8469b1ff6 100644 --- a/src/test/failures.test.ts +++ b/src/test/failures.test.ts @@ -63,7 +63,7 @@ test( assert.equal(cmdA.numInvocations, 1); assert.match(res.stdout, 'a stdout'); assert.match(res.stderr, 'a stderr'); - }) + }), ); test( @@ -99,7 +99,7 @@ test( assert.equal(cmdA.numInvocations, 1); assert.match(res.stdout, 'a stdout'); assert.match(res.stderr, 'a stderr'); - }) + }), ); test( @@ -144,7 +144,7 @@ test( assert.equal(cmdA.numInvocations, 0); assert.equal(cmdB.numInvocations, 1); assert.equal(cmdC.numInvocations, 1); - }) + }), ); test( @@ -195,7 +195,7 @@ test( assert.equal(cmdB.numInvocations, 0); assert.equal(cmdC.numInvocations, 1); assert.equal(cmdD.numInvocations, 1); - }) + }), ); for (const envSetting of ['no-new', undefined]) { @@ -311,7 +311,7 @@ for (const envSetting of ['no-new', undefined]) { assert.equal(failParentBlocker.numInvocations, 1); assert.equal(cancel.numInvocations, 0); assert.equal(cancelBlocker.numInvocations, 1); - }) + }), ); } @@ -376,7 +376,7 @@ test( assert.equal(a.numInvocations, 0); assert.equal(b.numInvocations, 1); } - }) + }), ); test( @@ -448,7 +448,7 @@ test( assert.equal(fail.numInvocations, 1); assert.equal(continues.numInvocations, 1); assert.equal(continuesBlocker.numInvocations, 1); - }) + }), ); test( @@ -501,7 +501,7 @@ test( // `kill` is killed. assert.equal((await wireit.exit).code, 1); - }) + }), ); test.run(); diff --git a/src/test/freshness.test.ts b/src/test/freshness.test.ts index eeb691eab..421e9371b 100644 --- a/src/test/freshness.test.ts +++ b/src/test/freshness.test.ts @@ -74,7 +74,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); } - }) + }), ); test( @@ -119,7 +119,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -165,7 +165,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -210,7 +210,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -267,7 +267,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -312,7 +312,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); } - }) + }), ); test( @@ -357,7 +357,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -402,7 +402,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -463,7 +463,7 @@ test( assert.equal(cmdA.numInvocations, 1); assert.equal(cmdC.numInvocations, 1); } - }) + }), ); test( @@ -502,7 +502,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); } - }) + }), ); test( @@ -543,7 +543,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); } - }) + }), ); test( @@ -632,7 +632,7 @@ test( assert.equal(cmdA.numInvocations, 3); assert.equal(cmdB.numInvocations, 2); } - }) + }), ); test( @@ -685,7 +685,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -756,7 +756,7 @@ test( assert.equal(cmdB.numInvocations, 2); assert.equal(cmdC.numInvocations, 2); } - }) + }), ); test( @@ -801,7 +801,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -858,7 +858,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -904,9 +904,9 @@ test( '.wireit', // Buffer.from(name).toString('hex') 'f09f94a53c3e3a2f5c7c3f2a', - 'fingerprint' - ) - ) + 'fingerprint', + ), + ), ); // No input file changed, so script is fresh, and command is not invoked. @@ -916,7 +916,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); } - }) + }), ); test( @@ -959,7 +959,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -1028,7 +1028,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 3); } - }) + }), ); test( @@ -1107,7 +1107,7 @@ test( assert.equal(cmdA.numInvocations, 3); assert.equal(cmdB.numInvocations, 2); } - }) + }), ); test( @@ -1162,7 +1162,7 @@ test( assert.equal(cmdA.numInvocations, 2); assert.equal(cmdB.numInvocations, 2); } - }) + }), ); test( @@ -1223,7 +1223,7 @@ test( assert.equal(cmdA1.numInvocations, 1); assert.equal(cmdA2.numInvocations, 1); } - }) + }), ); test( @@ -1280,7 +1280,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -1338,7 +1338,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -1396,7 +1396,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); } - }) + }), ); test( @@ -1504,7 +1504,7 @@ test( assert.equal(cmdE.numInvocations, 1); assert.equal(cmdF.numInvocations, 1); } - }) + }), ); for (const [agent, lockfile] of [ @@ -1580,7 +1580,7 @@ for (const [agent, lockfile] of [ assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 3); } - }) + }), ); } @@ -1633,7 +1633,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 1); } - }) + }), ); test( @@ -1687,7 +1687,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -1753,7 +1753,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 3); } - }) + }), ); test( @@ -1798,7 +1798,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test( @@ -1849,7 +1849,7 @@ test( assert.equal((await exec.exit).code, 0); assert.equal(consumer.numInvocations, 2); } - }) + }), ); test( @@ -1950,7 +1950,7 @@ test( assert.equal((await exec.exit).code, 0); assert.equal(main.numInvocations, 2); } - }) + }), ); test( @@ -2004,7 +2004,7 @@ test( assert.equal(res.code, 0); assert.equal(cmdA.numInvocations, 2); } - }) + }), ); test.run(); diff --git a/src/test/gc.test.ts b/src/test/gc.test.ts index bf0439494..455752a7a 100644 --- a/src/test/gc.test.ts +++ b/src/test/gc.test.ts @@ -64,7 +64,7 @@ test.after.each(async (ctx) => { }); async function retryWithGcUntilCallbackDoesNotThrow( - cb: () => void + cb: () => void, ): Promise { for (const wait of [0, 10, 100, 500, 1000]) { global.gc(); @@ -100,7 +100,7 @@ test( const logger = new DefaultLogger(rig.temp); const script = await new Analyzer('npm').analyze( {packageDir: rig.temp, name: 'standard'}, - [] + [], ); if (!script.config.ok) { for (const error of script.config.error) { @@ -120,7 +120,7 @@ test( undefined, 'no-new', undefined, - true + true, ); const resultPromise = executor.execute(); assert.ok(numLiveExecutors >= 1); @@ -142,7 +142,7 @@ test( assert.equal(numLiveExecutions, 1); }); assert.equal(standard.numInvocations, numIterations); - }) + }), ); test( @@ -166,7 +166,7 @@ test( const logger = new DefaultLogger(rig.temp); const script = await new Analyzer('npm').analyze( {packageDir: rig.temp, name: 'service'}, - [] + [], ); if (!script.config.ok) { for (const error of script.config.error) { @@ -187,7 +187,7 @@ test( undefined, 'no-new', previousServices, - true + true, ); const resultPromise = executor.execute(); assert.ok(numLiveExecutors >= 1); @@ -216,7 +216,7 @@ test( assert.equal(numLiveExecutions, 1); }); assert.equal(service.numInvocations, 1); - }) + }), ); test( @@ -256,7 +256,7 @@ test( const logger = new DefaultLogger(rig.temp); const script = await new Analyzer('npm').analyze( {packageDir: rig.temp, name: 'entrypoint'}, - [] + [], ); if (!script.config.ok) { for (const error of script.config.error) { @@ -277,7 +277,7 @@ test( undefined, 'no-new', previousServices, - true + true, ); const resultPromise = executor.execute(); assert.ok(numLiveExecutors >= 1); @@ -310,7 +310,7 @@ test( assert.equal(standard.numInvocations, numIterations); assert.equal(servicePersistent.numInvocations, 1); assert.equal(serviceEphemeral.numInvocations, numIterations); - }) + }), ); test.run(); diff --git a/src/test/glob.test.ts b/src/test/glob.test.ts index 16bf370db..983c78a21 100644 --- a/src/test/glob.test.ts +++ b/src/test/glob.test.ts @@ -115,7 +115,7 @@ test.before.each(async (ctx) => { // We need ignoreInitial=false because we need the initial "add" // events to find out what chokidar has found (we usually only care // about changes, not initial files). - false + false, ); watcher.on('add', (path) => { actual.push(rig.resolve(path)); @@ -123,7 +123,7 @@ test.before.each(async (ctx) => { await new Promise((resolve) => watcher.on('ready', () => { resolve(); - }) + }), ); await watcher.close(); } @@ -175,7 +175,7 @@ for (const mode of ['once', 'watch'] as const) { files: ['foo'], patterns: ['foo/'], expected: ['foo'], - }) + }), ); test(`[${mode}] normalizes ../ in pattern`, ({check}) => @@ -310,7 +310,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: ['foo'], expected: ['foo'], includeDirectories: true, - }) + }), ); test(`[${mode}] * star excludes directory when includeDirectories=false`, ({ @@ -332,7 +332,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: ['*'], expected: ['foo'], includeDirectories: true, - }) + }), ); skipIfWatch( @@ -353,7 +353,7 @@ for (const mode of ['once', 'watch'] as const) { expected: [], includeDirectories: false, expandDirectories: false, - }) + }), ); skipIfWatch( @@ -374,7 +374,7 @@ for (const mode of ['once', 'watch'] as const) { expected: ['foo'], includeDirectories: true, expandDirectories: false, - }) + }), ); test(`[${mode}] includeDirectories=false + expandDirectories=true`, ({ @@ -415,7 +415,7 @@ for (const mode of ['once', 'watch'] as const) { ], includeDirectories: true, expandDirectories: true, - }) + }), ); skipIfWatch( @@ -442,7 +442,7 @@ for (const mode of ['once', 'watch'] as const) { expected: ['foo', 'foo/1', 'foo/2', 'foo/baz'], includeDirectories: true, expandDirectories: true, - }) + }), ); skipIfWatch( @@ -462,7 +462,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: ['.'], expected: ['.'], includeDirectories: true, - }) + }), ); test(`[${mode}] . matches current directory with expandDirectories=true`, ({ @@ -483,7 +483,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: ['{foo,baz}'], expected: ['foo/1', 'foo/2', 'foo/bar/1', 'foo/bar/2'], expandDirectories: true, - }) + }), ); skipIfWatch(`[${mode}] empty pattern throws`, ({check}) => @@ -492,7 +492,7 @@ for (const mode of ['once', 'watch'] as const) { files: ['foo', 'bar'], patterns: [''], expected: 'ERROR', - }) + }), ); skipIfWatch( @@ -504,7 +504,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: [''], expected: 'ERROR', expandDirectories: true, - }) + }), ); skipIfWatch(`[${mode}] whitespace pattern throws`, ({check}) => @@ -513,7 +513,7 @@ for (const mode of ['once', 'watch'] as const) { files: ['foo', 'bar'], patterns: [' '], expected: 'ERROR', - }) + }), ); skipIfWatch( @@ -525,7 +525,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: [' '], expected: 'ERROR', expandDirectories: true, - }) + }), ); skipIfWatchOnWindows(`[${mode}] re-inclusion of file`, ({check}) => @@ -534,7 +534,7 @@ for (const mode of ['once', 'watch'] as const) { files: ['foo'], patterns: ['!foo', 'foo'], expected: ['foo'], - }) + }), ); skipIfWatch(`[${mode}] re-inclusion of directory`, ({check}) => @@ -544,7 +544,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: ['!foo', 'foo'], expected: ['foo'], includeDirectories: true, - }) + }), ); skipIfWatch(`[${mode}] re-inclusion of file into directory`, ({check}) => @@ -553,7 +553,7 @@ for (const mode of ['once', 'watch'] as const) { files: ['foo/1', 'foo/bar/1', 'foo/bar/baz', 'foo/qux'], patterns: ['foo/**', '!foo/bar/**', 'foo/bar/baz', '!foo/qux'], expected: ['foo/1', 'foo/bar/baz'], - }) + }), ); test(`[${mode}] re-inclusion of file into directory with expandDirectories=true`, ({ @@ -591,7 +591,7 @@ for (const mode of ['once', 'watch'] as const) { expected: ['target', 'target/foo', 'symlink', 'symlink/foo'], includeDirectories: true, followSymlinks: true, - }) + }), ); skipIfWatch( @@ -607,7 +607,7 @@ for (const mode of ['once', 'watch'] as const) { expected: ['target', 'target/foo', 'symlink'], includeDirectories: true, followSymlinks: false, - }) + }), ); test(`[${mode}] dirent tags files`, async ({rig}) => { @@ -778,7 +778,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: ['../foo'], expected: 'ERROR', throwIfOutsideCwd: true, - }) + }), ); skipIfWatch( @@ -791,7 +791,7 @@ for (const mode of ['once', 'watch'] as const) { patterns: ['../foo'], expected: ['foo'], throwIfOutsideCwd: false, - }) + }), ); test(`[${mode}] allows path inside cwd when throwIfOutsideCwd=true`, ({ diff --git a/src/test/ide.test.ts b/src/test/ide.test.ts index 6ab69b90f..1b8e06e63 100644 --- a/src/test/ide.test.ts +++ b/src/test/ide.test.ts @@ -40,7 +40,7 @@ test.after.each(async (ctx) => { async function assertDiagnostics( ide: IdeAnalyzer, - expected: Record + expected: Record, ) { const actual = {} as Record; const byFile = await ide.getDiagnostics(); @@ -68,7 +68,7 @@ test('changing a file gives us new diagnostics', async ({rig}) => { await assertDiagnostics(ide, {}); ide.setOpenFileContents( rig.resolve(`package.json`), - `{"scripts": {"bad": []}}` + `{"scripts": {"bad": []}}`, ); await assertDiagnostics(ide, { [rig.resolve(`package.json`)]: ['Expected a string, but was array.'], @@ -87,7 +87,7 @@ test('the overlay filesystem overrides the regular one', async ({rig}) => { dependencies: ['./child:b'], }, }, - }) + }), ); await assertDiagnostics(ide, { [rig.resolve(`package.json`)]: [ @@ -99,11 +99,11 @@ test('the overlay filesystem overrides the regular one', async ({rig}) => { childPath, JSON.stringify({ scripts: {b: 'foo'}, - }) + }), ); assert.equal( [...ide.openFiles], - [rig.resolve('package.json'), rig.resolve('child/package.json')] + [rig.resolve('package.json'), rig.resolve('child/package.json')], ); await assertDiagnostics(ide, {}); // Replace the in-memory buffer with a file on disk. @@ -125,7 +125,7 @@ test('the overlay filesystem overrides the regular one', async ({rig}) => { dependencies: ['./child:c'], }, }, - }) + }), ); await assertDiagnostics(ide, {}); }); @@ -147,7 +147,7 @@ test('we can get cyclic dependency errors', async ({rig}) => { dependencies: ['a'], }, }, - }) + }), ); await assertDiagnostics(ide, { [rig.resolve('package.json')]: [`Cycle detected in dependencies of "a".`], @@ -166,7 +166,7 @@ async function assertDefinition( targetSelection: string; originSelection: string; }; - } + }, ) { const offset = options.contentsWithPipe.indexOf('|'); const contents = @@ -180,14 +180,14 @@ async function assertDefinition( const sourceConverter = OffsetToPositionConverter.get(sourceFile.jsonFile); const definitions = await ide.getDefinition( options.path, - sourceConverter.toIdePosition(offset) + sourceConverter.toIdePosition(offset), ); if (definitions === undefined) { if (options.expected === undefined) { return; // No definition, as expected. } throw new Error( - `Expected to find a definition matching \n${inspect(options.expected)}` + `Expected to find a definition matching \n${inspect(options.expected)}`, ); } // currently we always expect one definition @@ -195,11 +195,11 @@ async function assertDefinition( const definition = definitions[0]; if (options.expected === undefined) { throw new Error( - `Expected no definition, but got one: ${inspect(definition)}` + `Expected no definition, but got one: ${inspect(definition)}`, ); } const targetFile = await ide.getPackageJsonForTest( - url.fileURLToPath(definition.targetUri) + url.fileURLToPath(definition.targetUri), ); if (targetFile === undefined) { throw new Error(`Could not load target file`); @@ -210,7 +210,7 @@ async function assertDefinition( file: targetFile.jsonFile, range: targetConverter.ideRangeToRange(definition.targetRange), }, - 0 + 0, ); assertSquiggleEquals(targetSquiggle, options.expected.target); @@ -219,11 +219,11 @@ async function assertDefinition( file: targetFile.jsonFile, range: targetConverter.ideRangeToRange(definition.targetSelectionRange), }, - 0 + 0, ); assertSquiggleEquals( targetSelectionSquiggle, - options.expected.targetSelection + options.expected.targetSelection, ); if (definition.originSelectionRange === undefined) { throw new Error(`No iriginSelectionRange returned`); @@ -233,11 +233,11 @@ async function assertDefinition( file: sourceFile.jsonFile, range: sourceConverter.ideRangeToRange(definition.originSelectionRange), }, - 2 + 2, ); assertSquiggleEquals( sourceSelectionSquiggle, - options.expected.originSelection + options.expected.originSelection, ); } @@ -269,7 +269,7 @@ test('we can get the definition for a same file dependency', async ({rig}) => { }, }, null, - 2 + 2, ), expected: { target: ` @@ -306,7 +306,7 @@ test(`we jump to the scripts section for a vanilla script`, async ({rig}) => { }, }, null, - 2 + 2, ), expected: { target: ` @@ -339,7 +339,7 @@ test('jump to definition from object style dependency', async ({rig}) => { }, }, null, - 2 + 2, ), expected: { target: ` @@ -376,7 +376,7 @@ test(`we don't get definitions for non-dep locations`, async ({rig}) => { }, }, null, - 2 + 2, ), expected: undefined, }); @@ -399,7 +399,7 @@ test(`we don't get definitions for non-dep locations`, async ({rig}) => { }, }, null, - 2 + 2, ), expected: undefined, }); @@ -421,7 +421,7 @@ test(`we don't get definitions for non-dep locations`, async ({rig}) => { }, }, null, - 2 + 2, ), expected: undefined, }); @@ -443,7 +443,7 @@ test(`we don't get definitions for non-dep locations`, async ({rig}) => { }, }, null, - 2 + 2, ), expected: undefined, }); @@ -466,7 +466,7 @@ test(`we can jump to definitions across files`, async ({rig}) => { }, }, null, - 2 + 2, ), expected: { target: ` @@ -502,7 +502,7 @@ test('can jump from scripts section to wireit config', async ({rig}) => { }, }, null, - 2 + 2, ), expected: { target: ` diff --git a/src/test/json-schema.test.ts b/src/test/json-schema.test.ts index f50ce7550..7db0cc7fd 100644 --- a/src/test/json-schema.test.ts +++ b/src/test/json-schema.test.ts @@ -20,10 +20,10 @@ const schema = JSON.parse( '..', '..', '..', - 'schema.json' + 'schema.json', ), - 'utf-8' - ) + 'utf-8', + ), ) as jsonSchema.Schema; const validator = new jsonSchema.Validator(); validator.addSchema(schema); @@ -36,7 +36,7 @@ function expectValidationErrors(packageJson: object, errors: string[]) { const validationResult = validator.validate(packageJson, schema); assert.equal( validationResult.errors.map((e) => e.toString()), - errors + errors, ); } @@ -128,7 +128,7 @@ test('clean can be either a boolean or the string if-file-deleted', () => { }, [ 'instance.wireit.a.clean is not one of enum values: true,false,if-file-deleted', - ] + ], ); }); @@ -141,7 +141,7 @@ test('command must not be empty', () => { }, }, }, - ['instance.wireit.a.command does not meet minimum length of 1'] + ['instance.wireit.a.command does not meet minimum length of 1'], ); }); @@ -160,7 +160,7 @@ test('dependencies[i] must not be empty', () => { // ourselves. [ 'instance.wireit.a.dependencies[0] is not any of [subschema 0],[subschema 1]', - ] + ], ); }); @@ -174,7 +174,7 @@ test('files[i] must not be empty', () => { }, }, }, - ['instance.wireit.a.files[0] does not meet minimum length of 1'] + ['instance.wireit.a.files[0] does not meet minimum length of 1'], ); }); @@ -188,7 +188,7 @@ test('output[i] must not be empty', () => { }, }, }, - ['instance.wireit.a.output[0] does not meet minimum length of 1'] + ['instance.wireit.a.output[0] does not meet minimum length of 1'], ); }); @@ -202,7 +202,7 @@ test('packageLocks[i] must not be empty', () => { }, }, }, - ['instance.wireit.a.packageLocks[0] does not meet minimum length of 1'] + ['instance.wireit.a.packageLocks[0] does not meet minimum length of 1'], ); }); @@ -216,7 +216,7 @@ test('dependencies must be an array of strings', () => { }, }, }, - ['instance.wireit.a.dependencies is not of a type(s) array'] + ['instance.wireit.a.dependencies is not of a type(s) array'], ); expectValidationErrors( @@ -230,7 +230,7 @@ test('dependencies must be an array of strings', () => { }, [ 'instance.wireit.a.dependencies[0] is not any of [subschema 0],[subschema 1]', - ] + ], ); }); @@ -246,7 +246,7 @@ test('dependencies[i].script is required', () => { }, [ 'instance.wireit.a.dependencies[0] is not any of [subschema 0],[subschema 1]', - ] + ], ); }); @@ -262,7 +262,7 @@ test('dependencies[i].cascade must be boolean', () => { }, [ 'instance.wireit.a.dependencies[0] is not any of [subschema 0],[subschema 1]', - ] + ], ); }); diff --git a/src/test/metrics.test.ts b/src/test/metrics.test.ts index 68c6ad819..3999ddbcc 100644 --- a/src/test/metrics.test.ts +++ b/src/test/metrics.test.ts @@ -109,7 +109,7 @@ test( percentCached: 50, }); } - }) + }), ); test( @@ -137,7 +137,7 @@ test( // There should be no metrics in the output. assert.equal([...stdout.matchAll(/🏁/gi)].length, 0); - }) + }), ); test( @@ -206,7 +206,7 @@ test( fresh: 1, percentFresh: 50, }); - }) + }), ); test( @@ -247,7 +247,7 @@ test( // There should only be one metrics entry in stdout. assert.equal([...stdout.matchAll(/\[metrics\]/gi)].length, 1); assertNthMetric(0, stdout, {total: 1, ran: 1, percentRan: 100}); - }) + }), ); /** @@ -264,7 +264,7 @@ function assertNthMetric( percentFresh?: number; cached?: number; percentCached?: number; - } + }, ): void { const metric = findNthMetric(n, stdout); diff --git a/src/test/optimize-mkdirs.test.ts b/src/test/optimize-mkdirs.test.ts index c2068786a..3214dfbd9 100644 --- a/src/test/optimize-mkdirs.test.ts +++ b/src/test/optimize-mkdirs.test.ts @@ -13,7 +13,7 @@ import {windowsifyPathIfOnWindows} from './util/windows.js'; const check = (input: string[], expected: string[]) => assert.equal( optimizeMkdirs(input.map(windowsifyPathIfOnWindows)).sort(), - expected.map(windowsifyPathIfOnWindows).sort() + expected.map(windowsifyPathIfOnWindows).sort(), ); test('empty', () => { diff --git a/src/test/parallelism.test.ts b/src/test/parallelism.test.ts index 4cb927eae..42c87be27 100644 --- a/src/test/parallelism.test.ts +++ b/src/test/parallelism.test.ts @@ -79,7 +79,7 @@ test( assert.equal(dep2.numInvocations, 1); assert.equal(main.numInvocations, 1); } - }) + }), ); test( @@ -132,7 +132,7 @@ test( assert.equal(dep1.numInvocations, 1); assert.equal(dep2.numInvocations, 1); assert.equal(main.numInvocations, 1); - }) + }), ); test( @@ -185,7 +185,7 @@ test( assert.equal(cmd.numInvocations, 1); } assert.equal(main.numInvocations, 1); - }) + }), ); test( @@ -223,7 +223,7 @@ test( assert.equal(dep1.numInvocations, 1); assert.equal(dep2.numInvocations, 1); assert.equal(main.numInvocations, 1); - }) + }), ); test( @@ -271,8 +271,8 @@ test( assert.equal(cmdA.numInvocations, concurrency); }, - IS_WINDOWS ? 60_000 : undefined - ) + IS_WINDOWS ? 60_000 : undefined, + ), ); test( @@ -305,7 +305,7 @@ test( assert.equal((await exec1.exit).code, 0); assert.equal((await exec2.exit).code, 0); assert.equal(cmdA.numInvocations, 2); - }) + }), ); test.run(); diff --git a/src/test/service.test.ts b/src/test/service.test.ts index 692d2fac3..79d0f1c14 100644 --- a/src/test/service.test.ts +++ b/src/test/service.test.ts @@ -69,7 +69,7 @@ test( const wireit = rig.exec('npm run consumer'); await wireit.waitForLog( - /50% \[1 \/ 2\] \[2 running\] \[1 service\] consumer/ + /50% \[1 \/ 2\] \[2 running\] \[1 service\] consumer/, ); // The service starts because the consumer depends on it @@ -95,7 +95,7 @@ test( assert.equal(service.numInvocations, 1); assert.equal(consumer.numInvocations, 1); await wireit.waitForLog(/✅ Ran 2 scripts and skipped 0 in/); - }) + }), ); test( @@ -184,7 +184,7 @@ test( assert.equal(serviceDep.numInvocations, 1); assert.equal(service.numInvocations, 1); assert.equal(consumer.numInvocations, 1); - }) + }), ); test( @@ -218,7 +218,7 @@ test( const wireit = rig.exec('npm run consumer'); await wireit.waitForLog( - /50% \[1 \/ 2\] \[2 running\] \[1 service\] consumer/ + /50% \[1 \/ 2\] \[2 running\] \[1 service\] consumer/, ); // Service starts @@ -238,7 +238,7 @@ test( // Wireit exits with an error code assert.equal((await wireit.exit).code, 1); await wireit.waitForLog(/❌ 2 scripts failed\./); - }) + }), ); test( @@ -298,7 +298,7 @@ test( }, }); await wireit.waitForLog( - /25% \[1 \/ 4\] \[3 running\] \[1 service\] (blocker|consumer1)/ + /25% \[1 \/ 4\] \[3 running\] \[1 service\] (blocker|consumer1)/, ); // Service starts @@ -325,7 +325,7 @@ test( // Consumer 2 can't start becuase the consumer already failed, so wireit // exits. assert.equal((await wireit.exit).code, 1); - }) + }), ); test( @@ -369,7 +369,7 @@ test( const wireit = rig.exec('npm run consumer'); await wireit.waitForLog( - /67% \[2 \/ 3\] \[3 running\] \[2 services\] consumer/ + /67% \[2 \/ 3\] \[3 running\] \[2 services\] consumer/, ); // Service2 starts @@ -398,7 +398,7 @@ test( assert.equal(service1.numInvocations, 1); assert.equal(service2.numInvocations, 1); await wireit.waitForLog(/❌ 2 scripts failed/); - }) + }), ); test( @@ -473,7 +473,7 @@ test( await wireit.exit; assert.equal(service1.numInvocations, 1); assert.equal(service2.numInvocations, 1); - }) + }), ); for (const failureMode of ['continue', 'no-new', 'kill']) { @@ -573,7 +573,7 @@ for (const failureMode of ['continue', 'no-new', 'kill']) { assert.equal(standard.numInvocations, 1); assert.equal(service1.numInvocations, 1); assert.equal(service2.numInvocations, 1); - }) + }), ); test( @@ -621,7 +621,7 @@ for (const failureMode of ['continue', 'no-new', 'kill']) { assert.equal((await wireit.exit).code, 1); await wireit.waitForLog(/❌ \[service1\] Service exited unexpectedly/); await wireit.waitForLog(/❌ 1 script failed/); - }) + }), ); } @@ -664,7 +664,7 @@ for (const failureMode of ['continue', 'no-new']) { env: {WIREIT_FAILURES: failureMode}, }); await wireit.waitForLog( - /50% \[1 \/ 2\] \[2 running\] \[1 service\] standard/ + /50% \[1 \/ 2\] \[2 running\] \[1 service\] standard/, ); const serviceInv = await service.nextInvocation(); const standardInv1 = await standard.nextInvocation(); @@ -685,7 +685,7 @@ for (const failureMode of ['continue', 'no-new']) { await wireit.exit; assert.equal(service.numInvocations, 1); assert.equal(standard.numInvocations, 2); - }) + }), ); } @@ -724,7 +724,7 @@ test( env: {WIREIT_FAILURES: 'kill'}, }); await wireit.waitForLog( - /50% \[1 \/ 2\] \[2 running\] \[1 service\] standard/ + /50% \[1 \/ 2\] \[2 running\] \[1 service\] standard/, ); const serviceInv = await service.nextInvocation(); const standardInv = await standard.nextInvocation(); @@ -733,7 +733,7 @@ test( await serviceInv.closed; wireit.kill(); await wireit.exit; - }) + }), ); test( @@ -769,7 +769,7 @@ test( await rig.write('input', '0'); const wireit = rig.exec('npm run consumer --watch'); await wireit.waitForLog( - /50% \[1 \/ 2\] \[2 running\] \[1 service\] consumer/ + /50% \[1 \/ 2\] \[2 running\] \[1 service\] consumer/, ); // Iteration 1 @@ -784,7 +784,7 @@ test( await rig.write('input', '1'); await wireit.waitForLog( - /50% \[1 \/ 2\] \[2 running\] \[1 service\] consumer/ + /50% \[1 \/ 2\] \[2 running\] \[1 service\] consumer/, ); // Iteration 2 @@ -801,7 +801,7 @@ test( await wireit.exit; assert.equal(consumer.numInvocations, 2); assert.equal(service.numInvocations, 2); - }) + }), ); test( @@ -850,7 +850,7 @@ test( await rig.write('input', '0'); const wireit = rig.exec('npm run entrypoint --watch'); await wireit.waitForLog( - /67% \[2 \/ 3\] \[3 running\] \[2 services\] standard/ + /67% \[2 \/ 3\] \[3 running\] \[2 services\] standard/, ); // Iteration 1 @@ -865,7 +865,7 @@ test( await rig.write('input', '1'); await wireit.waitForLog( - /67% \[2 \/ 3\] \[3 running\] \[2 services\] standard/ + /67% \[2 \/ 3\] \[3 running\] \[2 services\] standard/, ); // Iteration 2 @@ -880,7 +880,7 @@ test( assert.equal(service1.numInvocations, 1); assert.equal(service2.numInvocations, 1); assert.equal(standard.numInvocations, 2); - }) + }), ); test( @@ -918,7 +918,7 @@ test( // Iteration 1. Both scripts start. const wireit = rig.exec('npm run entrypoint --watch'); await wireit.waitForLog( - /50% \[1 \/ 2\] \[2 running\] \[1 service\] standard/ + /50% \[1 \/ 2\] \[2 running\] \[1 service\] standard/, ); const serviceInv = await service.nextInvocation(); const standardInv1 = await standard.nextInvocation(); @@ -969,7 +969,7 @@ test( await wireit.exit; assert.equal(service.numInvocations, 1); assert.equal(standard.numInvocations, 2); - }) + }), ); test( @@ -1044,7 +1044,7 @@ test( assert.equal(consumer.numInvocations, 2); assert.equal(service.numInvocations, 2); } - }) + }), ); test( @@ -1117,7 +1117,7 @@ test( await wireit.exit; assert.equal(service.numInvocations, 2); assert.equal(consumer.numInvocations, 2); - }) + }), ); test( @@ -1202,7 +1202,7 @@ test( assert.equal(service.numInvocations, 2); assert.equal(hard.numInvocations, 2); assert.equal(soft.numInvocations, 2); - }) + }), ); test( @@ -1284,7 +1284,7 @@ test( assert.not(childServiceInv1.isRunning); assert.equal(parentService.numInvocations, 1); assert.equal(childService.numInvocations, 2); - }) + }), ); test( @@ -1338,7 +1338,7 @@ test( standardInv.exit(0); assert.equal((await wireit.exit).code, 0); assert.equal(standard.numInvocations, 1); - }) + }), ); test( @@ -1440,7 +1440,7 @@ test( await wireit.exit; assert.equal(service.numInvocations, 2); assert.equal(standard.numInvocations, 5); - }) + }), ); test.run(); diff --git a/src/test/util/check-script-output.ts b/src/test/util/check-script-output.ts index 84e04dea9..f5776623d 100644 --- a/src/test/util/check-script-output.ts +++ b/src/test/util/check-script-output.ts @@ -18,7 +18,7 @@ import {NODE_MAJOR_VERSION} from './node-version.js'; export function checkScriptOutput( actual: string, expected: string, - message?: string + message?: string, ) { actual = removeOverwrittenLines(removeAnsiColors(actual)).trim(); expected = expected.trim(); diff --git a/src/test/util/fake-github-actions-cache-server.ts b/src/test/util/fake-github-actions-cache-server.ts index 1c7cd600d..cfb188163 100644 --- a/src/test/util/fake-github-actions-cache-server.ts +++ b/src/test/util/fake-github-actions-cache-server.ts @@ -136,7 +136,7 @@ export class FakeGitHubActionsCacheServer { if (address === null || typeof address !== 'object') { throw new Error( `Expected server address to be ServerInfo object, ` + - `got ${JSON.stringify(address)}` + `got ${JSON.stringify(address)}`, ); } // The real API includes a unique identifier as the base path. It's good to @@ -174,7 +174,7 @@ export class FakeGitHubActionsCacheServer { private _respond( response: http.ServerResponse, status: number, - message?: string + message?: string, ): void { response.statusCode = status; if (message !== undefined) { @@ -185,7 +185,7 @@ export class FakeGitHubActionsCacheServer { private _maybeServeForcedError( response: http.ServerResponse, - apiName: ApiName + apiName: ApiName, ): boolean { const code = this._forcedErrors.get(apiName); if (code !== undefined) { @@ -202,7 +202,7 @@ export class FakeGitHubActionsCacheServer { private _checkAuthorization( request: http.IncomingMessage, - response: http.ServerResponse + response: http.ServerResponse, ): boolean { if (request.headers.authorization !== `Bearer ${this._authToken}`) { this._respond(response, /* Not Authorized */ 401); @@ -213,7 +213,7 @@ export class FakeGitHubActionsCacheServer { private _checkUserAgent( request: http.IncomingMessage, - response: http.ServerResponse + response: http.ServerResponse, ): boolean { // https://github.com/actions/toolkit/blob/500d0b42fee2552ae9eeb5933091fe2fbf14e72d/packages/cache/src/internal/cacheHttpClient.ts#L67 const expected = 'actions/cache'; @@ -225,7 +225,7 @@ export class FakeGitHubActionsCacheServer { response, /* Bad Request */ 400, `Expected user-agent ${JSON.stringify(expected)}. ` + - `Got ${JSON.stringify(actual)}.` + `Got ${JSON.stringify(actual)}.`, ); return false; } @@ -235,7 +235,7 @@ export class FakeGitHubActionsCacheServer { private _checkContentType( request: http.IncomingMessage, response: http.ServerResponse, - expected: string | undefined + expected: string | undefined, ): boolean { const actual = request.headers['content-type']; if (actual !== expected) { @@ -245,7 +245,7 @@ export class FakeGitHubActionsCacheServer { response, /* Bad Request */ 400, `Expected content-type ${JSON.stringify(expected)}. ` + - `Got ${JSON.stringify(actual)}.` + `Got ${JSON.stringify(actual)}.`, ); return false; } @@ -255,7 +255,7 @@ export class FakeGitHubActionsCacheServer { private _checkAccept( request: http.IncomingMessage, response: http.ServerResponse, - expected: string | undefined + expected: string | undefined, ): boolean { const actual = request.headers['accept']; if (actual !== expected) { @@ -265,7 +265,7 @@ export class FakeGitHubActionsCacheServer { response, /* Bad Request */ 400, `Expected accept ${JSON.stringify(expected)}. ` + - `Got ${JSON.stringify(actual)}.` + `Got ${JSON.stringify(actual)}.`, ); return false; } @@ -274,7 +274,7 @@ export class FakeGitHubActionsCacheServer { private _route = ( request: http.IncomingMessage, - response: http.ServerResponse + response: http.ServerResponse, ): void => { if (!request.url) { return this._respond(response, 404); @@ -327,7 +327,7 @@ export class FakeGitHubActionsCacheServer { private _check( request: http.IncomingMessage, response: http.ServerResponse, - url: URL + url: URL, ): void { this.metrics.check++; if (this._maybeServeForcedError(response, 'check')) { @@ -358,7 +358,7 @@ export class FakeGitHubActionsCacheServer { return this._respond( response, /* Not Implemented */ 501, - 'Fake does not support multiple keys' + 'Fake does not support multiple keys', ); } @@ -381,7 +381,7 @@ export class FakeGitHubActionsCacheServer { JSON.stringify({ archiveLocation: `${this._url.href}tarballs/${entry.tarballId}`, cacheKey: keys, - }) + }), ); } @@ -394,7 +394,7 @@ export class FakeGitHubActionsCacheServer { */ private async _reserve( request: http.IncomingMessage, - response: http.ServerResponse + response: http.ServerResponse, ): Promise { this.metrics.reserve++; if (this._maybeServeForcedError(response, 'reserve')) { @@ -431,7 +431,7 @@ export class FakeGitHubActionsCacheServer { this._respond( response, /* Created */ 201, - JSON.stringify({cacheId: entryId}) + JSON.stringify({cacheId: entryId}), ); } @@ -444,7 +444,7 @@ export class FakeGitHubActionsCacheServer { private async _upload( request: http.IncomingMessage, response: http.ServerResponse, - idStr: string + idStr: string, ): Promise { this.metrics.upload++; if (this._maybeServeForcedError(response, 'upload')) { @@ -468,8 +468,8 @@ export class FakeGitHubActionsCacheServer { response, /* Bad Request */ 400, `Expected transfer-encoding ${JSON.stringify( - expectedTransferEncoding - )}. ` + `Got ${String(actualTransferEncoding)}.` + expectedTransferEncoding, + )}. ` + `Got ${String(actualTransferEncoding)}.`, ); } @@ -488,7 +488,7 @@ export class FakeGitHubActionsCacheServer { return this._respond( response, 400, - 'Missing or invalid Content-Range header' + 'Missing or invalid Content-Range header', ); } const start = Number(parsedContentRange[1]); @@ -507,7 +507,7 @@ export class FakeGitHubActionsCacheServer { return this._respond( response, 400, - 'Chunk length did not match Content-Range header' + 'Chunk length did not match Content-Range header', ); } entry.chunks.push({start, end, buffer}); @@ -523,7 +523,7 @@ export class FakeGitHubActionsCacheServer { private async _commit( request: http.IncomingMessage, response: http.ServerResponse, - idStr: string + idStr: string, ): Promise { this.metrics.commit++; if (this._maybeServeForcedError(response, 'commit')) { @@ -559,7 +559,7 @@ export class FakeGitHubActionsCacheServer { return this._respond( response, 400, - 'Cache entry chunks were not contiguous' + 'Cache entry chunks were not contiguous', ); } expectedNextStart = chunk.end + 1; @@ -576,7 +576,7 @@ export class FakeGitHubActionsCacheServer { return this._respond( response, 400, - 'Cache entry did not match expected length' + 'Cache entry did not match expected length', ); } @@ -598,7 +598,7 @@ export class FakeGitHubActionsCacheServer { private _download( request: http.IncomingMessage, response: http.ServerResponse, - tarballId: string + tarballId: string, ): void { this.metrics.download++; if (this._maybeServeForcedError(response, 'download')) { @@ -626,7 +626,7 @@ export class FakeGitHubActionsCacheServer { response.statusCode = 200; const contentLength = entry.chunks.reduce( (sum, chunk) => sum + chunk.buffer.length, - 0 + 0, ); response.setHeader('Content-Length', contentLength); for (const chunk of entry.chunks) { diff --git a/src/test/util/filesystem-test-rig.ts b/src/test/util/filesystem-test-rig.ts index 0a0ee404a..50418345e 100644 --- a/src/test/util/filesystem-test-rig.ts +++ b/src/test/util/filesystem-test-rig.ts @@ -25,7 +25,7 @@ export class FilesystemTestRig { protected _assertState(expected: 'uninitialized' | 'running' | 'done') { if (this._state !== expected) { throw new Error( - `Expected state to be ${expected} but was ${this._state}` + `Expected state to be ${expected} but was ${this._state}`, ); } } @@ -65,7 +65,7 @@ export class FilesystemTestRig { async write(files: {[filename: string]: unknown}): Promise; async write( fileOrFiles: string | {[filename: string]: unknown}, - data?: string + data?: string, ): Promise { this._assertState('running'); if (typeof fileOrFiles === 'string') { @@ -77,8 +77,8 @@ export class FilesystemTestRig { } else { await Promise.all( Object.entries(fileOrFiles).map(async ([relative, data]) => - this.write(relative, data) - ) + this.write(relative, data), + ), ); } } @@ -91,7 +91,7 @@ export class FilesystemTestRig { async writeAtomic(files: {[filename: string]: unknown}): Promise; async writeAtomic( fileOrFiles: string | {[filename: string]: unknown}, - data?: string + data?: string, ): Promise { this._assertState('running'); if (typeof fileOrFiles === 'string') { @@ -102,8 +102,8 @@ export class FilesystemTestRig { } else { await Promise.all( Object.entries(fileOrFiles).map(async ([relative, data]) => - this.writeAtomic(relative, data) - ) + this.writeAtomic(relative, data), + ), ); } } @@ -204,7 +204,7 @@ export class FilesystemTestRig { async delete(filename: string): Promise { this._assertState('running'); return gracefulFs(() => - fs.rm(this.resolve(filename), {force: true, recursive: true}) + fs.rm(this.resolve(filename), {force: true, recursive: true}), ); } @@ -214,7 +214,7 @@ export class FilesystemTestRig { async symlink( target: string, filename: string, - windowsType: 'file' | 'dir' | 'junction' + windowsType: 'file' | 'dir' | 'junction', ): Promise { this._assertState('running'); const absolute = this.resolve(filename); diff --git a/src/test/util/test-rig-command-child.ts b/src/test/util/test-rig-command-child.ts index aa672af92..3a68e8a75 100644 --- a/src/test/util/test-rig-command-child.ts +++ b/src/test/util/test-rig-command-child.ts @@ -62,7 +62,7 @@ class ChildIpcClient extends IpcClient { console.error( `Unhandled message type ${ (unreachable(message) as RigToChildMessage).type - }` + }`, ); process.exit(1); break; diff --git a/src/test/util/test-rig-command.ts b/src/test/util/test-rig-command.ts index 761ba6d8f..24f23e212 100644 --- a/src/test/util/test-rig-command.ts +++ b/src/test/util/test-rig-command.ts @@ -44,7 +44,7 @@ export class WireitTestRigCommand { private _assertState(expected: 'uninitialized' | 'listening' | 'closed') { if (this._state !== expected) { throw new Error( - `Expected state to be ${expected} but was ${this._state}` + `Expected state to be ${expected} but was ${this._state}`, ); } } @@ -156,7 +156,7 @@ export class WireitTestRigCommandInvocation extends IpcClient< return; } console.error( - `Unhandled IPC socket error ${err.message} in WireitTestRigCommandInvocation` + `Unhandled IPC socket error ${err.message} in WireitTestRigCommandInvocation`, ); process.exit(1); }); @@ -165,7 +165,7 @@ export class WireitTestRigCommandInvocation extends IpcClient< private _assertState(expected: 'connected' | 'closing' | 'closed') { if (this._state !== expected) { throw new Error( - `Expected state to be ${expected} but was ${this._state}` + `Expected state to be ${expected} but was ${this._state}`, ); } } @@ -193,7 +193,7 @@ export class WireitTestRigCommandInvocation extends IpcClient< throw new Error( `Unhandled message type ${ (unreachable(message) as ChildToRigMessage).type - }` + }`, ); } } diff --git a/src/test/util/test-rig.ts b/src/test/util/test-rig.ts index 5b42a7f20..99534b045 100644 --- a/src/test/util/test-rig.ts +++ b/src/test/util/test-rig.ts @@ -49,7 +49,7 @@ export class WireitTestRig extends FilesystemTestRig { this.temp, 'node_modules', '.bin', - 'wireit' + 'wireit', ); if (IS_WINDOWS) { // Npm install works differently on Windows, since it won't recognize a @@ -136,7 +136,7 @@ export class WireitTestRig extends FilesystemTestRig { */ exec( command: string, - opts?: {cwd?: string; env?: Record} + opts?: {cwd?: string; env?: Record}, ): ExecResult { this._assertState('running'); const cwd = this._resolve(opts?.cwd ?? '.'); @@ -180,7 +180,7 @@ export class WireitTestRig extends FilesystemTestRig { ...(opts?.env ?? {}), }); this._activeChildProcesses.add(result); - result.exit.finally(() => this._activeChildProcesses.delete(result)); + void result.exit.finally(() => this._activeChildProcesses.delete(result)); return result; } @@ -198,13 +198,13 @@ export class WireitTestRig extends FilesystemTestRig { ipcPath = pathlib.join( '\\\\?\\pipe', this.temp, - Math.random().toString() + Math.random().toString(), ); } else { ipcPath = pathlib.resolve( this.temp, '__sockets', - Math.random().toString() + Math.random().toString(), ); // The socket file will be created on the net.createServer call, but the // parent directory must exist. @@ -234,7 +234,7 @@ class ExecResult { constructor( command: string, cwd: string, - env: Record + env: Record, ) { // Remove any environment variables that start with "npm_", because those // will have been set by the "npm test" or similar command that launched @@ -246,7 +246,7 @@ class ExecResult { const unsetNpmVariables = Object.fromEntries( Object.keys(process.env) .filter((name) => /^npm_/i.test(name)) - .map((name) => [name, undefined]) + .map((name) => [name, undefined]), ); this._child = spawn(command, { cwd, @@ -366,7 +366,7 @@ class ExecResult { this._logMatchers.delete(matcher); stdoutLastIndex = Math.max( stdoutLastIndex, - stdoutMatch.index + stdoutMatch[0].length + stdoutMatch.index + stdoutMatch[0].length, ); } else { const stderrMatch = re.exec(this._matcherStderr); @@ -375,7 +375,7 @@ class ExecResult { this._logMatchers.delete(matcher); stderrLastIndex = Math.max( stderrLastIndex, - stderrMatch.index + stderrMatch[0].length + stderrMatch.index + stderrMatch[0].length, ); } } @@ -389,8 +389,9 @@ class ExecResult { } private readonly _onStdout = (chunk: string | Buffer) => { - this._allStdout += chunk; - this._matcherStdout += chunk; + // toString on a Buffer decodes it as UTF-8. + this._allStdout += String(chunk); + this._matcherStdout += String(chunk); if (process.env.SHOW_TEST_OUTPUT) { process.stdout.write(chunk); } @@ -398,8 +399,8 @@ class ExecResult { }; private readonly _onStderr = (chunk: string | Buffer) => { - this._allStderr += chunk; - this._matcherStdout += chunk; + this._allStderr += String(chunk); + this._matcherStdout += String(chunk); if (process.env.SHOW_TEST_OUTPUT) { process.stdout.write(chunk); } diff --git a/src/test/util/uvu-timeout.ts b/src/test/util/uvu-timeout.ts index e46c4eccf..69112f571 100644 --- a/src/test/util/uvu-timeout.ts +++ b/src/test/util/uvu-timeout.ts @@ -24,7 +24,7 @@ export const wait = async (ms: number) => */ export const timeout = ( handler: uvu.Callback, - ms = DEFAULT_UVU_TIMEOUT + ms = DEFAULT_UVU_TIMEOUT, ): uvu.Callback => { return (...args) => { let timerId: ReturnType; diff --git a/src/test/watch.test.ts b/src/test/watch.test.ts index 2bcd508ab..81b8dba68 100644 --- a/src/test/watch.test.ts +++ b/src/test/watch.test.ts @@ -83,7 +83,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 1); - }) + }), ); test( @@ -130,7 +130,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -177,7 +177,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -222,7 +222,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -269,7 +269,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -326,7 +326,7 @@ test( await exec.exit; assert.equal(cmdA1.numInvocations, 1); assert.equal(cmdA2.numInvocations, 1); - }) + }), ); test( @@ -406,7 +406,7 @@ test( await exec.exit; assert.equal(cmdA.numInvocations, 3); assert.equal(cmdB.numInvocations, 2); - }) + }), ); test( @@ -492,7 +492,7 @@ test( await exec.exit; assert.equal(cmdA.numInvocations, 3); assert.equal(cmdB.numInvocations, 2); - }) + }), ); test( @@ -541,7 +541,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -645,7 +645,7 @@ test( wireit.kill(); await wireit.exit; - }) + }), ); test( @@ -705,7 +705,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -749,7 +749,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -791,7 +791,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -854,7 +854,7 @@ test( await exec.exit; assert.equal(cmdA.numInvocations, 2); assert.equal(cmdB.numInvocations, 2); - }) + }), ); test( @@ -897,7 +897,7 @@ test( exec.kill(); await exec.exit; assert.equal(cmdA.numInvocations, 2); - }) + }), ); test( @@ -965,15 +965,15 @@ test( assert.equal( [1, 2].includes(count), true, - `Expected to see one or two "Watching for file changes" but found ${count}` + `Expected to see one or two "Watching for file changes" but found ${count}`, ); const failureCount = [...stderr.matchAll(/Failed/gi)].length; assert.equal( [1, 2].includes(failureCount), true, - `Expected to see one or two "Failed" lines but found ${failureCount}` + `Expected to see one or two "Failed" lines but found ${failureCount}`, ); - }) + }), ); test( @@ -1010,7 +1010,7 @@ test( exec.kill(); assert.equal(cmdA.numInvocations, 1); - }) + }), ); test.run(); diff --git a/src/util/ast.ts b/src/util/ast.ts index b83a585f6..4eef46232 100644 --- a/src/util/ast.ts +++ b/src/util/ast.ts @@ -66,7 +66,7 @@ export interface NamedAstNode export function findNamedNodeAtLocation( astNode: JsonAstNode, path: jsonParser.JSONPath, - file: JsonFile + file: JsonFile, ): Result { const node = findNodeAtLocation(astNode, path) as NamedAstNode | undefined; const parent = node?.parent; @@ -98,7 +98,7 @@ export function findNamedNodeAtLocation( export function findNodeAtLocation( astNode: JsonAstNode, - path: jsonParser.JSONPath + path: jsonParser.JSONPath, ): JsonAstNode | undefined { return jsonParser.findNodeAtLocation(astNode, path) as | JsonAstNode @@ -107,7 +107,7 @@ export function findNodeAtLocation( export function parseTree( filePath: string, - json: string + json: string, ): Result { const errors: ParseError[] = []; const result = parseTreeInternal(json, errors); diff --git a/src/util/copy.ts b/src/util/copy.ts index c3ffdd77b..ddb1842c5 100644 --- a/src/util/copy.ts +++ b/src/util/copy.ts @@ -24,7 +24,7 @@ import type {AbsoluteEntry} from './glob.js'; export const copyEntries = async ( entries: AbsoluteEntry[], sourceDir: string, - destDir: string + destDir: string, ): Promise => { if (entries.length === 0) { return; @@ -49,8 +49,8 @@ export const copyEntries = async ( await Promise.all( optimizeMkdirs([...directories]).map((path) => - fs.mkdir(path, {recursive: true}) - ) + fs.mkdir(path, {recursive: true}), + ), ); const copyPromises = []; @@ -58,16 +58,16 @@ export const copyEntries = async ( copyPromises.push( copyFileGracefully( pathlib.join(sourceDir, path), - pathlib.join(destDir, path) - ) + pathlib.join(destDir, path), + ), ); } for (const path of symlinks) { copyPromises.push( copySymlinkGracefully( pathlib.join(sourceDir, path), - pathlib.join(destDir, path) - ) + pathlib.join(destDir, path), + ), ); } await Promise.all(copyPromises); @@ -95,7 +95,7 @@ const copyFileGracefully = async (src: string, dest: string): Promise => { */ const copySymlinkGracefully = async ( src: string, - dest: string + dest: string, ): Promise => { try { const target = await fs.readlink(src, {encoding: 'buffer'}); @@ -127,11 +127,11 @@ const copySymlinkGracefully = async ( */ const detectWindowsSymlinkType = async ( target: Buffer, - linkPath: string + linkPath: string, ): Promise<'file' | 'dir' | undefined> => { const resolved = pathlib.resolve( pathlib.dirname(linkPath), - target.toString() + target.toString(), ); try { const stats = await fs.stat(resolved); diff --git a/src/util/delete.ts b/src/util/delete.ts index 0e764b1e8..e14964568 100644 --- a/src/util/delete.ts +++ b/src/util/delete.ts @@ -20,7 +20,7 @@ import type {AbsoluteEntry} from './glob.js'; * left in-place. */ export const deleteEntries = async ( - entries: AbsoluteEntry[] + entries: AbsoluteEntry[], ): Promise => { if (entries.length === 0) { return; @@ -85,12 +85,12 @@ interface Directory { * scheduled for deletion as long as they are empty. */ const deleteDirectoriesDepthFirst = async ( - directory: Directory + directory: Directory, ): Promise => { const childrenDeleted = await Promise.all( Object.values(directory.children).map((child) => - deleteDirectoriesDepthFirst(child) - ) + deleteDirectoriesDepthFirst(child), + ), ); if (directory.pathIfShouldDelete === undefined) { // This directory wasn't scheduled for deletion. diff --git a/src/util/fs.ts b/src/util/fs.ts index 08ce3317c..da81c97d3 100644 --- a/src/util/fs.ts +++ b/src/util/fs.ts @@ -81,7 +81,7 @@ export const fileBudget = (() => { export async function mkdir( path: string, - options?: fsTypes.MakeDirectoryOptions & {recursive: boolean} + options?: fsTypes.MakeDirectoryOptions & {recursive: boolean}, ): Promise { const reservation = await fileBudget.reserve(); try { @@ -103,7 +103,7 @@ export async function mkdtemp(path: string): Promise { export async function writeFile( path: string, contents: string, - encoding: 'utf8' + encoding: 'utf8', ): Promise { const reservation = await fileBudget.reserve(); try { @@ -115,7 +115,7 @@ export async function writeFile( export async function readFile( path: string, - encoding: 'utf8' + encoding: 'utf8', ): Promise { const reservation = await fileBudget.reserve(); try { @@ -127,7 +127,7 @@ export async function readFile( export async function rm( path: string, - options: fsTypes.RmOptions + options: fsTypes.RmOptions, ): Promise { const reservation = await fileBudget.reserve(); try { @@ -183,7 +183,7 @@ type ReadStreamOptions = export async function createReadStream( path: string, - options?: ReadStreamOptions + options?: ReadStreamOptions, ): Promise { const reservation = await fileBudget.reserve(); const stream = rawCreateReadStream(path, options); @@ -192,7 +192,7 @@ export async function createReadStream( } export async function createWriteStream( - path: string + path: string, ): Promise { const reservation = await fileBudget.reserve(); const stream = rawCreateWriteStream(path); @@ -203,7 +203,7 @@ export async function createWriteStream( export async function copyFile( src: fsTypes.PathLike, dest: fsTypes.PathLike, - flags?: number | undefined + flags?: number | undefined, ) { const reservation = await fileBudget.reserve(); try { @@ -215,19 +215,19 @@ export async function copyFile( export function readlink( path: fsTypes.PathLike, - options?: fsTypes.BaseEncodingOptions | BufferEncoding | null + options?: fsTypes.BaseEncodingOptions | BufferEncoding | null, ): Promise; export function readlink( path: fsTypes.PathLike, - options: fsTypes.BufferEncodingOption + options: fsTypes.BufferEncodingOption, ): Promise; export async function readlink( path: fsTypes.PathLike, options?: | fsTypes.BaseEncodingOptions | fsTypes.BufferEncodingOption - | string - | null + | BufferEncoding + | null, ): Promise { const reservation = await fileBudget.reserve(); try { @@ -240,7 +240,7 @@ export async function readlink( export async function symlink( target: fsTypes.PathLike, path: fsTypes.PathLike, - type?: string | null + type?: string | null, ) { const reservation = await fileBudget.reserve(); try { diff --git a/src/util/glob.ts b/src/util/glob.ts index 4775988d6..1e4264d7f 100644 --- a/src/util/glob.ts +++ b/src/util/glob.ts @@ -79,7 +79,7 @@ interface GlobGroup { */ export async function glob( patterns: string[], - opts: GlobOptions + opts: GlobOptions, ): Promise { if (patterns.length === 0) { return []; @@ -106,7 +106,7 @@ export async function glob( // not recursing into them at all, so there is no need to also // generate a recursive version when excluding. expandedPatterns.push( - expanded + (expanded.endsWith('/') ? '**' : '/**') + expanded + (expanded.endsWith('/') ? '**' : '/**'), ); } } @@ -175,7 +175,7 @@ export async function glob( currentGroup.exclude.push( // Trim trailing slashes because fast-glob does not understand trailing // slashes in "ignore" list entries (they have no effect!). - pattern.replace(/\/+$/, '') + pattern.replace(/\/+$/, ''), ); } else if (pattern.match(/^\s*$/)) { // fast-glob already throws on empty strings, but we also throw on @@ -185,7 +185,7 @@ export async function glob( // on exclusive patterns, because by definition they start with a "!" so // can't have been empty/blank. throw new Error( - `glob encountered empty or blank pattern: ${JSON.stringify(pattern)}` + `glob encountered empty or blank pattern: ${JSON.stringify(pattern)}`, ); } else { currentGroup.include.push(pattern); @@ -250,7 +250,7 @@ export async function glob( } combinedMap.set(match.path, match); } - }) + }), ); return [...combinedMap.values()] as AbsoluteEntry[]; diff --git a/src/util/package-json-reader.ts b/src/util/package-json-reader.ts index 6e8daf777..8353ef5a4 100644 --- a/src/util/package-json-reader.ts +++ b/src/util/package-json-reader.ts @@ -52,7 +52,7 @@ export class CachingPackageJsonReader { } const packageJsonFile = new PackageJson( {contents, path}, - astResult.value + astResult.value, ); return {ok: true, value: packageJsonFile}; }); diff --git a/src/util/package-json.ts b/src/util/package-json.ts index 62671504c..2e2b22ad2 100644 --- a/src/util/package-json.ts +++ b/src/util/package-json.ts @@ -102,12 +102,12 @@ export class PackageJson { * add them to this._scripts. */ private _analyzeScriptsSection( - failures: Failure[] + failures: Failure[], ): undefined | NamedAstNode { const scriptsSectionResult = findNamedNodeAtLocation( this._fileAstNode, ['scripts'], - this.jsonFile + this.jsonFile, ); if (!scriptsSectionResult.ok) { failures.push(scriptsSectionResult.error); @@ -162,7 +162,7 @@ export class PackageJson { const wireitSectionResult = findNamedNodeAtLocation( this._fileAstNode, ['wireit'], - this.jsonFile + this.jsonFile, ); if (!wireitSectionResult.ok) { failures.push(wireitSectionResult.error); diff --git a/src/util/script-data-dir.ts b/src/util/script-data-dir.ts index e7dc2fba1..415ea8321 100644 --- a/src/util/script-data-dir.ts +++ b/src/util/script-data-dir.ts @@ -22,5 +22,5 @@ export const getScriptDataDir = (script: ScriptReference) => // // Reference: // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions - Buffer.from(script.name).toString('hex') + Buffer.from(script.name).toString('hex'), ); diff --git a/src/util/windows.ts b/src/util/windows.ts index 2b1e2c174..59d3a85ff 100644 --- a/src/util/windows.ts +++ b/src/util/windows.ts @@ -45,7 +45,7 @@ export const posixifyPathIfOnWindows = (path: string) => * `process.env`. */ export const augmentProcessEnvSafelyIfOnWindows = ( - augmentations: Record + augmentations: Record, ): Record => { if (ENVIRONMENT_VARIABLE_CASINGS_IF_WINDOWS === undefined) { // On Linux and macOS, environment variables are case-sensitive, so there's @@ -55,7 +55,7 @@ export const augmentProcessEnvSafelyIfOnWindows = ( const augmented = {...process.env}; for (const [name, value] of Object.entries(augmentations)) { const existingNames = ENVIRONMENT_VARIABLE_CASINGS_IF_WINDOWS.get( - name.toLowerCase() + name.toLowerCase(), ); if (existingNames === undefined) { augmented[name] = value; diff --git a/src/util/worker-pool.ts b/src/util/worker-pool.ts index c08b9d235..f585b57eb 100644 --- a/src/util/worker-pool.ts +++ b/src/util/worker-pool.ts @@ -27,7 +27,7 @@ export class WorkerPool { constructor(numWorkers: number) { if (numWorkers <= 0) { throw new Error( - `WorkerPool needs a positive number of workers, got ${numWorkers}` + `WorkerPool needs a positive number of workers, got ${numWorkers}`, ); } this._availableWorkers = numWorkers; @@ -46,7 +46,7 @@ export class WorkerPool { await waiter.promise; if (this._availableWorkers <= 0) { throw new Error( - `Internal error: expected availableWorkers to be positive after task was awoken, but was ${this._availableWorkers}` + `Internal error: expected availableWorkers to be positive after task was awoken, but was ${this._availableWorkers}`, ); } } @@ -60,7 +60,7 @@ export class WorkerPool { // case. // eslint-disable-next-line no-unsafe-finally throw new Error( - `Internal error: expected availableWorkers to be positive after incrementing, but was ${this._availableWorkers}` + `Internal error: expected availableWorkers to be positive after incrementing, but was ${this._availableWorkers}`, ); } this._waitingWorkers.pop()?.resolve(); diff --git a/src/watcher.ts b/src/watcher.ts index da44cc123..b37178b88 100644 --- a/src/watcher.ts +++ b/src/watcher.ts @@ -138,7 +138,7 @@ export class Watcher { workerPool: WorkerPool, cache: Cache | undefined, failureMode: FailureMode, - agent: Agent + agent: Agent, ) { this._rootScript = rootScript; this._extraArgs = extraArgs; @@ -249,7 +249,7 @@ export class Watcher { this._configFilesWatcher = makeWatcher( configFiles, '/', - this._onConfigFileChanged + this._onConfigFileChanged, ); if (oldWatcher !== undefined) { void oldWatcher.watcher.close(); @@ -281,7 +281,7 @@ export class Watcher { this._failureMode, this._previousIterationServices, true, - this._previousIterationFailures + this._previousIterationFailures, ); const result = await this._executor.execute(); this._previousIterationServices = result.persistentServices; @@ -384,7 +384,7 @@ export class Watcher { const newWatcher = makeWatcher( newInputFiles, script.packageDir, - this._fileChanged + this._fileChanged, ); this._inputFileWatchers.set(key, newWatcher); } @@ -453,7 +453,7 @@ export class Watcher { const watchPathsEqual = ( a: Array | undefined, - b: Array | undefined + b: Array | undefined, ) => { if (a === undefined && b === undefined) { return true; @@ -484,7 +484,7 @@ export const makeWatcher = ( patterns: string[], cwd: string, callback: () => void, - ignoreInitial = true + ignoreInitial = true, ): FileWatcher => { // TODO(aomarks) chokidar doesn't work exactly like fast-glob, so there are // currently various differences in what gets watched vs what actually affects @@ -496,7 +496,7 @@ export const makeWatcher = ( { cwd, ignoreInitial, - } + }, ); watcher.on('all', callback); return { diff --git a/vscode-extension/src/client.ts b/vscode-extension/src/client.ts index 109364241..f132add06 100644 --- a/vscode-extension/src/client.ts +++ b/vscode-extension/src/client.ts @@ -38,7 +38,7 @@ export async function activate(context: vscode.ExtensionContext) { }, ], traceOutputChannel: outputChannel, - } + }, ); context.subscriptions.push( client.onNotification( @@ -48,8 +48,8 @@ export async function activate(context: vscode.ExtensionContext) { // the console (when running as part of a test). outputChannel.appendLine(`languageServer: ${message}`); console.error(`languageServer: ${message}`); - } - ) + }, + ), ); await client.start(); diff --git a/vscode-extension/src/test/main.test.ts b/vscode-extension/src/test/main.test.ts index 312306d10..55749bb1f 100644 --- a/vscode-extension/src/test/main.test.ts +++ b/vscode-extension/src/test/main.test.ts @@ -15,14 +15,14 @@ test('the extension is installed', () => { const ourId = 'google.wireit'; assert.ok( extensionIds.includes(ourId), - `Expected ${JSON.stringify(extensionIds)} to include '${ourId}'` + `Expected ${JSON.stringify(extensionIds)} to include '${ourId}'`, ); }); // Wait until the something is able to produce diagnostics, then return // those. async function getDiagnostics( - doc: vscode.TextDocument + doc: vscode.TextDocument, ): Promise { return await tryUntil(() => { const diagnostics = vscode.languages.getDiagnostics(doc.uri); @@ -34,7 +34,7 @@ async function getDiagnostics( const TICKS_TO_WAIT = process.env.CI ? 1000 : 40; async function tryUntil( - f: () => T | null | undefined | Promise + f: () => T | null | undefined | Promise, ): Promise { for (let i = 0; i < TICKS_TO_WAIT; i++) { const v = await f(); @@ -53,8 +53,8 @@ async function tryUntil( test('warns on a package.json based on the schema', async () => { const doc = await vscode.workspace.openTextDocument( vscode.Uri.file( - pathlib.join(__dirname, '../../src/test/fixtures/incorrect/package.json') - ) + pathlib.join(__dirname, '../../src/test/fixtures/incorrect/package.json'), + ), ); await vscode.window.showTextDocument(doc); const diagnostic = await tryUntil(() => { @@ -75,7 +75,7 @@ test('warns on a package.json based on the schema', async () => { start: {line: 6, character: 17}, end: {line: 6, character: 18}, }, - JSON.stringify(range) + JSON.stringify(range), ); }); @@ -84,9 +84,9 @@ test('warns on a package.json based on semantic analysis in the language server' vscode.Uri.file( pathlib.join( __dirname, - '../../src/test/fixtures/semantic_errors/package.json' - ) - ) + '../../src/test/fixtures/semantic_errors/package.json', + ), + ), ); await vscode.window.showTextDocument(doc); const diagnostics = await getDiagnostics(doc); @@ -96,7 +96,7 @@ test('warns on a package.json based on semantic analysis in the language server' 'This command should just be "wireit", as this script is configured in the wireit section.', 'A wireit config must set at least one of "command", "dependencies", or "files". Otherwise there is nothing for wireit to do.', ], - JSON.stringify(diagnostics.map((d) => d.message)) + JSON.stringify(diagnostics.map((d) => d.message)), ); assert.equal( diagnostics.map((d) => ({ @@ -111,8 +111,8 @@ test('warns on a package.json based on semantic analysis in the language server' diagnostics.map((d) => ({ start: {line: d.range.start.line, character: d.range.start.character}, end: {line: d.range.end.line, character: d.range.end.character}, - })) - ) + })), + ), ); }); diff --git a/website/.eleventy.cjs b/website/.eleventy.cjs index ace2e59e1..66dbcfa55 100644 --- a/website/.eleventy.cjs +++ b/website/.eleventy.cjs @@ -27,7 +27,7 @@ module.exports = function (eleventyConfig) { }).use(markdownItAnchor, { level: 3, permalink: markdownItAnchor.permalink.headerLink(), - }) + }), ); /** @@ -46,7 +46,7 @@ module.exports = function (eleventyConfig) { * but it produces paths that don't depend on the current URL). */ eleventyConfig.addFilter('relativePathToRoot', (url) => - url === '/' ? '.' : pathlib.posix.relative(url, '/') + url === '/' ? '.' : pathlib.posix.relative(url, '/'), ); return {