Skip to content

Commit 369ae54

Browse files
loks0nclaude
andcommitted
Claim root dev dependencies in linked test resolution
Composer installs the root package's require-dev alongside require, and the ../* path repository shadows any sibling on Packagist. cli's dev dependency on console resolved fine until console was absorbed; then the path repo offered it as dev-main, unclaimed, failing the 0.0.* constraint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 7a81788 commit 369ae54

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

bin/monorepo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,12 @@ function linked_versions(string $package): array
201201
$seen = [$package => true];
202202
while ($pending !== []) {
203203
$current = array_shift($pending);
204-
foreach (manifest($current)['require'] ?? [] as $dependency => $constraint) {
204+
$manifest = manifest($current);
205+
// composer installs the root package's dev dependencies too, and the
206+
// path repository shadows them on Packagist
207+
$requirements = ($manifest['require'] ?? [])
208+
+ ($current === $package ? $manifest['require-dev'] ?? [] : []);
209+
foreach ($requirements as $dependency => $constraint) {
205210
if (!str_starts_with($dependency, ORG . '/')) {
206211
continue;
207212
}

0 commit comments

Comments
 (0)