Bundled production dependencies only in the PHAR and pinned Box.#335
Conversation
📝 WalkthroughWalkthroughMigrates the vendor-bin Box Dependency Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #335 +/- ##
=======================================
Coverage 96.91% 96.91%
=======================================
Files 6 6
Lines 421 421
=======================================
Hits 408 408
Misses 13 13 ☔ View full report in Codecov by Harness. |
9be3ac4 to
953de4a
Compare
Summary
The compiled PHAR bundled development and build dependencies because
box.json'sfinder: { in: "./" }pulled the entirevendor/andvendor-bin/box/trees - PHPStan, PHPUnit, Rector, and the Box toolchain itself - into the artifact. Separately, the build pulled Box with no version constraint (composer bin box require --dev humbug/box), so builds were not reproducible and the exact build-time dependency tree could not be audited. This scopes the Box finder to production code only and pins Box as a locked, isolated bin dependency. The shipped PHAR drops from 7.28 MB / 4021 files to 1.22 MB / 1005 files. Because the fix lives in the shared build (not the Dockerfile), it applies to both the Docker image and the GitHub release binary.Changes
box.json- Scoped the Box finder fromin: "./"toin: ["src", "vendor"]withexclude: ["bin"]. Combined with Box'sexclude-dev-files, the PHAR now contains only the application source and production dependencies - no dev package bodies, novendor/binproxy scripts, and novendor-bin/boxbuild toolchain.vendor-bin/box/composer.json+composer.lock- Declared and fully lockedhumbug/box: ^4.7in an isolated bamarni bin namespace, so the build tool and its entire dependency tree are pinned, reproducible, auditable, and tracked by Renovate, while staying out of the application's own dependency graph (avoiding conflicts withsymfony/* ^7.4).composer.json- Thebuildscript now runs@composer bin box install(installing Box from the committed lock) instead of resolving the latest Box unpinned at build time..gitignore/.dockerignore- Commit the bin namespace'scomposer.jsonandcomposer.lock(so the pin is tracked and available to the Docker build) while keeping the installedvendor-bin/*/vendorignored.Before / After
Summary by CodeRabbit