Skip to content

findRoot

findRoot(from): Promise<string>

The project root to inspect, found by walking up from from.

Repository markers are checked across the WHOLE ancestor chain before any package marker is considered. Checking both together at each level fails in exactly the case that matters: every package in a monorepo has a package.json, so running from packages/ts/thing would stop there and report that one package’s scripts as if they were the repository’s.

The NEAREST repository marker wins rather than the highest, so a nested checkout — a git worktree living inside its parent repo, a vendored clone — resolves to itself instead of escaping upward into the parent.

moon and just already search upward for their own configuration, so this makes discovery agree with the runners rather than fighting them.

ParameterType
fromstring

Promise<string>