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
Reconcile dependency overlay to consumer autoload layout
A composer-package dependency overlay is mounted at the consumer's
vendor/<package> path and autoloaded through the consumer's committed
PSR-4 map, not the override's own. When the override ships a different
PSR-4 source layout than the consumer recorded (e.g. a repo published as
src/ but consumed as php-transformer/src/), the mounted class files
landed where the consumer autoloader never looks, so the override was
silently ignored and the pinned released version kept running.
Relocate the staged overlay's PSR-4 source directories to the paths the
consumer's autoloader resolves before mounting, staging a copy so the
caller's checkout is never restructured in place. Add a regression smoke.
awaitwriteFile(join(overrideSource,"src","ArtifactCompiler","ArtifactCompiler.php"),"<?php\nnamespace Automattic\\BlocksEngine\\PhpTransformer\\ArtifactCompiler;\nfinal class ArtifactCompiler {}\n")
// The class must be relocated to the consumer's recorded PSR-4 path so the
74
+
// consumer autoloader resolves it after the vendor-path mount.
75
+
assert.equal(awaitexists(join(staged,"php-transformer","src","ArtifactCompiler","ArtifactCompiler.php")),true,"override class relocated to consumer PSR-4 layout")
76
+
assert.equal(awaitexists(join(staged,"src","ArtifactCompiler","ArtifactCompiler.php")),false,"override source layout no longer shadows the consumer path")
0 commit comments