From 30521aacef06292c026cad59607d6ce2907a933a Mon Sep 17 00:00:00 2001 From: IlyaZar Date: Sat, 27 May 2023 22:23:48 +0200 Subject: [PATCH 1/9] feat: add file .rscignore - add_rscignore_file() generates .rscignore at golem top level - call in add_rstudio_files() is used in RStudio connect, shiny server and shinyapps io - can be called directly Refs: #110 --- R/add_rstudio_files.R | 53 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/R/add_rstudio_files.R b/R/add_rstudio_files.R index eedabc20..f69265e6 100644 --- a/R/add_rstudio_files.R +++ b/R/add_rstudio_files.R @@ -7,7 +7,7 @@ add_rstudio_files <- function( "Shiny Server", "ShinyApps.io" ) -) { + ) { service <- match.arg(service) where <- fs_path(pkg, "app.R") @@ -55,6 +55,8 @@ add_rstudio_files <- function( ) ) + add_rscignore_file(pkg = pkg, open = open) + open_or_go_to(where, open) } else { file_already_there_dance( @@ -64,6 +66,49 @@ add_rstudio_files <- function( } } +add_rscignore_file <- function(pkg, open, min_rsc = "0.8.25") { + check_min_rsc <- rlang::is_installed("rsconnect", version = min_rsc) + if (isFALSE(check_min_rsc)) { + cat_red_bullet( + sprintf( + "Not creating '.rscignore'. Required 'rsconnect' version >= %s!", + min_rsc + ) + ) + return(invisible(pkg)) + } + + where <- fs_path(pkg, ".rscignore") + if (isTRUE(fs_file_exists(where))) { + file_already_there_dance( + where = where, + open_file = open + ) + return(invisible(pkg)) + } + list_exclusion_defaults <- c( + ".here", + "CODE_OF_CONDUCT.md", + "LICENSE", + "LICENCE", + "LICENSE.md", + "LICENCE.md", + "NEWS", + "NEWS.md", + "README.md", + "README.Rmd", + "README.HTML", + "dev", + "man", + "vignettes", + "tests" + ) + writeLines(text = list_exclusion_defaults, con = where) + usethis_use_build_ignore(".rscignore") + + cat_created(where) + return(invisible(pkg)) +} #' Add an app.R at the root of your package to deploy on RStudio Connect #' #' @note @@ -93,7 +138,7 @@ add_rstudio_files <- function( add_positconnect_file <- function( pkg = get_golem_wd(), open = TRUE -) { + ) { add_rstudio_files( pkg = pkg, open = open, @@ -116,7 +161,7 @@ add_rstudioconnect_file <- function(pkg = get_golem_wd(), add_shinyappsio_file <- function( pkg = get_golem_wd(), open = TRUE -) { + ) { add_rstudio_files( pkg = pkg, open = open, @@ -129,7 +174,7 @@ add_shinyappsio_file <- function( add_shinyserver_file <- function( pkg = get_golem_wd(), open = TRUE -) { + ) { add_rstudio_files( pkg = pkg, open = open, From f3da55802c9f108960ce094a40d665fe9c16ef4a Mon Sep 17 00:00:00 2001 From: IlyaZar Date: Sat, 27 May 2023 23:19:07 +0200 Subject: [PATCH 2/9] docs: add docs to add_rscignore_file --- NAMESPACE | 1 + R/add_rstudio_files.R | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index 38c07d51..37bd5092 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -20,6 +20,7 @@ export(add_partial_html_template) export(add_positconnect_file) export(add_r6) export(add_resource_path) +export(add_rscignore_file) export(add_rstudioconnect_file) export(add_sass_file) export(add_shinyappsio_file) diff --git a/R/add_rstudio_files.R b/R/add_rstudio_files.R index f69265e6..68971933 100644 --- a/R/add_rstudio_files.R +++ b/R/add_rstudio_files.R @@ -66,7 +66,27 @@ add_rstudio_files <- function( } } -add_rscignore_file <- function(pkg, open, min_rsc = "0.8.25") { +#' Add `.rscignore`-file for golem project +#' +#' Adds a `.rscignore` to the top level (default, see `pkg`) of the `{golem}` +#' project. A list of default files excluded: +#' * .here +#' * CODE_OF_CONDUCT.md +#' * LICENSE\{.md\} +#' * LICENCE\{.md\} +#' * NEWS\{.md\} +#' * README\{.md,.Rmd,.HTML\} +#' * dev +#' * man +#' * tests +#' * vignettes +#' +#' @inheritParams add_module +#' +#' @return pure side-effect function for file creation; returns `pkg` invisibly +#' @export +add_rscignore_file <- function(pkg = get_golem_wd(), open = TRUE) { + min_rsc <- "0.8.25" check_min_rsc <- rlang::is_installed("rsconnect", version = min_rsc) if (isFALSE(check_min_rsc)) { cat_red_bullet( From 2151fe8013716b22c0d51e5ff5faa2107e2888c0 Mon Sep 17 00:00:00 2001 From: IlyaZar Date: Sat, 27 May 2023 23:26:38 +0200 Subject: [PATCH 3/9] tests: add a basic test for add_rscignore_file --- tests/testthat/test-add_deploy_helpers.R | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/testthat/test-add_deploy_helpers.R b/tests/testthat/test-add_deploy_helpers.R index 567ca1ab..c1e3c4d1 100644 --- a/tests/testthat/test-add_deploy_helpers.R +++ b/tests/testthat/test-add_deploy_helpers.R @@ -126,3 +126,31 @@ test_that("add_rstudio_files", { } }) }) + +test_that("add_rscignore_file", { + with_dir(pkg, { + burn_after_reading( + ".rscignore", + { + withr::with_options( + c("golem.quiet" = FALSE), + { + output <- testthat::capture_output( + add_rscignore_file( + pkg = pkg, + open = FALSE + ) + ) + } + ) + expect_exists(".rscignore") + test <- stringr::str_detect( + output, + "ile created at .*/.rscignore" + ) + expect_true(test) + } + ) + } + ) +}) From 08bc9e981bc36ac9eaa9f40db643a3956a410e40 Mon Sep 17 00:00:00 2001 From: IlyaZar Date: Sat, 27 May 2023 23:34:26 +0200 Subject: [PATCH 4/9] refactor: typos + pass CI + update cat_green/docs - fix typos in two tests - update docs to pass CI - use different cat_green_tick() for app.R and .rscignore as they are called right after each other - move doc for rscignore down so man-page displays add_rstudioconnect_file at the top --- R/add_rstudio_files.R | 116 ++++++++++++----------- man/rstudio_deploy.Rd | 27 +++++- tests/testthat/test-add_deploy_helpers.R | 4 +- 3 files changed, 85 insertions(+), 62 deletions(-) diff --git a/R/add_rstudio_files.R b/R/add_rstudio_files.R index 68971933..9eb19896 100644 --- a/R/add_rstudio_files.R +++ b/R/add_rstudio_files.R @@ -59,17 +59,22 @@ add_rstudio_files <- function( open_or_go_to(where, open) } else { - file_already_there_dance( + cat_green_tick("The 'app.R'-file already exists.") + open_or_go_to( where = where, open_file = open ) } } -#' Add `.rscignore`-file for golem project +#' Add an `app.R` at the root of your package to deploy on RStudio Connect #' -#' Adds a `.rscignore` to the top level (default, see `pkg`) of the `{golem}` -#' project. A list of default files excluded: +#' Additionally, adds a `.rscignore` at the root of the `{golem}` project if the +#' `rsconnect` package version is `>= 0.8.25`. +#' +#' @note +#' In previous versions, this function was called add_rconnect_file. +#' @section List of excluded files in `.rscignore`: #' * .here #' * CODE_OF_CONDUCT.md #' * LICENSE\{.md\} @@ -81,58 +86,6 @@ add_rstudio_files <- function( #' * tests #' * vignettes #' -#' @inheritParams add_module -#' -#' @return pure side-effect function for file creation; returns `pkg` invisibly -#' @export -add_rscignore_file <- function(pkg = get_golem_wd(), open = TRUE) { - min_rsc <- "0.8.25" - check_min_rsc <- rlang::is_installed("rsconnect", version = min_rsc) - if (isFALSE(check_min_rsc)) { - cat_red_bullet( - sprintf( - "Not creating '.rscignore'. Required 'rsconnect' version >= %s!", - min_rsc - ) - ) - return(invisible(pkg)) - } - - where <- fs_path(pkg, ".rscignore") - if (isTRUE(fs_file_exists(where))) { - file_already_there_dance( - where = where, - open_file = open - ) - return(invisible(pkg)) - } - list_exclusion_defaults <- c( - ".here", - "CODE_OF_CONDUCT.md", - "LICENSE", - "LICENCE", - "LICENSE.md", - "LICENCE.md", - "NEWS", - "NEWS.md", - "README.md", - "README.Rmd", - "README.HTML", - "dev", - "man", - "vignettes", - "tests" - ) - writeLines(text = list_exclusion_defaults, con = where) - usethis_use_build_ignore(".rscignore") - - cat_created(where) - return(invisible(pkg)) -} -#' Add an app.R at the root of your package to deploy on RStudio Connect -#' -#' @note -#' In previous versions, this function was called add_rconnect_file and add_rstudioconnect_file. #' #' @inheritParams add_module #' @aliases add_rconnect_file add_rstudioconnect_file add_positconnect_file @@ -140,7 +93,8 @@ add_rscignore_file <- function(pkg = get_golem_wd(), open = TRUE) { #' #' @rdname rstudio_deploy #' -#' @return The path to the file, invisibly. +#' @return Side-effect functions for file creation returning the path to the +#' file, invisibly. #' #' @examples #' # Add a file for Connect @@ -201,3 +155,51 @@ add_shinyserver_file <- function( service = "Shiny Server" ) } +#' @inheritParams add_module +#' @rdname rstudio_deploy +#' @export +add_rscignore_file <- function(pkg = get_golem_wd(), open = TRUE) { + min_rsc <- "0.8.25" + check_min_rsc <- rlang::is_installed("rsconnect", version = min_rsc) + if (isFALSE(check_min_rsc)) { + cat_red_bullet( + sprintf( + "Not creating '.rscignore'. Required 'rsconnect' version >= %s!", + min_rsc + ) + ) + return(invisible(pkg)) + } + + where <- fs_path(pkg, ".rscignore") + if (isTRUE(fs_file_exists(where))) { + cat_green_tick("The '.rscignore'-file already exists.") + open_or_go_to( + where = where, + open_file = open + ) + return(invisible(pkg)) + } + list_exclusion_defaults <- c( + ".here", + "CODE_OF_CONDUCT.md", + "LICENSE", + "LICENCE", + "LICENSE.md", + "LICENCE.md", + "NEWS", + "NEWS.md", + "README.md", + "README.Rmd", + "README.HTML", + "dev", + "man", + "vignettes", + "tests" + ) + writeLines(text = list_exclusion_defaults, con = where) + usethis_use_build_ignore(".rscignore") + + cat_created(where) + return(invisible(pkg)) +} diff --git a/man/rstudio_deploy.Rd b/man/rstudio_deploy.Rd index de2957ab..340238bd 100644 --- a/man/rstudio_deploy.Rd +++ b/man/rstudio_deploy.Rd @@ -6,7 +6,8 @@ \alias{add_rstudioconnect_file} \alias{add_shinyappsio_file} \alias{add_shinyserver_file} -\title{Add an app.R at the root of your package to deploy on RStudio Connect} +\alias{add_rscignore_file} +\title{Add an \code{app.R} at the root of your package to deploy on RStudio Connect} \usage{ add_positconnect_file(pkg = get_golem_wd(), open = TRUE) @@ -15,6 +16,8 @@ add_rstudioconnect_file(pkg = get_golem_wd(), open = TRUE) add_shinyappsio_file(pkg = get_golem_wd(), open = TRUE) add_shinyserver_file(pkg = get_golem_wd(), open = TRUE) + +add_rscignore_file(pkg = get_golem_wd(), open = TRUE) } \arguments{ \item{pkg}{Path to the root of the package. Default is \code{get_golem_wd()}.} @@ -22,16 +25,34 @@ add_shinyserver_file(pkg = get_golem_wd(), open = TRUE) \item{open}{Should the created file be opened?} } \value{ -The path to the file, invisibly. +Side-effect functions for file creation returning the path to the +file, invisibly. } \description{ -Add an app.R at the root of your package to deploy on RStudio Connect +Additionally, adds a \code{.rscignore} at the root of the \code{{golem}} project if the +\code{rsconnect} package version is \verb{>= 0.8.25}. } \note{ In previous versions, this function was called add_rconnect_file and add_rstudioconnect_file. \code{add_rstudioconnect_file} is now deprecated; replace by \code{\link[=add_positconnect_file]{add_positconnect_file()}}. } +\section{List of excluded files in \code{.rscignore}}{ + +\itemize{ +\item .here +\item CODE_OF_CONDUCT.md +\item LICENSE\{.md\} +\item LICENCE\{.md\} +\item NEWS\{.md\} +\item README\{.md,.Rmd,.HTML\} +\item dev +\item man +\item tests +\item vignettes +} +} + \examples{ # Add a file for Connect if (interactive()) { diff --git a/tests/testthat/test-add_deploy_helpers.R b/tests/testthat/test-add_deploy_helpers.R index c1e3c4d1..ebbf7dac 100644 --- a/tests/testthat/test-add_deploy_helpers.R +++ b/tests/testthat/test-add_deploy_helpers.R @@ -118,7 +118,7 @@ test_that("add_rstudio_files", { expect_exists("app.R") test <- stringr::str_detect( output, - "ile created at .*/app.R" + "File created at .*/app.R" ) expect_true(test) } @@ -146,7 +146,7 @@ test_that("add_rscignore_file", { expect_exists(".rscignore") test <- stringr::str_detect( output, - "ile created at .*/.rscignore" + "File created at .*/.rscignore" ) expect_true(test) } From 4ea5e4e2c7dc8b624996be93b3f47d2dee8ee608 Mon Sep 17 00:00:00 2001 From: ColinFay Date: Thu, 27 Jun 2024 07:32:56 +0000 Subject: [PATCH 5/9] Re-build README.md --- DESCRIPTION | 2 +- README.md | 32 +++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 34867cb2..26bd1999 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: golem Title: A Framework for Robust Shiny Applications -Version: 0.4.22 +Version: 0.4.23 Authors@R: c( person("Colin", "Fay", , "contact@colinfay.me", role = c("cre", "aut"), comment = c(ORCID = "0000-0001-7343-1846")), diff --git a/README.md b/README.md index 0e3365a1..2edabe0c 100644 --- a/README.md +++ b/README.md @@ -103,24 +103,42 @@ You can also find apps at: ## About -You’re reading the doc about version: 0.4.22 +You’re reading the doc about version: 0.4.23 This `README` has been compiled on the Sys.time() - #> [1] "2024-02-29 20:34:57 UTC" + #> [1] "2024-06-27 07:30:32 UTC" Here are the test & coverage results: devtools::check(quiet = TRUE) #> ℹ Loading golem - #> ── R CMD check results ─────────────────────────────────────── golem 0.4.22 ──── - #> Duration: 1m 10.1s + #> Writing 'rstudio_deploy.Rd' + #> ── R CMD check results ─────────────────────────────────────── golem 0.4.23 ──── + #> Duration: 1m 21.4s #> - #> 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ + #> ❯ checking Rd files ... NOTE + #> checkRd: (-1) create_golem.Rd:30: Lost braces; missing escapes or markup? + #> 30 | \item{package_name}{Package name to use. By default, {golem} uses + #> | ^ + #> checkRd: (-1) get_sysreqs.Rd:23: Lost braces; missing escapes or markup? + #> 23 | {dockerfiler}. + #> | ^ + #> checkRd: (-1) golem_opts.Rd:83: Lost braces; missing escapes or markup? + #> 83 | \item{config_file}{path to the {golem} config file} + #> | ^ + #> checkRd: (-1) install_dev_deps.Rd:5: Lost braces; missing escapes or markup? + #> 5 | \title{Install {golem} dev dependencies} + #> | ^ + #> checkRd: (-1) project_hook.Rd:13: Lost braces; missing escapes or markup? + #> 13 | \item{package_name}{Package name to use. By default, {golem} uses + #> | ^ + #> + #> 0 errors ✔ | 0 warnings ✔ | 1 note ✖ covr::package_coverage() - #> golem Coverage: 85.38% + #> golem Coverage: 85.32% #> R/addins.R: 0.00% #> R/bootstrap_rstudio_api.R: 0.00% #> R/enable_roxygenize.R: 0.00% @@ -141,7 +159,7 @@ Here are the test & coverage results: #> R/golem-yaml-set.R: 83.02% #> R/use_utils.R: 83.33% #> R/utils.R: 83.75% - #> R/add_rstudio_files.R: 88.52% + #> R/add_rstudio_files.R: 85.29% #> R/add_resource_path.R: 88.89% #> R/create_golem.R: 89.47% #> R/make_dev.R: 90.00% From e1c2c387c4f21dae28d9a9acc54e245e358a4771 Mon Sep 17 00:00:00 2001 From: vincent guyader Date: Fri, 28 Jun 2024 16:20:05 +0200 Subject: [PATCH 6/9] fix #1150 (#1151) --- DESCRIPTION | 2 +- R/add_dockerfiles_renv.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 26bd1999..fe907721 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: golem Title: A Framework for Robust Shiny Applications -Version: 0.4.23 +Version: 0.4.23.0001 Authors@R: c( person("Colin", "Fay", , "contact@colinfay.me", role = c("cre", "aut"), comment = c(ORCID = "0000-0001-7343-1846")), diff --git a/R/add_dockerfiles_renv.R b/R/add_dockerfiles_renv.R index fefdfd47..61ffe56b 100644 --- a/R/add_dockerfiles_renv.R +++ b/R/add_dockerfiles_renv.R @@ -81,7 +81,7 @@ add_dockerfile_with_renv_ <- function( my_dock <- dockerfiler_Dockerfile()$new(FROM = tolower(tolower(paste0(golem::get_golem_name(), "_base")))) - my_dock$COPY(lockfile, "renv.lock") + my_dock$COPY(basename(lockfile), "renv.lock") my_dock$RUN("R -e 'renv::restore()'") From f3ce7f4ffc9065480dabc2757e513656bdedb1ab Mon Sep 17 00:00:00 2001 From: VincentGuyader Date: Fri, 28 Jun 2024 14:25:09 +0000 Subject: [PATCH 7/9] Re-build README.md --- DESCRIPTION | 2 +- README.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fe907721..a1aff4cd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: golem Title: A Framework for Robust Shiny Applications -Version: 0.4.23.0001 +Version: 0.4.24 Authors@R: c( person("Colin", "Fay", , "contact@colinfay.me", role = c("cre", "aut"), comment = c(ORCID = "0000-0001-7343-1846")), diff --git a/README.md b/README.md index 2edabe0c..a7a4b57d 100644 --- a/README.md +++ b/README.md @@ -103,20 +103,20 @@ You can also find apps at: ## About -You’re reading the doc about version: 0.4.23 +You’re reading the doc about version: 0.4.24 This `README` has been compiled on the Sys.time() - #> [1] "2024-06-27 07:30:32 UTC" + #> [1] "2024-06-28 14:22:50 UTC" Here are the test & coverage results: devtools::check(quiet = TRUE) #> ℹ Loading golem #> Writing 'rstudio_deploy.Rd' - #> ── R CMD check results ─────────────────────────────────────── golem 0.4.23 ──── - #> Duration: 1m 21.4s + #> ── R CMD check results ─────────────────────────────────────── golem 0.4.24 ──── + #> Duration: 1m 17.8s #> #> ❯ checking Rd files ... NOTE #> checkRd: (-1) create_golem.Rd:30: Lost braces; missing escapes or markup? From 490abd728ae6df3751a268161cd3f62a919b5706 Mon Sep 17 00:00:00 2001 From: vincent guyader Date: Thu, 4 Jul 2024 09:46:14 +0200 Subject: [PATCH 8/9] Docker user (#1152) * feat `golem::add_dockerfile_with_renv_*()` set "rstudio" as default USER in Dockerfile to avoid launching app as root * feat It is now easier to modify the renv.config.pak.enabled parameter in the Dockerfile generated by golem::add_dockerfile_with_renv_*(). --- NEWS.md | 4 ++++ R/add_dockerfiles_renv.R | 11 ++++++++++- man/dockerfiles.Rd | 5 +++++ man/rstudio_deploy.Rd | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 649b36ea..3aa1dc78 100644 --- a/NEWS.md +++ b/NEWS.md @@ -50,6 +50,10 @@ + `use_git()` is now at the bottom of 01_dev.R ((#1094, @ilyaZar)) ++ `golem::add_dockerfile_with_renv_*()` set "rstudio" as default USER in Dockerfile to avoid launching app as root + ++ It is now easier to modify the renv.config.pak.enabled parameter in the Dockerfile generated by `golem::add_dockerfile_with_renv_*()` functions. + ## Bug fix + `use_{internal,external}_XXX_file()` function family works with default missing `name` argument (#1060, @ilyaZar) diff --git a/R/add_dockerfiles_renv.R b/R/add_dockerfiles_renv.R index 61ffe56b..2252559a 100644 --- a/R/add_dockerfiles_renv.R +++ b/R/add_dockerfiles_renv.R @@ -83,7 +83,7 @@ add_dockerfile_with_renv_ <- function( my_dock$COPY(basename(lockfile), "renv.lock") - my_dock$RUN("R -e 'renv::restore()'") + my_dock$RUN("R -e 'options(renv.config.pak.enabled = FALSE);renv::restore()'") if (update_tar_gz) { old_version <- list.files(path = output_dir, pattern = paste0(golem::get_golem_name(), "_*.*.tar.gz"), full.names = TRUE) @@ -150,6 +150,7 @@ add_dockerfile_with_renv_ <- function( #' @param document boolean. If TRUE (by default), DESCRIPTION file is updated using [attachment::att_amend_desc()] before creating the renv.lock file #' @param dockerfile_cmd What is the CMD to add to the Dockerfile. If NULL, the default, #' the CMD will be `R -e "options('shiny.port'={port},shiny.host='{host}');library({appname});{appname}::run_app()\`. +#' @param user Name of the user to specify in the Dockerfile with the USER instruction. Default is `rstudio`, if set to `NULL` no the user from the FROM image is used. #' @param ... Other arguments to pass to [renv::snapshot()]. #' @inheritParams add_dockerfile #' @rdname dockerfiles @@ -171,6 +172,7 @@ add_dockerfile_with_renv <- function( extra_sysreqs = NULL, update_tar_gz = TRUE, dockerfile_cmd = NULL, + user = "rstudio", ... ) { base_dock <- add_dockerfile_with_renv_( @@ -191,6 +193,9 @@ add_dockerfile_with_renv <- function( if (!is.null(port)) { base_dock$EXPOSE(port) } + if (!is.null(user)) { + base_dock$USER(user) + } if (is.null(dockerfile_cmd)) { dockerfile_cmd <- sprintf( "R -e \"options('shiny.port'=%s,shiny.host='%s');library(%3$s);%3$s::run_app()\"", @@ -244,6 +249,7 @@ add_dockerfile_with_renv_shinyproxy <- function( open = TRUE, document = TRUE, update_tar_gz = TRUE, + user = "rstudio", ... ) { add_dockerfile_with_renv( @@ -262,6 +268,7 @@ add_dockerfile_with_renv_shinyproxy <- function( update_tar_gz = update_tar_gz, open = open, document = document, + user = user, dockerfile_cmd = sprintf( "R -e \"options('shiny.port'=3838,shiny.host='0.0.0.0');library(%1$s);%1$s::run_app()\"", golem::get_golem_name() @@ -287,6 +294,7 @@ add_dockerfile_with_renv_heroku <- function( extra_sysreqs = NULL, open = TRUE, document = TRUE, + user = "rstudio", update_tar_gz = TRUE, ... ) { @@ -306,6 +314,7 @@ add_dockerfile_with_renv_heroku <- function( update_tar_gz = update_tar_gz, open = FALSE, document = document, + user = user, dockerfile_cmd = sprintf( "R -e \"options('shiny.port'=$PORT,shiny.host='0.0.0.0');library(%1$s);%1$s::run_app()\"", golem::get_golem_name() diff --git a/man/dockerfiles.Rd b/man/dockerfiles.Rd index 6f9b0af7..1fd28d5e 100644 --- a/man/dockerfiles.Rd +++ b/man/dockerfiles.Rd @@ -73,6 +73,7 @@ add_dockerfile_with_renv( extra_sysreqs = NULL, update_tar_gz = TRUE, dockerfile_cmd = NULL, + user = "rstudio", ... ) @@ -90,6 +91,7 @@ add_dockerfile_with_renv_shinyproxy( open = TRUE, document = TRUE, update_tar_gz = TRUE, + user = "rstudio", ... ) @@ -106,6 +108,7 @@ add_dockerfile_with_renv_heroku( extra_sysreqs = NULL, open = TRUE, document = TRUE, + user = "rstudio", update_tar_gz = TRUE, ... ) @@ -165,6 +168,8 @@ See available distributions at https://hub.docker.com/r/rstudio/r-base/.} \item{dockerfile_cmd}{What is the CMD to add to the Dockerfile. If NULL, the default, the CMD will be \verb{R -e "options('shiny.port'=\{port\},shiny.host='\{host\}');library(\{appname\});\{appname\}::run_app()\\}.} +\item{user}{Name of the user to specify in the Dockerfile with the USER instruction. Default is \code{rstudio}, if set to \code{NULL} no the user from the FROM image is used.} + \item{...}{Other arguments to pass to \code{\link[renv:snapshot]{renv::snapshot()}}.} } \value{ diff --git a/man/rstudio_deploy.Rd b/man/rstudio_deploy.Rd index 340238bd..4be92a71 100644 --- a/man/rstudio_deploy.Rd +++ b/man/rstudio_deploy.Rd @@ -33,7 +33,7 @@ Additionally, adds a \code{.rscignore} at the root of the \code{{golem}} project \code{rsconnect} package version is \verb{>= 0.8.25}. } \note{ -In previous versions, this function was called add_rconnect_file and add_rstudioconnect_file. +In previous versions, this function was called add_rconnect_file. \code{add_rstudioconnect_file} is now deprecated; replace by \code{\link[=add_positconnect_file]{add_positconnect_file()}}. } From ddb51b7af5f5389ecf9b3d8de27d271be67db6f4 Mon Sep 17 00:00:00 2001 From: VincentGuyader Date: Thu, 4 Jul 2024 07:53:04 +0000 Subject: [PATCH 9/9] Re-build README.md --- DESCRIPTION | 2 +- README.md | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a1aff4cd..4fa54436 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: golem Title: A Framework for Robust Shiny Applications -Version: 0.4.24 +Version: 0.4.25 Authors@R: c( person("Colin", "Fay", , "contact@colinfay.me", role = c("cre", "aut"), comment = c(ORCID = "0000-0001-7343-1846")), diff --git a/README.md b/README.md index a7a4b57d..b2fa05fe 100644 --- a/README.md +++ b/README.md @@ -103,20 +103,21 @@ You can also find apps at: ## About -You’re reading the doc about version: 0.4.24 +You’re reading the doc about version: 0.4.25 This `README` has been compiled on the Sys.time() - #> [1] "2024-06-28 14:22:50 UTC" + #> [1] "2024-07-04 07:50:43 UTC" Here are the test & coverage results: devtools::check(quiet = TRUE) - #> ℹ Loading golem - #> Writing 'rstudio_deploy.Rd' - #> ── R CMD check results ─────────────────────────────────────── golem 0.4.24 ──── - #> Duration: 1m 17.8s + #> ══ Documenting ═════════════════════════════════════════════════════════════════ + #> ℹ Installed roxygen2 version (7.3.2) doesn't match required (7.3.1) + #> ✖ `check()` will not re-document this package + #> ── R CMD check results ─────────────────────────────────────── golem 0.4.25 ──── + #> Duration: 1m 21.6s #> #> ❯ checking Rd files ... NOTE #> checkRd: (-1) create_golem.Rd:30: Lost braces; missing escapes or markup? @@ -138,7 +139,7 @@ Here are the test & coverage results: #> 0 errors ✔ | 0 warnings ✔ | 1 note ✖ covr::package_coverage() - #> golem Coverage: 85.32% + #> golem Coverage: 85.34% #> R/addins.R: 0.00% #> R/bootstrap_rstudio_api.R: 0.00% #> R/enable_roxygenize.R: 0.00% @@ -163,9 +164,9 @@ Here are the test & coverage results: #> R/add_resource_path.R: 88.89% #> R/create_golem.R: 89.47% #> R/make_dev.R: 90.00% - #> R/add_files.R: 91.96% + #> R/add_files.R: 91.98% #> R/golem-yaml-get.R: 93.18% - #> R/add_dockerfiles_renv.R: 93.81% + #> R/add_dockerfiles_renv.R: 93.91% #> R/run_dev.R: 95.65% #> R/desc.R: 96.67% #> R/use_favicon.R: 96.67%