Skip to content

Commit

Permalink
feat: breaking change - removing set_here() from creation and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinFay committed Sep 6, 2024
1 parent 8bfa224 commit 7d748b8
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 15 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Depends:
Imports:
attempt (>= 0.3.0),
config,
here,
htmltools,
rlang (>= 1.0.0),
shiny (>= 1.5.0),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Breaking change

- Creating a `golem` doesn't use `set_here()` anymore. `here::here()` should be able to find its way based using `DESCRIPTION`.

- The `add_*_files` and `use_*_files` now fail when:
- 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 )
- The file that the user tries to create already exists
Expand Down
8 changes: 0 additions & 8 deletions R/create_golem.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ copy_golem_skeleton_and_replace_name <- function(
cat_green_tick("Copied app skeleton")
}

# For mocking in tests
here_set_here <- function(...) {
here::set_here(...)
}

#' Create a package for a Shiny App using `{golem}`
#'
#' @param path Name of the folder to create the package in.
Expand Down Expand Up @@ -145,9 +140,6 @@ create_golem <- function(
path = path_to_golem,
open = FALSE
)
if (!file.exists(".here")) {
here_set_here(path_to_golem)
}
cat_green_tick("Created package directory")
}

Expand Down
2 changes: 0 additions & 2 deletions R/install_dev_deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#' + {roxygen2}
#' + {attachment}
#' + {rstudioapi}
#' + {here}
#' + {fs}
#' + {desc}
#' + {pkgbuild}
Expand Down Expand Up @@ -87,7 +86,6 @@ dev_deps <- unique(
"devtools",
"dockerfiler",
"fs",
"here",
"httpuv",
"pkgbuild",
"pkgload",
Expand Down
1 change: 0 additions & 1 deletion man/install_dev_deps.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/testthat/test-add_r_files.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
test_that("add_fct and add_utils", {
testthat::with_mocked_bindings(
# This is just to bypass usethis_use_test
# setting here()
usethis_use_test = function(name, ...) {
file.create(
file.path(
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-create_golem.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ test_that("create_golem works", {
testthat::with_mocked_bindings(
usethis_create_project = function(path, open) {
dir.create(path, recursive = TRUE)
},
here_set_here = function(path) {
return(TRUE)
},
{
Expand Down

0 comments on commit 7d748b8

Please sign in to comment.