Skip to content

Commit 056d5a9

Browse files
Merge pull request #1196 from ThinkR-open/dev
master is now the new "dev" branch
2 parents 6291796 + 6b44a00 commit 056d5a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1688
-1853
lines changed

DESCRIPTION

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: golem
22
Title: A Framework for Robust Shiny Applications
3-
Version: 0.5.1
3+
Version: 0.5.1.9005
44
Authors@R: c(
55
person("Colin", "Fay", , "contact@colinfay.me", role = c("cre", "aut"),
66
comment = c(ORCID = "0000-0001-7343-1846")),
@@ -28,7 +28,6 @@ Depends:
2828
Imports:
2929
attempt (>= 0.3.0),
3030
config,
31-
here,
3231
htmltools,
3332
rlang (>= 1.0.0),
3433
shiny (>= 1.5.0),
@@ -69,7 +68,6 @@ Suggests:
6968
VignetteBuilder:
7069
knitr
7170
Config/testthat/edition: 3
72-
Config/testthat/parallel: true
7371
Encoding: UTF-8
7472
Language: en-US
7573
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
> Notes: the # between parenthesis refers to the related issue on GitHub, and the @ refers to an external contributor solving this issue.
22
3+
4+
# golem 0.5.1 to 0.6.0
5+
6+
## Breaking change
7+
8+
- Creating a `golem` doesn't call `set_here()` nor `usethis::create_project()` anymore. It used to be because we wanted to be able to use `here::here()`, but the function should be able to find its way based using `DESCRIPTION`. It gives a lighter implementation of golem projects creation as it doesn't mess up with where `here()` is anymore.
9+
10+
- The `add_*_files` and `use_*_files` now fail when:
11+
- The directory where the user tries to add the file doesn't exist. `{golem}` used to try to create the directory but that's not the function job — use_*_file functions should only be there to add file (Singe responsabily )
12+
- The file that the user tries to create already exists
13+
14+
- Creating a golem with `create_golem(overwrite = TRUE)` will now __delete the old folder__ and replace with the golem skeleton.
15+
16+
## Bug fix
17+
18+
- Removing the comments on golem creation didn't work fully, this has been fixed.
19+
20+
## Internal changes
21+
22+
- Full refactoring of the `add_*_files` and `use_*_files` functions that now all share the same behavior
23+
324
# golem 0.5.1
425

526
* Hotfixing a bug with utils_download_file (#1168)

R/add_dockerfiles.R

Lines changed: 112 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,26 @@ talk_once <- function(.f, msg = "") {
8383
#' }
8484
#' @return The `{dockerfiler}` object, invisibly.
8585
add_dockerfile <- function(
86-
path = "DESCRIPTION",
87-
output = "Dockerfile",
88-
pkg = get_golem_wd(),
89-
from = paste0(
90-
"rocker/verse:",
91-
R.Version()$major,
92-
".",
93-
R.Version()$minor
94-
),
95-
as = NULL,
96-
port = 80,
97-
host = "0.0.0.0",
98-
sysreqs = TRUE,
99-
repos = c(CRAN = "https://cran.rstudio.com/"),
100-
expand = FALSE,
101-
open = TRUE,
102-
update_tar_gz = TRUE,
103-
build_golem_from_source = TRUE,
104-
extra_sysreqs = NULL) {
86+
path = "DESCRIPTION",
87+
output = "Dockerfile",
88+
pkg = get_golem_wd(),
89+
from = paste0(
90+
"rocker/verse:",
91+
R.Version()$major,
92+
".",
93+
R.Version()$minor
94+
),
95+
as = NULL,
96+
port = 80,
97+
host = "0.0.0.0",
98+
sysreqs = TRUE,
99+
repos = c(CRAN = "https://cran.rstudio.com/"),
100+
expand = FALSE,
101+
open = TRUE,
102+
update_tar_gz = TRUE,
103+
build_golem_from_source = TRUE,
104+
extra_sysreqs = NULL
105+
) {
105106
add_dockerfile_(
106107
path = path,
107108
output = output,
@@ -122,26 +123,26 @@ add_dockerfile <- function(
122123

123124
add_dockerfile_ <- talk_once(
124125
function(
125-
path = "DESCRIPTION",
126-
output = "Dockerfile",
127-
pkg = get_golem_wd(),
128-
from = paste0(
129-
"rocker/verse:",
130-
R.Version()$major,
131-
".",
132-
R.Version()$minor
133-
),
134-
as = NULL,
135-
port = 80,
136-
host = "0.0.0.0",
137-
sysreqs = TRUE,
138-
repos = c(CRAN = "https://cran.rstudio.com/"),
139-
expand = FALSE,
140-
open = TRUE,
141-
update_tar_gz = TRUE,
142-
build_golem_from_source = TRUE,
143-
extra_sysreqs = NULL
144-
) {
126+
path = "DESCRIPTION",
127+
output = "Dockerfile",
128+
pkg = get_golem_wd(),
129+
from = paste0(
130+
"rocker/verse:",
131+
R.Version()$major,
132+
".",
133+
R.Version()$minor
134+
),
135+
as = NULL,
136+
port = 80,
137+
host = "0.0.0.0",
138+
sysreqs = TRUE,
139+
repos = c(CRAN = "https://cran.rstudio.com/"),
140+
expand = FALSE,
141+
open = TRUE,
142+
update_tar_gz = TRUE,
143+
build_golem_from_source = TRUE,
144+
extra_sysreqs = NULL
145+
) {
145146
where <- fs_path(pkg, output)
146147

147148
usethis_use_build_ignore(
@@ -190,23 +191,24 @@ add_dockerfile_ <- talk_once(
190191
#' @export
191192
#' @rdname dockerfiles
192193
add_dockerfile_shinyproxy <- function(
193-
path = "DESCRIPTION",
194-
output = "Dockerfile",
195-
pkg = get_golem_wd(),
196-
from = paste0(
197-
"rocker/verse:",
198-
R.Version()$major,
199-
".",
200-
R.Version()$minor
201-
),
202-
as = NULL,
203-
sysreqs = TRUE,
204-
repos = c(CRAN = "https://cran.rstudio.com/"),
205-
expand = FALSE,
206-
open = TRUE,
207-
update_tar_gz = TRUE,
208-
build_golem_from_source = TRUE,
209-
extra_sysreqs = NULL) {
194+
path = "DESCRIPTION",
195+
output = "Dockerfile",
196+
pkg = get_golem_wd(),
197+
from = paste0(
198+
"rocker/verse:",
199+
R.Version()$major,
200+
".",
201+
R.Version()$minor
202+
),
203+
as = NULL,
204+
sysreqs = TRUE,
205+
repos = c(CRAN = "https://cran.rstudio.com/"),
206+
expand = FALSE,
207+
open = TRUE,
208+
update_tar_gz = TRUE,
209+
build_golem_from_source = TRUE,
210+
extra_sysreqs = NULL
211+
) {
210212
add_dockerfile_shinyproxy_(
211213
path = path,
212214
output = output,
@@ -225,23 +227,24 @@ add_dockerfile_shinyproxy <- function(
225227

226228
add_dockerfile_shinyproxy_ <- talk_once(
227229
function(
228-
path = "DESCRIPTION",
229-
output = "Dockerfile",
230-
pkg = get_golem_wd(),
231-
from = paste0(
232-
"rocker/verse:",
233-
R.Version()$major,
234-
".",
235-
R.Version()$minor
236-
),
237-
as = NULL,
238-
sysreqs = TRUE,
239-
repos = c(CRAN = "https://cran.rstudio.com/"),
240-
expand = FALSE,
241-
open = TRUE,
242-
update_tar_gz = TRUE,
243-
build_golem_from_source = TRUE,
244-
extra_sysreqs = NULL) {
230+
path = "DESCRIPTION",
231+
output = "Dockerfile",
232+
pkg = get_golem_wd(),
233+
from = paste0(
234+
"rocker/verse:",
235+
R.Version()$major,
236+
".",
237+
R.Version()$minor
238+
),
239+
as = NULL,
240+
sysreqs = TRUE,
241+
repos = c(CRAN = "https://cran.rstudio.com/"),
242+
expand = FALSE,
243+
open = TRUE,
244+
update_tar_gz = TRUE,
245+
build_golem_from_source = TRUE,
246+
extra_sysreqs = NULL
247+
) {
245248
where <- fs_path(pkg, output)
246249

247250
usethis_use_build_ignore(output)
@@ -282,23 +285,24 @@ add_dockerfile_shinyproxy_ <- talk_once(
282285
#' @export
283286
#' @rdname dockerfiles
284287
add_dockerfile_heroku <- function(
285-
path = "DESCRIPTION",
286-
output = "Dockerfile",
287-
pkg = get_golem_wd(),
288-
from = paste0(
289-
"rocker/verse:",
290-
R.Version()$major,
291-
".",
292-
R.Version()$minor
293-
),
294-
as = NULL,
295-
sysreqs = TRUE,
296-
repos = c(CRAN = "https://cran.rstudio.com/"),
297-
expand = FALSE,
298-
open = TRUE,
299-
update_tar_gz = TRUE,
300-
build_golem_from_source = TRUE,
301-
extra_sysreqs = NULL) {
288+
path = "DESCRIPTION",
289+
output = "Dockerfile",
290+
pkg = get_golem_wd(),
291+
from = paste0(
292+
"rocker/verse:",
293+
R.Version()$major,
294+
".",
295+
R.Version()$minor
296+
),
297+
as = NULL,
298+
sysreqs = TRUE,
299+
repos = c(CRAN = "https://cran.rstudio.com/"),
300+
expand = FALSE,
301+
open = TRUE,
302+
update_tar_gz = TRUE,
303+
build_golem_from_source = TRUE,
304+
extra_sysreqs = NULL
305+
) {
302306
add_dockerfile_heroku_(
303307
path = path,
304308
output = output,
@@ -317,23 +321,24 @@ add_dockerfile_heroku <- function(
317321

318322
add_dockerfile_heroku_ <- talk_once(
319323
function(
320-
path = "DESCRIPTION",
321-
output = "Dockerfile",
322-
pkg = get_golem_wd(),
323-
from = paste0(
324-
"rocker/verse:",
325-
R.Version()$major,
326-
".",
327-
R.Version()$minor
328-
),
329-
as = NULL,
330-
sysreqs = TRUE,
331-
repos = c(CRAN = "https://cran.rstudio.com/"),
332-
expand = FALSE,
333-
open = TRUE,
334-
update_tar_gz = TRUE,
335-
build_golem_from_source = TRUE,
336-
extra_sysreqs = NULL) {
324+
path = "DESCRIPTION",
325+
output = "Dockerfile",
326+
pkg = get_golem_wd(),
327+
from = paste0(
328+
"rocker/verse:",
329+
R.Version()$major,
330+
".",
331+
R.Version()$minor
332+
),
333+
as = NULL,
334+
sysreqs = TRUE,
335+
repos = c(CRAN = "https://cran.rstudio.com/"),
336+
expand = FALSE,
337+
open = TRUE,
338+
update_tar_gz = TRUE,
339+
build_golem_from_source = TRUE,
340+
extra_sysreqs = NULL
341+
) {
337342
where <- fs_path(pkg, output)
338343

339344
usethis_use_build_ignore(output)

R/add_dockerfiles_renv.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,7 @@ add_dockerfile_with_renv_heroku <- function(
416416
"README"
417417
)
418418

419-
write_there <- function(...) {
420-
write(..., file = readme_output, append = TRUE)
421-
}
419+
write_there <- write_there_builder(readme_output)
422420

423421
write_there("From your command line, run:\n")
424422

0 commit comments

Comments
 (0)