Skip to main content

Module tools

Module tools 

Source
Expand description

Back-half paydown 1D.5b (#4003, Decision F): the spawning of the external tools the driver runs, in one place: tsc, tsx, node, git, and the npm, pnpm, bun and yarn installs.

  • pins: the versions fetched on demand (TypeScript, tsx).
  • ladder: the tsc and tsx runner ladders.
  • Here: the node and git commands, and run_to_completion, which runs an install. What to run for each package manager (PackageManager’s runner and install methods) stays in crate::npm_install.

Each tool is found exactly as its callers always found it, so moving a spawn here changes no error text and no edge case: node through crate::probe::program_path for a test run (node_command) and through detection for bynk test --inspect (resolved_node_command), git by its bare name. Detection itself stays in crate::probe, which wrangler and Docker also use. wrangler::command builds every wrangler spawn (1D.3a); what bynk asks wrangler is bynk’s cloudflare module.

Re-exports§

pub use ladder::Ladder;
pub use ladder::Rung;

Modules§

ladder
The runner ladders for tsc and tsx: the tool itself when it is on PATH, then the package manager’s runner (npx, pnpm dlx, bunx) fetching it.
pins
The versions of the external tools the toolchain fetches on demand.
wrangler
Spawning wrangler (back-half paydown 1D.3a, #4043 Decision J): the one place a wrangler Command is built.

Functions§

git_command
git, by its bare name. A caller adds its own policy: bynk fetch hardens every invocation (fetch::git).
node_command
node, found as crate::probe::program_path finds it: its resolved path, else the bare name.
resolved_node_command
node at the path detection resolves, or None when it is not on PATH.
run_to_completion
Run program args in dir to completion. Ok((success, output)), where the output is the tool’s stderr, or its stdout when stderr is blank; Err when the tool could not be started.