Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
README.html
^CRAN-SUBMISSION$
^dev$
^pkgdown$
30 changes: 21 additions & 9 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [main, master, '*coverage*']
pull_request:
branches: [main, master]

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
Expand All @@ -15,36 +16,47 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
covr::codecov(
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v5
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ doc
Meta
revdep/
README.html
*.Rproj
*.Rproj
/doc/
/Meta/
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: golem
Title: A Framework for Robust Shiny Applications
Version: 0.5.1.9005
Version: 0.5.1.9007
Authors@R: c(
person("Colin", "Fay", , "contact@colinfay.me", role = c("cre", "aut"),
comment = c(ORCID = "0000-0001-7343-1846")),
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

- Creating a golem with `create_golem(overwrite = TRUE)` will now __delete the old folder__ and replace with the golem skeleton.

## User visible change

- `run_dev()` only prints one message (#1191 / @howardbaik)

## Bug fix

- Removing the comments on golem creation didn't work fully, this has been fixed.
Expand All @@ -21,6 +25,10 @@

- Full refactoring of the `add_*_files` and `use_*_files` functions that now all share the same behavior

## Doc

- Vignettes have been renamed

# golem 0.5.1

* Hotfixing a bug with utils_download_file (#1168)
Expand Down
3 changes: 0 additions & 3 deletions R/bootstrap_pkgload.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ check_pkgload_installed <- function() {
)
}




pkgload_load_all <- function(
path = ".",
reset = TRUE,
Expand Down
1 change: 1 addition & 0 deletions R/reload.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ document_and_reload <- function(
export_all = export_all,
helpers = helpers,
attach_testthat = attach_testthat,
quiet = TRUE,
...
)
})
Expand Down
10 changes: 5 additions & 5 deletions vignettes/a_start.Rmd → vignettes/a-getting-started.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "a_start"
title: "01. Getting started"
author: "Colin Fay"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{a_start}
%\VignetteIndexEntry{01 Getting started}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down Expand Up @@ -156,7 +156,7 @@ About [tests in a package](https://r-pkgs.org/testing-basics.html).

### Use Recommended Packages

This will add `{shiny}`, `{DT}`, `{attempt}`, `{glue}`, `{htmltools}`, and
This will add `{shiny}`, `{DT}`, `{attempt}`, `{glue}`, `{htmltools}`, and
`{golem}` as dependencies to your package:

```{r}
Expand All @@ -182,8 +182,8 @@ your `{golem}` project. They can be used along the process of building your app:
golem::use_utils_ui(with_test = TRUE)
golem::use_utils_server(with_test = TRUE)
```
For a detailed description of the generated functions see the respective files
`R/golem_utils_server.R` and `R/golem_utils_ui.R` for which also default tests
For a detailed description of the generated functions see the respective files
`R/golem_utils_server.R` and `R/golem_utils_ui.R` for which also default tests
are added in `tests/testthat` (to suppress this set `with_test = FALSE` in the
above calls).

Expand Down
4 changes: 2 additions & 2 deletions vignettes/b_dev.Rmd → vignettes/b-develop.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "b_dev"
title: "02. Day to day development"
author: "Colin Fay"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{b_dev}
%\VignetteIndexEntry{02 Day to day development}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down
14 changes: 7 additions & 7 deletions vignettes/c_deploy.Rmd → vignettes/c-deploy.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "c_deploy"
title: "03. Deploy your app"
author: "Colin Fay"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{c_deploy}
%\VignetteIndexEntry{03 Deploy your app}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down Expand Up @@ -60,7 +60,7 @@ to run your app on.

## Deploying Apps with `{golem}`

The `dev/03_deploy.R` file contains functions for deployment on various platforms.
The `dev/03_deploy.R` file contains functions for deployment on various platforms.

### Posit Products

Expand All @@ -76,7 +76,7 @@ a `manifest.json` file is required which can be added (or updated) via:
rsconnect::writeManifest()
```

### Docker
### Docker

#### Without using `{renv}`

Expand All @@ -94,7 +94,7 @@ golem::add_dockerfile_heroku()
#### Using `{renv}` - CASE 1 : you didn't use renv during development process


> this functions will create a "deploy" folder containing :
> this functions will create a "deploy" folder containing :

```
deploy/
Expand All @@ -115,7 +115,7 @@ golem::add_dockerfile_with_renv(output_dir = "deploy")
golem::add_dockerfile_with_renv_shinyproxy(output_dir = "deploy")
```

If you would like to use `{renv}` during development, you can init a
If you would like to use `{renv}` during development, you can init a
`renv.lock` file with

```{r}
Expand Down Expand Up @@ -152,7 +152,7 @@ golem::add_dockerfile_with_renv(output_dir = "deploy", lockfile = "renv.lock")
golem::add_dockerfile_with_renv_shinyproxy(output_dir = "deploy", lockfile = "renv.lock")
```

> this functions will create a "deploy" folder containing :
> this functions will create a "deploy" folder containing :

```
deploy/
Expand Down
6 changes: 3 additions & 3 deletions vignettes/d_js.Rmd → vignettes/d-js.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "d_js"
title: "04. JavaScript"
author: "Colin Fay"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{d_js}
%\VignetteIndexEntry{04 - JavaScript}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down Expand Up @@ -46,7 +46,7 @@ golem::invoke_js("showid", ns("plot"))
golem::invoke_js("showhref", "panel2")
```

+ `clickon` click on the element. You have to use the full jQuery selector.
+ `clickon` click on the element. You have to use the full jQuery selector.

+ `show` & `hide` show and hide elements, using the full jQuery selector.

Expand Down
42 changes: 21 additions & 21 deletions vignettes/e_config.Rmd → vignettes/e-config.Rmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: "e_config"
title: "05. Configuration"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{config}
%\VignetteIndexEntry{05 - Configuration}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
Expand Down Expand Up @@ -34,9 +34,9 @@ old <- setwd(x)

## About `inst/golem-config.yml`

When you start a new `{golem}` application, you'll find a file called `golem-config.yml` in the `inst/` folder.
When you start a new `{golem}` application, you'll find a file called `golem-config.yml` in the `inst/` folder.

By default, this file contains the name of your app, its version, and the default working directory (which is the root of your package).
By default, this file contains the name of your app, its version, and the default working directory (which is the root of your package).

This config file is based on the [`{config}`](https://github.com/rstudio/config) format, which allows you to create configuration files for different application contexts. Please refer to this package documentation for more information.

Expand All @@ -57,13 +57,13 @@ dev:
golem_wd: !expr golem::pkg_path()
```

+ default/golem_name, default/golem_version, default/app_prod are usable across the whole life of your golem app: while developing, and also when in production.
+ production/app_prod might be used for adding elements that are to be used once the app is in production.
+ default/golem_name, default/golem_version, default/app_prod are usable across the whole life of your golem app: while developing, and also when in production.
+ production/app_prod might be used for adding elements that are to be used once the app is in production.
+ dev/golem_wd is in a `dev` config because the only moment you might reliably use this config is while developing your app. Use the `app_sys()` function if you want to rely on the package path once the app is deployed.

The good news is that if you don't want/need to use `{config}`, you can safely ignore this file, __just leave it where it is: it is used internally by the `{golem}` functions__.

These options are globally set with:
These options are globally set with:

```{r}
set_golem_options()
Expand All @@ -78,15 +78,15 @@ cat(
)
```

The functions reading the options in this config file are:
The functions reading the options in this config file are:

```{r}
get_golem_name()
get_golem_wd()
get_golem_version()
```

You can set these with:
You can set these with:

```{r eval = FALSE}
set_golem_name("this")
Expand All @@ -106,7 +106,7 @@ cat(

## Using `golem-config`

If you're already familiar with the `{config}` package, you can use this file just as any config file.
If you're already familiar with the `{config}` package, you can use this file just as any config file.

`{golem}` comes with an `amend_golem_config()` function to add elements to it.

Expand Down Expand Up @@ -136,7 +136,7 @@ cat(

## `app_config.R`

In `R/app_config.R`, you'll find a `get_golem_config()` function that allows you to retrieve config from this config file:
In `R/app_config.R`, you'll find a `get_golem_config()` function that allows you to retrieve config from this config file:

```{r}
pkgload::load_all()
Expand All @@ -149,7 +149,7 @@ get_golem_config(
)
```

Or using the env var (default `{config}` behavior):
Or using the env var (default `{config}` behavior):

```{r}
Sys.setenv("R_CONFIG_ACTIVE" = "production")
Expand All @@ -158,20 +158,20 @@ get_golem_config("where")

## `golem_config` vs `golem_options`

There is two ways to configure golem apps:
There is two ways to configure golem apps:

+ The `golem_opts` in the `run_app()` function
+ The `golem_opts` in the `run_app()` function
+ The `golem-config.yml` file

The big difference between these two is that the golem options from `run_app()` are meant to be configured during runtime: you'll be doing `run_app(val = "this")`, whereas the `golem-config` is meant to be used in the back-end, and will not be linked to the parameters passed to `run_app()` (even if this is technically possible, this is not the main objective),.

It's also linked to the `R_CONFIG_ACTIVE` environment variable, just as any `{config}` file.
The big difference between these two is that the golem options from `run_app()` are meant to be configured during runtime: you'll be doing `run_app(val = "this")`, whereas the `golem-config` is meant to be used in the back-end, and will not be linked to the parameters passed to `run_app()` (even if this is technically possible, this is not the main objective),.

It's also linked to the `R_CONFIG_ACTIVE` environment variable, just as any `{config}` file.

The idea is also that the `golem-config.yml` file is shareable across `{golem}` projects (`golem_opts` are application specific), and will be tracked by version control systems.
The idea is also that the `golem-config.yml` file is shareable across `{golem}` projects (`golem_opts` are application specific), and will be tracked by version control systems.

## Note for `{golem}` < 0.2.0 users
## Note for `{golem}` < 0.2.0 users

If you've built an app with `{golem}` before the version 0.2.0, this config file doesn't exist: you'll be prompted to create it if you update a newer version of `{golem}`.
If you've built an app with `{golem}` before the version 0.2.0, this config file doesn't exist: you'll be prompted to create it if you update a newer version of `{golem}`.

```{r echo = FALSE}
setwd(old)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "f_extending_golem"
title: "06. Extending `{golem}`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{f_extending_golem}
%\VignetteIndexEntry{06 - Extending golem}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down
Loading
Loading