diff --git a/package-lock.json b/package-lock.json index 49763ff8c8..05258dd001 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1378,7 +1378,6 @@ "integrity": "sha512-JTqrD47tV+rWc1y2W8T0NTfWLQMlSWX4OF64/Jf3WbsOD+4UXVIfjRlzPry7+1Zekm6pa38+23jkDBytYpu8yw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=20" } @@ -1447,8 +1446,7 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.19.tgz", "integrity": "sha512-VYHtPnZt/Zd/ATbW3rtexWpBnHUohUrQOHff/2JBhsVgxOrksAxJnLAO43Q1ayLJBJUUwNVo+RU0sx0aaysZfg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspell/dict-dart": { "version": "2.3.2", @@ -1588,16 +1586,14 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.14.tgz", "integrity": "sha512-2bf7n+kS92g+cMKV0wr9o/Oq9n8JzU7CcrB96gIh2GHgnF+0xDOqO2W/1KeFAqOfqosoOVE48t+4dnEMkkoJ2Q==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.5.tgz", "integrity": "sha512-429alTD4cE0FIwpMucvSN35Ld87HCyuM8mF731KU5Rm4Je2SG6hmVx7nkBsLyrmH3sQukTcr1GaiZsiEg8svPA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspell/dict-java": { "version": "5.0.12", @@ -1795,8 +1791,7 @@ "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.3.tgz", "integrity": "sha512-zXh1wYsNljQZfWWdSPYwQhpwiuW0KPW1dSd8idjMRvSD0aSvWWHoWlrMsmZeRl4qM4QCEAjua8+cjflm41cQBg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspell/dict-vue": { "version": "3.0.5", @@ -2783,80 +2778,6 @@ "node": ">=0.12.0" } }, - "node_modules/@heroku/heroku-cli-util": { - "version": "10.4.0-beta.1", - "resolved": "https://registry.npmjs.org/@heroku/heroku-cli-util/-/heroku-cli-util-10.4.0-beta.1.tgz", - "integrity": "sha512-+M5PBhl7MEKvg76RcOMF8idYmWD9f0zw4QEyL4wXBOxOSFzDIJ7Aoq3LD4UHO41Eu+2Rqbv+rcZkEC/6YpH+Mg==", - "license": "ISC", - "dependencies": { - "@heroku-cli/command": "^12.0.0", - "@heroku/http-call": "^5.5.0", - "@oclif/core": "^4.3.0", - "@oclif/table": "0.4.14", - "ansis": "^4.1.0", - "debug": "^4.4.0", - "inquirer": "^12.6.1", - "printf": "^0.6.1", - "tsheredoc": "^1.0.1", - "tunnel-ssh": "5.2.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/@heroku/heroku-cli-util/node_modules/ansis": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ansis/-/ansis-4.2.0.tgz", - "integrity": "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==", - "license": "ISC", - "engines": { - "node": ">=14" - } - }, - "node_modules/@heroku/heroku-cli-util/node_modules/inquirer": { - "version": "12.11.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-12.11.1.tgz", - "integrity": "sha512-9VF7mrY+3OmsAfjH3yKz/pLbJ5z22E23hENKw3/LNSaA/sAt3v49bDRY+Ygct1xwuKT+U+cBfTzjCPySna69Qw==", - "license": "MIT", - "dependencies": { - "@inquirer/ansi": "^1.0.2", - "@inquirer/core": "^10.3.2", - "@inquirer/prompts": "^7.10.1", - "@inquirer/type": "^3.0.10", - "mute-stream": "^2.0.0", - "run-async": "^4.0.6", - "rxjs": "^7.8.2" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/node": ">=18" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@heroku/heroku-cli-util/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==", - "license": "ISC", - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/@heroku/heroku-cli-util/node_modules/run-async": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-4.0.6.tgz", - "integrity": "sha512-IoDlSLTs3Yq593mb3ZoKWKXMNu3UpObxhgA/Xuid5p4bbfi2jdY1Hj0m1K+0/tEuQTxIGMhQDqGjKb7RuxGpAQ==", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/@heroku/http-call": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/@heroku/http-call/-/http-call-5.5.0.tgz", @@ -3363,6 +3284,7 @@ "version": "7.10.1", "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.10.1.tgz", "integrity": "sha512-Dx/y9bCQcXLI5ooQ5KyvA4FTgeo2jYj/7plWfV5Ak5wDPKQZgudKez2ixyfz7tKXzcJciTxqLeK7R9HItwiByg==", + "dev": true, "license": "MIT", "dependencies": { "@inquirer/checkbox": "^4.3.2", @@ -3392,6 +3314,7 @@ "version": "5.1.21", "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.21.tgz", "integrity": "sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==", + "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^10.3.2", @@ -3413,6 +3336,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-4.3.1.tgz", "integrity": "sha512-kN0pAM4yPrLjJ1XJBjDxyfDduXOuQHrBB8aLDMueuwUGn+vNpF7Gq7TvyVxx8u4SHlFFj4trmj+a2cbpG4Jn1g==", + "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^10.3.2", @@ -3434,6 +3358,7 @@ "version": "4.4.2", "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.4.2.tgz", "integrity": "sha512-l4xMuJo55MAe+N7Qr4rX90vypFwCajSakx59qe/tMaC1aEHWLyw68wF4o0A4SLAY4E0nd+Vt+EyskeDIqu1M6w==", + "dev": true, "license": "MIT", "dependencies": { "@inquirer/ansi": "^1.0.2", @@ -5023,7 +4948,6 @@ "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.8.0.tgz", "integrity": "sha512-jteNUQKgJHLHFbbz806aGZqf+RJJ7t4gwF4MYa8fCwCxQ8/klJNWc0MvaJiBebk7Mc+J39mdlsB4XraaCKznFw==", "license": "MIT", - "peer": true, "dependencies": { "ansi-escapes": "^4.3.2", "ansis": "^3.17.0", @@ -5219,7 +5143,6 @@ "version": "4.2.0", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^3.0.0", "@octokit/graphql": "^5.0.0", @@ -5362,7 +5285,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=8.0.0" } @@ -5384,7 +5306,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.2.0.tgz", "integrity": "sha512-qRkLWiUEZNAmYapZ7KGS5C4OmBLcP/H2foXeOEaowYCR0wi89fHejrfYfbuLVCMLp/dWZXKvQusdbUEZjERfwQ==", "license": "Apache-2.0", - "peer": true, "engines": { "node": "^18.19.0 || >=20.6.0" }, @@ -5397,7 +5318,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.2.0.tgz", "integrity": "sha512-FuabnnUm8LflnieVxs6eP7Z383hgQU4W1e3KJS6aOG3RxWxcHyBxH8fDMHNgu/gFx/M2jvTOW/4/PHhLz6bjWw==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/semantic-conventions": "^1.29.0" }, @@ -7514,7 +7434,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.38.0.tgz", "integrity": "sha512-kocjix+/sSggfJhwXqClZ3i9Y/MI0fp7b+g7kCRm6psy2dsf8uApTRclwG18h8Avm7C9+fnt+O36PspJ/OzoWg==", "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=14" } @@ -7750,7 +7669,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.208.0.tgz", "integrity": "sha512-Eju0L4qWcQS+oXxi6pgh7zvE2byogAkcsVv0OjHF/97iOz1N/aKE6etSGowYkie+YA1uo6DNwdSxaaNnLvcRlA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/api-logs": "0.208.0", "import-in-the-middle": "^2.0.0", @@ -7768,7 +7686,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.2.0.tgz", "integrity": "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/core": "2.2.0", "@opentelemetry/semantic-conventions": "^1.29.0" @@ -7785,7 +7702,6 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.2.0.tgz", "integrity": "sha512-xWQgL0Bmctsalg6PaXExmzdedSp3gyKV8mQBwK/j9VGdCDu2fmXIb2gAehBKbkXCpJ4HPkgv3QfoJWRT4dHWbw==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@opentelemetry/core": "2.2.0", "@opentelemetry/resources": "2.2.0", @@ -8851,7 +8767,6 @@ "node_modules/@types/node": { "version": "24.3.1", "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.10.0" } @@ -8902,7 +8817,6 @@ "node_modules/@types/react": { "version": "18.3.26", "license": "MIT", - "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -8979,7 +8893,6 @@ "version": "6.21.0", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "6.21.0", "@typescript-eslint/types": "6.21.0", @@ -9492,7 +9405,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -11925,7 +11837,6 @@ "version": "8.57.0", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -12322,7 +12233,6 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -16248,7 +16158,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "@nrwl/cli": "15.6.3", "@nrwl/tao": "15.6.3", @@ -17656,7 +17565,6 @@ "node_modules/react": { "version": "18.3.1", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -19499,7 +19407,6 @@ "node_modules/typescript": { "version": "4.9.5", "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -20210,7 +20117,7 @@ "@heroku-cli/schema": "^1.0.25", "@heroku/buildpack-registry": "^1.0.1", "@heroku/eventsource": "^1.0.7", - "@heroku/heroku-cli-util": "10.4.0-beta.1", + "@heroku/heroku-cli-util": "10.4.0", "@heroku/http-call": "^5.5.0", "@heroku/mcp-server": "1.0.7-alpha.1", "@heroku/plugin-ai": "^1.0.1", @@ -20236,6 +20143,7 @@ "@sentry/opentelemetry": "^10.27.0", "@types/js-yaml": "^3.12.5", "ansi-escapes": "3.2.0", + "ansis": "^4", "bytes": "^3.1.2", "cli-progress": "^3.12.0", "commander": "^2.15.1", @@ -20268,7 +20176,6 @@ "ssh2": "^1.16.0", "stdout-stderr": "^0.1.13", "strftime": "^0.10.0", - "strip-ansi": "^6", "term-img": "^4.1.0", "tmp": "^0.2.5", "true-myth": "4.1.1", @@ -20316,7 +20223,6 @@ "@types/uuid": "^8.3.0", "@types/write-json-file": "^3.2.1", "@types/ws": "^6.0.1", - "ansis": "^4", "bats": "^1.1.0", "chai": "^4.4.1", "chai-as-promised": "^7.1.1", @@ -20332,7 +20238,6 @@ "sinon": "^19.0.2", "source-map-support": "^0.5.21", "std-mocks": "^2.0.0", - "strip-ansi": "6.0.1", "ts-node": "^10.9.2", "typescript": "4.8.4" }, @@ -21334,7 +21239,6 @@ "version": "7.23.9", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.23.5", @@ -21674,6 +21578,141 @@ "version": "2.2.3", "license": "MIT" }, + "packages/cli/node_modules/@heroku/heroku-cli-util": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/@heroku/heroku-cli-util/-/heroku-cli-util-10.4.0.tgz", + "integrity": "sha512-3WJZukxSS4mgAZ+ovJ4Bg0ZHcoe0ySjgzzR5q7miX9EmPEzaPOEx2o6HK8q3o447+rUpyR3ZZNyS/hUv6eBiyw==", + "license": "ISC", + "dependencies": { + "@heroku-cli/command": "^12.0.0", + "@heroku/http-call": "^5.5.0", + "@oclif/core": "^4.3.0", + "@oclif/table": "0.4.14", + "ansis": "^4.1.0", + "debug": "^4.4.0", + "inquirer": "^12.6.1", + "printf": "^0.6.1", + "tsheredoc": "^1.0.1", + "tunnel-ssh": "5.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "packages/cli/node_modules/@heroku/heroku-cli-util/node_modules/@inquirer/prompts": { + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.10.1.tgz", + "integrity": "sha512-Dx/y9bCQcXLI5ooQ5KyvA4FTgeo2jYj/7plWfV5Ak5wDPKQZgudKez2ixyfz7tKXzcJciTxqLeK7R9HItwiByg==", + "license": "MIT", + "dependencies": { + "@inquirer/checkbox": "^4.3.2", + "@inquirer/confirm": "^5.1.21", + "@inquirer/editor": "^4.2.23", + "@inquirer/expand": "^4.0.23", + "@inquirer/input": "^4.3.1", + "@inquirer/number": "^3.0.23", + "@inquirer/password": "^4.0.23", + "@inquirer/rawlist": "^4.1.11", + "@inquirer/search": "^3.2.2", + "@inquirer/select": "^4.4.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "packages/cli/node_modules/@heroku/heroku-cli-util/node_modules/@inquirer/select": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-4.4.2.tgz", + "integrity": "sha512-l4xMuJo55MAe+N7Qr4rX90vypFwCajSakx59qe/tMaC1aEHWLyw68wF4o0A4SLAY4E0nd+Vt+EyskeDIqu1M6w==", + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^1.0.2", + "@inquirer/core": "^10.3.2", + "@inquirer/figures": "^1.0.15", + "@inquirer/type": "^3.0.10", + "yoctocolors-cjs": "^2.1.3" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "packages/cli/node_modules/@heroku/heroku-cli-util/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "packages/cli/node_modules/@heroku/heroku-cli-util/node_modules/inquirer": { + "version": "12.11.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-12.11.1.tgz", + "integrity": "sha512-9VF7mrY+3OmsAfjH3yKz/pLbJ5z22E23hENKw3/LNSaA/sAt3v49bDRY+Ygct1xwuKT+U+cBfTzjCPySna69Qw==", + "license": "MIT", + "dependencies": { + "@inquirer/ansi": "^1.0.2", + "@inquirer/core": "^10.3.2", + "@inquirer/prompts": "^7.10.1", + "@inquirer/type": "^3.0.10", + "mute-stream": "^2.0.0", + "run-async": "^4.0.6", + "rxjs": "^7.8.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "packages/cli/node_modules/@heroku/heroku-cli-util/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==", + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "packages/cli/node_modules/@heroku/heroku-cli-util/node_modules/run-async": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-4.0.6.tgz", + "integrity": "sha512-IoDlSLTs3Yq593mb3ZoKWKXMNu3UpObxhgA/Xuid5p4bbfi2jdY1Hj0m1K+0/tEuQTxIGMhQDqGjKb7RuxGpAQ==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, "packages/cli/node_modules/@heroku/mcp-server": { "version": "1.0.7-alpha.1", "license": "Apache-2.0", @@ -23786,7 +23825,6 @@ "packages/cli/node_modules/@types/node": { "version": "22.16.5", "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~6.21.0" } @@ -23946,7 +23984,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/ansis/-/ansis-4.2.0.tgz", "integrity": "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==", - "dev": true, "license": "ISC", "engines": { "node": ">=14" @@ -24203,7 +24240,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001580", "electron-to-chromium": "^1.4.648", @@ -24261,7 +24297,6 @@ "version": "4.4.1", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.3", @@ -28531,7 +28566,6 @@ "version": "15.1.0", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.2", @@ -30272,7 +30306,6 @@ "packages/cli/node_modules/zod": { "version": "3.25.76", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/packages/cli/package.json b/packages/cli/package.json index 776b90fb35..00ba20583e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -12,7 +12,7 @@ "@heroku-cli/schema": "^1.0.25", "@heroku/buildpack-registry": "^1.0.1", "@heroku/eventsource": "^1.0.7", - "@heroku/heroku-cli-util": "10.4.0-beta.1", + "@heroku/heroku-cli-util": "10.4.0", "@heroku/http-call": "^5.5.0", "@heroku/mcp-server": "1.0.7-alpha.1", "@heroku/plugin-ai": "^1.0.1", @@ -38,6 +38,7 @@ "@sentry/opentelemetry": "^10.27.0", "@types/js-yaml": "^3.12.5", "ansi-escapes": "3.2.0", + "ansis": "^4", "bytes": "^3.1.2", "cli-progress": "^3.12.0", "commander": "^2.15.1", @@ -70,7 +71,6 @@ "ssh2": "^1.16.0", "stdout-stderr": "^0.1.13", "strftime": "^0.10.0", - "strip-ansi": "^6", "term-img": "^4.1.0", "tmp": "^0.2.5", "true-myth": "4.1.1", @@ -115,7 +115,6 @@ "@types/uuid": "^8.3.0", "@types/write-json-file": "^3.2.1", "@types/ws": "^6.0.1", - "ansis": "^4", "bats": "^1.1.0", "chai": "^4.4.1", "chai-as-promised": "^7.1.1", @@ -131,7 +130,6 @@ "sinon": "^19.0.2", "source-map-support": "^0.5.21", "std-mocks": "^2.0.0", - "strip-ansi": "6.0.1", "ts-node": "^10.9.2", "typescript": "4.8.4" }, diff --git a/packages/cli/src/commands/access/index.ts b/packages/cli/src/commands/access/index.ts index ed68cad242..be261f19c5 100644 --- a/packages/cli/src/commands/access/index.ts +++ b/packages/cli/src/commands/access/index.ts @@ -27,7 +27,7 @@ function buildTableColumns(showPermissions: boolean) { get: ({email}: any): string => color.user(email), }, role: { - get: ({role}: any) => color.green(role), + get: ({role}: any) => color.info(role), }, } diff --git a/packages/cli/src/commands/apps/create.ts b/packages/cli/src/commands/apps/create.ts index a802759365..90635088c3 100644 --- a/packages/cli/src/commands/apps/create.ts +++ b/packages/cli/src/commands/apps/create.ts @@ -45,11 +45,11 @@ async function createApp(context: Interfaces.ParserOutput, heroku: APIClient, na let status = name ? 'done' : `done, ${color.app(app.name || '')}` if (flags.region) { - status += `, region is ${color.yellow(app.region?.name || '')}` + status += `, region is ${color.info(app.region?.name || '')}` } if (stack) { - status += `, stack is ${color.yellow(app.stack?.name || '')}` + status += `, stack is ${color.info(app.stack?.name || '')}` } ux.action.stop(status) @@ -99,7 +99,7 @@ function printAppSummary(context: Interfaces.ParserOutput, app: Heroku.App, remo if (context.flags.json) { hux.styledJSON(app) } else { - ux.stdout(`${color.cyan(app.web_url || '')} | ${color.green(remoteUrl)}`) + ux.stdout(`${color.info(app.web_url || '')} | ${color.info(remoteUrl)}`) } } @@ -112,7 +112,7 @@ async function runFromFlags(context: Interfaces.ParserOutput, heroku: APIClient, const name = flags.app || args.app || process.env.HEROKU_APP async function addBuildpack(app: Heroku.App, buildpack: string) { - ux.action.start(`Setting buildpack to ${color.cyan(buildpack)}`) + ux.action.start(`Setting buildpack to ${color.info(buildpack)}`) await heroku.put(`/apps/${app.name}/buildpack-installations`, { body: {updates: [{buildpack}]}, headers: {Range: ''}, diff --git a/packages/cli/src/commands/apps/errors.ts b/packages/cli/src/commands/apps/errors.ts index 63880ecb15..cf2056c341 100644 --- a/packages/cli/src/commands/apps/errors.ts +++ b/packages/cli/src/commands/apps/errors.ts @@ -20,7 +20,7 @@ const colorize = (level: string, s: string) => { } case 'info': { - return color.cyan(s) + return color.info(s) } default: { diff --git a/packages/cli/src/commands/apps/index.ts b/packages/cli/src/commands/apps/index.ts index 378f9918be..30e0104626 100644 --- a/packages/cli/src/commands/apps/index.ts +++ b/packages/cli/src/commands/apps/index.ts @@ -23,7 +23,7 @@ function annotateAppName(app: App) { function regionizeAppName(app: App) { const name = annotateAppName(app) if (app.region && app.region.name !== 'us') { - return `${name} (${color.green(app.region.name)})` + return `${name} (${color.info(app.region.name)})` } return name diff --git a/packages/cli/src/commands/apps/info.ts b/packages/cli/src/commands/apps/info.ts index b9e27b618b..d9aaf8261a 100644 --- a/packages/cli/src/commands/apps/info.ts +++ b/packages/cli/src/commands/apps/info.ts @@ -73,7 +73,7 @@ function print(info: Heroku.App, addons: Heroku.AddOn[], collaborators: Heroku.C data['Auto Cert Mgmt'] = info.app.acm data['Git URL'] = info.app.git_url - data['Web URL'] = info.app.web_url + data['Web URL'] = color.info(info.app.web_url) data['Repo Size'] = filesize(info.app.repo_size, {round: 0, standard: 'jedec'}) if (getGeneration(info.app) !== 'fir') data['Slug Size'] = filesize(info.app.slug_size, {round: 0, standard: 'jedec'}) data.Owner = color.user(info.app.owner.email) diff --git a/packages/cli/src/commands/apps/rename.ts b/packages/cli/src/commands/apps/rename.ts index b3e1c12069..e309e18df0 100644 --- a/packages/cli/src/commands/apps/rename.ts +++ b/packages/cli/src/commands/apps/rename.ts @@ -37,7 +37,7 @@ export default class AppsRename extends Command { ux.action.stop() const gitUrl = git.gitUrl(app.name) - ux.stdout(`${app.web_url} | ${gitUrl}`) + ux.stdout(`${color.info(app.web_url!)} | ${color.info(gitUrl)}`) if (!app.web_url!.includes('https')) { ux.stdout('Please note that it may take a few minutes for Heroku to provision a SSL certificate for your application.') @@ -60,7 +60,7 @@ export default class AppsRename extends Command { const {name} = remote await git.rmRemote(name) await git.createRemote(name, url.replace(oldApp, newApp)) - ux.stdout(`Git remote ${name} updated`) + ux.stdout(`Git remote ${color.name(name)} updated`) } } diff --git a/packages/cli/src/commands/authorizations/index.ts b/packages/cli/src/commands/authorizations/index.ts index 590dd6fe68..4d36896024 100644 --- a/packages/cli/src/commands/authorizations/index.ts +++ b/packages/cli/src/commands/authorizations/index.ts @@ -25,7 +25,7 @@ export default class AuthorizationsIndex extends Command { ux.stdout('No OAuth authorizations.') } else { hux.table(authorizations, { - Description: {get: (v: any) => color.green(v.description)}, + Description: {get: (v: any) => color.name(v.description)}, ID: {get: (v: any) => v.id}, Scope: {get: (v: any) => v.scope.join(',')}, }, {sort: {Description: 'asc'}}) diff --git a/packages/cli/src/commands/clients/create.ts b/packages/cli/src/commands/clients/create.ts index ae2269ac18..1ec566dc62 100644 --- a/packages/cli/src/commands/clients/create.ts +++ b/packages/cli/src/commands/clients/create.ts @@ -40,8 +40,8 @@ export default class ClientsCreate extends Command { if (flags.json) { hux.styledJSON(client) } else { - ux.stdout(`HEROKU_OAUTH_ID=${client.id}`) - ux.stdout(`HEROKU_OAUTH_SECRET=${client.secret}`) + ux.stdout(`${color.label('HEROKU_OAUTH_ID')}=${color.name(client.id!)}`) + ux.stdout(`${color.label('HEROKU_OAUTH_SECRET')}=${color.info(client.secret!)}`) } } } diff --git a/packages/cli/src/commands/config/set.ts b/packages/cli/src/commands/config/set.ts index 6ee8796bff..5863bf4b93 100644 --- a/packages/cli/src/commands/config/set.ts +++ b/packages/cli/src/commands/config/set.ts @@ -47,13 +47,13 @@ RACK_ENV: staging`)] argv.forEach((v: string) => { const idx = v.indexOf('=') if (idx === -1) { - ux.error(`${color.cyan(v)} is invalid. Must be in the format ${color.cyan('FOO=bar')}.`, {exit: 1}) + ux.error(`${color.name(v)} is invalid. Must be in the format ${color.code('FOO=bar')}.`, {exit: 1}) } vars[v.slice(0, idx)] = v.slice(idx + 1) }) - const varsCopy = argv.map((v: string) => color.green(v.split('=')[0])).join(', ') + const varsCopy = argv.map((v: string) => color.name(v.split('=')[0])).join(', ') ux.action.start(`Setting ${varsCopy} and restarting ${color.app(flags.app)}`) let {body: config} = await this.heroku.patch(`/apps/${flags.app}/config-vars`, { @@ -65,7 +65,7 @@ RACK_ENV: staging`)] config = Object.fromEntries( Object.entries(config) .filter(([k]) => vars[k]) - .map(([k, v]) => [color.green(k), v]), + .map(([k, v]) => [color.name(k), v]), ) hux.styledObject(config) await this.config.runHook('recache', {app: flags.app, type: 'config'}) diff --git a/packages/cli/src/commands/domains/index.ts b/packages/cli/src/commands/domains/index.ts index d1cf876e28..ac71346216 100644 --- a/packages/cli/src/commands/domains/index.ts +++ b/packages/cli/src/commands/domains/index.ts @@ -199,7 +199,7 @@ www.example.com CNAME www.example.herokudns.com`] hux.styledJSON(domains) } else { hux.styledHeader(`${color.app(flags.app)} Heroku Domain`) - ux.stdout(herokuDomain && herokuDomain.hostname) + ux.stdout(herokuDomain && color.info(herokuDomain.hostname!)) if (customDomains && customDomains.length > 0) { ux.stdout() diff --git a/packages/cli/src/commands/drains/index.ts b/packages/cli/src/commands/drains/index.ts index 7c9966235b..c9bfd4114b 100644 --- a/packages/cli/src/commands/drains/index.ts +++ b/packages/cli/src/commands/drains/index.ts @@ -47,7 +47,7 @@ export default class Drains extends Command { if (drainsWithoutAddons.length > 0) { hux.styledHeader('Drains') drainsWithoutAddons.forEach((drain: Heroku.LogDrain) => { - styledDrain(drain.url || '', color.green(drain.token || ''), drain) + styledDrain(drain.url || '', color.name(drain.token || ''), drain) }) } diff --git a/packages/cli/src/commands/keys/index.ts b/packages/cli/src/commands/keys/index.ts index a651f1abec..131de455b4 100644 --- a/packages/cli/src/commands/keys/index.ts +++ b/packages/cli/src/commands/keys/index.ts @@ -5,7 +5,7 @@ import {ux} from '@oclif/core' function formatKey(key: string) { const [name, pub, email] = key.trim().split(/\s/) - return `${name} ${pub.slice(0, 10)}...${pub.slice(-10)} ${color.green(email)}` + return `${name} ${pub.slice(0, 10)}...${pub.slice(-10)} ${color.user(email)}` } export default class Keys extends Command { diff --git a/packages/cli/src/commands/members/index.ts b/packages/cli/src/commands/members/index.ts index 8fff320aa8..a50132515c 100644 --- a/packages/cli/src/commands/members/index.ts +++ b/packages/cli/src/commands/members/index.ts @@ -14,7 +14,7 @@ const buildTableColumns = (teamInvites: MemberWithStatus[]) => { get: ({email}: any): string => color.user(email), }, role: { - get: ({role}: any): string => color.green(role), + get: ({role}: any): string => color.info(role), }, } @@ -22,7 +22,10 @@ const buildTableColumns = (teamInvites: MemberWithStatus[]) => { return { ...baseColumns, status: { - get: ({status}: any): string => color.green(status), + get({status}: any): string { + if (status === 'pending') return color.warning(status) + return color.success(status) + }, }, } } @@ -84,7 +87,7 @@ export default class MembersIndex extends Command { } else if (members.length === 0) { let msg = `No members in ${color.team(team || '')}` if (role) - msg += ` with role ${color.green(role)}` + msg += ` with role ${color.info(role)}` ux.stdout(msg) } else { const tableColumns = buildTableColumns(teamInvites) diff --git a/packages/cli/src/commands/pg/backups/index.ts b/packages/cli/src/commands/pg/backups/index.ts index 62fb727063..cd5a3bbf0d 100644 --- a/packages/cli/src/commands/pg/backups/index.ts +++ b/packages/cli/src/commands/pg/backups/index.ts @@ -39,7 +39,7 @@ export default class Index extends Command { const pgbackups = backupsFactory(app, this.heroku) hux.styledHeader('Backups') if (backups.length === 0) { - ux.stdout(`No backups. Capture one with ${color.cyan.bold('heroku pg:backups:capture')}`) + ux.stdout(`No backups. Capture one with ${color.code('heroku pg:backups:capture')}`) } else { /* eslint-disable perfectionist/sort-objects */ hux.table(backups, { @@ -70,7 +70,7 @@ export default class Index extends Command { const copies = transfers.filter(t => t.from_type === 'pg_dump' && t.to_type === 'pg_restore').slice(0, 10) hux.styledHeader('Copies') if (copies.length === 0) { - ux.stdout(`No copies found. Use ${color.cyan.bold('heroku pg:copy')} to copy a database to another`) + ux.stdout(`No copies found. Use ${color.code('heroku pg:copy')} to copy a database to another`) } else { /* eslint-disable perfectionist/sort-objects */ hux.table(copies, { @@ -106,11 +106,11 @@ export default class Index extends Command { const pgbackups = backupsFactory(app, this.heroku) hux.styledHeader('Restores') if (restores.length === 0) { - ux.stdout(`No restores found. Use ${color.cyan.bold('heroku pg:backups:restore')} to restore a backup`) + ux.stdout(`No restores found. Use ${color.code('heroku pg:backups:restore')} to restore a backup`) } else { hux.table(restores, { ID: { - get: (transfer: BackupTransfer) => color.cyan(pgbackups.name(transfer)), + get: (transfer: BackupTransfer) => color.name(pgbackups.name(transfer)), }, 'Started at': { get: (transfer: BackupTransfer) => transfer.created_at, @@ -122,7 +122,7 @@ export default class Index extends Command { get: (transfer: BackupTransfer) => pgbackups.filesize(transfer.processed_bytes), }, Database: { - get: (transfer: BackupTransfer) => color.green(transfer.to_name) || 'UNKNOWN', + get: (transfer: BackupTransfer) => color.datastore(transfer.to_name) || 'UNKNOWN', }, }) } diff --git a/packages/cli/src/commands/pg/backups/info.ts b/packages/cli/src/commands/pg/backups/info.ts index 323d59b53c..0e5d153d7e 100644 --- a/packages/cli/src/commands/pg/backups/info.ts +++ b/packages/cli/src/commands/pg/backups/info.ts @@ -48,7 +48,7 @@ export default class Info extends Command { displayBackup = (backup: BackupTransfer, app: string) => { const pgbackups = pgBackupsApi(app, this.heroku) - hux.styledHeader(`Backup ${color.cyan(pgbackups.name(backup))}`) + hux.styledHeader(`Backup ${color.name(pgbackups.name(backup))}`) /* eslint-disable perfectionist/sort-objects */ hux.styledObject({ Database: color.datastore(backup.from_name), @@ -82,7 +82,7 @@ export default class Info extends Command { const backups = transfers.filter(t => t.from_type === 'pg_dump' && t.to_type === 'gof3r') const lastBackup = backups.pop() if (!lastBackup) - throw new Error(`No backups. Capture one with ${color.cyan.bold('heroku pg:backups:capture')}`) + throw new Error(`No backups. Capture one with ${color.code('heroku pg:backups:capture')}`) backupID = lastBackup.num } diff --git a/packages/cli/src/commands/pg/backups/schedules.ts b/packages/cli/src/commands/pg/backups/schedules.ts index 7b71a30631..fb6c40b3ba 100644 --- a/packages/cli/src/commands/pg/backups/schedules.ts +++ b/packages/cli/src/commands/pg/backups/schedules.ts @@ -20,11 +20,11 @@ export default class Schedules extends Command { const db = await dbResolver.getArbitraryLegacyDB(app) const {body: schedules} = await this.heroku.get(`/client/v11/databases/${db.id}/transfer-schedules`, {hostname: utils.pg.host()}) if (schedules.length === 0) { - ux.warn(`No backup schedules found on ${color.app(app)}\nUse ${color.cyan.bold('heroku pg:backups:schedule')} to set one up`) + ux.warn(`No backup schedules found on ${color.app(app)}\nUse ${color.code('heroku pg:backups:schedule')} to set one up`) } else { hux.styledHeader('Backup Schedules') for (const s of schedules) { - ux.stdout(`${color.green(s.name)}: daily at ${s.hour}:00 ${s.timezone}\n`) + ux.stdout(`${color.name(s.name)}: daily at ${s.hour}:00 ${s.timezone}\n`) } } } diff --git a/packages/cli/src/commands/pg/info.ts b/packages/cli/src/commands/pg/info.ts index 461e579cfd..bdef848b7b 100644 --- a/packages/cli/src/commands/pg/info.ts +++ b/packages/cli/src/commands/pg/info.ts @@ -18,7 +18,7 @@ function displayDB(db: DBObject, app: string) { hux.styledHeader(db.addon.attachment_names.map((c: string) => color.attachment(c + '_URL')) .join(', ')) } else { - hux.styledHeader(db.configVars?.map(c => color.green(c)) + hux.styledHeader(db.configVars?.map(c => color.name(c)) .join(', ') || '') } diff --git a/packages/cli/src/commands/ps/index.ts b/packages/cli/src/commands/ps/index.ts index f4ddf865e1..3472ef896c 100644 --- a/packages/cli/src/commands/ps/index.ts +++ b/packages/cli/src/commands/ps/index.ts @@ -120,7 +120,7 @@ async function printAccountQuota(heroku: APIClient, app: AppProcessTier, account ux.stdout(`Eco dyno hours quota remaining this month: ${hours}h ${minutes}m (${percentage}%)`) ux.stdout(`Eco dyno usage for this app: ${appHours}h ${appMinutes}m (${appPercentage}%)`) ux.stdout('For more information on Eco dyno hours, see:') - ux.stdout('https://devcenter.heroku.com/articles/eco-dyno-hours') + ux.stdout(color.info('https://devcenter.heroku.com/articles/eco-dyno-hours')) ux.stdout() } @@ -128,7 +128,7 @@ async function printAccountQuota(heroku: APIClient, app: AppProcessTier, account ux.stdout(`Free dyno hours quota remaining this month: ${hours}h ${minutes}m (${percentage}%)`) ux.stdout(`Free dyno usage for this app: ${appHours}h ${appMinutes}m (${appPercentage}%)`) ux.stdout('For more information on dyno sleeping and how to upgrade, see:') - ux.stdout('https://devcenter.heroku.com/articles/dyno-sleeping') + ux.stdout(color.info('https://devcenter.heroku.com/articles/dyno-sleeping')) ux.stdout() } } @@ -137,14 +137,14 @@ function decorateOneOffDyno(dyno: DynoExtended) : string { const since = ago(new Date(dyno.updated_at)) // eslint-disable-next-line unicorn/explicit-length-check const size = dyno.size || '1X' - const state = dyno.state === 'up' ? color.green(dyno.state) : color.yellow(dyno.state) + const state = dyno.state === 'up' ? color.success(dyno.state) : color.warning(dyno.state) - return `${dyno.name} (${color.cyan(size)}): ${state} ${color.dim(since)}: ${dyno.command}` + return `${dyno.name} (${color.info(size)}): ${state} ${color.dim(since)}: ${dyno.command}` } function decorateCommandDyno(dyno: DynoExtended) : string { const since = ago(new Date(dyno.updated_at)) - const state = dyno.state === 'up' ? color.green(dyno.state) : color.yellow(dyno.state) + const state = dyno.state === 'up' ? color.success(dyno.state) : color.warning(dyno.state) return `${dyno.name}: ${state} ${color.dim(since)}` } @@ -158,7 +158,7 @@ function printDynos(dynos: DynoExtended[]) : void { // Print one-off dynos if (oneOffs.length > 0) { - hux.styledHeader(`${color.green('run')}: one-off processes (${color.yellow(oneOffs.length.toString())})`) + hux.styledHeader(`${color.label('run')}: one-off processes (${oneOffs.length})`) oneOffs.forEach(dyno => ux.stdout(decorateOneOffDyno(dyno))) ux.stdout() } @@ -168,7 +168,7 @@ function printDynos(dynos: DynoExtended[]) : void { const commandDynos = dynos.filter(d => d.command === command).sort(byProcessNumber) const {size = '1X', type} = commandDynos[0] - hux.styledHeader(`${color.green(type)} (${color.cyan(size)}): ${command} (${color.yellow(commandDynos.length.toString())})`) + hux.styledHeader(`${color.label(type)} (${color.info(size)}): ${command} (${commandDynos.length})`) for (const dyno of commandDynos) ux.stdout(decorateCommandDyno(dyno)) ux.stdout() @@ -233,7 +233,7 @@ export default class Index extends Command { selectedDynos = selectedDynos.filter(dyno => types.find((t: string) => dyno.type === t)) types.forEach(t => { if (!selectedDynos.some(d => d.type === t)) { - throw new Error(`No ${color.cyan(t)} dynos on ${color.app(app)}`) + throw new Error(`No ${color.info(t)} dynos on ${color.app(app)}`) } }) } diff --git a/packages/cli/src/commands/releases/index.ts b/packages/cli/src/commands/releases/index.ts index 36f74295fa..49ead8d13c 100644 --- a/packages/cli/src/commands/releases/index.ts +++ b/packages/cli/src/commands/releases/index.ts @@ -1,9 +1,9 @@ +import ansis from 'ansis' import {color, hux} from '@heroku/heroku-cli-util' import {Command, flags} from '@heroku-cli/command' import * as Heroku from '@heroku-cli/schema' import {ux} from '@oclif/core' import _ from 'lodash' -import stripAnsi from 'strip-ansi' import * as statusHelper from '../../lib/releases/status_helper.js' import * as time from '../../lib/time.js' @@ -52,7 +52,7 @@ const getDescriptionTruncation = function (releases: Heroku.Release[], columns: if (key !== optimizeKey) { optimizationWidthMap[key] = Math.max( optimizationWidthMap[key], - stripAnsi(String(formattedValue)).length, + ansis.strip(String(formattedValue)).length, ) } } diff --git a/packages/cli/src/commands/releases/info.ts b/packages/cli/src/commands/releases/info.ts index ac6b473e38..84fba501e1 100644 --- a/packages/cli/src/commands/releases/info.ts +++ b/packages/cli/src/commands/releases/info.ts @@ -40,29 +40,29 @@ export default class Info extends Command { let colorFn: (s: string) => string switch (statusColor) { case 'red': { - colorFn = color.red + colorFn = color.failure break } case 'yellow': { - colorFn = color.yellow + colorFn = color.warning break } case 'gray': { - colorFn = color.gray + colorFn = color.inactive break } default: { - colorFn = color.cyan + colorFn = color.info } } releaseChange += ' (' + colorFn(status) + ')' } - hux.styledHeader(`Release ${color.cyan('v' + release.version)}`) + hux.styledHeader(`Release ${color.name('v' + release.version)}`) /* eslint-disable perfectionist/sort-objects */ hux.styledObject({ 'Add-ons': release.addon_plan_names, @@ -73,7 +73,7 @@ export default class Info extends Command { }) /* eslint-enable perfectionist/sort-objects */ ux.stdout() - hux.styledHeader(`${color.cyan('v' + release.version)} Config vars`) + hux.styledHeader(`${color.name('v' + release.version)} Config vars`) if (shell) { Object.entries(config).forEach(([k, v]) => { ux.stdout(`${k}=${quote(v)}`) diff --git a/packages/cli/src/commands/spaces/index.ts b/packages/cli/src/commands/spaces/index.ts index 3fe9cebe0b..0883ddb026 100644 --- a/packages/cli/src/commands/spaces/index.ts +++ b/packages/cli/src/commands/spaces/index.ts @@ -24,7 +24,13 @@ export default class Index extends Command { Name: {get: space => color.space(space.name)}, Team: {get: space => color.team(space.team.name || '')}, Region: {get: space => space.region.name}, - State: {get: space => space.state}, + State: { + get(space) { + if (space.state === 'allocated') return color.success(space.state) + if (space.state === 'deleting') return color.failure(space.state) + return color.warning(space.state) + }, + }, Generation: {get: space => getGeneration(space)}, createdAt: { header: 'Created At', @@ -56,7 +62,7 @@ export default class Index extends Command { this.displayJSON(spaces) else if (spaces.length === 0) { if (team) - ux.error(`No spaces in ${color.cyan(team)}.`) + ux.error(`No spaces in ${color.team(team)}.`) else ux.error('You do not have access to any spaces.') } else { diff --git a/packages/cli/src/commands/teams/index.ts b/packages/cli/src/commands/teams/index.ts index b84e974531..47bd2bf8a1 100644 --- a/packages/cli/src/commands/teams/index.ts +++ b/packages/cli/src/commands/teams/index.ts @@ -23,7 +23,7 @@ export default class Index extends Command { return (aName > bName) ? 1 : ((bName > aName) ? -1 : 0) }), { name: {header: 'Team'}, - role: {get: ({role}) => color.green(role || ''), header: 'Role'}, + role: {get: ({role}) => color.info(role || ''), header: 'Role'}, }) } } diff --git a/packages/cli/src/lib/addons/create_addon.ts b/packages/cli/src/lib/addons/create_addon.ts index ce621509ce..5eec6fb010 100644 --- a/packages/cli/src/lib/addons/create_addon.ts +++ b/packages/cli/src/lib/addons/create_addon.ts @@ -66,7 +66,8 @@ export default async function ( ux.stdout(formatConfigVarsMessage(addon)) } else { ux.stdout(`${color.addon(addon.name || '')} is being created in the background. The app will restart when complete...`) - if (utils.pg.isAdvancedDatabase(addon)) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (utils.pg.isAdvancedDatabase(addon as any)) ux.stdout(`Run ${color.code('heroku data:pg:info ' + addon.name + ' -a ' + addon.app!.name)} to check creation progress.`) else ux.stdout(`Run ${color.code('heroku addons:info ' + addon.name)} to check creation progress.`) diff --git a/packages/cli/src/lib/addons/destroy_addon.ts b/packages/cli/src/lib/addons/destroy_addon.ts index 247094a46f..220facab3c 100644 --- a/packages/cli/src/lib/addons/destroy_addon.ts +++ b/packages/cli/src/lib/addons/destroy_addon.ts @@ -16,7 +16,8 @@ export default async function (heroku: APIClient, addon: Heroku.AddOn, force = f headers: {'Accept-Expansion': 'plan'}, }).catch(error => { const errorMessage = error.body?.message || error - if (utils.pg.isAdvancedDatabase(addon)) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (utils.pg.isAdvancedDatabase(addon as any)) { throw new Error(`We can't destroy your database due to an error: ${errorMessage}. Try again or open a ticket with Heroku Support: https://help.heroku.com/`) } else { throw new Error(`The add-on was unable to be destroyed: ${errorMessage}.`) @@ -45,7 +46,8 @@ export default async function (heroku: APIClient, addon: Heroku.AddOn, force = f ux.stdout(`Run ${color.code('heroku addons:info ' + addonName)} to check destruction progress`) } } else if (addonResponse.state !== 'deprovisioned') { - if (utils.pg.isAdvancedDatabase(addonResponse)) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (utils.pg.isAdvancedDatabase(addonResponse as any)) { throw new Error(`You can't destroy a database with a ${addonResponse.state} status.`) } else { throw new Error(`The add-on was unable to be destroyed, with status ${addonResponse.state}.`) diff --git a/packages/cli/test/helpers/utils/normalizeTableOutput.ts b/packages/cli/test/helpers/utils/normalizeTableOutput.ts index efff0a3de7..edc29b2070 100644 --- a/packages/cli/test/helpers/utils/normalizeTableOutput.ts +++ b/packages/cli/test/helpers/utils/normalizeTableOutput.ts @@ -1,7 +1,8 @@ -import stripAnsi from 'strip-ansi' + +import ansis from 'ansis' export default function normalizeTableOutput(output: string): string { - return stripAnsi(output) + return ansis.strip(output) .normalize('NFKC') .toLowerCase() .split('\n') diff --git a/packages/cli/test/helpers/utils/remove-whitespaces.ts b/packages/cli/test/helpers/utils/remove-whitespaces.ts index 8e096ed144..fb3dc2530d 100644 --- a/packages/cli/test/helpers/utils/remove-whitespaces.ts +++ b/packages/cli/test/helpers/utils/remove-whitespaces.ts @@ -1,5 +1,5 @@ -import stripAnsi from 'strip-ansi' +import ansis from 'ansis' -const removeAllWhitespace = (str: string): string => stripAnsi(str).replace(/\s+/g, '') +const removeAllWhitespace = (str: string): string => ansis.strip(str).replaceAll(/\s+/g, '') export default removeAllWhitespace diff --git a/packages/cli/test/helpers/uxStub.ts b/packages/cli/test/helpers/uxStub.ts index e573d4caf2..f2a4f59967 100644 --- a/packages/cli/test/helpers/uxStub.ts +++ b/packages/cli/test/helpers/uxStub.ts @@ -1,15 +1,15 @@ import {ux} from '@oclif/core' -import stripAnsi from 'strip-ansi' +import ansis from 'ansis' export function stubUxActionStart() { const originalStart = ux.action.start ux.action.start = (message: string) => { - process.stderr.write(`${stripAnsi(message)}... `) + process.stderr.write(`${ansis.strip(message)}... `) } const originalStop = ux.action.stop ux.action.stop = (messageToWrite = 'done') => { - process.stderr.write(`${stripAnsi(messageToWrite)}\n`) + process.stderr.write(`${ansis.strip(messageToWrite)}\n`) } return { diff --git a/packages/cli/test/unit/commands/accounts/current.unit.test.ts b/packages/cli/test/unit/commands/accounts/current.unit.test.ts index c3113a2a93..74ae6f89ef 100644 --- a/packages/cli/test/unit/commands/accounts/current.unit.test.ts +++ b/packages/cli/test/unit/commands/accounts/current.unit.test.ts @@ -1,10 +1,11 @@ +import ansis from 'ansis' import {expect} from 'chai' -import runCommand from '../../../helpers/runCommand.js' import * as sinon from 'sinon' +import {stdout} from 'stdout-stderr' + import Cmd from '../../../../src/commands/accounts/current.js' import AccountsModule from '../../../../src/lib/accounts/accounts.js' -import {stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' +import runCommand from '../../../helpers/runCommand.js' describe('accounts:current', function () { let currentStub: sinon.SinonStub @@ -27,7 +28,7 @@ describe('accounts:current', function () { currentStub.returns(null) await runCommand(Cmd, []) .catch((error: Error) => { - expect(stripAnsi(error.message)).to.equal('You haven\'t set an account. Run heroku accounts:add to add an account to your cache or heroku accounts:set to set the current account.') + expect(ansis.strip(error.message)).to.equal('You haven\'t set an account. Run heroku accounts:add to add an account to your cache or heroku accounts:set to set the current account.') }) }) }) diff --git a/packages/cli/test/unit/commands/addons/create.unit.test.ts b/packages/cli/test/unit/commands/addons/create.unit.test.ts index 0bce0738b8..11f19a2480 100644 --- a/packages/cli/test/unit/commands/addons/create.unit.test.ts +++ b/packages/cli/test/unit/commands/addons/create.unit.test.ts @@ -1,12 +1,12 @@ import {HTTPError} from '@heroku/http-call' import * as Heroku from '@heroku-cli/schema' +import ansis from 'ansis' import {expect} from 'chai' import _ from 'lodash' -import * as lolex from 'lolex' +import lolex from 'lolex' import nock from 'nock' import sinon from 'sinon' import {stderr, stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import Cmd from '../../../../src/commands/addons/create.js' import runCommand from '../../../helpers/runCommand.js' @@ -324,7 +324,7 @@ describe('addons:create', function () { '--foo', ]) .catch(error => { - expect(stripAnsi(error.message)).to.equal('Confirmation not-my-app did not match myapp. Aborted.') + expect(ansis.strip(error.message)).to.equal('Confirmation not-my-app did not match myapp. Aborted.') }) }) diff --git a/packages/cli/test/unit/commands/addons/upgrade.unit.test.ts b/packages/cli/test/unit/commands/addons/upgrade.unit.test.ts index 9ce9e056ae..edb61934cb 100644 --- a/packages/cli/test/unit/commands/addons/upgrade.unit.test.ts +++ b/packages/cli/test/unit/commands/addons/upgrade.unit.test.ts @@ -1,8 +1,8 @@ import {AddOn} from '@heroku-cli/schema' +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' import {stderr, stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import Cmd from '../../../../src/commands/addons/upgrade.js' import runCommand from '../../../helpers/runCommand.js' @@ -178,7 +178,7 @@ describe('addons:upgrade', function () { ]) } catch (error) { if (error instanceof Error) { - expect(stripAnsi(error.message)).to.equal('Couldn\'t find either the add-on service or the add-on plan of "heroku-db1:invalid".\n\nHere are the available plans for heroku-db1:\nheroku-db1:free\nheroku-db1:basic\nheroku-db1:premium-0\n\nSee more plan information with heroku addons:plans heroku-db1\n\nhttps://devcenter.heroku.com/articles/managing-add-ons') + expect(ansis.strip(error.message)).to.equal('Couldn\'t find either the add-on service or the add-on plan of "heroku-db1:invalid".\n\nHere are the available plans for heroku-db1:\nheroku-db1:free\nheroku-db1:basic\nheroku-db1:premium-0\n\nSee more plan information with heroku addons:plans heroku-db1\n\nhttps://devcenter.heroku.com/articles/managing-add-ons') } } }) diff --git a/packages/cli/test/unit/commands/apps/transfer.unit.test.ts b/packages/cli/test/unit/commands/apps/transfer.unit.test.ts index dd76c715dc..c7a3973418 100644 --- a/packages/cli/test/unit/commands/apps/transfer.unit.test.ts +++ b/packages/cli/test/unit/commands/apps/transfer.unit.test.ts @@ -1,8 +1,8 @@ +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' import sinon from 'sinon' import {stderr, stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import Cmd from '../../../../src/commands/apps/transfer.js' import runCommand from '../../../helpers/runCommand.js' @@ -34,8 +34,8 @@ describe('heroku apps:transfer', function () { 'team', ]) api.done() - expect(stripAnsi(stderr.output)).to.include('Warning: Transferring applications to team...') - expect(stripAnsi(stderr.output)).to.include('Transferring ⬢ myapp... done') + expect(ansis.strip(stderr.output)).to.include('Warning: Transferring applications to team...') + expect(ansis.strip(stderr.output)).to.include('Transferring ⬢ myapp... done') }) it('transfers selected apps to a personal account', async function () { @@ -48,8 +48,8 @@ describe('heroku apps:transfer', function () { 'gandalf@heroku.com', ]) api.done() - expect(stripAnsi(stderr.output)).to.include('Warning: Transferring applications to gandalf@heroku.com...') - expect(stripAnsi(stderr.output)).to.include('Initiating transfer of ⬢ myapp... email sent') + expect(ansis.strip(stderr.output)).to.include('Warning: Transferring applications to gandalf@heroku.com...') + expect(ansis.strip(stderr.output)).to.include('Initiating transfer of ⬢ myapp... email sent') }) }) @@ -66,7 +66,7 @@ describe('heroku apps:transfer', function () { 'gandalf@heroku.com', ]) expect('').to.eq(stdout.output) - expect(stripAnsi(stderr.output)).to.include('Initiating transfer of ⬢ myapp to gandalf@heroku.com... email sent') + expect(ansis.strip(stderr.output)).to.include('Initiating transfer of ⬢ myapp to gandalf@heroku.com... email sent') api.done() }) diff --git a/packages/cli/test/unit/commands/apps/unlock.unit.test.ts b/packages/cli/test/unit/commands/apps/unlock.unit.test.ts index ea30db69fc..9fe4a6daa2 100644 --- a/packages/cli/test/unit/commands/apps/unlock.unit.test.ts +++ b/packages/cli/test/unit/commands/apps/unlock.unit.test.ts @@ -1,20 +1,28 @@ -import {stdout, stderr} from 'stdout-stderr' -import nock from 'nock' -import {expect} from 'chai' import {Errors} from '@oclif/core' +import ansis from 'ansis' +import {expect} from 'chai' +import nock from 'nock' +import {stderr, stdout} from 'stdout-stderr' + import Cmd from '../../../../src/commands/apps/unlock.js' import runCommand from '../../../helpers/runCommand.js' -import stripAnsi from 'strip-ansi' describe('heroku apps:unlock', function () { + let api: nock.Scope + + beforeEach(function () { + api = nock('https://api.heroku.com') + }) + afterEach(function () { + api.done() return nock.cleanAll() }) it('unlocks the app', async function () { - const api = nock('https://api.heroku.com:443') + api .get('/teams/apps/myapp') - .reply(200, {name: 'myapp', locked: true}) + .reply(200, {locked: true, name: 'myapp'}) .patch('/teams/apps/myapp', {locked: false}) .reply(200) await runCommand(Cmd, [ @@ -23,22 +31,20 @@ describe('heroku apps:unlock', function () { ]) expect('').to.eq(stdout.output) expect(stderr.output).to.eq('Unlocking ⬢ myapp... done\n') - api.done() }) it('returns an error if the app is already unlocked', async function () { - const api = nock('https://api.heroku.com:443') + api .get('/teams/apps/myapp') - .reply(200, {name: 'myapp', locked: false}) + .reply(200, {locked: false, name: 'myapp'}) await runCommand(Cmd, [ '--app', 'myapp', ]) .catch((error: unknown) => { const {message, oclif} = error as Errors.CLIError - expect(stripAnsi(message)).to.eq('cannot unlock ⬢ myapp\nThis app is not locked.') + expect(ansis.strip(message)).to.eq('cannot unlock ⬢ myapp\nThis app is not locked.') expect(oclif.exit).to.equal(1) // You can add testing for the correct exit status if you're using `ux.error` to throw. }) - api.done() }) }) diff --git a/packages/cli/test/unit/commands/certs/auto/disable.unit.test.ts b/packages/cli/test/unit/commands/certs/auto/disable.unit.test.ts index 5675df52a9..26854e7bdb 100644 --- a/packages/cli/test/unit/commands/certs/auto/disable.unit.test.ts +++ b/packages/cli/test/unit/commands/certs/auto/disable.unit.test.ts @@ -1,9 +1,9 @@ +import ansis from 'ansis' import {stdout, stderr} from 'stdout-stderr' import Cmd from '../../../../../src/commands/certs/auto/disable.js' import runCommand from '../../../../helpers/runCommand.js' import nock from 'nock' import expectOutput from '../../../../helpers/utils/expectOutput.js' -import stripAnsi from 'strip-ansi' import {expect} from 'chai' import tsheredoc from 'tsheredoc' @@ -38,7 +38,7 @@ describe('heroku certs:auto:disable', function () { 'notexample', ]) .catch(error => { - expect(stripAnsi(error.message)).to.equal('Confirmation notexample did not match example. Aborted.') + expect(ansis.strip(error.message)).to.equal('Confirmation notexample did not match example. Aborted.') }) }) }) diff --git a/packages/cli/test/unit/commands/certs/remove.unit.test.ts b/packages/cli/test/unit/commands/certs/remove.unit.test.ts index 45dbc09bba..2c7d8b4f2e 100644 --- a/packages/cli/test/unit/commands/certs/remove.unit.test.ts +++ b/packages/cli/test/unit/commands/certs/remove.unit.test.ts @@ -1,7 +1,7 @@ +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' import {stderr, stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import tsheredoc from 'tsheredoc' import Cmd from '../../../../src/commands/certs/remove.js' @@ -52,7 +52,7 @@ describe('heroku certs:remove', function () { ]) } catch (error) { const {message} = error as Error - expect(stripAnsi(message)).to.equal('Confirmation notexample did not match example. Aborted.') + expect(ansis.strip(message)).to.equal('Confirmation notexample did not match example. Aborted.') } api.done() diff --git a/packages/cli/test/unit/commands/certs/update.unit.test.ts b/packages/cli/test/unit/commands/certs/update.unit.test.ts index 467bd23e7b..1868965062 100644 --- a/packages/cli/test/unit/commands/certs/update.unit.test.ts +++ b/packages/cli/test/unit/commands/certs/update.unit.test.ts @@ -1,10 +1,10 @@ +import ansis from 'ansis' import {Errors} from '@oclif/core' import {expect} from 'chai' import nock from 'nock' import * as sinon from 'sinon' import {SinonStub} from 'sinon' import {stderr, stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import tsheredoc from 'tsheredoc' import Cmd from '../../../../src/commands/certs/update.js' @@ -48,7 +48,7 @@ describe('heroku certs:update', function () { ]) } catch (error) { const {message} = error as Error - expect(stripAnsi(message)).to.equal('Confirmation notexample did not match example. Aborted.') + expect(ansis.strip(message)).to.equal('Confirmation notexample did not match example. Aborted.') } api.done() @@ -64,7 +64,7 @@ describe('heroku certs:update', function () { ]) } catch (error) { const {message, oclif} = error as Errors.CLIError - expect(stripAnsi(message)).to.equal('Missing 1 required arg:\nKEY absolute path of the key file on disk\nSee more help with --help') + expect(ansis.strip(message)).to.equal('Missing 1 required arg:\nKEY absolute path of the key file on disk\nSee more help with --help') expect(oclif.exit).to.equal(2) } @@ -107,7 +107,7 @@ describe('heroku certs:update', function () { ]) } catch (error) { const {message, oclif} = error as Errors.CLIError - expect(stripAnsi(message)).to.equal('Unexpected argument: key_file\nSee more help with --help') + expect(ansis.strip(message)).to.equal('Unexpected argument: key_file\nSee more help with --help') expect(oclif.exit).to.equal(2) } diff --git a/packages/cli/test/unit/commands/config/set.unit.test.ts b/packages/cli/test/unit/commands/config/set.unit.test.ts index 0d4a20615a..e491020319 100644 --- a/packages/cli/test/unit/commands/config/set.unit.test.ts +++ b/packages/cli/test/unit/commands/config/set.unit.test.ts @@ -1,7 +1,7 @@ import {runCommand} from '@oclif/test' +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' -import stripAnsi from 'strip-ansi' describe('config:set', function () { let api: nock.Scope @@ -53,7 +53,7 @@ describe('config:set', function () { it('errors with invalid args', async function () { const {error} = await runCommand(['config:set', '--app', 'myapp', 'WRONG']) - expect(stripAnsi(error?.message || '')).to.equal('WRONG is invalid. Must be in the format FOO=bar.') + expect(ansis.strip(error?.message || '')).to.equal('WRONG is invalid. Must be in the format FOO=bar.') expect(error?.oclif?.exit).to.equal(1) }) }) diff --git a/packages/cli/test/unit/commands/features/disable.unit.test.ts b/packages/cli/test/unit/commands/features/disable.unit.test.ts index 7e9a883cbb..17a6778f24 100644 --- a/packages/cli/test/unit/commands/features/disable.unit.test.ts +++ b/packages/cli/test/unit/commands/features/disable.unit.test.ts @@ -1,7 +1,7 @@ import {runCommand} from '@oclif/test' +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' -import stripAnsi from 'strip-ansi' describe('features:disable', function () { let api: nock.Scope @@ -37,6 +37,6 @@ describe('features:disable', function () { const {error} = await runCommand(['features:disable', '-a', 'myapp', 'feature-a']) - expect(stripAnsi(error?.message || '')).to.equal('feature-a is already disabled.') + expect(ansis.strip(error?.message || '')).to.equal('feature-a is already disabled.') }) }) diff --git a/packages/cli/test/unit/commands/features/enable.unit.test.ts b/packages/cli/test/unit/commands/features/enable.unit.test.ts index 8cb3e1a9ff..8c1368c3df 100644 --- a/packages/cli/test/unit/commands/features/enable.unit.test.ts +++ b/packages/cli/test/unit/commands/features/enable.unit.test.ts @@ -1,7 +1,7 @@ import {runCommand} from '@oclif/test' +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' -import stripAnsi from 'strip-ansi' describe('features:enable', function () { let api: nock.Scope @@ -37,6 +37,6 @@ describe('features:enable', function () { const {error} = await runCommand(['features:enable', '-a', 'myapp', 'feature-a']) - expect(stripAnsi(error?.message || '')).to.equal('feature-a is already enabled.') + expect(ansis.strip(error?.message || '')).to.equal('feature-a is already enabled.') }) }) diff --git a/packages/cli/test/unit/commands/keys/remove.unit.test.ts b/packages/cli/test/unit/commands/keys/remove.unit.test.ts index a552e10c17..da275c3819 100644 --- a/packages/cli/test/unit/commands/keys/remove.unit.test.ts +++ b/packages/cli/test/unit/commands/keys/remove.unit.test.ts @@ -1,7 +1,7 @@ import {runCommand} from '@oclif/test' +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' -import stripAnsi from 'strip-ansi' describe('keys:remove', function () { let api: nock.Scope @@ -46,6 +46,6 @@ describe('keys:remove', function () { const {error} = await runCommand(['keys:remove', 'different@machine']) expect(error).to.exist - expect(stripAnsi(error!.message)).to.equal('SSH Key different@machine not found.\nFound keys: user@machine.') + expect(ansis.strip(error!.message)).to.equal('SSH Key different@machine not found.\nFound keys: user@machine.') }) }) diff --git a/packages/cli/test/unit/commands/pg/backups/index.unit.test.ts b/packages/cli/test/unit/commands/pg/backups/index.unit.test.ts index b62a307d9a..d454d7fb8a 100644 --- a/packages/cli/test/unit/commands/pg/backups/index.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/backups/index.unit.test.ts @@ -162,7 +162,7 @@ No backups. Capture one with heroku pg:backups:capture Id Started at Status Size Database ──── ───────────────────────── ─────────────────────────────────── ────── ──────── - r003 2016-10-08 00:42:54 +0000 Completed 2016-10-08 00:43:00 +0000 1.40KB IVORY + r003 2016-10-08 00:42:54 +0000 Completed 2016-10-08 00:43:00 +0000 1.40KB ⛁ IVORY === Copies diff --git a/packages/cli/test/unit/commands/pg/backups/info.unit.test.ts b/packages/cli/test/unit/commands/pg/backups/info.unit.test.ts index e19cdfa2ee..35c52d030d 100644 --- a/packages/cli/test/unit/commands/pg/backups/info.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/backups/info.unit.test.ts @@ -1,7 +1,7 @@ +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' import {stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import tsheredoc from 'tsheredoc' import Cmd from '../../../../../src/commands/pg/backups/info.js' @@ -24,7 +24,7 @@ const shouldInfo = function (cmdRun: (args: string[]) => Promise) { it('shows error message', async function () { await cmdRun(['--app', 'myapp']) .catch((error: Error) => { - expect(stripAnsi(error.message)).to.equal('No backups. Capture one with heroku pg:backups:capture') + expect(ansis.strip(error.message)).to.equal('No backups. Capture one with heroku pg:backups:capture') }) }) }) diff --git a/packages/cli/test/unit/commands/pg/credentials/destroy.unit.test.ts b/packages/cli/test/unit/commands/pg/credentials/destroy.unit.test.ts index ea431b41d9..e735277cd5 100644 --- a/packages/cli/test/unit/commands/pg/credentials/destroy.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/credentials/destroy.unit.test.ts @@ -1,3 +1,4 @@ +import ansis from 'ansis' import {stderr, stdout} from 'stdout-stderr' import Cmd from '../../../../../src/commands/pg/credentials/destroy.js' import runCommand from '../../../../helpers/runCommand.js' @@ -5,7 +6,6 @@ import nock from 'nock' import expectOutput from '../../../../helpers/utils/expectOutput.js' import {expect} from 'chai' import tsheredoc from 'tsheredoc' -import stripAnsi from 'strip-ansi' const heredoc = tsheredoc.default @@ -109,7 +109,7 @@ describe('pg:credentials:destroy', function () { '--name', 'gandalf', ]).catch((error: Error) => { - expect(stripAnsi(error.message)).to.equal(err) + expect(ansis.strip(error.message)).to.equal(err) }) }) @@ -138,7 +138,7 @@ describe('pg:credentials:destroy', function () { '--name', 'gandalf', ]).catch((error: Error) => { - expect(stripAnsi(error.message)).to.equal(err) + expect(ansis.strip(error.message)).to.equal(err) }) }) }) diff --git a/packages/cli/test/unit/commands/pg/credentials/rotate.unit.test.ts b/packages/cli/test/unit/commands/pg/credentials/rotate.unit.test.ts index b282e6217f..adf92d239d 100644 --- a/packages/cli/test/unit/commands/pg/credentials/rotate.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/credentials/rotate.unit.test.ts @@ -1,3 +1,4 @@ +import ansis from 'ansis' import {ux} from '@oclif/core' import {expect} from 'chai' import nock from 'nock' @@ -6,7 +7,6 @@ import tsheredoc from 'tsheredoc' import Cmd from '../../../../../src/commands/pg/credentials/rotate.js' import runCommand from '../../../../helpers/runCommand.js' import * as sinon from 'sinon' -import stripAnsi from 'strip-ansi' import {hux} from '@heroku/heroku-cli-util' const heredoc = tsheredoc.default @@ -144,8 +144,8 @@ describe('pg:credentials:rotate', function () { '--all', ]) - expect(stripAnsi(uxPromptStub.args[0].toString())).contains('To proceed, type myapp') - expect(stripAnsi(uxWarnStub.args[0].toString())).to.eq(message) + expect(ansis.strip(uxPromptStub.args[0].toString())).contains('To proceed, type myapp') + expect(ansis.strip(uxWarnStub.args[0].toString())).to.eq(message) }) it('requires app confirmation for rotating all roles with --all and --force', async function () { @@ -163,8 +163,8 @@ describe('pg:credentials:rotate', function () { '--all', '--force', ]) - expect(stripAnsi(uxPromptStub.args[0].toString())).contains('To proceed, type myapp') - expect(stripAnsi(uxWarnStub.args[0].toString())).to.eq(message) + expect(ansis.strip(uxPromptStub.args[0].toString())).contains('To proceed, type myapp') + expect(ansis.strip(uxWarnStub.args[0].toString())).to.eq(message) }) it('requires app confirmation for rotating a specific role with --name', async function () { @@ -181,8 +181,8 @@ describe('pg:credentials:rotate', function () { '--name', 'my_role', ]) - expect(stripAnsi(uxPromptStub.args[0].toString())).contains('To proceed, type myapp') - expect(stripAnsi(uxWarnStub.args[0].toString())).to.eq(message) + expect(ansis.strip(uxPromptStub.args[0].toString())).contains('To proceed, type myapp') + expect(ansis.strip(uxWarnStub.args[0].toString())).to.eq(message) }) it('requires app confirmation for force rotating a specific role with --name and --force', async function () { @@ -202,8 +202,8 @@ describe('pg:credentials:rotate', function () { 'my_role', '--force', ]) - expect(stripAnsi(uxPromptStub.args[0].toString())).contains('To proceed, type myapp') - expect(stripAnsi(uxWarnStub.args[0].toString())).to.eq(message) + expect(ansis.strip(uxPromptStub.args[0].toString())).contains('To proceed, type myapp') + expect(ansis.strip(uxWarnStub.args[0].toString())).to.eq(message) }) }) diff --git a/packages/cli/test/unit/commands/pg/promote.unit.test.ts b/packages/cli/test/unit/commands/pg/promote.unit.test.ts index 07ea815ad1..304e993997 100644 --- a/packages/cli/test/unit/commands/pg/promote.unit.test.ts +++ b/packages/cli/test/unit/commands/pg/promote.unit.test.ts @@ -1,4 +1,5 @@ -import {stderr, stdout} from 'stdout-stderr' +import ansis from 'ansis' +import {stderr} from 'stdout-stderr' import Cmd from '../../../../src/commands/pg/promote.js' import runCommand from '../../../helpers/runCommand.js' import expectOutput from '../../../helpers/utils/expectOutput.js' @@ -6,7 +7,6 @@ import {expect} from 'chai' import nock from 'nock' import tsheredoc from 'tsheredoc' import * as fixtures from '../../../fixtures/addons/fixtures.js' -import stripAnsi from 'strip-ansi' const heredoc = tsheredoc.default @@ -243,7 +243,7 @@ describe('pg:promote when argument is database', function () { 'myapp', 'DATABASE', ]).catch((error: Error) => { - expect(stripAnsi(error.message)).to.equal(err) + expect(ansis.strip(error.message)).to.equal(err) }) }) @@ -524,7 +524,7 @@ describe('pg:promote when argument is a credential attachment', function () { 'DATABASE', ]) .catch((error: Error) => { - expect(stripAnsi(error.message)).to.equal(err) + expect(ansis.strip(error.message)).to.equal(err) }) }) }) @@ -725,7 +725,7 @@ describe('pg:promote when database is not available or force flag is present', f 'myapp', 'DATABASE', ]).catch((error: Error) => { - expect(stripAnsi(error.message)).to.equal(err) + expect(ansis.strip(error.message)).to.equal(err) }) }) diff --git a/packages/cli/test/unit/commands/ps/index.unit.test.ts b/packages/cli/test/unit/commands/ps/index.unit.test.ts index ac8662e622..9fa5f149e1 100644 --- a/packages/cli/test/unit/commands/ps/index.unit.test.ts +++ b/packages/cli/test/unit/commands/ps/index.unit.test.ts @@ -1,8 +1,8 @@ +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' import {stderr, stdout} from 'stdout-stderr' import strftime from 'strftime' -import stripAnsi from 'strip-ansi' import tsheredoc from 'tsheredoc' import Cmd from '../../../../src/commands/ps/index.js' @@ -166,7 +166,7 @@ describe('ps', function () { 'myapp', ]) } catch (error: any) { - expect(stripAnsi(error.message)).to.include('No foo dynos on ⬢ myapp') + expect(ansis.strip(error.message)).to.include('No foo dynos on ⬢ myapp') } api.done() diff --git a/packages/cli/test/unit/commands/ps/restart.unit.test.ts b/packages/cli/test/unit/commands/ps/restart.unit.test.ts index 049dc701e0..fac26d4232 100644 --- a/packages/cli/test/unit/commands/ps/restart.unit.test.ts +++ b/packages/cli/test/unit/commands/ps/restart.unit.test.ts @@ -1,10 +1,10 @@ +import ansis from 'ansis' import {stderr} from 'stdout-stderr' import Cmd from '../../../../src/commands/ps/restart.js' import runCommand from '../../../helpers/runCommand.js' import nock from 'nock' import expectOutput from '../../../helpers/utils/expectOutput.js' import {expect} from 'chai' -import stripAnsi from 'strip-ansi' import tsheredoc from 'tsheredoc' const heredoc = tsheredoc.default @@ -59,7 +59,7 @@ describe('ps:restart', function () { 'myapp', 'web.1', ]) - expect(stripAnsi(stderr.output)).to.include('DYNO is a deprecated argument.') + expect(ansis.strip(stderr.output)).to.include('DYNO is a deprecated argument.') expect(stderr.output).to.include('Restarting dyno web.1 on ⬢ myapp... done') }) }) diff --git a/packages/cli/test/unit/commands/ps/scale.unit.test.ts b/packages/cli/test/unit/commands/ps/scale.unit.test.ts index 8e443629ad..b84e3fd656 100644 --- a/packages/cli/test/unit/commands/ps/scale.unit.test.ts +++ b/packages/cli/test/unit/commands/ps/scale.unit.test.ts @@ -1,7 +1,7 @@ +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' import {stderr, stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import Cmd from '../../../../src/commands/ps/scale.js' import runCommand from '../../../helpers/runCommand.js' @@ -63,7 +63,7 @@ describe('ps:scale', function () { 'myapp', ]) } catch (error: any) { - expect(stripAnsi(error.message)).to.include('No process types on ⬢ myapp.') + expect(ansis.strip(error.message)).to.include('No process types on ⬢ myapp.') } expect(stdout.output).to.equal('') diff --git a/packages/cli/test/unit/commands/ps/stop.unit.test.ts b/packages/cli/test/unit/commands/ps/stop.unit.test.ts index d940907762..09fb9eb780 100644 --- a/packages/cli/test/unit/commands/ps/stop.unit.test.ts +++ b/packages/cli/test/unit/commands/ps/stop.unit.test.ts @@ -1,12 +1,11 @@ +import ansis from 'ansis' +import {expect} from 'chai' +import nock from 'nock' import {stderr} from 'stdout-stderr' + import Cmd from '../../../../src/commands/ps/stop.js' import runCommand from '../../../helpers/runCommand.js' -import nock from 'nock' import expectOutput from '../../../helpers/utils/expectOutput.js' -import {expect} from 'chai' -import stripAnsi from 'strip-ansi' -import tsheredoc from 'tsheredoc' -const heredoc = tsheredoc.default describe('ps:stop', function () { it('requires a dyno name or type', async function () { @@ -56,7 +55,7 @@ describe('ps:stop', function () { 'myapp', 'web.1', ]) - expect(stripAnsi(stderr.output)).to.include('Warning: DYNO is a deprecated argument.') + expect(ansis.strip(stderr.output)).to.include('Warning: DYNO is a deprecated argument.') expect(stderr.output).to.include('Stopping dyno web.1 on ⬢ myapp... done') }) }) diff --git a/packages/cli/test/unit/commands/redis/maxmemory.unit.test.ts b/packages/cli/test/unit/commands/redis/maxmemory.unit.test.ts index 6904dceded..bcb4873676 100644 --- a/packages/cli/test/unit/commands/redis/maxmemory.unit.test.ts +++ b/packages/cli/test/unit/commands/redis/maxmemory.unit.test.ts @@ -5,7 +5,7 @@ import nock from 'nock' import {expect} from 'chai' import expectOutput from '../../../helpers/utils/expectOutput.js' import heredoc from 'tsheredoc' -import stripAnsi from 'strip-ansi' +import ansis from 'ansis' import {shouldHandleArgs} from '../../lib/redis/shared.unit.test.js' /* @@ -47,7 +47,7 @@ describe('heroku redis:maxmemory', function () { '--app', 'example', ]).catch(function (error: Error) { - expect(stripAnsi(error.message)).to.equal(heredoc(` + expect(ansis.strip(error.message)).to.equal(heredoc(` The following error occurred: Missing required flag policy See more help with --help`)) diff --git a/packages/cli/test/unit/commands/redis/timeout.unit.test.ts b/packages/cli/test/unit/commands/redis/timeout.unit.test.ts index 5dcbd10b88..0a20efee87 100644 --- a/packages/cli/test/unit/commands/redis/timeout.unit.test.ts +++ b/packages/cli/test/unit/commands/redis/timeout.unit.test.ts @@ -5,7 +5,7 @@ import nock from 'nock' import {expect} from 'chai' import expectOutput from '../../../helpers/utils/expectOutput.js' import heredoc from 'tsheredoc' -import stripAnsi from 'strip-ansi' +import ansis from 'ansis' import * as fixtures from '../../../fixtures/addons/fixtures.js' import {shouldHandleArgs} from '../../lib/redis/shared.unit.test.js' @@ -77,7 +77,7 @@ describe('heroku redis:timeout should handle standard arg behavior', function () 'example', ]).catch((error: Error) => { expect(stdout.output).to.equal('') - expect(stripAnsi(error.message)).to.equal(heredoc(` + expect(ansis.strip(error.message)).to.equal(heredoc(` The following error occurred: Missing required flag seconds See more help with --help`)) diff --git a/packages/cli/test/unit/commands/redis/upgrade.unit.test.ts b/packages/cli/test/unit/commands/redis/upgrade.unit.test.ts index 30dba86e2b..ccf862ffbb 100644 --- a/packages/cli/test/unit/commands/redis/upgrade.unit.test.ts +++ b/packages/cli/test/unit/commands/redis/upgrade.unit.test.ts @@ -5,7 +5,7 @@ import nock from 'nock' import {expect} from 'chai' import expectOutput from '../../../helpers/utils/expectOutput.js' import heredoc from 'tsheredoc' -import stripAnsi from 'strip-ansi' +import ansis from 'ansis' import * as fixtures from '../../../fixtures/addons/fixtures.js' /* @@ -47,7 +47,7 @@ describe('heroku redis:upgrade', function () { ]) .catch((error: Error) => { expect(stdout.output).to.equal('') - expect(stripAnsi(error.message)).to.equal(heredoc(` + expect(ansis.strip(error.message)).to.equal(heredoc(` The following error occurred: Missing required flag version See more help with --help`)) diff --git a/packages/cli/test/unit/commands/spaces/index.unit.test.ts b/packages/cli/test/unit/commands/spaces/index.unit.test.ts index 68dfaf2425..de85d51f70 100644 --- a/packages/cli/test/unit/commands/spaces/index.unit.test.ts +++ b/packages/cli/test/unit/commands/spaces/index.unit.test.ts @@ -1,8 +1,8 @@ import {Errors} from '@oclif/core' +import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' import {stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import Cmd from '../../../../src/commands/spaces/index.js' import runCommand from '../../../helpers/runCommand.js' @@ -79,7 +79,7 @@ describe('spaces', function () { await runCommand(Cmd, ['--team', 'other-team']) } catch (error) { const {message} = error as Errors.CLIError - expect(stripAnsi(message)).to.eq('No spaces in other-team.') + expect(ansis.strip(message)).to.eq('No spaces in other-team.') } }) diff --git a/packages/cli/test/unit/commands/spaces/vpn/connect.unit.test.ts b/packages/cli/test/unit/commands/spaces/vpn/connect.unit.test.ts index 1b01d98432..1904be64d8 100644 --- a/packages/cli/test/unit/commands/spaces/vpn/connect.unit.test.ts +++ b/packages/cli/test/unit/commands/spaces/vpn/connect.unit.test.ts @@ -2,7 +2,6 @@ import ansis from 'ansis' import {expect} from 'chai' import nock from 'nock' import {stderr} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' import tsheredoc from 'tsheredoc' import Cmd from '../../../../../src/commands/spaces/vpn/connect.js' diff --git a/packages/cli/test/unit/lib/confirm-command.unit.test.ts b/packages/cli/test/unit/lib/confirm-command.unit.test.ts index 78d12a93c9..706227e548 100644 --- a/packages/cli/test/unit/lib/confirm-command.unit.test.ts +++ b/packages/cli/test/unit/lib/confirm-command.unit.test.ts @@ -2,7 +2,7 @@ import {hux} from '@heroku/heroku-cli-util' import {expect} from 'chai' import sinon from 'sinon' import {stderr, stdout} from 'stdout-stderr' -import stripAnsi from 'strip-ansi' +import ansis from 'ansis' import ConfirmCommand from '../../../src/lib/confirmCommand.js' @@ -32,7 +32,7 @@ describe('confirmApp', function () { await new ConfirmCommand().confirm('app', 'nope') expect.fail('Expected confirm to throw error') } catch (error: any) { - expect(stripAnsi(error.message)).to.equal('Confirmation nope did not match app. Aborted.') + expect(ansis.strip(error.message)).to.equal('Confirmation nope did not match app. Aborted.') } finally { stdout.stop() stderr.stop() @@ -75,7 +75,7 @@ describe('confirmApp', function () { await new ConfirmCommand().confirm('app') expect.fail('Expected confirm to throw error') } catch (error: any) { - expect(stripAnsi(error.message)).to.equal('Confirmation did not match app. Aborted.') + expect(ansis.strip(error.message)).to.equal('Confirmation did not match app. Aborted.') } }) })