| Title: | Create Project Manifest Files |
|---|---|
| Description: | Provides 'TOML' representations of packages needed that must be installed to run a project. Includes functions to specify detailed installation functions, validate files, and to use a given file as the requirements for a project. Handles package installations, when necessary, via 'pak'. |
| Authors: | Christopher T. Kenny [aut, cre] (ORCID: <https://orcid.org/0000-0002-9386-6860>) |
| Maintainer: | Christopher T. Kenny <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2 |
| Built: | 2026-06-05 06:15:36 UTC |
| Source: | https://github.com/christopherkenny/manifesto |
The version is returned as a string in the format "major.minor.patch" (e.g., "4.4.0"),
using components from R.version.
current_r_version()current_r_version()
A character string representing the full R version.
current_r_version()current_r_version()
Return all defined optional dependency groups in a manifest file
manifest_all_groups(path = "rproject.toml")manifest_all_groups(path = "rproject.toml")
path |
Path to the |
A character vector of group names (without "-dependencies")
manifest_all_groups(path = system.file(package = 'manifesto', 'minimal.toml'))manifest_all_groups(path = system.file(package = 'manifesto', 'minimal.toml'))
Check if the installed packages match the manifest requirements
manifest_check(path = "rproject.toml", groups = NULL)manifest_check(path = "rproject.toml", groups = NULL)
path |
Path to the TOML manifest file. Defaults to "rproject.toml". |
groups |
Optional dependency groups to include. Defaults to NULL (core only). |
A data.frame reporting installed version, required version, and status.
manifest_check(system.file(package = 'manifesto', 'minimal.toml'))manifest_check(system.file(package = 'manifesto', 'minimal.toml'))
This function checks for the presence of system dependencies listed in the
[system-dependencies] section of the manifest file.
manifest_check_system(path = "rproject.toml")manifest_check_system(path = "rproject.toml")
path |
Path to the |
A data.frame reporting the system dependency, and its status.
path <- manifest_create(`system-dependencies` = list(git = '*')) manifest_check_system(path)path <- manifest_create(`system-dependencies` = list(git = '*')) manifest_check_system(path)
This creates a minimal TOML file with a [manifesto], [project],
[environment], and empty [dependencies] section.
manifest_create( path, project_name = "Project", project_version = "0.0.1", manifesto_version = manifest_version(), r_version = "*", ... )manifest_create( path, project_name = "Project", project_version = "0.0.1", manifesto_version = manifest_version(), r_version = "*", ... )
path |
File path to write to. If missing, a temporary file will be used. |
project_name |
Optional project name. Defaults to |
project_version |
Optional project version. Defaults to |
manifesto_version |
Optional |
r_version |
Optional R version settings. Defaults to |
... |
Additional named arguments to add to the manifest. These will be added to the top-level of the TOML file. |
Invisibly returns the written path.
path <- manifest_create( dependencies = list(dplyr = '>= 1.0.0'), 'suggests-dependencies' = list(testthat = '>= 3.0.0') )path <- manifest_create( dependencies = list(dplyr = '>= 1.0.0'), 'suggests-dependencies' = list(testthat = '>= 3.0.0') )
Parses fields from a DESCRIPTION file and generates a corresponding
TOML manifest with [project], [environment], and dependency groups.
manifest_from_description( description = "DESCRIPTION", path, include_empty_groups = FALSE )manifest_from_description( description = "DESCRIPTION", path, include_empty_groups = FALSE )
description |
Path to the DESCRIPTION file. |
path |
Optional output file path. Defaults to a temporary |
include_empty_groups |
Whether to include empty dependency sections. |
By default, both Depends and Imports are mapped to [dependencies].
Suggests, LinkingTo, and Enhances are mapped to their own optional groups.
Path to the generated TOML file (invisibly).
path <- manifest_from_description(system.file(package = 'cli', 'DESCRIPTION'))path <- manifest_from_description(system.file(package = 'cli', 'DESCRIPTION'))
Captures all packages installed on .libPaths() and generates
a manifesto-style TOML manifest. Package versions can either reflect
their installed versions, or use a wildcard (*) to accept any.
manifest_from_installed( path, include_base = FALSE, min_version = c("installed", "*"), r_version = current_r_version() )manifest_from_installed( path, include_base = FALSE, min_version = c("installed", "*"), r_version = current_r_version() )
path |
Optional path to write the manifest. If missing, a temporary |
include_base |
Logical. Whether to include base packages. Defaults to FALSE. |
min_version |
Whether to require exact installed versions ( |
r_version |
Optional R version settings. Defaults to |
Base packages are excluded by default to minimize boilerplate.
Path to the generated TOML file (invisibly).
path <- manifest_from_installed()path <- manifest_from_installed()
Captures all currently loaded packages in the R session and generates
a manifesto-style TOML manifest. Package versions can either reflect
their current loaded versions, or use a wildcard (*) to accept any.
manifest_from_loaded( path, include_base = FALSE, min_version = c("loaded", "*"), r_version = current_r_version() )manifest_from_loaded( path, include_base = FALSE, min_version = c("loaded", "*"), r_version = current_r_version() )
path |
Optional path to write the manifest. If missing, a temporary |
include_base |
Logical. Whether to include base packages. Defaults to FALSE. |
min_version |
Whether to require exact loaded versions ( |
r_version |
Optional R version settings. Defaults to |
Base packages are excluded by default to minimize boilerplate.
Path to the generated TOML file (invisibly).
path <- manifest_from_loaded()path <- manifest_from_loaded()
pak lockfileReads a {pak} lockfile (JSON format) and converts it to a manifesto-style
TOML manifest. Extracts package versions and the locked R version.
manifest_from_pak(lockfile = "pkg.lock", path, r_version)manifest_from_pak(lockfile = "pkg.lock", path, r_version)
lockfile |
Path to a |
path |
Optional path to write the manifest. Defaults to a temporary |
r_version |
Optional R version settings. Defaults to version found in lockfile. |
Path to the generated TOML file (invisibly).
path <- manifest_from_pak(system.file(package = 'manifesto', 'pkg.lock'))path <- manifest_from_pak(system.file(package = 'manifesto', 'pkg.lock'))
Reads a {renv} lockfile (JSON format) and converts it to a manifesto-style
TOML manifest. Extracts package versions and the R environment version.
manifest_from_renv(lockfile = "renv.lock", path, r_version)manifest_from_renv(lockfile = "renv.lock", path, r_version)
lockfile |
Path to a |
path |
Optional path to write the TOML manifest. Defaults to a temporary |
r_version |
Optional R version settings. Defaults to version found in lockfile. |
Path to the generated TOML file (invisibly).
path <- manifest_from_renv(system.file(package = 'manifesto', 'renv.lock'))path <- manifest_from_renv(system.file(package = 'manifesto', 'renv.lock'))
Install packages from a manifesto manifest
manifest_install(path = "rproject.toml", groups = NULL, dry_run = FALSE)manifest_install(path = "rproject.toml", groups = NULL, dry_run = FALSE)
path |
Path to the |
groups |
Optional character vector of dependency groups to include (e.g., "dev", "workshop"). |
dry_run |
If |
Invisibly returns a character vector of package references that were installed.
manifest_install( path = system.file(package = 'manifesto', 'minimal.toml'), dry_run = TRUE )manifest_install( path = system.file(package = 'manifesto', 'minimal.toml'), dry_run = TRUE )
By default, groups = NULL, which will only install core dependencies.
If you want to include all optional groups, set groups = 'all'.
manifest_parse(path = "rproject.toml", groups = NULL)manifest_parse(path = "rproject.toml", groups = NULL)
path |
Path to the |
groups |
Optional character vector of dependency groups to include. |
A character vector of resolved package references.
manifest_parse(path = system.file(package = 'manifesto', 'minimal.toml'))manifest_parse(path = system.file(package = 'manifesto', 'minimal.toml'))
Peek into a manifest file
manifest_peek(path = "rproject.toml")manifest_peek(path = "rproject.toml")
path |
Path to the |
Invisibly returns a list with parsed contents.
manifest_peek(system.file('complex.toml', package = 'manifesto'))manifest_peek(system.file('complex.toml', package = 'manifesto'))
Generates a valid DESCRIPTION file from a manifest. Required fields like Title, Description, License, and Authors@R are inserted as TODOs if not present.
manifest_to_description(path = "rproject.toml", out = "DESCRIPTION")manifest_to_description(path = "rproject.toml", out = "DESCRIPTION")
path |
Path to the TOML manifest file. |
out |
Path to the DESCRIPTION file to write. Defaults to 'DESCRIPTION'. |
Invisibly returns the path to the written DESCRIPTION file.
out <- tempfile(pattern = 'DESCRIPTION') manifest_to_description( path = system.file('minimal.toml', package = 'manifesto'), out = out )out <- tempfile(pattern = 'DESCRIPTION') manifest_to_description( path = system.file('minimal.toml', package = 'manifesto'), out = out )
Validate a manifesto manifest file
manifest_validate(path = "rproject.toml", groups = NULL)manifest_validate(path = "rproject.toml", groups = NULL)
path |
Path to the |
groups |
Optional character vector of dependency groups to include. |
Invisibly returns TRUE if the manifest is valid; otherwise, stops with an error.
manifest_validate(path = system.file(package = 'manifesto', 'minimal.toml'))manifest_validate(path = system.file(package = 'manifesto', 'minimal.toml'))
Return the current version of the manifesto package
manifest_version()manifest_version()
A character version string.
manifest_version()manifest_version()