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§
- Installed
Aube - A validated on-disk aube install.
- Installed
Node - A validated on-disk Node install.
- Node
Request - A fully-formed request: what version, what to do when it can’t be satisfied locally, and where the requirement came from.
- Node
Runtime - Noop
Progress - Pinned
Node - An exact resolved version plus its per-platform artifacts —
the interchange shape for lockfile pins (the CLI maps this onto
aube_lockfile::RuntimePin). - Pinned
Variant - 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.
- Runtime
Config - Configuration for a
NodeRuntime.
Enums§
- Error
- Install
Origin - Where an installed Node came from.
- Install
Phase - Installer
Mode - Who installs a missing runtime (the
runtimeInstallersetting). - Network
Mode - Node
Spec - A parsed Node version request.
- Request
Source - Where a node version request came from, in precedence order.
- Resolved
From - How a resolution was satisfied.
Constants§
- DEFAULT_
MIRROR_ BASE - Default download base, matching pnpm’s runtime resolver (the
/download/releasetree mirrors/distand 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§
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/VERSIONlatest-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_dirlooking for.node-versionthen.nvmrc(same-directory precedence:.node-versionwins; 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 underauto/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
miseexecutable 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
nodeexecutable onPATHwithout spawning it (unlikeprobe_path_node, which runsnode --version). Cheap enough to call on the hot install/run path to populatenpm_node_execpath/NODEfor lifecycle scripts when no runtime switch is active. Returns the firstnode(node.exeon Windows) onPATHas an absolute, executable path, orNoneif none qualifies. - probe_
path_ node - Find
nodeon 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 anError::UnsupportedPlatformpointing at mise. - runtime_
dir - Root of aube-managed Node installs.
AUBE_RUNTIME_DIRoverrides 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_DIRoverrides 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>).