You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test: add Composer (composer.lock) edge-case fixture for vg build #265
PHP / Composer lockfiles are a common local tree that vg build should handle deterministically. Adjacent lockfile fixtures already cover pnpm, Yarn Berry, Poetry, Bundler, Cargo, and Go workspaces; Composer is a natural next edge-case for graph stability.
What to do
Add a small fixture under test/ with a realistic composer.lock edge (e.g. path repo, replaced package, or platform php constraint) — keep it tiny.
Assert deterministic graph.json / build output (stable IDs, stable sort; no wall-clock or filesystem-order dependence).
Follow CONTRIBUTING: pnpm test, DCO (git commit -s), prefer vg in any docs/examples touched.
Acceptance
Fixture committed and referenced from the test that builds it
Same input → same graph output across two runs
pnpm test green; DCO on commits
Mentoring notes
Mirror the size/scope of #252 (Poetry) / #259 (Bundler). One lockfile family only — do not expand into Packagist network calls.
Some pointers from the current code so this stays small and lands on the right behaviour.
vg build reads composer.lock through lockfileVersion → composerLock in src/engine/lockfile.ts. It looks up a direct dependency in packages, then packages-dev, and strips a leading v (v1.2.3 becomes 1.2.3).
fullDependencyGraph in the same file has no Composer branch, so a Composer project gets direct-dependency pins only and no transitive component list. The fixture should assert that as current behaviour rather than expect transitive components.
Edges worth covering in one tiny lock:
a v-prefixed tag (expect the bare version)
a path repository entry ("dist": {"type": "path"}) with a dev-main version (expect dev-main unchanged, not coerced to semver)
the same name in both packages and packages-dev (expect the packages version)
a name that is only satisfied through another entry's replace map (expect undefined today; note it in the PR rather than fixing it here)
platform: { "php": ... } stays out of the dependency list
Put the unit cases next to the existing ones in src/engine/lockfile.test.ts (they write a lockfile into a temp dir and call lockfileVersion). Add one check that builds the fixture twice and compares graph.json bytes.
Extra acceptance: every expectation above is asserted, and the test makes no network calls.
Activity
vibgrate-team commentedon Oct 6, 2026
Some pointers from the current code so this stays small and lands on the right behaviour.
vg buildreadscomposer.lockthroughlockfileVersion→composerLockinsrc/engine/lockfile.ts. It looks up a direct dependency inpackages, thenpackages-dev, and strips a leadingv(v1.2.3becomes1.2.3).fullDependencyGraphin the same file has no Composer branch, so a Composer project gets direct-dependency pins only and no transitive component list. The fixture should assert that as current behaviour rather than expect transitive components.v-prefixed tag (expect the bare version)"dist": {"type": "path"}) with adev-mainversion (expectdev-mainunchanged, not coerced to semver)packagesandpackages-dev(expect thepackagesversion)replacemap (expectundefinedtoday; note it in the PR rather than fixing it here)platform: { "php": ... }stays out of the dependency listsrc/engine/lockfile.test.ts(they write a lockfile into a temp dir and calllockfileVersion). Add one check that builds the fixture twice and comparesgraph.jsonbytes.Extra acceptance: every expectation above is asserted, and the test makes no network calls.
vibgrate-team commentedon Oct 29, 2026
Folding this into #513, which covers this lockfile with the exact functions, fixtures and acceptance tests. Please pick it up there!