vignette workflow for checking as-cran

With the new behavior of devtools with respect to building vignettes...I'm not 100% sure on the workflow for submitting to CRAN. I've read that the reason for inst/doc being deleted on build and check is to prevent developers from having old/stale vignettes in that folder. Historically, I've used devtools::build_vignettes() to get the vignettes built and put in inst/doc, then check (with --as-cran) to make sure the package was being checked in the same way CRAN would check.

Now I'm wondering if there is a new prescribed devtools process. What I've come up with is:

  1. Add "--compact-vignettes" to the Build Source additional arguments
  2. Build Source
  3. Check via uploading the source to r-hub.

My ramblings:
a. I'm currently unable to figure out a local way to check via devtools. If I just do build/check, I see during check:

v  checking installed files from 'inst/doc' ... 

But since that folder was could it check anything? (that CRAN presumably will check)

b. I can use the Terminal and do:

R CMD build . --compact-vignettes
R CMD check ./mypackage_1.0.1.tar.gz --as-cran

(and this seems OK, I can un-tar.gz the file and absolutely confirm that there are built vignettes in the inst/doc folder compacted).

I feel like I must be missing some slick devtools workflow. I see I can run devtools::build(args = "--compact-vignettes"), but I don't see how to check that directly via devtools (since that is what I'd be submitting to CRAN). I'm probably making a mountain out of a molehill...but I get very nervous submitting packages to CRAN....

I believe devtools::release could help. It should build the vignette in the correct place in the process. Did you already try ?

I must admit...I'm very scared to try ACTUALLY posts to CRAN, correct? I want to test in every imaginable way before posting it up to CRAN. I guess my new workflow that I've been using today is:

  1. Use the build/check RStudio buttons like I have historically for little package periodic checks during development.
  2. Lean on Travis/Appveyor to build the vignettes (since I previously have used devtools::build_vignettes() committing the files in inst/doc, I could save time on Travis with a --no-vignettes argument)
  3. Run devtools::check_win_release(args = "--compact-vignettes") (as well as check_win_devel) when I'm near a CRAN release.
  4. Run devtools::build(args = "--compact-vignettes"), and send the tar.gz to various r-hub platforms
  5. Send to CRAN

devtools::release() is a helper that ask a lot of questions to check you haven't missed anything. You can even add your own question. This a yes-no game step by step

And do not worry, it asks for confirmation before submitting

submit_cran <- function(pkg = ".", args = NULL) {
  if (yesno("Is your email address ", maintainer(pkg)$email, "?")) {

  pkg <- as.package(pkg)
  built_path <- build_cran(pkg, args = args)

  if (yesno("Ready to submit ", pkg$package, " (", pkg$version, ") to CRAN?")) {

  upload_cran(pkg, built_path)


I understand that now devtools::build_vignettes() is for development process. They have been moved so that you can call the vignettes after load_all() using vignettes(). Before deploying, vignettes are build by R CMD build when creating the tar.gz, so pkgbuild::build() will create the vignettes in inst/doc. I think it the new workflow proprosed :thinking: