.usethis.R

#' Package development process' history
#'
#' Audit trail of various functions calls related to the development process
#' of the package. It can be used to (partially) re-generate this package's
#' source code programmatically. It primarily focuses on `usethis`.
#'
#' @note This script is (obviously) ignored in package's builds.


# Initialize package's skeleton ------------------------------------------------


usethis::create_package(".")
usethis::create_project(".")

# Remove name from .Rproj. It is useless.
file.rename("gather.Rproj", ".Rproj")


# Initialize Git repository ----------------------------------------------------


usethis::git_default_branch_configure(name = "main")
usethis::use_git()
usethis::use_git_remote(
    name = "origin",
    url  = "git@github.com:jeanmathieupotvin/dotprofile.git")


# Create an entry point for developers -----------------------------------------


usethis::use_devtools()
usethis::use_usethis()


# Add records to .Rbuildignore -------------------------------------------------


usethis::use_build_ignore(escape = TRUE, files = c(
    ".Rprofile",
    ".usethis.R"
))


# Build DESCRIPTION file -------------------------------------------------------


usethis::use_description(check_name = TRUE, roxygen = TRUE, fields = list(
    Package          = "dotprofile",
    Title            = "Create and Manage Configuration Profiles",
    License          = "MIT + file LICENSE",
    Language         = "en",
    Encoding         = "UTF-8",
    ByteCompile      = "true",
    NeedsCompilation = "no",
    Roxygen          = "list(markdown = TRUE, r6 = TRUE)",
    URL              = "https://github.com/jeanmathieupotvin/dotprofile",
    BugReports       = "https://github.com/jeanmathieupotvin/dotprofile/issues/new",
    `Authors@R`      = 'utils::person(
        given   = "Jean-Mathieu",
        family  = "Potvin",
        email   = "jm@potvin.xyz",
        role    = c("aut", "cre"),
        comment = c(ORCID = "0000-0002-8237-422X"))',
    Description = "
        A toolbox to create and manage metadata files and configuration
        profiles: files used to configure the parameters and initial settings
        for some computer programs."
))


# Bump version field -----------------------------------------------------------


usethis::use_version(which = "patch")
usethis::use_version(which = "dev")


# Choose license and create underlying files -----------------------------------


usethis::use_mit_license("Jean-Mathieu Potvin")


# Create a news file -----------------------------------------------------------


usethis::use_news_md()


# Create a read-me file --------------------------------------------------------


usethis::use_readme_md()
usethis::use_cran_badge()
usethis::use_lifecycle_badge(stage = "experimental")


# Setup dependencies -----------------------------------------------------------


# Required dependencies.
usethis::use_package("R", type = "Depends", min_version = "4.1.0")

# Imported packages.
usethis::use_package("cli",  type = "Imports", min_version = "3.1.0")
usethis::use_package("R6",   type = "Imports", min_version = NULL)

# Suggested packages.
usethis::use_package("covr",           type = "Suggests", min_version = NULL)
usethis::use_package("microbenchmark", type = "Suggests", min_version = NULL)
usethis::use_package("withr",          type = "Suggests", min_version = NULL)


# Setup testing framework / environment ----------------------------------------


usethis::use_testthat(edition = 3L, parallel = TRUE)


# Setup continuous integration framework / environment (CI) --------------------


usethis::use_github_action_check_standard()


# Setup Codecov (CI) -----------------------------------------------------------


usethis::use_coverage("codecov")
usethis::use_github_action("test-coverage")

covr::codecov(token = Sys.getenv("CODECOV_TOKEN"))


# Setup source files -----------------------------------------------------------


usethis::use_r(name = "dotprofile-package")

usethis::use_r(name    = "has-names")
usethis::use_test(name = "has-names")

usethis::use_r(name    = "introspectors")
usethis::use_test(name = "introspectors")

usethis::use_r(name    = "match-arg")
usethis::use_test(name = "match-arg")

usethis::use_r(name    = "nest")
usethis::use_test(name = "nest")

usethis::use_r(name    = "op-concat")
usethis::use_test(name = "op-concat")

usethis::use_r(name    = "op-nullish")
usethis::use_test(name = "op-nullish")

usethis::use_r(name    = "ui")
usethis::use_test(name = "ui")

usethis::use_r(name    = "utils")
usethis::use_test(name = "utils")
jeanmathieupotvin/dotprofile documentation built on Dec. 20, 2021, 10:08 p.m.