-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove outdated yuralist reporter with a custom one
- Loading branch information
1 parent
ce74b21
commit 1a830b9
Showing
6 changed files
with
48 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
yarn-error.log | ||
cli.js | ||
Avo.js | ||
reporter.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters