- Project/component:
nodeupcrate foundation contract - Canonical path:
crates/nodeup
- Runtime: Rust CLI and shim dispatch runtime
- Primary language: Rust
- Developers managing local Node.js versions
- Maintainers operating release and distribution workflows
- Channel and command identifiers must remain stable and documented.
- Binary entrypoints must force-link
swc_mallocallocator policy, while the library target remains allocator-agnostic for downstream consumers. - Shim dispatch behavior must remain deterministic by executable name (
node,npm,npx,yarn,pnpm). - Install/update command surfaces must preserve backward-compatible flags and outputs.
- Host support must include
macOS,Linux, andWindowsx64/arm64, while x86 hosts remain unsupported. - Homebrew installation must consume prebuilt release archives for
darwin/amd64,darwin/arm64,linux/amd64, andlinux/arm64. - Direct install scripts must verify release artifacts with
SHA256SUMSand Sigstore bundle sidecars (<artifact>.sigstore.json) viacosign verify-blob --bundle. - Direct installers must remain available at
scripts/install/nodeup.shandscripts/install/nodeup.ps1. cargo-binstallmetadata must resolve only first-party GitHub Release assets and disablequick-installandcompilestrategies.- Runtime archive selection must remain enum-driven:
tar.xzfordarwin/*andlinux/*,zipforwindows/*. - Windows runtime archives that unpack without a top-level directory must be normalized into the stable
bin/runtime layout used by nodeup execution and linking flows. yarn/pnpmdelegated execution must honor nearestpackage.jsonpackageManagerwhen present.packageManagerparsing contract is strict:<manager>@<exact-semver>with manager limited toyarn|pnpm.packageManagermanager-command mismatch must fail withconflict; malformed values must fail withinvalid-input.packageManager-aware execution must use runtimenpm exec(Corepack is out of scope).which yarn|pnpmin npm-exec mode must resolve to the runtimenpmexecutable path.- Human output styling must support
--color auto|always|neverandNODEUP_COLOR=auto|always|never. - Human output color precedence must remain
--color>NODEUP_COLOR>NO_COLOR> stream-awareauto. - User-facing
NodeupErrormessages must follow the format<cause>. Hint: <next action>. NodeupErrorcause text should include deterministic key-value diagnostics when available (for exampleselector,runtime,path,url,status,attempt).- JSON error envelopes must keep the stable shape
kind,message, andexit_codewhile allowing message text improvements. - ANSI styling must never be injected into
--output jsonpayloads on stdout/stderr. completionsmust generate raw shell completion scripts forbash,zsh,fish,powershell, andelvish.completions <shell> [command]command scope must accept only top-level command identifiers and fail withinvalid-inputfor unsupported scopes.completionsoutput must remain raw script text on stdout even when--output jsonis requested.
- Maintains local version metadata, installation roots, and shim state.
- Downloaded runtime artifacts must follow deterministic path resolution.
- Download and install flows must validate source and artifact integrity.
- Secrets must not be logged, and sensitive file paths should be minimized in logs.
- URL diagnostics in error messages must omit query strings and fragments.
- Use structured
tracinglogs for install, resolve, and dispatch flows. - Include resolution source, requested channel, selected version, and result state.
- Delegated command planning logs must include
mode=direct|npm-exec,package_spec,package_json_path, andreason. - Completion generation logs must include shell, command scope, and
generated|failedoutcome state.
- Local validation:
cargo test -p nodeup - Workspace baseline:
cargo test --workspace --all-targets - Release contract checks should align with
release-nodeupworkflow expectations. - Release assets must include both standalone prebuilt binaries (
nodeup-<os>-<arch>[.exe]) and compressed archives (nodeup-<os>-<arch>.tar.gz|zip) forlinux/amd64,linux/arm64,darwin/amd64,darwin/arm64,windows/amd64, andwindows/arm64. - Release signing outputs must include
SHA256SUMS.sigstore.jsonand<artifact>.sigstore.jsonsidecars; legacy.sig/.pemsidecars are out of scope for direct installation. - Homebrew release automation must render the prebuilt formula from release asset URLs and push tap updates directly to
delinoio/homebrew-tapmainwith a dedicated tap-write credential. - Install docs that choose to describe direct-install flows must keep Bash, PowerShell,
cargo-binstall, and GitHub Actions usage aligned with the installer scripts and manifest metadata. apps/public-docsis not required to surface repo-local direct-installer script examples.- Completion coverage must include successful script generation, invalid shell/scope validation, and JSON-mode raw output behavior.
- Output color coverage must include flag/env precedence, invalid env fallback, stream-aware auto-mode behavior, and JSON/completion ANSI exclusion.
packageManagercoverage must include strict parsing, mismatch conflicts, yarn v1 vs v2+ mapping, direct-binary preference, and npm-exec fallback behavior.- Runtime install coverage must include
linux-arm64,windows-x64, andwindows-arm64archive selection and extraction behavior.
- Integrates with filesystem runtime shims and remote distribution channels.
- Integrates with release automation and package manager update workflows.
- Update
docs/project-nodeup.mdwith this file when dispatch, storage, or channel contracts change. - Update
crates/AGENTS.mdand rootAGENTS.mdwhen ownership or policy contracts change.
docs/project-nodeup.mddocs/domain-template.md