diff --git a/package-lock.json b/package-lock.json index 0abb569..483f837 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "2.1.6", "license": "ISC", "dependencies": { - "@inquirer/prompts": "^7.1.0", "async-retry": "^1.3.3", "dotenv": "^16.4.5", "form-data-lite": "^1.0.3", @@ -17,6 +16,7 @@ "performance-results-parser": "latest", "phin-retry": "^1.0.3", "pretty-ms": "^7.0.1", + "prompts": "^2.4.2", "rosters": "0.0.1", "sade": "^1.8.1", "test-results-parser": "0.2.5" @@ -110,257 +110,6 @@ "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", "dev": true }, - "node_modules/@inquirer/checkbox": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.2.tgz", - "integrity": "sha512-+gznPl8ip8P8HYHYecDtUtdsh1t2jvb+sWCD72GAiZ9m45RqwrLmReDaqdC0umQfamtFXVRoMVJ2/qINKGm9Tg==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/confirm": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.0.2.tgz", - "integrity": "sha512-KJLUHOaKnNCYzwVbryj3TNBxyZIrr56fR5N45v6K9IPrbT6B7DcudBMfylkV1A8PUdJE15mybkEQyp2/ZUpxUA==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/core": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.0.tgz", - "integrity": "sha512-I+ETk2AL+yAVbvuKx5AJpQmoaWhpiTFOg/UJb7ZkMAK4blmtG8ATh5ct+T/8xNld0CZG/2UhtkdMwpgvld92XQ==", - "license": "MIT", - "dependencies": { - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2", - "cli-width": "^4.1.0", - "mute-stream": "^2.0.0", - "signal-exit": "^4.1.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^6.2.0", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/core/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@inquirer/editor": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.1.0.tgz", - "integrity": "sha512-K1gGWsxEqO23tVdp5MT3H799OZ4ER1za7Dlc8F4um0W7lwSv0KGR/YyrUEyimj0g7dXZd8XknM/5QA2/Uy+TbA==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1", - "external-editor": "^3.1.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/expand": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.2.tgz", - "integrity": "sha512-WdgCX1cUtinz+syKyZdJomovULYlKUWZbVYZzhf+ZeeYf4htAQ3jLymoNs3koIAKfZZl3HUBb819ClCBfyznaw==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/figures": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.8.tgz", - "integrity": "sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@inquirer/input": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.0.2.tgz", - "integrity": "sha512-yCLCraigU085EcdpIVEDgyfGv4vBiE4I+k1qRkc9C5dMjWF42ADMGy1RFU94+eZlz4YlkmFsiyHZy0W1wdhaNg==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/number": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.2.tgz", - "integrity": "sha512-MKQhYofdUNk7eqJtz52KvM1dH6R93OMrqHduXCvuefKrsiMjHiMwjc3NZw5Imm2nqY7gWd9xdhYrtcHMJQZUxA==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/password": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.2.tgz", - "integrity": "sha512-tQXGSu7IO07gsYlGy3VgXRVsbOWqFBMbqAUrJSc1PDTQQ5Qdm+QVwkP0OC0jnUZ62D19iPgXOMO+tnWG+HhjNQ==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/prompts": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.1.0.tgz", - "integrity": "sha512-5U/XiVRH2pp1X6gpNAjWOglMf38/Ys522ncEHIKT1voRUvSj/DQnR22OVxHnwu5S+rCFaUiPQ57JOtMFQayqYA==", - "license": "MIT", - "dependencies": { - "@inquirer/checkbox": "^4.0.2", - "@inquirer/confirm": "^5.0.2", - "@inquirer/editor": "^4.1.0", - "@inquirer/expand": "^4.0.2", - "@inquirer/input": "^4.0.2", - "@inquirer/number": "^3.0.2", - "@inquirer/password": "^4.0.2", - "@inquirer/rawlist": "^4.0.2", - "@inquirer/search": "^3.0.2", - "@inquirer/select": "^4.0.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/rawlist": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.0.2.tgz", - "integrity": "sha512-3XGcskMoVF8H0Dl1S5TSZ3rMPPBWXRcM0VeNVsS4ByWeWjSeb0lPqfnBg6N7T0608I1B2bSVnbi2cwCrmOD1Yw==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/search": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.0.2.tgz", - "integrity": "sha512-Zv4FC7w4dJ13BOJfKRQCICQfShinGjb1bCEIHxTSnjj2telu3+3RHwHubPG9HyD4aix5s+lyAMEK/wSFD75HLA==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/select": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.0.2.tgz", - "integrity": "sha512-uSWUzaSYAEj0hlzxa1mUB6VqrKaYx0QxGBLZzU4xWFxaSyGaXxsSE4OSOwdU24j0xl8OajgayqFXW0l2bkl2kg==", - "license": "MIT", - "dependencies": { - "@inquirer/core": "^10.1.0", - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, - "node_modules/@inquirer/type": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz", - "integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - } - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -561,15 +310,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "peer": true, - "dependencies": { - "undici-types": "~6.20.0" - } - }, "node_modules/agent-base": { "version": "6.0.2", "dev": true, @@ -590,22 +330,9 @@ "node": ">=6" } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ansi-regex": { "version": "5.0.1", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -613,6 +340,7 @@ }, "node_modules/ansi-styles": { "version": "4.3.0", + "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -880,11 +608,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" - }, "node_modules/charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", @@ -925,14 +648,6 @@ "dev": true, "license": "ISC" }, - "node_modules/cli-width": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", - "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", - "engines": { - "node": ">= 12" - } - }, "node_modules/cliui": { "version": "7.0.4", "dev": true, @@ -945,6 +660,7 @@ }, "node_modules/color-convert": { "version": "2.0.1", + "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -955,6 +671,7 @@ }, "node_modules/color-name": { "version": "1.1.4", + "dev": true, "license": "MIT" }, "node_modules/combined-stream": { @@ -1116,6 +833,7 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", + "dev": true, "license": "MIT" }, "node_modules/end-of-stream": { @@ -1154,19 +872,6 @@ "node": ">=6" } }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/fast-glob": { "version": "3.2.12", "dev": true, @@ -1459,17 +1164,6 @@ "node": ">= 6" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ieee754": { "version": "1.2.1", "dev": true, @@ -1587,6 +1281,7 @@ }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -1732,6 +1427,14 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "engines": { + "node": ">=6" + } + }, "node_modules/klona": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", @@ -2039,14 +1742,6 @@ "node": ">= 6" } }, - "node_modules/mute-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz", - "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==", - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, "node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -2108,14 +1803,6 @@ "klona": "^2.0.4" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/p-is-promise": { "version": "3.0.0", "dev": true, @@ -2406,6 +2093,18 @@ "node": ">=0.4.0" } }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/pump": { "version": "3.0.0", "dev": true, @@ -2593,11 +2292,6 @@ } ] }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, "node_modules/semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -2644,6 +2338,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, "engines": { "node": ">=14" }, @@ -2696,6 +2391,11 @@ "simple-concat": "^1.0.0" } }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, "node_modules/slash": { "version": "3.0.0", "dev": true, @@ -2727,6 +2427,7 @@ }, "node_modules/string-width": { "version": "4.2.3", + "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -2754,6 +2455,7 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -2917,17 +2619,6 @@ "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==" }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/to-fast-properties": { "version": "2.0.0", "dev": true, @@ -2983,23 +2674,6 @@ "node": "*" } }, - "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "peer": true - }, "node_modules/universalify": { "version": "2.0.0", "dev": true, @@ -3163,18 +2837,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/yoctocolors-cjs": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", - "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } }, "dependencies": { @@ -3226,164 +2888,6 @@ "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", "dev": true }, - "@inquirer/checkbox": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.2.tgz", - "integrity": "sha512-+gznPl8ip8P8HYHYecDtUtdsh1t2jvb+sWCD72GAiZ9m45RqwrLmReDaqdC0umQfamtFXVRoMVJ2/qINKGm9Tg==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" - } - }, - "@inquirer/confirm": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.0.2.tgz", - "integrity": "sha512-KJLUHOaKnNCYzwVbryj3TNBxyZIrr56fR5N45v6K9IPrbT6B7DcudBMfylkV1A8PUdJE15mybkEQyp2/ZUpxUA==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1" - } - }, - "@inquirer/core": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.0.tgz", - "integrity": "sha512-I+ETk2AL+yAVbvuKx5AJpQmoaWhpiTFOg/UJb7ZkMAK4blmtG8ATh5ct+T/8xNld0CZG/2UhtkdMwpgvld92XQ==", - "requires": { - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2", - "cli-width": "^4.1.0", - "mute-stream": "^2.0.0", - "signal-exit": "^4.1.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^6.2.0", - "yoctocolors-cjs": "^2.1.2" - }, - "dependencies": { - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - } - } - }, - "@inquirer/editor": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-4.1.0.tgz", - "integrity": "sha512-K1gGWsxEqO23tVdp5MT3H799OZ4ER1za7Dlc8F4um0W7lwSv0KGR/YyrUEyimj0g7dXZd8XknM/5QA2/Uy+TbA==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1", - "external-editor": "^3.1.0" - } - }, - "@inquirer/expand": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.2.tgz", - "integrity": "sha512-WdgCX1cUtinz+syKyZdJomovULYlKUWZbVYZzhf+ZeeYf4htAQ3jLymoNs3koIAKfZZl3HUBb819ClCBfyznaw==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1", - "yoctocolors-cjs": "^2.1.2" - } - }, - "@inquirer/figures": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.8.tgz", - "integrity": "sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==" - }, - "@inquirer/input": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.0.2.tgz", - "integrity": "sha512-yCLCraigU085EcdpIVEDgyfGv4vBiE4I+k1qRkc9C5dMjWF42ADMGy1RFU94+eZlz4YlkmFsiyHZy0W1wdhaNg==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1" - } - }, - "@inquirer/number": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-3.0.2.tgz", - "integrity": "sha512-MKQhYofdUNk7eqJtz52KvM1dH6R93OMrqHduXCvuefKrsiMjHiMwjc3NZw5Imm2nqY7gWd9xdhYrtcHMJQZUxA==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1" - } - }, - "@inquirer/password": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-4.0.2.tgz", - "integrity": "sha512-tQXGSu7IO07gsYlGy3VgXRVsbOWqFBMbqAUrJSc1PDTQQ5Qdm+QVwkP0OC0jnUZ62D19iPgXOMO+tnWG+HhjNQ==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2" - } - }, - "@inquirer/prompts": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.1.0.tgz", - "integrity": "sha512-5U/XiVRH2pp1X6gpNAjWOglMf38/Ys522ncEHIKT1voRUvSj/DQnR22OVxHnwu5S+rCFaUiPQ57JOtMFQayqYA==", - "requires": { - "@inquirer/checkbox": "^4.0.2", - "@inquirer/confirm": "^5.0.2", - "@inquirer/editor": "^4.1.0", - "@inquirer/expand": "^4.0.2", - "@inquirer/input": "^4.0.2", - "@inquirer/number": "^3.0.2", - "@inquirer/password": "^4.0.2", - "@inquirer/rawlist": "^4.0.2", - "@inquirer/search": "^3.0.2", - "@inquirer/select": "^4.0.2" - } - }, - "@inquirer/rawlist": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.0.2.tgz", - "integrity": "sha512-3XGcskMoVF8H0Dl1S5TSZ3rMPPBWXRcM0VeNVsS4ByWeWjSeb0lPqfnBg6N7T0608I1B2bSVnbi2cwCrmOD1Yw==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/type": "^3.0.1", - "yoctocolors-cjs": "^2.1.2" - } - }, - "@inquirer/search": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-3.0.2.tgz", - "integrity": "sha512-Zv4FC7w4dJ13BOJfKRQCICQfShinGjb1bCEIHxTSnjj2telu3+3RHwHubPG9HyD4aix5s+lyAMEK/wSFD75HLA==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "yoctocolors-cjs": "^2.1.2" - } - }, - "@inquirer/select": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.0.2.tgz", - "integrity": "sha512-uSWUzaSYAEj0hlzxa1mUB6VqrKaYx0QxGBLZzU4xWFxaSyGaXxsSE4OSOwdU24j0xl8OajgayqFXW0l2bkl2kg==", - "requires": { - "@inquirer/core": "^10.1.0", - "@inquirer/figures": "^1.0.8", - "@inquirer/type": "^3.0.1", - "ansi-escapes": "^4.3.2", - "yoctocolors-cjs": "^2.1.2" - } - }, - "@inquirer/type": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.1.tgz", - "integrity": "sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==", - "requires": {} - }, "@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -3519,15 +3023,6 @@ "version": "2.0.4", "dev": true }, - "@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "peer": true, - "requires": { - "undici-types": "~6.20.0" - } - }, "agent-base": { "version": "6.0.2", "dev": true, @@ -3541,19 +3036,13 @@ "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "requires": { - "type-fest": "^0.21.3" - } - }, "ansi-regex": { - "version": "5.0.1" + "version": "5.0.1", + "dev": true }, "ansi-styles": { "version": "4.3.0", + "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -3722,11 +3211,6 @@ "supports-color": "^7.1.0" } }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" - }, "charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", @@ -3751,11 +3235,6 @@ "version": "1.1.4", "dev": true }, - "cli-width": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", - "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==" - }, "cliui": { "version": "7.0.4", "dev": true, @@ -3767,12 +3246,14 @@ }, "color-convert": { "version": "2.0.1", + "dev": true, "requires": { "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.4" + "version": "1.1.4", + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -3874,7 +3355,8 @@ "dev": true }, "emoji-regex": { - "version": "8.0.0" + "version": "8.0.0", + "dev": true }, "end-of-stream": { "version": "1.4.4", @@ -3897,16 +3379,6 @@ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", "dev": true }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, "fast-glob": { "version": "3.2.12", "dev": true, @@ -4092,14 +3564,6 @@ "debug": "4" } }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, "ieee754": { "version": "1.2.1", "dev": true @@ -4170,7 +3634,8 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "3.0.0" + "version": "3.0.0", + "dev": true }, "is-glob": { "version": "4.0.3", @@ -4261,6 +3726,11 @@ "universalify": "^2.0.0" } }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" + }, "klona": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", @@ -4463,11 +3933,6 @@ } } }, - "mute-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz", - "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==" - }, "napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -4508,11 +3973,6 @@ "klona": "^2.0.4" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==" - }, "p-is-promise": { "version": "3.0.0", "dev": true @@ -4710,6 +4170,15 @@ "version": "2.0.3", "dev": true }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, "pump": { "version": "3.0.0", "dev": true, @@ -4819,11 +4288,6 @@ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, "semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -4857,7 +4321,8 @@ "signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true }, "simple-concat": { "version": "1.0.1", @@ -4876,6 +4341,11 @@ "simple-concat": "^1.0.0" } }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, "slash": { "version": "3.0.0", "dev": true @@ -4902,6 +4372,7 @@ }, "string-width": { "version": "4.2.3", + "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4921,6 +4392,7 @@ }, "strip-ansi": { "version": "6.0.1", + "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -5040,14 +4512,6 @@ } } }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } - }, "to-fast-properties": { "version": "2.0.0", "dev": true @@ -5084,17 +4548,6 @@ "safe-buffer": "^5.0.1" } }, - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" - }, - "undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "peer": true - }, "universalify": { "version": "2.0.0", "dev": true @@ -5203,11 +4656,6 @@ "yocto-queue": { "version": "0.1.0", "dev": true - }, - "yoctocolors-cjs": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", - "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==" } } } diff --git a/package.json b/package.json index 7bf75ac..c5e282e 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ }, "homepage": "https://testbeats.com", "dependencies": { - "@inquirer/prompts": "^7.1.0", "async-retry": "^1.3.3", "dotenv": "^16.4.5", "form-data-lite": "^1.0.3", @@ -54,6 +53,7 @@ "performance-results-parser": "latest", "phin-retry": "^1.0.3", "pretty-ms": "^7.0.1", + "prompts": "^2.4.2", "rosters": "0.0.1", "sade": "^1.8.1", "test-results-parser": "0.2.5" diff --git a/src/cli.js b/src/cli.js index 0da7ea1..d7cc03b 100755 --- a/src/cli.js +++ b/src/cli.js @@ -2,7 +2,6 @@ require('dotenv').config(); const sade = require('sade'); -const { ExitPromptError } = require('@inquirer/prompts'); const prog = sade('testbeats'); const { PublishCommand } = require('./commands/publish.command'); diff --git a/src/commands/generate-config.command.js b/src/commands/generate-config.command.js index 149fe23..f6b0093 100644 --- a/src/commands/generate-config.command.js +++ b/src/commands/generate-config.command.js @@ -1,4 +1,4 @@ -const { input, confirm, checkbox } = require('@inquirer/prompts'); +const prompts = require('prompts'); const fs = require('fs/promises'); const logger = require('../utils/logger'); @@ -37,87 +37,114 @@ class GenerateConfigCommand { const targetExtensions = {}; const globalExtensions = []; const extensionsList = [ - { name: 'Quick Chart Test Summary', value: 'quick-chart-test-summary' }, - { name: 'CI Information', value: 'ci-info' }, - { name: 'Hyperlinks', value: 'hyperlinks' }, - { name: 'Mentions', value: 'mentions' }, - { name: 'Report Portal Analysis', value: 'report-portal-analysis' }, - { name: 'Report Portal History', value: 'report-portal-history' }, - { name: 'Percy Analysis', value: 'percy-analysis' }, - { name: 'Metadata', value: 'metadata' }, - { name: 'AI Failure Summary', value: 'ai-failure-summary' }, - { name: 'Smart Analysis', value: 'smart-analysis' }, - { name: 'Error Clusters', value: 'error-clusters' } + { title: 'Quick Chart Test Summary', value: 'quick-chart-test-summary' }, + { title: 'CI Information', value: 'ci-info' }, + { title: 'Hyperlinks', value: 'hyperlinks' }, + { title: 'Mentions', value: 'mentions' }, + { title: 'Report Portal Analysis', value: 'report-portal-analysis' }, + { title: 'Report Portal History', value: 'report-portal-history' }, + { title: 'Percy Analysis', value: 'percy-analysis' }, + { title: 'Metadata', value: 'metadata' }, + { title: 'AI Failure Summary', value: 'ai-failure-summary' }, + { title: 'Smart Analysis', value: 'smart-analysis' }, + { title: 'Error Clusters', value: 'error-clusters' } ]; // Get initial answers - const configPath = await input({ + const { configPath, includeResults } = await prompts([{ + type: 'text', + name: 'configPath', message: 'Enter path for configuration file :', - default: '.testbeats.json' - }); - - const includeResults = await confirm({ + initial: '.testbeats.json' + }, + { + type: 'toggle', + name: 'includeResults', message: 'Do you want to configure test results?', - default: true - }); + initial: true, + active: 'Yes', + inactive: 'No' + }]); if (includeResults) { - testResults = await checkbox({ + const response = await prompts({ + type: 'multiselect', + name: 'testResults', message: 'Select test result types to include:', choices: [ - { name: 'Mocha', value: 'mocha' , checked: true}, - { name: 'JUnit', value: 'junit' }, - { name: 'TestNG', value: 'testng' }, - { name: 'Cucumber', value: 'cucumber' }, - { name: 'NUnit', value: 'nunit' }, - { name: 'xUnit', value: 'xunit' }, - { name: 'MSTest', value: 'mstest' } + { title: 'Mocha', value: 'mocha', selected: true }, + { title: 'JUnit', value: 'junit' }, + { title: 'TestNG', value: 'testng' }, + { title: 'Cucumber', value: 'cucumber' }, + { title: 'NUnit', value: 'nunit' }, + { title: 'xUnit', value: 'xunit' }, + { title: 'MSTest', value: 'mstest' } ], - required: true + min: 1 }); + testResults = response.testResults; } - const includeTargets = await confirm({ + const { includeTargets } = await prompts({ + type: 'toggle', + name: 'includeTargets', message: 'Do you want to configure notification targets (slack, teams, chat etc)?', - default: true + initial: true, + active: 'Yes', + inactive: 'No' }); if (includeTargets) { - targets = await checkbox({ + const response = await prompts({ + type: 'multiselect', + name: 'targets', message: 'Select notification targets:', choices: [ - { name: 'Slack', value: 'slack' }, - { name: 'Microsoft Teams', value: 'teams' }, - { name: 'Google Chat', value: 'chat' } + { title: 'Slack', value: 'slack' }, + { title: 'Microsoft Teams', value: 'teams' }, + { title: 'Google Chat', value: 'chat' } ], - required: true + min: 1 }); + targets = response.targets; if (targets.length > 0) { - - title = await input({ + const { titleInput } = await prompts({ + type: 'text', + name: 'titleInput', message: 'Enter notification title (optional):' }); + title = titleInput; // For each target, ask about target-specific extensions for (const target of targets) { - webhookEnvVars[target] = await input({ + const { webhookEnvVar } = await prompts({ + type: 'text', + name: 'webhookEnvVar', message: `Enter environment variable name for ${target} webhook URL:`, - default: `${target.toUpperCase()}_WEBHOOK_URL` + initial: `${target.toUpperCase()}_WEBHOOK_URL` }); + webhookEnvVars[target] = webhookEnvVar; - const useExtensions = await confirm({ + const { useExtensions } = await prompts({ + type: 'toggle', + name: 'useExtensions', message: `Do you want to configure extensions for ${target}?`, - default: true + initial: true, + active: 'Yes', + inactive: 'No' }); if (useExtensions) { targetExtensions[`${target}Extensions`] = true; - targetExtensions[`${target}ExtensionsList`] = await checkbox({ + const { selectedExtensions } = await prompts({ + type: 'multiselect', + name: 'selectedExtensions', message: `Select extensions for ${target}:`, choices: extensionsList, - required: true + min: 1 }); + targetExtensions[`${target}ExtensionsList`] = selectedExtensions; // Configure extension-specific inputs for (const ext of targetExtensions[`${target}ExtensionsList`]) { @@ -128,16 +155,23 @@ class GenerateConfigCommand { } } - const includeGlobalExtensions = await confirm({ + const { includeGlobalExtensions } = await prompts({ + type: 'toggle', + name: 'includeGlobalExtensions', message: 'Do you want to configure global extensions?', - default: false + initial: false, + active: 'Yes', + inactive: 'No' }); if (includeGlobalExtensions) { - const globalExtensionsSelected = await checkbox({ + const { globalExtensionsSelected } = await prompts({ + type: 'multiselect', + name: 'globalExtensionsSelected', message: 'Select global extensions to enable:', choices: extensionsList }); + // Configure extension-specific inputs for (const ext of globalExtensionsSelected) { const extDetails = await this.#promptExtensionConfig(ext, null); @@ -149,26 +183,37 @@ class GenerateConfigCommand { const resultPaths = {}; if (testResults.length > 0) { for (const resultType of testResults) { - resultPaths[`${resultType}Path`] = await input({ + const { path } = await prompts({ + type: 'text', + name: 'path', message: `Enter file path for ${resultType} results (.json, .xml etc):`, - default: "", + initial: "" }); + resultPaths[`${resultType}Path`] = path; } } // TestBeats configuration - const includeTestBeats = await confirm({ + const { includeTestBeats } = await prompts({ + type: 'toggle', + name: 'includeTestBeats', message: 'Do you want to configure TestBeats API key (optional)?', - default: false + initial: false, + active: 'Yes', + inactive: 'No' }); if (includeTestBeats) { - const apiKey = await input({ + const { apiKey } = await prompts({ + type: 'text', + name: 'apiKey', message: 'Enter environment variable name for API key (optional):', - default: '{TEST_RESULTS_API_KEY}' + initial: '{TEST_RESULTS_API_KEY}' }); - const project = await input({ + const { project } = await prompts({ + type: 'text', + name: 'project', message: 'Enter project name (optional):' }); @@ -203,24 +248,44 @@ class GenerateConfigCommand { switch (extension) { case 'hyperlinks': const links = []; - const addLink = await confirm({ + const { addLink } = await prompts({ + type: 'toggle', + name: 'addLink', message: 'Do you want to add a hyperlink?', - default: true + initial: true, + active: 'Yes', + inactive: 'No' }); while (addLink) { - links.push({ - text: await input({ message: 'Enter link text:' }), - url: await input({ message: 'Enter link URL:' }), - condition: await input({ + const { text, url, condition } = await prompts([ + { + type: 'text', + name: 'text', + message: 'Enter link text:' + }, + { + type: 'text', + name: 'url', + message: 'Enter link URL:' + }, + { + type: 'text', + name: 'condition', message: 'Enter condition (PASS, FAIL, or PASS_OR_FAIL):', - default: 'PASS_OR_FAIL' - }) - }); + initial: 'PASS_OR_FAIL' + } + ]); + + links.push({ text, url, condition }); - const addAnother = await confirm({ + const { addAnother } = await prompts({ + type: 'toggle', + name: 'addAnother', message: 'Add another link?', - default: false + initial: false, + active: 'Yes', + inactive: 'No' }); if (!addAnother) break; } @@ -229,28 +294,56 @@ class GenerateConfigCommand { case 'mentions': const users = []; - const addUser = await confirm({ + const { addUser } = await prompts({ + type: 'toggle', + name: 'addUser', message: 'Do you want to add user mentions?', - default: true + initial: true, + active: 'Yes', + inactive: 'No' }); while (addUser) { const user = {}; - user.name = await input({ message: 'Enter user name:' }); + const { name } = await prompts({ + type: 'text', + name: 'name', + message: 'Enter user name:' + }); + user.name = name; if (target === 'teams') { - user.teams_upn = await input({ message: 'Enter Teams UPN (user principal name):' }); + const { teams_upn } = await prompts({ + type: 'text', + name: 'teams_upn', + message: 'Enter Teams UPN (user principal name):' + }); + user.teams_upn = teams_upn; } else if (target === 'slack') { - user.slack_uid = await input({ message: 'Enter Slack user ID:' }); + const { slack_uid } = await prompts({ + type: 'text', + name: 'slack_uid', + message: 'Enter Slack user ID:' + }); + user.slack_uid = slack_uid; } else if (target === 'chat') { - user.chat_uid = await input({ message: 'Enter Google Chat user ID:' }); + const { chat_uid } = await prompts({ + type: 'text', + name: 'chat_uid', + message: 'Enter Google Chat user ID:' + }); + user.chat_uid = chat_uid; } users.push(user); - const addAnother = await confirm({ + const { addAnother } = await prompts({ + type: 'toggle', + name: 'addAnother', message: 'Add another user?', - default: false + initial: false, + active: 'Yes', + inactive: 'No' }); if (!addAnother) break; } @@ -259,24 +352,44 @@ class GenerateConfigCommand { case 'metadata': const data = []; - const addMetadata = await confirm({ + const { addMetadata } = await prompts({ + type: 'toggle', + name: 'addMetadata', message: 'Do you want to add metadata?', - default: true + initial: true, + active: 'Yes', + inactive: 'No' }); while (addMetadata) { - data.push({ - key: await input({ message: 'Enter metadata key:' }), - value: await input({ message: 'Enter metadata value:' }), - condition: await input({ + const { key, value, condition } = await prompts([ + { + type: 'text', + name: 'key', + message: 'Enter metadata key:' + }, + { + type: 'text', + name: 'value', + message: 'Enter metadata value:' + }, + { + type: 'text', + name: 'condition', message: 'Enter condition (PASS, FAIL, or PASS_OR_FAIL):', - default: 'PASS_OR_FAIL' - }) - }); + initial: 'PASS_OR_FAIL' + } + ]); + + data.push({ key, value, condition }); - const addAnother = await confirm({ + const { addAnother } = await prompts({ + type: 'toggle', + name: 'addAnother', message: 'Add another metadata item?', - default: false + initial: false, + active: 'Yes', + inactive: 'No' }); if (!addAnother) break; }