dev module declared-dependencies

Validate that declared dependencies match actual module structure

Command version
0.0.0
Command configuration
dev-tool:dev.module.declared-dependencies@0.0.0

Arguments

ArgumentTypeRequiredDefaultDescription
--validate, --no-validatebooleanNofalseValidate declared dependencies for unknown references, cycles, and executable dependency violations
--outstringNoOptional path for dependency graph output. Relative paths are resolved from --repo-root.
--formatstring one of dotNo"dot"Dependency graph output format (default: dot)
--group-bystring one of type, moduleNo"type"Group the dependency listing by dependency type or by module (default: type)
--exclude-tests, --no-exclude-testsbooleanNofalseExclude testDependencies from command output and validation
--hide-submodule-dependencies, --no-hide-submodule-dependenciesbooleanNofalseHide dependencies that target descendant submodules of the same module in response output and DOT export
--recurse, --no-recursebooleanNofalseValidate every repository this one pins as well, each in its own checkout by its own manifest and what it vendored -- what its own gate reads standing alone -- and the adapter checkout a tracked adapter catalog pins among them. A run from a tree's root otherwise reads the root's manifest, and can pass a manifest the repository holding it would refuse. Refused without --validate

It also takes the global arguments.

Output

It answers with a declared_dependencies.declaredDependenciesResult.

Types

declared_dependencies.declaredDependenciesResult

FieldTypeRequiredDefaultDescription
moduleCountintegerYesHow many modules the manifest declares
declaredDependencieslist[declared_dependencies.DeclaredDependencyEntry]No[]What each module of the manifest declares, one entry per module in the manifest's order
dependencyDeliverylist[declared_dependencies.DependencyDeliveryEntry]No[]How the repository declaring each coordinate edge obtains the package it names: vendored from a build catalog, vendored as a schema, taken from a path by the language's package manager, or delivered by none of its own declarations. A path is build and deployment coupling a vendored package does not have. Reported, never validated.
validatedbooleanNofalseWhether --validate was given, so that validation and isValid say what it found
excludeTestsbooleanNofalseWhether --exclude-tests was given, which leaves test dependencies out of the listing and of the validation
hideSubmoduleDependenciesbooleanNofalseWhether --hide-submodule-dependencies was given, which leaves out each dependency on a submodule nested under the module that declares it
groupByenum one of type, moduleNo"type"How the human-readable listing is grouped, as --group-by gave it: by kind of dependency or by module
outputPathstringNoThe graph file the run wrote, as an absolute path; absent where --out was not given
outputFormatstringNoThe format of the file outputPath names, as --format gave it; absent where --out was not given
validationdeclared_dependencies.DependencyValidationResultNo{}What --validate found, each kind of finding in a list of its own; left at its defaults where the run did not validate
isValidbooleanNoWhether --validate found nothing in validation; absent where it was not given

declared_dependencies.DeclaredDependencyEntry

FieldTypeRequiredDefaultDescription
modulestringYesThe module's name
dependencieslist[string]No[]The module's runtime dependencies, each a module name or a coordinate, with its direct submodules added after them unless --hide-submodule-dependencies was given
buildDependencieslist[string]No[]What the module declares as buildDependencies, each a module name or a coordinate
devDependencieslist[string]No[]What the module declares as devDependencies, each a module name or a coordinate
testDependencieslist[string]No[]What the module declares as testDependencies, each a module name or a coordinate; empty under --exclude-tests

declared_dependencies.DependencyDeliveryEntry

FieldTypeRequiredDefaultDescription
repositorystringYesWhose declarations answered, as a path from the tree's root. One edge can have two answers: the tree taking a package from a path so its edits are live, and the checkout holding the module vendoring it.
modulestringYesThe module that declares the edge.
dependencystringYesThe coordinate the edge names.
typestringYesThe kind of edge -- runtime, build, dev or test.
deliveryenum one of vendored, vendored-schema, path, undeliveredYesHow that repository obtains the package: vendored from a build catalog, vendored-schema as a schema, path through the language's package manager, or undelivered where none of its declarations delivers it.
viastringNo""What delivers it: the vendored library or schema coordinate, or the path as the package manager's declaration writes it. Empty when nothing does.

declared_dependencies.DependencyValidationResult

FieldTypeRequiredDefaultDescription
isValidbooleanNofalseWhether every list of findings here is empty
moduleCountintegerNo0How many modules the manifest declares
unknownDependencieslist[declared_dependencies.ValidationIssue]No[]Each dependency written as a module name that the manifest declares no module by
executableDependencieslist[declared_dependencies.ValidationIssue]No[]Each runtime, dev or test edge onto an executable module. Nothing depends on an application but its generated API, the library declared with apiOf naming it in the same manifest
internalDependencieslist[declared_dependencies.ValidationIssue]No[]Each runtime or build edge from a library released to a client -- one declared public or hidden -- onto a module declared neither: a client obtains the library and cannot obtain what it depends on
hiddenApplicationslist[string]No[]Each executable module declared audience: hidden, by coordinate: hidden is a library's audience, since an application's commands are public or internal and take theirs from it
testLibraryDependencieslist[declared_dependencies.ValidationIssue]No[]Each runtime or dev edge onto a test-library module, which a test dependency alone may name
explicitSubmoduleDependencieslist[declared_dependencies.ValidationIssue]No[]Each dependency a module declares on its own direct submodule, which is implied and is not to be declared
independentNestedModuleslist[declared_dependencies.ValidationIssue]No[]Each module rooted inside another module's rootDir without being declared its submodule: module is the nearest enclosing module and dependency the nested one
submoduleExternalDependencieslist[declared_dependencies.ValidationIssue]No[]Each runtime, dev or test edge from a submodule onto a module of the manifest outside its own top-level module. A runtime edge the submodule also declares as a build edge is not reported
invalidSubmoduleRootPathslist[declared_dependencies.ValidationIssue]No[]Each submodule whose rootDir is not inside its parent's: module is the parent and dependency the submodule
cycleslist[list[string]]No[]Each dependency cycle among runtime edges, a module's submodules counted as its dependencies, or among build edges: the module names along it, ending with the one it began with

declared_dependencies.ValidationIssue

FieldTypeRequiredDefaultDescription
modulestringNo""The module the finding is about, which for an edge is the module that declares it
dependencystringNo""The other end of the finding: the module name or coordinate the edge names
typestringNo""The kind of edge: runtime, build, dev or test. Empty for a finding that is about where a module is rooted and not about an edge