Skip to main content

Crate aube_runtime

Crate aube_runtime 

Source
Expand description

Node.js runtime management for aube: resolve a project’s requested Node version (devEngines.runtime / .node-version / .nvmrc), discover satisfying installs (PATH, mise, aube’s own runtime dir), and download missing versions — delegating to mise by default when it’s present so mise users keep one Node store.

This crate is policy-light plumbing: settings resolution, manifest parsing, PATH injection, and lockfile recording live in the CLI crate. Nothing here prints; progress flows through DownloadProgress and diagnostics through tracing.

Structs§

InstalledAube
A validated on-disk aube install.
InstalledNode
A validated on-disk Node install.
NodeRequest
A fully-formed request: what version, what to do when it can’t be satisfied locally, and where the requirement came from.
NodeRuntime
NoopProgress
PinnedNode
An exact resolved version plus its per-platform artifacts — the interchange shape for lockfile pins (the CLI maps this onto aube_lockfile::RuntimePin).
PinnedVariant
One platform’s artifact in a PinnedNode. Vocabulary matches pnpm’s lockfile (os: win32, archive: tarball|zip, integrity: sha256-<base64>).
Platform
Resolution
A successfully resolved runtime.
RuntimeConfig
Configuration for a NodeRuntime.

Enums§

Error
InstallOrigin
Where an installed Node came from.
InstallPhase
InstallerMode
Who installs a missing runtime (the runtimeInstaller setting).
NetworkMode
NodeSpec
A parsed Node version request.
RequestSource
Where a node version request came from, in precedence order.
ResolvedFrom
How a resolution was satisfied.

Constants§

DEFAULT_MIRROR_BASE
Default download base, matching pnpm’s runtime resolver (the /download/release tree mirrors /dist and is what pnpm records in lockfiles).
UNOFFICIAL_BASE
musl builds aren’t published on the official mirror; pnpm and mise both source them from unofficial-builds. Used only when no custom mirror is configured.

Traits§

DownloadProgress

Functions§

available_aube_versions
Every published aube version (for resolving range pins to the best satisfying release). Primary source is the versions host’s plaintext list — CDN-cached, no rate limits; the aube.jdx.dev/VERSION latest-only announcement is the fallback, degrading range resolution to “newest release” rather than failing.
effective_request
Build the effective request for a project: devEngines.runtime (passed in pre-parsed by the caller) beats version files.
find_installed_aube
Look up one exact installed version (mise first, then self dir — the self-dir copy wins, mirroring list_installed_aube).
find_version_file
Walk upward from start_dir looking for .node-version then .nvmrc (same-directory precedence: .node-version wins; nearer directory beats farther). The walk stops after checking the home directory (inclusive) or the filesystem root, whichever comes first — predictable, and matches what nvm/fnm users expect in monorepos where the version file sits above the invocation dir.
install_aube
Install aube version, honoring the installer mode: mise delegation first under auto/mise (one tool store for mise users), self-download from GitHub releases otherwise.
install_dir
The install dir for an exact version: <runtime_dir>/24.1.0/.
list_installed
List every valid installed Node version across aube’s runtime dir and mise’s installs dir. When both have the same version, aube’s copy wins (deterministic, and it’s the copy aube can manage).
list_installed_aube
Every valid installed aube across mise’s installs dir and aube’s self dir. Same collision rule as Node: aube’s own copy of a version wins over mise’s.
mise_node_installs_dir
mise’s node installs directory.
mise_on_path
The mise executable on PATH, if any. Memoized — PATH walks are cheap but this gets asked on every resolution that reaches the install stage.
node_on_path
Locate a node executable on PATH without spawning it (unlike probe_path_node, which runs node --version). Cheap enough to call on the hot install/run path to populate npm_node_execpath / NODE for lifecycle scripts when no runtime switch is active. Returns the first node (node.exe on Windows) on PATH as an absolute, executable path, or None if none qualifies.
probe_path_node
Find node on PATH and probe its version (node --version). Memoized for the process: one spawn no matter how many resolution calls happen.
release_target_triple
The release-archive target triple for the host. aube publishes: aarch64-apple-darwin, {x86_64,aarch64}-unknown-linux-{gnu,musl}, {x86_64,aarch64}-pc-windows-msvc. Hosts without a published build (e.g. Intel macOS) get an Error::UnsupportedPlatform pointing at mise.
runtime_dir
Root of aube-managed Node installs. AUBE_RUNTIME_DIR overrides for tests and unusual setups. The data namespace comes from the active embedder (standalone aube → "aube").
self_dir
aube’s own versions dir ($XDG_DATA_HOME/aube/self). AUBE_SELF_DIR overrides for tests.
sha256_from_sri
Parse an SRI sha256-<base64> string back into raw bytes.
sri_sha256
Convert a raw SHA-256 into the SRI form lockfiles use (sha256-<base64>).