13Plugin reference
@vzn/vx-lockfile
Lockfile plugins for @vzn/vx: bun(), pnpm(), npm() and yarn(). Each keys every task on its own project’s resolved dependency closure from the package manager’s lockfile, not on the whole file. pnpm update foo (or bun add, npm install, yarn up) re-keys exactly the projects that reach foo — through their dependencies, transitively, and through workspace links — and vx run … --affected selects the same projects. Each also gives vx the projects, names and edges the lockfile records (discover), adds each package’s manifest (package.json; under pnpm() a package.json5 or package.yaml where it has none, as pnpm reads them) to its cached tasks’ inputs, and hashes the manager’s install settings into every task. Zero dependencies: Bun’s own YAML and JSONC parsers, and yarn’s own readers (classic, and berry’s, which reads every value as its text: an unquoted range 0.10 is not the number 0.1).
Core keys no package file: without a plugin no lockfile, install setting or package.json reaches any cache key, so an install re-keys nothing and a build made against the old node_modules replays. A JS workspace declares one.
bun add -d @vzn/vx @vzn/vx-lockfileimport { defineWorkspace } from '@vzn/vx/config'import { pnpm } from '@vzn/vx-lockfile' // or bun, npm, yarn
export default defineWorkspace({ plugins: [pnpm()],})That is the whole setup. The plugin owns its lockfile and its manager’s install settings (VxPlugin.fingerprint), and its key hook hashes one digest per project plus each settings file present into the key. vx lock records the digests in .vx/dependencies.lock and a run keys from that record, so after an install run vx lock and commit it: a run whose lockfile changed since refuses until you do. An edit in a link: or file: directory (or a patch) the lockfile names needs no vx lock: the run sees it moved since the record and digests anew. vx why <task> names the material as plugin @vzn/vx-lockfile/pnpm (or /bun, /npm, /yarn) and plugin @vzn/vx-lockfile/.npmrc (or the settings file that moved).
With no lockfile at the workspace root (before the first install), it warns and keys no package’s dependencies; a ^build then has no edges to follow, and the run refuses it.
| Option | Values | Meaning |
|---|---|---|
scope |
'project' (default), 'workspace' |
project: each task keys on its own project’s closure. workspace: the whole file in every task’s key — the coarse key, for a workspace not yet ready to trust the precision. |
What a project’s digest covers
Section titled “What a project’s digest covers”Every package the project can reach, by resolved identity (name, version, integrity), and under bun and npm by the name it installs under, not where it sits, so a re-hoist of one version re-keys nothing, plus the install-wide material every project hashes — and the root package’s own closure. The root’s dependencies and devDependencies reach every task: their bins run from the root node_modules/.bin, which vx puts on every task’s PATH, and Node’s resolution walks up to the root node_modules (@types/*, a plugin a root tool’s config names). So a root devDependency bump (pnpm add -Dw oxlint@next) re-keys every project and --affected selects every project; a package only project A reaches still moves only A. A root workspace: dependency hashes that package’s closure into every project too. Which field the root’s and each workspace’s dependency sits in (dependencies, devDependencies, optionalDependencies) is in its digest as well: an install that leaves dev or optional packages out (npm omit=dev, pnpm install --prod, bun install --production) lays node_modules out by it, so moving a root dependency to devDependencies re-keys every project and --affected selects them: a build that would now fail “Cannot find module” does not replay its old success. yarn.lock records no field, so yarn() reads the root package.json’s (below). Per manager:
- pnpm (
pnpm-lock.yaml, lockfile v5, v6, v9 and v13): importers → snapshots, transitively, each dependency by the name it is installed under as well as what it resolves to (two aliases swapping targets re-key); each package by name, version and resolved peers (foo@1(react@18)is notfoo@1(react@19); undernodeLinker: hoistedinpnpm-workspace.yamlornode-linker=hoistedin.npmrc, every variant offoo@1, since that install keeps one copy per version and ignores the variants, so a’s react bump re-keys b when both reachfoo@1; a linker set on the command line, in the environment or in a user.npmrcis not seen), resolution and thepatchedDependenciesentry pnpm applies to it (keyedname@version, a version range such asname@<=7.0.0, orname, in that precedence);link:hashes the linked importer’s reach (a link to an importer’spublishDirectory, aspublishConfig.linkDirectorywriteslink:../b/dist, is that importer: its edge and reach, not the directory’s content), or the CONTENT of a linked directory that is no importer (an importer’s or, under an override, a package’s; underexcludeLinksFromLockfile, which leaves it out of the file, the one apackage.jsonlink:names, in every project’s key, as the importers’ reaches are), and afile:directory dependency hashes its own closure (v9 keys itname@file:…, v5/v6 by the barefile:…) and the CONTENT of the directory (pnpm copies it at install and records only its path; itsnode_modulesand.gitaside), so an edit in it re-keys the projects reaching it, unless the directory is an importer’s (an injected workspace package is an edge, below: its directory’s build output re-keys nothing, its copy’s CONTENT does, where the dependant finds it — its ownnode_modules/<name>, then the root’s undernodeLinker: hoisted— so a copypnpm installre-synced re-keys only the projects reaching it); every other top-level field butoverridesand the catalogs, whose effect is the snapshot an importer reaches (settings,packageExtensionsChecksum,pnpmfileChecksum,ignoredOptionalDependencies, v6’sonlyBuiltDependencies, and any field pnpm adds later) and the lockfile version into every project. A multi-document lockfile (pnpm 10.x and 11 write the env lockfile —configDependencies, the package manager’s own install — ahead of the project’s) reads its last document as the lockfile and hashes the ones before it into every project. v13 (lockfile.format: v13, pnpm 12.20+) writes no peer suffix: one entry pername@versionlists its peers, andpnpm()resolves each from the dependant’s scope as pnpm installs it (a peer its own dependency asks for,below, included), so a v13 file keys each project exactly as the same workspace’s v9 file, itssettings’overrides,catalogsandpatchedDependenciesread per project as v9’s top-level ones. A CRLF file (a Windows checkout) reads as its LF form,settingsandignoredOptionalDependenciesincluded. A workspace’s ownversionis not in pnpm-lock.yaml (link:../b), so a bump of it re-keys only that workspace, not the projects whosepnpm packwrites it in place of aworkspace:range: give such a task the dependency’spackage.jsonininputs.workspaceFiles. - bun (
bun.lock; abun.lockbalone is refused — it is binary — namingbun install --save-text-lockfile, which writesbun.lock): Bun’s hoisted layout — a dependencydof the package at pathpisp/dwhen that key exists, else the nearest ancestor’s, else the root’s, so a nested version counts for the package it is nested under and no other, and a workspace resolves from its own name, or from./<name>when a root package holds that name (Bun nests that workspace’s own dependencies there); a peer (peerDependenciesinstalled under no other field, of a package or a workspace) reaches every installed copy of its name, since Bun’s isolated linker, the default for a workspace whose bun.lock saysconfigVersion: 1, links a peer from its store rather than by that walk;workspace:entries, the root package’sname@root:and alink:to a workspace’s directory (b@link:./packages/b, which symlinks the workspace) hash the linked package’s reach and are its project edge, a workspace’s ownversion(not the root’s) with it, sincebun pm packandbun publishwrite it in place of a dependent’sworkspace:range, so a bump re-keys the workspace and the projects linking it; eachpatchedDependenciesentry and the CONTENT of its patch file (bun.lock records only its path) with the package it patches, so a patch edit re-keys only the projects reaching it; afile:directory dependency, and alink:to a directory that is no workspace, with the CONTENT of the directory (Bun copies the first and links the second, recording only the path), as under pnpm; abun linklink (gdep@link:gdep, a name, not a path) with the CONTENT of what itsnode_modules/gdepsymlink (at the root, or under each workspace asking for it) points at in Bun’s global store; every top-level field butworkspaces,packages, the catalogs,overridesandpatchedDependencies(trustedDependencies, and any field Bun adds later, keys sorted so the order Bun writes them in moves nothing), and any patch naming no entry, into every project — a catalog bump reaches only the projects whosecatalog:dependency resolves anew, through thepackagesentry it installs. - npm (
npm-shrinkwrap.jsonwhen present, as npm reads it, elsepackage-lock.json; lockfileVersion 2 and 3): each package by version and integrity (itsresolvedURL only where it has no integrity, a git or tarball dependency, so a registry mirror move re-keys nothing); thepackagesmap —p/node_modules/d, then each ancestor directory’s (a workspace nested in another’s directory resolves through the outer one’snode_modules, as Node does), thennode_modules/d; alink: trueentry hashes its target workspace’s reach, and one to afile:directory (an entry outside the root’sworkspacesglobs,!exclusions honoured, or any entry outsidenode_moduleswhen the root names none) the CONTENT of the directory, as under pnpm, since npm links it, and so does an entry npm copied from one (install-links=true:resolved: "file:…"with no integrity); rootoverridesreach a project through the entries they force (npm 10 does not write them to the lockfile); the root’s ownversionis its package.json’s, not an install, and is not in the key, but a workspace’s is, with that workspace:npm packandnpm publishwrite it in place of a dependent’s range to it, so a bump re-keys the workspace and the projects linking it. Version 1 (npm 6) has nopackagesmap and is refused, as is a later version whose packages are only in the legacydependenciestree. - yarn (
yarn.lock): berry (yarn 2+) resolvesname@npm:rangedescriptors to entries, workspaces included, each entry hashing every field, its dependency lists included (so the root workspace’sdependenciesMetareaches every project, and two aliases swapping targets re-key),__metadata’sversionandcacheKeyinto every project. Berry records every workspace as0.0.0-use.local, so as under pnpm a workspace’s own version bump re-keys no dependent. A Yarn 4 catalog dependency (catalog:,catalog:<name>) is recorded as that literal and its range lives in.yarnrc.yml, so the digest reads the range there and reaches the entry it keys; a catalog.yarnrc.ymldoes not name, or a range the file does not key, reaches every entry of its package: a bump of any of them re-keys the workspace. So does a descriptor the file does not key, as when a rootresolutionsoverride rewrote it to another range: the entry installed in its place is reached through the package’s name, so changing it re-keys the workspaces that depend on it. A path range (portal:,file:,link:) reaches the entry keyed bound to the package naming it (::locator=…), not another workspace’s of the same name; aportal:orlink:to a workspace reaches that workspace’s closure, asworkspace:does (Yarn symlinks the workspace itself, and its entry lists no dependencies); aportal:orlink:to a directory that is no workspace also hashes the CONTENT of the directory (Yarn symlinks it and records no hash; berry’sfile:carries its own::hash=), one aportal:orfile:package names too (its path is relative to that package’s directory). Everypatch:entry is reached by the plain descriptor it patches: Yarn’s builtin compat patches (resolve,typescript,fsevents), in Yarn 2/3’s spelling (resolve@^1.22.0) as in Yarn 4’s (resolve@npm%3A^1.22.0), and a rootresolutionspatch over a descriptor the file still keys (whatyarn patch-commit -swrites). The workspace asks for the plain descriptor, and the patched entry is the one Yarn installs, so adding or editing the patch re-keys it. ApackageExtensionsdependency (.yarnrc.yml’s, and every one Yarn’s builtin list adds, as Yarn 2.4 through 4.18 ship it:@babel/parser→@babel/types,winston-transport→logform,terser→acornand some eighty more) is installed for each matching package that does not declare it, yet its lockfile entry lists none:yarn()adds the edge, so a lockfile-only bump of the added package re-keys the packages that reach the extended one, and an entry no workspace reaches (an extension it cannot read) re-keys every project.yarn()owns.yarnrc.ymland hashes it into every task, so a catalog edit re-keys every project (pnpm-lock.yaml records a catalog’s resolution, so underpnpm()it re-keys only the projects naming it). Classic (yarn 1) records no workspaces, so it yields one digest for the root that every project hashes — coarse, and honest about what the file records — and no project edges (below); afile:directory, which classic copies with no hash, and alink:one, which it symlinks, hash their CONTENT into that digest, but alink:to a workspace the rootworkspacesglobs name (a!glob aside: Yarn 1 takes none and links the directory anyway): Yarn 1 links that workspace as it does by its name.
A file: or link: directory outside the repository ("dep": "link:../../../vendor/dep") is hashed by its CONTENT too, under every manager: an edit in it re-keys the projects reaching it. So is a gitignored file inside a directory in the repository (a dist/ the dependency builds): the manager copies or links it. Git lists no change to either, so --affected compares each directory’s hash with the one vx lock recorded at the base and selects the projects reaching one that moved; the run hashes each directory once, for selection and key alike.
A project the lockfile has no entry for hashes the digest of the nearest package that encloses it, with the root’s (packages/a/e2e resolves from packages/a/node_modules first), or the root’s alone outside every package — the only node_modules it can resolve from. A phantom dependency (imported, never declared by the project or the root — a sibling’s package hoisted to the root) is not in any closure; declare it. Nor is a patch a postinstall script applies (patch-package): no lockfile records it, so name the patches in inputs.workspaceFiles (patches/**).
A lockfile the parser cannot read refuses the run, naming the file, the reason and the install that regenerates it. That is deliberate: the alternative to reading the lockfile is keying on nothing, and a key that is missing material is a stale hit waiting to happen. Under --affected the refusal also says which side could not be read — the working tree’s copy, or the one at the base ref (a lockfile-migration commit hits the second). A lockfile holding git merge conflict markers is refused the same way: it names two installs at once, and yarn classic’s format parsed one side of it without a word. So is a pnpm-lock.yaml whose importer or package names a dependency it has no entry for (snapshots in v9, packages in v5/v6; a link: needs none), as pnpm refuses it (“Broken lockfile”): read as a leaf, that package’s own dependencies were in no key.
The installed tree
Section titled “The installed tree”The key hashes the lockfile, never node_modules, so a git pull that brings a lockfile change, run before the install, would build against the old packages and save the output under the new lockfile’s key, replayed after the install, to teammates too through a remote cache. So a run whose cached tasks key on the lockfile refuses while node_modules is not the install the lockfile names, naming the package and the install that fixes it: node_modules was installed from a different bun.lock (packages/ui’s is-number is 7.0.0, the lockfile names 5.0.0) — run bun install. It reads the record each manager leaves of its install: npm’s node_modules/.package-lock.json (each installed path’s version, read from node_modules/.store under install-strategy=linked), pnpm’s node_modules/.pnpm/lock.yaml (each importer’s links and the packages they reach: pnpm add, update and remove leave the package they replaced in it until a plain pnpm install, and that leftover counts for nothing), Yarn 1’s node_modules/.yarn-integrity, Yarn 2+‘s node_modules/.yarn-state.yml (each package installed, then each workspace it lists: its registry dependencies’ versions where Node resolves them) and, under nodeLinker: pnpm, its node_modules/.store (a directory per package, named by its locator’s hash). Bun 1.4 leaves none, so bun() reads each workspace’s registry dependencies’ package.json where Node resolves them (its own node_modules, then up to the root’s), then every registry package bun.lock lists where the linker put it, so a pull that bumps only a transitive version refuses too: the hoisted linker’s key p/d at node_modules/p/node_modules/d (a package’s bundled dependencies, which its tarball ships, aside), the isolated linker’s store (node_modules/.bun/<name>@<version>/node_modules) as Node walks it from the workspaces’ links, each copy’s dependency linked to the version the lockfile resolves (Bun never prunes the store, so a copy no link reaches is not read). npm’s record is checked against the tree too: npm install --dry-run (npm 10.9) rewrites it to the new lockfile and installs nothing, so a recorded package the tree lacks or holds at another version refuses. Only what the install put there counts: a package the lockfile does not list or names at another version, and one missing that the install should hold: under npm a production dependency of a package or workspace installed (of the root’s own once every workspace is), under pnpm a production dependency of an importer installed, under Yarn 1 any entry unless the install recorded --production (or --focus). So a --omit=dev / --prod / --production or filtered (npm install -w, pnpm --filter) install passes, and so does a pull that adds a workspace the filter never installed. Not checked: a workspace with no root node_modules (a fresh clone: nothing installed can be wrong, and a task that needs a package fails, which saves nothing), a package Yarn 2+ left out (only an extra counts there: a platform’s optional package is left out too), Yarn’s PnP linker, an install by a manager whose record is absent, and under bun() a package that is not from the registry (file:, git, a tarball) or one the hoisted tree lacks (another platform’s optional package, a --production install). The answer is a pure function of the files compared, so a match is kept in the cache dir (vx-lockfile-installed-*.json) under their stat identities (under bun(), the root’s and each workspace’s node_modules directory, which a relink or a replaced package moves; a changed lockfile compares all again): a warm run stats them and compares nothing. A run that parsed a changed lockfile for its key compares from that parse, not a second one.
Install settings
Section titled “Install settings”Files no lockfile records lay node_modules out anew under a byte-identical lockfile (pnpm’s node-linker, bun’s linker = "isolated", a registry in .npmrc, Yarn’s nodeLinker). Each plugin owns its manager’s and hashes each present file whole into every task; a change to one selects every project under --affected:
| Plugin | Settings |
|---|---|
pnpm() |
pnpm-workspace.yaml, .npmrc, the root manifest’s pnpm field (package.json, package.json5 or package.yaml) |
bun() |
bunfig.toml, .npmrc |
npm() |
.npmrc |
yarn() |
.yarnrc.yml, .yarnrc and .npmrc (yarn 1), the root package.json’s workspaces.nohoist, installConfig, resolutions, dependencies, devDependencies and optionalDependencies |
pnpm() hashes pnpm-workspace.yaml without patchedDependencies, overrides, packageExtensions, ignoredOptionalDependencies, catalog and catalogs, which pnpm 10+ keeps there: the lockfile records what each one did, per project, so a patch, an override, an extension or a catalog bump re-keys only the projects that reach the package it changes, and --affected selects them through the lockfile. Any other setting in the file re-keys every project, and a file that does not parse is hashed whole. The root manifest (package.json, package.json5 or package.yaml) adds only its pnpm field (onlyBuiltDependencies and the rest pnpm reads there and the lockfile does not record), its overrides, packageExtensions and patchedDependencies aside: a root dependency edit is the lockfile’s.
yarn() hashes .yarnrc.yml without catalog and catalogs: the digest resolves each workspace’s catalog: range through them to the yarn.lock entry it names, so a catalog bump re-keys only the projects that reach the package. Under --affected a catalog edit still selects every project: the base side’s digest reads the working tree’s .yarnrc.yml.
yarn() reads the root package.json’s resolutions because yarn.lock does not record where one applies: a parent-scoped one ("is-odd/is-number") leaves the parent’s entry on the range it declares, so adding one whose range another package already keys changes the install under a byte-identical yarn.lock. Berry’s overrides also become edges: each entry a resolutions key reaches (any entry depending on the name, or only the named parent’s for a scoped one; a parent’s range or a ** counts as any parent) gets an edge to the entry the override’s range names, so a lockfile-only bump of that entry (yarn up -R is-number) re-keys the parent’s workspaces too, not only the package that keys the range itself. An unreadable scope over-keys, never under-keys.
It reads the root’s dependencies, devDependencies and optionalDependencies because yarn 1’s lockfile records no importer, only the ranges asked: moving a range between the root and a workspace (root is-number ^6 → ^7, packages/a ^7 → ^6) leaves yarn.lock byte-identical and moves the root node_modules copy every project without its own resolves. Any change to them re-keys every project and selects every project under --affected; berry records them on the root workspace’s entry, which every project’s digest already includes.
For the same reason a yarn 1 key reads every workspace’s package.json: packages/a moving is-number ^6 → ^7 beside packages/b’s ^7 leaves yarn.lock byte-identical, yet a, and every project linking a, resolves 7.0.0. Any edit to a workspace manifest re-keys every project and selects every project under --affected, since a yarn 1 key covers the whole workspace.
A file has one owner, so two of these plugins that share a settings file (pnpm() and bun() both own .npmrc) cannot be declared together.
The manifest as an input
Section titled “The manifest as an input”Every task with inputs of a project the lockfile lists, cached or not, gets its literal manifest appended to inputs.files (the project stage), so an edit to a manifest re-keys that project’s tasks and, through ^ keys, its dependants. The manifest is package.json; under pnpm() it is package.json5 or package.yaml where the package has no package.json, as pnpm reads them (one stat per project a run). A task with no inputs stays keyless; one whose inputs already name its manifest is left alone. A task that rewrites its own package.json with the same bytes (tsdown) keeps its hits under inputs.stability: { strategy: 'mutable' }.
Project edges
Section titled “Project edges”discover gives vx each project’s edges as the lockfile records them, read from the same memo as the digests:
- deps (order
^task, reach--filter …and--affected): a dependency the lockfile resolves to a workspace package — pnpmlink:(underexcludeLinksFromLockfile, which leaves everylink:dependency out of the file, apackage.jsonlink:to a workspace package; the file then no longer says who links whom, so every project’s key holds every importer’s reach, and alink:it leaves out is no stale lockfile), andfile:to a workspace package’s directory (an injected one:dependenciesMeta.<name>.injected, orinjectWorkspacePackageswithdedupeInjectedDeps: false; so it waits for the package’s build; the dependant reads pnpm’s copy innode_modules/.pnpm, which pnpm re-syncs at install, not after a build vx runs, so the copy’s CONTENT is in the dependant’s key: runpnpm installafter building the injected package, or do not inject it, or the dependant builds against the old copy, keyed as that copy), bun’sworkspace:entries (aworkspace:path or alias, and annpm:alias Bun links to the workspace package, by the spec it records) andlink:entries to a workspace’s directory, npm’slink: trueentries, yarn berry’s workspace entries andlink:/portal:paths. - peers: a peer with no installed entry of the same name that resolves to a workspace package orders the build too, unless it would close a cycle through the order edges; then it is reach only (in project-name order, so the edge kept is stable). pnpm records an auto-installed peer under
dependencies, sopnpm()asks the project’spackage.jsonwhich of those entries are peers; yarn berry resolves a peer to the workspace of its name, which Yarn hoists. - workspace packages installed through a package: a registry package’s dependency the install resolved to a workspace package (npm and bun link
node_modules/is-numbertopackages/bwhen the workspace satisfiesis-odd’s range, Yarn’s transparent workspaces do the same, a pnpmoverridestoworkspace:*writeslink:into the package’s snapshot). The project loads that workspace package as surely as its own dependency, so it builds after it and its key holds that package’s, as a peer’s would: unless that would close a cycle through the order edges, then it is reach only. Read from each project’s own dependencies alone, an edit to such a package re-keyed only that package,--affectedleft out the projects reaching it, and they hit with its old build. Under yarn, only descriptors the file keys count, as for a direct link. - the root’s workspace packages: a workspace package the root depends on is the root project’s dependency and no other project’s. It is installed at the root
node_modules, so Node resolves it for every project, but that declares nothing: a project that reads it names it in its ownpackage.json, or the package neither orders its build, nor moves its key, nor selects it under--affected. - Each importer with a manifest (
package.json, or underpnpm()apackage.json5orpackage.yaml, which pnpm reads and records like any other) is a project: one with no vx config joins as a project a plugin added (its tasks come from theprojectstage, else the defaultbuild). The root importer is the exception: it is a project only by its own vx config. An importer with no manifest, and an edge to one, is skipped, unless core already has a project there (a sparse checkout left it out): the edge stands, so a run of a dependant is refused for it rather than run or hit without it. A project is named by its manifest’snameunless its config names it, or another importer’s manifest shares the name; then its path names it. The workspace globs match a directory holding any of the manifests the manager reads. - A yarn classic (v1) lockfile records no workspaces, so
yarn()reads them as Yarn 1 does: the directories the rootpackage.jsonworkspacesglobs (an array or{ packages }) name. A dependency on a workspace’s name is a link unless the lockfile keys its descriptor, which Yarn 1 writes only for the registry copy it fetched because the workspace’s version missed the range. Alink:to a workspace’s directory is a link whatever name it is under. A rootresolutionsentry that names the package everywhere (ms,**/ms) replaces the range first, as Yarn 1 does. - A lockfile older than the manifests refuses
vx lock, naming the install that refreshes it: a workspace the globs name (the rootpackage.jsonworkspaces, orpnpm-workspace.yamlunderpnpm(),!exclusions honoured as the manager reads them, a trailing**matching zero directories:!**/fixtures/**leaves outpackages/fixtures) that the file lists no importer for, such as a renamed folder, or adependencies,devDependenciesoroptionalDependenciesentry naming a workspace package that the file does not record for that importer (not one pnpm leaves out by design: an optional dependency itsignoredOptionalDependenciesnames). Either would lose edges: the package would build beside what it depends on and hit with old content. So does a dependency, still in a manifest, that the file resolves to a workspace no longer on disk (rm -rf packages/kwhilepackages/lnamesk): the install fails and leaves the file as it was, so the refusal names the dependency to remove (bun.lock is out of date: packages/l depends on the workspace k (packages/k), which is not on disk). Yarn classic is exempt: its edges come from the manifests. Underbun()apackage.jsonwith noname(build output’s{"type":"module"}) is no workspace, as Bun leaves it out ofbun.lock. pnpm()reads the rootpnpm-lock.yamlonly. Withshared-workspace-lockfilefalse (sharedWorkspaceLockfile: falseinpnpm-workspace.yaml, which pnpm 10.8+ reads first, or.npmrc), pnpm writes a lockfile per package and the root’s lists none of them, sovx lockrefuses naming the setting: an install would not fix it.
A workspace manifest that does not parse (git merge conflict markers, a syntax error, or JSON, JSON5 or YAML that is not an object) refuses vx lock, naming it, under every manager, and so does a directory holding two (a package.json and a package.yaml: pnpm 10.28 lists the package by one and installs the other’s dependencies): read as no manifest, it lost its dependencies and its dependents hit with old bytes. Turbo and Nx refuse it too. bun() reads a manifest as Bun does, so a trailing comma or a comment is no syntax error there; npm, pnpm and yarn refuse both, and so do their plugins.
These edges are what was installed, so they differ from a guess over manifest ranges where the manager decided otherwise: pnpm installs a plain range (^2.0.0, *, catalog:) from the registry unless it is workspace:, yarn packs a file: directory as a copy (no edge: Yarn neither links nor re-syncs it), bun installs dependencies over a devDependency of the same key. They are the only package edges vx has: core reads none from a package.json, so a workspace whose tasks use ^build declares one of these plugins (or another that returns deps), and without one vx refuses the ^ naming the fix. A dependency an install adds or removes reaches --affected as this lockfile’s change.
Owning the file, the per-project key, the memo and the --affected diff are core’s lockfileClaim; this package is the parsers, and they are internal: it exports pnpm, bun, npm, yarn and LockfileOptions. A run keys each project from its digest in .vx/dependencies.lock, which core holds to what this plugin derives from the lockfile now, through the memo below (unless a file the lockfile names moved since, as above). The rest is parsed once per content: each importer’s edges and the dependency names it records (what discover reads, with pnpm’s excludeLinksFromLockfile and ignoredOptionalDependencies, so a warm discover reads no lockfile text), and the digests vx lock asks for, are memoised in core’s cache.db (lockfile_memos, one row per file and claimant) by the file’s xxh3 and the plugin, its parsers’ source and what core’s digest step answers on a fixed probe graph included (an upgrade that changes how a digest is built never replays an old digest), so a warm run pays one read, one hash and one row read — never a parse. vx lock writes the digests’ row, so the run after it parses nothing; a lockfile changed since costs one parse. --affected reads which files the lockfile names from the same memo. Under scope: 'workspace' the file is parsed for its edges alone, once per content, so an unreadable lockfile is refused there too. The settings files are read once per run. The digest is one hash per strongly connected component of the dependency graph (lockfiles carry cycles), children first, so a 1000-importer / 3000-package lockfile digests in ~20 ms when it does change.
--affected
Section titled “--affected”vx run test --affected=origin/main after a lockfile change used to select every project. With a plugin declared at scope: 'project', core hands it the lockfile at the base ref and in the working tree; it digests both and names the projects whose digest moved. At scope: 'workspace' a change still selects every project. A lockfile that appeared or was deleted still selects everything — every project’s node_modules is in question. A change to a file the lockfile names but does not pin (a file:, link: or portal: directory, a patch) selects the projects reaching it, even when it sits inside another project’s directory.
Testing
Section titled “Testing”bun test covers each parser’s digests (transitive bumps, nested versions, workspace links, peer suffixes, patches, install-wide knobs, cycles, key order, aliases, refusals), discover’s edges per manager (discover.test.ts) and the edges core’s manifest graph read over the same real installs, recorded when core stopped reading them (discover-parity.test.ts), the settings files each plugin owns, and vx run / vx why / --affected end to end. vx’s own repository declares bun().