Repository navigation
Open
Description
I'm summarizing thoughts developed while revising R Packages (specifically, while working on the chapter about Other components). I have no plans to implement this now, i.e. to get it into the book or some such. It's a convention we could decide to adopt in the future and create a bit of tooling for.
Identified need: a place to store human- and machine-readable instructions for periodic maintenance tasks.
Currently maintainers store these in various places. The specific locations that got me thinking about this:
- In
tools/, but in the absence ofconfigureand withtools/listed in Rbuildignore. So an "off-label" repurposing oftools/. This results in the scripts being absent from both the package bundle and the installed package.- Examples: tzdb, renv, shiny, pkgcache
- A variation you see of this is to not list
tools/in Rbuildignore, in which casetools/appears in the package bundle, but not in the installed package. Examples at the time of writing: cli, pkgdown, plotly.R. I'm not sure this is really intentional (shippingtools/in the bundle) vs. being an oversight.
- In
inst/tools/. Generally results in the scripts being present in the package bundle and installed package, which seems weird. Also, gets promoted to top-leveltools/, which would seem to invite confusion with atools/directory that lives at the top-level in the source package.
Examples of tasks that would be natural to record in a folder of "maintenance / upkeep instructions":
- Recreate package data, i.e. the existing
data-raw/convention that we'd be generalizing. - Recreate concrete test fixtures.
- Re-vendor source code and headers for an embedded third party C/C++ library.
- haven https://github.com/tidyverse/haven/blob/main/R/update.R
- readxl https://github.com/tidyverse/readxl/blob/main/src/patch-to-libxls-upstream.R
- tzdb https://github.com/r-lib/tzdb/blob/main/tools/update-date-library.R
- Re-vendor web toolkits.
- Inline R code (as opposed to importing it).
- compat files, e.g. the
use_github_file()commands to (re)-inline them - pkgcache https://github.com/r-lib/pkgcache/blob/main/tools/embed_async.R
- compat files, e.g. the
- Re-ingest the specification for a web API.
- googledrive https://github.com/tidyverse/googledrive/blob/main/data-raw/discovery-doc-ingest.R
- googlesheets4 https://github.com/tidyverse/googlesheets4/blob/main/data-raw/discovery-doc-prep.R
- Re-discover colour palettes, styles, and themes.
- Re-ingest time zone data base
Interesting uses of tools/ or inst/tools/ that don't fall under what we're describing above:
- purrr using
configure/configure.win+tools/examples.R+cleanupto finesse the matter of using the base pipe and anonymous function syntax in examples: https://github.com/tidyverse/purrr/tree/2447c9d989dbf09880e85df39345260d5bf7d50d/tools - url checker using
inst/tools/to expose some base R functionality in the package: https://github.com/r-lib/urlchecker/tree/6aae0a87efcf724387f601e4a89ec697dad5fba9/inst/tools
Reacted by Hugo Gruson
Activity