Skip to main content

Module selection

Module selection 

Source
Expand description

WorkspacePackage selection across a PackageGraph.

cabin translates user flags (--workspace, --package, --exclude, --default-members) into a PackageSelection and hands it to resolve_package_selection, which validates the request against the graph and returns the deterministic ordered list of selected primary-package indices. Centralizing this here keeps CLI code free of workspace-graph algorithms.

Structs§

PackageSelection
User-facing selection request, before validation against any concrete graph.
ResolvedSelection
Final, validated selection. Indices are into PackageGraph::packages and are ordered to match the graph’s primary-package ordering.

Enums§

SelectionMode
Selection mode the user requested.

Functions§

closure_has_versioned_deps_excluding_with_dev
Whether the supplied closure carries any versioned (registry-bound) dependency that the artifact pipeline would need to fetch. Mirrors collect_closure_versioned_deps_excluding_with_dev but returns a bool so the CLI can short-circuit before opening an index.
collect_closure_versioned_deps_excluding_with_dev
Enumerate the versioned dependencies that drive resolve / fetch / update for a selected package set. Walks the closure (selection + transitive local path deps) so a registry dep declared by a path-dep lib is visible when the user selected app.
combine_version_reqs
Combine several version-requirement strings into one semver::VersionReq by joining them with , (the comma form semver reads as an AND of comparators) and re-parsing. On a parse failure the joined string is returned alongside the error so each caller can build its own diagnostic. This is the single join-on-collision kernel shared by the closure and patch requirement aggregators and the CLI’s root-dep merge.
resolve_package_selection
Validate a PackageSelection against graph and return the concrete list of selected primary-package indices. Errors are emitted with deterministic, actionable messages so the user can fix typos quickly.