diff --git a/R/appMetadata.R b/R/appMetadata.R index ec0e11e6..0a1b8234 100644 --- a/R/appMetadata.R +++ b/R/appMetadata.R @@ -3,7 +3,7 @@ appMetadata <- function(appDir, appPrimaryDoc = NULL, quarto = NA, contentCategory = NULL, - coerceStaticRmd = FALSE, + isShinyappsServer = FALSE, metadata = list()) { appFiles <- listDeploymentFiles(appDir, appFiles) @@ -38,7 +38,7 @@ appMetadata <- function(appDir, appMode <- inferAppMode( file.path(appDir, appFiles), usesQuarto = quarto, - coerceStaticRmd = coerceStaticRmd + isShinyappsServer = isShinyappsServer ) } @@ -119,7 +119,7 @@ checkAppLayout <- function(appDir, appPrimaryDoc = NULL) { # infer the mode of the application from files in the root dir inferAppMode <- function(absoluteAppFiles, usesQuarto = NA, - coerceStaticRmd = FALSE) { + isShinyappsServer = FALSE) { matchingNames <- function(paths, pattern) { idx <- grepl(pattern, basename(paths), ignore.case = TRUE, perl = TRUE) @@ -178,10 +178,9 @@ inferAppMode <- function(absoluteAppFiles, if (usesQuarto) { return("quarto-static") } else { - # For Shinyapps and posit.cloud, treat "rmd-static" app mode as "rmd-shiny" so that - # they can be served from a shiny process in Connect until we have better support of - # rmarkdown static content - if (coerceStaticRmd) { + # For shinyapps.io, treat "rmd-static" app mode as "rmd-shiny" so that + # it can be served from a shiny process in Connect + if (isShinyappsServer) { return("rmd-shiny") } return("rmd-static") diff --git a/R/client-cloud.R b/R/client-cloud.R index bcd3de39..be0afb60 100644 --- a/R/client-cloud.R +++ b/R/client-cloud.R @@ -302,15 +302,6 @@ cloudClient <- function(service, authInfo) { listRequest(service, authInfo, path, query, "invitations") }, - coerceStaticRmd = function(accountId) { - # Posit Cloud will gain support soon for rendering RMD into static content. When support is - # added, true_static_rmd_enabled will be TRUE. In the meantime, RMDs can be deployed by - # using Shiny. - # TODO once Cloud supports this, remove this coercion. - account <- GET(service, authInfo, paste0("/accounts/", accountId)) - account$beta$coerce_static_rmd_enabled - }, - listTasks = function(accountId, filters = NULL) { if (is.null(filters)) { filters <- vector() diff --git a/R/client-connect.R b/R/client-connect.R index 0411ea9f..98e1de43 100644 --- a/R/client-connect.R +++ b/R/client-connect.R @@ -96,10 +96,6 @@ connectClient <- function(service, authInfo) { GET(service, authInfo, paste0("/applications/", applicationId)) }, - coerceStaticRmd = function(accountId) { - FALSE - }, - ## Tasks API listTasks = function() { diff --git a/R/client-shinyapps.R b/R/client-shinyapps.R index 052cb8ae..15349037 100644 --- a/R/client-shinyapps.R +++ b/R/client-shinyapps.R @@ -214,10 +214,6 @@ shinyAppsClient <- function(service, authInfo) { POST_JSON(service, authInfo, path, json) }, - coerceStaticRmd = function(accountId) { - TRUE - }, - listTasks = function(accountId, filters = NULL) { if (is.null(filters)) { filters <- vector() diff --git a/R/deployApp.R b/R/deployApp.R index f0c9693e..d82b0e4c 100644 --- a/R/deployApp.R +++ b/R/deployApp.R @@ -336,7 +336,7 @@ deployApp <- function(appDir = getwd(), showCookies(serverInfo(accountDetails$server)$url) } - coerceStaticRmd <- client$coerceStaticRmd(accountDetails$accountId) + isShinyappsServer <- isShinyappsServer(target$server) logger("Inferring App mode and parameters") appMetadata <- appMetadata( @@ -345,7 +345,7 @@ deployApp <- function(appDir = getwd(), appPrimaryDoc = appPrimaryDoc, quarto = quarto, contentCategory = contentCategory, - coerceStaticRmd = coerceStaticRmd, + isShinyappsServer = isShinyappsServer, metadata = metadata ) diff --git a/tests/testthat/test-appMetadata.R b/tests/testthat/test-appMetadata.R index d24444f8..c5e44337 100644 --- a/tests/testthat/test-appMetadata.R +++ b/tests/testthat/test-appMetadata.R @@ -86,7 +86,7 @@ test_that("can infer mode for static quarto and rmd docs", { expect_equal(inferAppMode(paths), "rmd-static") expect_equal(inferAppMode(paths, usesQuarto = TRUE), "quarto-static") # Static R Markdown treated as rmd-shiny for shinyapps targets - expect_equal(inferAppMode(paths, coerceStaticRmd = TRUE), "rmd-shiny") + expect_equal(inferAppMode(paths, isShinyappsServer = TRUE), "rmd-shiny") }) test_that("can infer mode for shiny rmd docs", {