Skip to main content

Crate nova_pm

Crate nova_pm 

Source
Expand description

The package manager: nova.toml parsing, package names, finding a project, and the package graph (Phase 3.0 and 3.3a; specs docs/superpowers/specs/2026-10-07-phase-3-0-foundations-design.md §5 and §6.1, and docs/superpowers/specs/2026-10-08-phase-3-3a-local-packages-design.md §3), and the index’s offline side: $NOVA_HOME, nova.lock and the resolver (spec docs/superpowers/specs/2026-10-09-phase-3-3b-index-and-publishing-design.md §4, §5). See ARCHITECTURE.md for the crate’s place in the pipeline.

Re-exports§

pub use manifest::parse;
pub use manifest::Dependency;
pub use manifest::Manifest;
pub use manifest::Package;

Modules§

manifest
nova.toml: what 3.0 reads, and the diagnostics that point into it (spec docs/superpowers/specs/2026-10-07-phase-3-0-foundations-design.md §5).

Structs§

Candidate
One version of a package, as the index lists it.
Edge
A dependency that resolved.
Graph
The root package, and every package its dependencies reach.
GraphPackage
One package of a Graph.
Lock
A project’s nova.lock.
LockedPackage
One registry package of a Lock.
Offline
Where the graph finds registry packages (spec 3.3b §5.4).
PackageId
A package’s index in its Graph. The root is PackageId(0).
Requirement
A requirement on a package, and where it came from.

Enums§

ResolveError
Why a resolution failed.
Unlock
What a resolution may change (spec §4.4).

Constants§

LOCKFILE
The lockfile’s name, beside nova.toml.
MANIFEST
A project’s manifest file name.

Traits§

IndexView
What the resolver asks of an index.

Functions§

canonical_index
The canonical form of an index’s location: how indexes are compared, and what nova.lock and the cache are keyed by.
check_name
Check a package name: ASCII letters, digits, - and _, starting with a letter, at most 64 characters, and not a Windows device name. The error says which rule the name breaks.
find_root
The nearest directory at or above start that holds a nova.toml file.
graph
Read the package at root, the directory holding its nova.toml (empty for the current directory), and every package its dependencies reach. Every manifest goes into db, so each diagnostic’s label renders.
graph_from
graph, with the root’s nova.toml taken from text when it is given: nova add checks a new entry this way before writing it.
graph_with
graph_from, with registry packages found as offline says.
import_name
A package’s import name: its name with each - replaced by _ (spec docs/superpowers/specs/2026-10-08-phase-3-3a-local-packages-design.md §3.4), so json-api is imported as import json_api.
index_dir_name
The cache directory’s name for a canonical index (spec §5.1): its host without a port, keeping only a-z, 0-9, . and - (local for a local index), then - and the CRC-32 of the canonical form.
is_portable
Whether component, one name in a path, is valid on Windows, macOS and Linux (spec docs/superpowers/specs/2026-10-09-phase-3-3b-index-and-publishing-design.md §6.5):
local_index_path
The directory a canonical file: index names; None for an HTTP one.
nova_home
$NOVA_HOME: the variable when it is set, else .nova in the home directory, which is USERPROFILE on Windows and HOME elsewhere. None when neither is set; an empty value counts as unset. It takes the variables’ values rather than reading them, so tests need not change the process environment.
nova_home_from_env
nova_home from this process’s environment.
parse_lock
Parse text, the contents of a nova.lock that a FileDb holds as file. Anything a lock written by nova would not hold is M0016.
real_path
path, canonicalised when it exists, without Windows’ \\?\ prefix, so that it is spelled as the file system spells it. A package is identified by its directory’s real path (spec 3.3a §3.3), and the language server builds unopened files’ URIs on it.
registry_dir
$NOVA_HOME/registry, where downloaded packages live (spec §5.1).
requirements
Every version entry that the root and its path packages declare, for the resolver (spec 3.3b §4.1): who made each one, and the root’s entry through which it is reached. The root’s dev-dependencies count when dev is set. The root’s nova.toml is text when it is given.
resolve
The packages requirements need, newest versions first, keeping lock‘s versions as unlock says. Sorted by name, each with its dependencies’ names.