Skip to main content

Module module

Module module 

Source
Expand description

A Module pairs a parsed manifest with the directory it loaded from and the path through the lockfile that locates its dependency entries.

Carrying these together fixes two ambiguities that a bare Manifest cannot resolve on its own:

  1. A relative LocalPath in module.json is relative to that file, not to the process’s current working directory. Module::root is the directory to rebase against.
  2. Lockfile lookups must be scoped to the consumer’s branch of the nested dependencies tree, not searched globally. The Module::lockfile_scope field records the chain of dependency names from the top-level consumer down to this module.

See crate::lockfile for how the scope is consumed by lookups.

Structs§

Module
A WDL module, pairing its parsed Manifest, the directory on disk that holds the module.json file, and the lockfile scope that locates the module’s entry within a top-level lockfile.
ModuleId
A cheap identity for a Module that combines its root directory with its lockfile scope.

Functions§

is_module_root
Returns true when dir contains a module.json file at its root (i.e., dir is the on-disk location of a WDL module).