-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: remove the use of usethis::create_project from create_golem #1176
Comments
hey @ColinFay thanks for reworking the internals the readability is so much better each time I look at the code ! FWIW, I remember (and also just checked !) that on Now, neither I wonder, how this is (was, as this FR is about to eliminate it anyway) a wise choice in general given that I guess the answer is obvious and I just have a flawed understanding of R packaging. Anyways, just wanted to leave a note here. There are quite a lot of other usethis-bootstrapped type functions that may rely on |
Hey @ilyaZar, That's indeed a great question, so let me explain how it's handled in golem and the rationale behind this weird way of doing. When developping an app, you'll need a lot of dev dependencies — Historically, usethis used to be a golem dep, but it made deploying the app very cumbersome — you had to install a lot of deps on the server that you don't need. In order to make this process easier, I've moved all the dev dependencies to Suggests, and when you try to use a function that needs them, we check that the package is installed, and if it's not, we ask the user to install it. This is for example what you'll get from calling check_roxygen2_installed <- function() {
rlang::check_installed(
"roxygen2",
reason = "to document the package."
)
}
roxygen2_roxygenise <- function(
package.dir = ".",
roclets = NULL,
load_code = NULL,
clean = FALSE
) {
check_roxygen2_installed()
roxygen2::roxygenise(
package.dir = package.dir,
roclets = roclets,
load_code = load_code,
clean = clean
)
}
So to sum up, here is the theoretical workflow on a fresh machine.
You can also find some information about this here https://golemverse.org/news/golem-0.4.0-release-on-cran/ Let me know if that makes things clearer to you. |
Ah ok nice trick ! ! So it works basically because a shiny app never uses the dev facilities provided by The Still the user can install them when he/she is developing. Also |
Yeah my understanding is that CRAN installs all the deps even the Suggests, but by definition it has access to it so that's ok 😅 |
allrighty ! thanks for taking time to explain ! |
When creating a golem, we don't need to use usethis::create_projetct, as we then copy a skeleton for a package.
The text was updated successfully, but these errors were encountered: