spec_resolve()
Resolve a Project Spec from Layers
Merges spec layers into one complete project spec, the input to project_create(). This is the only implementation of the merge: the framework.pub cloud and the fw CLI send unmerged layers, and R resolves them.
Usage
spec_resolve(layers = list(), name, author = NULL, check = TRUE)
Arguments
| Name | Default | Description |
|---|---|---|
| layers | list() |
A list of layers, bottom to top. Each element is either a
layer (a named list in spec shape) or a list with |
| name |
Project name. Overrides any |
|
| author | NULL |
Optional author list ( |
| check | TRUE |
If |
Value
The resolved spec as a named list. Attribute "conflicts" holds a data frame of keys set by more than one layer (path, layers).
Details
The package defaults for the project type are always the bottom layer. The given layers are applied on top, in order. The project type is taken from the last layer that sets type (default "project").
Merge rules:
- Objects merge by key, and a later layer wins.
- A key set to
NULL(JSONnull) removes it. - Entries of
files,skills,extra_directories,packages$default_packages,connections$databases, andconnections$storage_bucketsare replaced whole, never merged field by field. git$gitignore_contentis concatenated, with a comment naming the layer each block came from. The base gitignore template is chosen after merging, from the project type andsecurity$sensitive.- Empty lists are no-ops, so an empty JSON object and an empty JSON array mean the same thing.
Examples
spec <- spec_resolve(
list(list(security = list(sensitive = TRUE))),
name = "My study"
)
spec$security$sensitive