-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced chalk by ansis to keep Pongo compatible with CommonJS
It seems that Chalk from v5 is ESModules-only
- Loading branch information
1 parent
7e86922
commit 11880df
Showing
9 changed files
with
65 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,21 @@ | ||
import ansis from 'ansis'; | ||
|
||
let enableColors = true; | ||
|
||
export const color = { | ||
set level(value: 0 | 1) { | ||
enableColors = value === 1; | ||
}, | ||
hex: (value: string) => (text: string) => | ||
enableColors ? ansis.hex(value)(text) : text, | ||
red: (value: string) => | ||
enableColors ? ansis.red(value) : (text: string) => text, | ||
green: (value: string) => | ||
enableColors ? ansis.green(value) : (text: string) => text, | ||
blue: (value: string) => | ||
enableColors ? ansis.blue(value) : (text: string) => text, | ||
yellow: (value: string) => | ||
enableColors ? ansis.yellow(value) : (text: string) => text, | ||
}; | ||
|
||
export default color; |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './color'; | ||
export * from './pretty'; |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import chalk from 'chalk'; | ||
import chalk from './color'; | ||
|
||
const TWO_SPACES = ' '; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
src/packages/dumbo/src/core/tracing/printing/pretty.unit.spec.ts
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