Skip to content

Commit

Permalink
Remove outdated yuralist reporter with a custom one
Browse files Browse the repository at this point in the history
  • Loading branch information
hugihlynsson committed Mar 5, 2024
1 parent ce74b21 commit 1a830b9
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, latest]
node-version: [14.x, 16.x, 18.x, 20.x, latest]

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
yarn-error.log
cli.js
Avo.js
reporter.js
10 changes: 5 additions & 5 deletions cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import pify from 'pify';
import portfinder from 'portfinder';
import querystring from 'querystring';
import got from 'got'; // eslint-disable-line import/no-unresolved
import report from 'yurnalist';
import semver from 'semver';
import updateNotifier from 'update-notifier';
import url from 'url';
Expand All @@ -31,6 +30,7 @@ import { hideBin } from 'yargs/helpers';
import httpShutdown from 'http-shutdown';
import fuzzypath from 'inquirer-fuzzy-path';

import * as report from './reporter.js';
import Avo from './Avo.js';

declare global {
Expand Down Expand Up @@ -1480,15 +1480,15 @@ function status(source: string, json, argv: any): void {
}
return pify(fs.readFile)(resultPath, 'utf8')
.then((data) => [resultPath, data])
.catch((error) => {
.catch(() => {
if (argv.verbose) {
report.warn(`Failed to parse file: ${resultPath}`, error);
report.warn(`Failed to parse file: ${resultPath}`);
}
});
})
.catch((error) => {
.catch(() => {
if (argv.verbose) {
report.warn(`Failed to read file stats: ${resultPath}`, error);
report.warn(`Failed to read file stats: ${resultPath}`);
}
}),
),
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"files": [
"cli.js",
"reporter.js",
"Avo.js"
],
"dependencies": {
Expand All @@ -51,8 +52,7 @@
"uuid": "^9.0.0",
"write": "^2.0.0",
"write-json-file": "^5.0.0",
"yargs": "^17.2.1",
"yurnalist": "^2.1.0"
"yargs": "^17.2.1"
},
"devDependencies": {
"@types/ignore-walk": "^4.0.0",
Expand Down
35 changes: 35 additions & 0 deletions reporter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import chalk from 'chalk';

export function log(text: string) {
console.log(text);
}

export function info(text: string) {
console.log(chalk.blue('info'), text);
}

export function success(text: string) {
console.log(chalk.green('success'), text);
}

export function warn(text: string) {
console.log(chalk.yellow('warn'), text);
}

export function error(text: string) {
console.log(chalk.red('error'), text);
}

export function tree(text: string, children) {
function recursiveTree(name = '', nodes = [], prefix = '') {
nodes.sort((a, b) => a.name.localeCompare(b.name));
return `${name}\n${nodes
.map((node, index) => {
const last = index === nodes.length - 1;
return `${prefix}${last ? '└' : '├'}${recursiveTree(node.name, node.children, `${prefix}${last ? ' ' : '│'} `)}`;
})
.join('')}`;
}
console.log(recursiveTree(text, children));
}
57 changes: 4 additions & 53 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,6 @@ chardet@^0.7.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==

ci-info@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==

ci-info@^3.2.0:
version "3.3.2"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.2.tgz#6d2967ffa407466481c6c90b6e16b3098f080128"
Expand Down Expand Up @@ -1669,25 +1664,6 @@ inquirer@^6.0.0:
strip-ansi "^5.1.0"
through "^2.3.6"

inquirer@^7.0.0:
version "7.3.3"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003"
integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==
dependencies:
ansi-escapes "^4.2.1"
chalk "^4.1.0"
cli-cursor "^3.1.0"
cli-width "^3.0.0"
external-editor "^3.0.3"
figures "^3.0.0"
lodash "^4.17.19"
mute-stream "0.0.8"
run-async "^2.4.0"
rxjs "^6.6.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
through "^2.3.6"

inquirer@^8.0.0:
version "8.2.6"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.6.tgz#733b74888195d8d400a67ac332011b5fae5ea562"
Expand Down Expand Up @@ -1770,13 +1746,6 @@ is-callable@^1.1.4, is-callable@^1.2.4:
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945"
integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==

is-ci@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
dependencies:
ci-info "^2.0.0"

is-ci@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867"
Expand Down Expand Up @@ -2129,7 +2098,7 @@ lodash.once@^4.0.0:
resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac"
integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==

lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.19, lodash@^4.17.21:
lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down Expand Up @@ -2253,7 +2222,7 @@ mute-stream@0.0.7:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
integrity sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==

mute-stream@0.0.8, mute-stream@~0.0.4:
mute-stream@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
Expand Down Expand Up @@ -2581,13 +2550,6 @@ rc@1.2.8:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

read@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4"
integrity sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==
dependencies:
mute-stream "~0.0.4"

readable-stream@^3.4.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
Expand Down Expand Up @@ -2720,7 +2682,7 @@ run-parallel@^1.1.9:
dependencies:
queue-microtask "^1.2.2"

rxjs@^6.4.0, rxjs@^6.6.0, rxjs@^6.6.2:
rxjs@^6.4.0, rxjs@^6.6.2:
version "6.6.7"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==
Expand Down Expand Up @@ -2931,7 +2893,7 @@ strip-ansi@^4.0.0:
dependencies:
ansi-regex "^3.0.0"

strip-ansi@^5.1.0, strip-ansi@^5.2.0:
strip-ansi@^5.1.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
Expand Down Expand Up @@ -3338,14 +3300,3 @@ yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

yurnalist@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/yurnalist/-/yurnalist-2.1.0.tgz#44cf7ea5a33a8fab4968cc8c2970489f93760902"
integrity sha512-PgrBqosQLM3gN2xBFIMDLACRTV9c365VqityKKpSTWpwR+U4LAFR3rSVyEoscWlu3EzX9+Y0I86GXUKxpHFl6w==
dependencies:
chalk "^2.4.2"
inquirer "^7.0.0"
is-ci "^2.0.0"
read "^1.0.7"
strip-ansi "^5.2.0"

0 comments on commit 1a830b9

Please sign in to comment.