Package 'hubDevs'

Title: Utilities for Creating and Standardising Hubverse Packages
Description: What the package does (one paragraph).
Authors: Anna Krystalli [aut, cre] , Zhian N. Kamvar [aut]
Maintainer: Anna Krystalli <[email protected]>
License: MIT + file LICENSE
Version: 0.1.1
Built: 2025-01-10 18:30:57 UTC
Source: https://github.com/hubverse-org/hubDevs

Help Index


Add website Needs field to DESCRIPTION

Description

Adds the hubverve hubStyle package as a website need to the DESCRIPTION file.

Usage

add_website_needs()

Create hubverse package skeleton

Description

Create hubverse package skeleton

Usage

create_hubdev_pkg(
  path,
  fields = list(),
  copyright_holder = "Consortium of Infectious Disease Modeling Hubs",
  organisation = "hubverse-org",
  hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html"
)

Arguments

path

A path. If it exists, it is used. If it does not exist, it is created, provided that the parent path exists.

fields

A named list of fields to add to DESCRIPTION, potentially overriding default values. See use_description() for how you can set personalized defaults using package options.

copyright_holder

Name of the copyright holder or holders. This defaults to "{package name} authors"; you should only change this if you use a CLA to assign copyright to a single entity.

organisation

Character string. The hubverse GitHub organisation name. The user's role and the token's scopes must be such that you have permission to create repositories in the hubverse organisation.

hubdocs_contribute_url

Character string. URL of the general contributing information page on hubDocs.

Value

Path to the newly created project or package, invisibly.


Helpers for creating community facing hubverse package documents

Description

These functions create community facing documents detailing how contributors and the wider community can interact with hubverse packages. Each function creates the relevant file in the .github directory from templates and is set up with appropriate hubverse default values.

Usage

use_hubdev_community(
  organisation = "hubverse-org",
  hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html"
)

use_hubdev_coc()

use_hubdev_contributing(
  organisation = "hubverse-org",
  hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html"
)

Arguments

organisation

Character string. The hubverse GitHub organisation name. The user's role and the token's scopes must be such that you have permission to create repositories in the hubverse organisation.

hubdocs_contribute_url

Character string. URL of the general contributing information page on hubDocs.

Functions

  • use_hubdev_community(): Create hubverse CODE_OF_CONDUCT.md and CONTRIBUTING.md files.

  • use_hubdev_coc(): Create hubverse CODE_OF_CONDUCT.md file.

  • use_hubdev_contributing(): Create hubverse CONTRIBUTING.md file.


Set up hubverse package on GitHub

Description

The function runs a number of internal utilities for setting up a hubverse package on GitHub:

  • Creates a repo in the hubverse GitHub organisation

  • Adds details of the repository to the DESCRIPTION file

  • Initailises pkgdown documentation

  • Creates GitHub Action workflows for:

    • standard R CMD CHECK

    • test coverage

    • linting with lintr

    • building pkgdown documentation and deploying production docs to GitHub Pages and PR previews to a Netlify site

Usage

use_hubdev_github(organisation = "hubverse-org")

Arguments

organisation

Character string. The hubverse GitHub organisation name. The user's role and the token's scopes must be such that you have permission to create repositories in the hubverse organisation.


Hubverse Developer GitHub Action setup

Description

Sets up common hubverse developer continuous integration (CI) workflows for hubverse packages hosted on GitHub using GitHub Actions. Available actions are hosted in repository hubverse-org/hubverse-developer-actions

Usage

use_hubdev_github_action(name)

Arguments

name

Name of workflow, i.e. the name of one of the hubverse developer action repository directories containing a GitHub Action workflow .yaml file.


Create a basic hubverse .lintr file from template

Description

Create a basic hubverse .lintr file from template

Usage

use_hubdev_lintr()

Add standard GitHub Actions workflows

Description

Downloads standard r-lib GitHub Action workflows and writes them to the .github/workflows directory for:

Usage

use_hubdev_pkg_actions()

Configure hubverse pkgdown site

Description

The function performs a number of actions to configure a hubverse package's pkgdown site to use the hubStyle template for docs styling.

  • Runs use_pkgdown() to initialise pkgdown documentation.

  • Runs use_github_pages() to initialise GitHub Pages for the package.

  • Adds a GitHub Action workflow for building pkgdown documentation and deploying to GitHub Pages (productions) and Netlify (PR previews) using use_hubdev_pkgdown_action().

  • Adds the hubStyle repository to the DESCRIPTION's Config/Needs/website property using add_website_needs().

  • Creates a favicon for the package using the hubStyle logo.

  • Overwrites standard ⁠_pkgdown.yml⁠ file with customised configuration to use the hubverse hubStyle package for docs styling.

Usage

use_hubdev_pkgdown(add_logo = FALSE)

Arguments

Logical. Whether to add the logo to the package.


Use the hubdev custom pkgdown GitHub Action

Description

The functions creates a pkgdown-netlify-preview.yaml action in the .github/workflows directory. The action follows the standard pkgdown publishing to gh-pages in the event of a merge into main branch but can also be set up to publish internal PR previews to Netlify.

Usage

use_hubdev_pkgdown_action(remove_std = TRUE)

Arguments

remove_std

Logical. Whether to remove the standard pkgdown action if it exists.

Details

To activate Netlify Previews, you must:

See pkgdown docs section on PR previews for more details.


Create a basic hubverse README.Rmd from template

Description

Create a basic hubverse README.Rmd from template

Usage

use_hubdev_readme(
  organisation = "hubverse-org",
  hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html"
)

Arguments

organisation

Character string. The hubverse GitHub organisation name. The user's role and the token's scopes must be such that you have permission to create repositories in the hubverse organisation.

hubdocs_contribute_url

Character string. URL of the general contributing information page on hubDocs.