Skip to main content

Module package

Module package 

Source
Expand description

Packages, decl.toml, and decl.lock (§8.6–8.7) — a port of the reference implementation’s package.ts: exact-pinned dependencies, fail-closed manifests, content-hashed reproducibility. Conventions: dependency packages live under <root>/decl_modules/<name>/ in a flat layout, and the lock file is line-based name version sha256 in name order.

Structs§

Manifest
a decl.toml (§8.6)
PackageUniverse
the closed set of packages an entry file’s manifest reaches (§8.6)
ResolvedPackage
a dependency resolved to a directory

Functions§

find_package_root
the enclosing package root (the nearest ancestor with decl.toml)
lock_text
The lock file’s text (§8.7): one line per package, name version hash, sorted by name.
open_package_universe
Open the package universe of an entry file: the manifest found upward from it, its dependencies resolved to a closed set. None when no manifest governs the entry.
package_hash
content hash: SHA-256 over the package’s module files in canonical path order (§8.7)
parse_manifest
Read a manifest, fail-closed (D28): an unknown field is E3011, a range pin E3012, a missing file E3004 — each reported through report with the code and the message. None when the manifest cannot be used.
verify_lock
fail-closed verification: missing entry, version drift, or hash mismatch stops resolution — never a silent re-resolve
write_lock
Write the lock file into the package root; returns its path.

Type Aliases§

Resolver
maps a package specifier, from a directory, to the package’s path or to a (code, message) diagnostic