pub fn detect(
project: &dyn Project,
setting: Option<&str>,
tb: &dyn Toolbox,
) -> Result<Detection, DetectError>Expand description
Choose the package manager, first match wins:
- an explicit setting,
BYNK_PACKAGE_MANAGERoverbynk.toml’s[build] package_manager(setting); - the
packageManagerfield of the project root’spackage.json; - a lockfile at the project root;
npm_config_user_agent;- the first of npm, pnpm and bun on PATH.
A packageManager or user agent naming a tool bynk does not install with
is skipped, since neither is a setting bynk owns; an explicit setting
naming one is an error.