# renv snapshots

These test the full end-to-end publishing experience with renv.

## Archived package

1.  Create a new project.

    ```r
    usethis::create_project("~/desktop/rsconnect-archived")
    ```

    The remaining steps happen within this newly created project.

2.  Install an old version of `rowr`.

    ```r
    devtools::install_version('rowr', '1.1.3')
    ```

3.  Run the following code to create an `app.R`:

    ```r
    writeLines(c(
      "library(rowr)",
      "shinyApp(ui = fluidPage('shiny rowr'), server = function(input, output){})"
    ), "app.R")
    ```

4.  Deploy to shinyapps.io:

    ```r
    rsconnect::deployApp(server = "shinyapps.io")
    ```

5.  Deploy to colorado (Posit employees, only):

    ```r
    rsconnect::deployApp(server = "colorado.posit.co")
    ```

Expected behaviour:

-   App successfully deploys to shinyapps.
-   App successfully deploys to colorado.

## CRAN, github, and BioC packages

1.  Create a new project:

    ```r
    usethis::create_project("~/desktop/rsconnect-key-types")
    ````

    The remaining steps happen within this newly created project.

2.  Install CRAN, GitHub, and Bioconductor packages into your library:

    ```r
    pak::pak(c("rlang", "r-lib/waldo", "bioc::Biobase"))
    ```

3.  Run the following code to create an `app.R`:

    ```r
    writeLines(c(
      "library(rlang)",
      "library(waldo)",
      "library(Biobase)",
      "shinyApp(ui = fluidPage('shiny rowr'), server = function(input, output){})"
    ), "app.R")
    ```

4.  Deploy this app (analyzing your library):

    ```r
    rsconnect::deployApp()
    ```

5.  Create an renv snapshot:

    ```r
    renv::snapshot()
    ```

6.  Deploy this app (using the `renv.lock`):

    ```r
    rsconnect::deployApp()
    ```

Expected behaviour:

-   App deploys without error when analyzing your R library.
-   App deploys without error when analyzing the `renv.lock`.
