From 6c08555b196e31c3b4dc9dcff26b5c269ad693fc Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 10 Oct 2023 15:08:17 -0400 Subject: [PATCH] Fix package given CRAN rejection notes. --- DESCRIPTION | 4 ++-- R/assets.R | 1 + R/export.R | 4 +--- R/quarto_ext.R | 2 +- cran-comments.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++- man/export.Rd | 4 ++-- man/install.Rd | 3 +++ 7 files changed, 68 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e6aabb7..f129351 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: shinylive -Title: Run Shiny Applications in the Browser +Title: Run 'shiny' Applications in the Browser Version: 0.1.0 Authors@R: c( @@ -9,7 +9,7 @@ Authors@R: person("George", "Stagg", role = "ctb", email = "george.stagg@posit.co"), person("Posit Software, PBC", role = c("cph", "fnd")) ) -Description: Run Shiny applications in the browser using 'webR' package. +Description: Exporting 'shiny' applications with 'shinylive' allows you to run them entirely in a web browser, without the need for a separate R server. The traditional way of deploying 'shiny' applications involves in a separate server and client: the server runs R and 'shiny', and clients connect via the web browser. When an application is deployed with 'shinylive', R and 'shiny' run in the web browser (via 'webR'): the browser is effectively both the client and server for the application. This allows for your 'shiny' application exported by 'shinylive' to be hosted by a static web server. License: MIT + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE) diff --git a/R/assets.R b/R/assets.R index 781c52f..df47270 100644 --- a/R/assets.R +++ b/R/assets.R @@ -128,6 +128,7 @@ install_local_helper <- function( #' @param version The version of the assets being installed. #' @inheritParams assets_download #' @seealso [`assets_download()`], [`assets_ensure()`], [`assets_cleanup()`] +#' @return All method return `invisible()`. #' @export assets_install_copy <- function( assets_repo_dir, diff --git a/R/export.R b/R/export.R index 6393323..b9eeaa3 100644 --- a/R/export.R +++ b/R/export.R @@ -13,8 +13,7 @@ #' @return Nothing. The app is exported to `destdir`. Instructions for serving #' the directory are printed to stdout. #' @importFrom rlang is_interactive -#' @examples -#' \dontrun{ +#' @examplesIf interactive() #' app_dir <- system.file("examples", "01_hello", package = "shiny") #' out_dir <- tempfile("shinylive-export") #' @@ -26,7 +25,6 @@ #' pr() %>% #' pr_static("/", out_dir) %>% #' pr_run() -#' } export <- function( appdir, destdir, diff --git a/R/quarto_ext.R b/R/quarto_ext.R index eb6ddf7..d81dbe2 100644 --- a/R/quarto_ext.R +++ b/R/quarto_ext.R @@ -5,7 +5,7 @@ #' @param args Command line arguments passed by the extension. See details for more information. #' @param ... Ignored. #' @param pretty Whether to pretty print the JSON output. -#' @returns Nothing. Values are printed to stdout. +#' @return Nothing. Values are printed to stdout. #' @section Command arguments: #' #' The first argument must be `"extension"`. This is done to match diff --git a/cran-comments.md b/cran-comments.md index c92fe58..f38202a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,4 +1,61 @@ -## 2023-10-06 +## Comments + +#### 2023-10-10 + +Updates: +* Package description length and wording. +* Added single quotes around `'shiny'` +* Added return value for `assets.Rd` and `install.Rd` +* Updated `export.Rd` example to use `if(interactive())` +* The `export.Rd` example writes to a temp folder, the tests are only run on CI, and there are no vignettes. Only temp files are created. + +Thank you, +Barret + + +#### 2023-10-09 + +Thanks, + +Please do not start the description with "This package", package name, +title or similar. + +The Description field is intended to be a (one paragraph) description of +what the package does and why it may be useful. Please add more details +about the package functionality and implemented methods in your +Description text. + +Please always write package names, software names and API (application +programming interface) names in single quotes in title and description. +e.g: --> 'shiny' +Please note that package names are case sensitive. + +Please add \value to .Rd files regarding exported methods and explain +the functions results in the documentation. Please write about the +structure of the output (class) and also what the output means. (If a +function does not return a value, please document that too, e.g. +\value{No return value, called for side effects} or similar) +Missing Rd-tags: + install.Rd: \value + +Functions which are supposed to only run interactively (e.g. shiny) +should be wrapped in if(interactive()). Please replace /dontrun{} with +if(interactive()){} if possible, then users can see that the functions +are not intended for use in scripts / functions that are supposed to run +non interactively. + +Please ensure that your functions do not write by default or in your +examples/vignettes/tests in the user's home filespace (including the +package directory and getwd()). This is not allowed by CRAN policies. +Please omit any default path in writing functions. In your +examples/vignettes/tests you can write to tempdir(). + +Please fix and resubmit. + +Best, +Benjamin Altmann + +#### 2023-10-06 This is a new package. diff --git a/man/export.Rd b/man/export.Rd index 1e04c1d..899a538 100644 --- a/man/export.Rd +++ b/man/export.Rd @@ -27,7 +27,7 @@ This function exports a Shiny app to a directory, which can then be served using \code{plumber}. } \examples{ -\dontrun{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} app_dir <- system.file("examples", "01_hello", package = "shiny") out_dir <- tempfile("shinylive-export") @@ -39,5 +39,5 @@ library(plumber) pr() \%>\% pr_static("/", out_dir) \%>\% pr_run() -} +\dontshow{\}) # examplesIf} } diff --git a/man/install.Rd b/man/install.Rd index f3c4e9a..8c2be8e 100644 --- a/man/install.Rd +++ b/man/install.Rd @@ -30,6 +30,9 @@ should be used.} \item{version}{The version of the assets being installed.} } +\value{ +All method return \code{invisible()}. +} \description{ Helper methods for testing updates to shinylive assets. }