Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace crayon by cli #399

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Imports:
callr,
checkmate (>= 2.0.0),
chromote (>= 0.1.2),
crayon,
cli,
fs,
globals (>= 0.14.0),
httr,
Expand Down
14 changes: 7 additions & 7 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export(use_shinytest2)
export(use_shinytest2_test)
importFrom(R6,R6Class)
importFrom(callr,process)
importFrom(crayon,blue)
importFrom(crayon,cyan)
importFrom(crayon,green)
importFrom(crayon,magenta)
importFrom(crayon,make_style)
importFrom(crayon,red)
importFrom(crayon,silver)
importFrom(cli,col_blue)
importFrom(cli,col_cyan)
importFrom(cli,col_green)
importFrom(cli,col_magenta)
importFrom(cli,col_red)
importFrom(cli,col_silver)
importFrom(cli,make_ansi_style)
importFrom(rlang,"%||%")
importFrom(rlang,":=")
importFrom(rlang,list2)
Expand Down
2 changes: 1 addition & 1 deletion R/app-driver-initialize.R
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ app_initialize <- function(self, private, ..., view = missing_arg()) {
c(
conditionMessage(e),
"\n",
i = crayon::silver("You can inspect the failed AppDriver object via `rlang::last_error()$app`"),
i = cli::col_silver("You can inspect the failed AppDriver object via `rlang::last_error()$app`"),
i = paste0("AppDriver logs:\n", logs),
"\n"
),
Expand Down
2 changes: 1 addition & 1 deletion R/compare-screenshot-threshold.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ compare_screenshot_threshold <- function(
" > `", threshold, "` (threshold)."),
"*" = paste0("`old`:", old),
"*" = paste0("`new`:", new),
"i" = crayon::silver("(To remove this message, increase `threshold`, or set `quiet = TRUE`)")
"i" = cli::col_silver("(To remove this message, increase `threshold`, or set `quiet = TRUE`)")
))
}

Expand Down
8 changes: 4 additions & 4 deletions R/shinytest2-logs.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ print.shinytest2_log <- function(x, ...) {
}

#' @export
#' @importFrom crayon blue magenta cyan green red silver make_style
#' @importFrom cli col_blue col_magenta col_cyan col_green col_red col_silver make_ansi_style
format.shinytest2_log <- function(x, ...) {

get_color <- function(location, level) {
switch(as.character(location),
shiny = switch(level, stderr = magenta, force),
chromote = switch(level, throw = red, error = red, cyan),
shinytest2 = switch(level, green)
shiny = switch(level, stderr = col_magenta, force),
chromote = switch(level, throw = col_red, error = col_red, col_cyan),
shinytest2 = switch(level, col_green)
)
}

Expand Down
Loading