Skip to content

fix(adapters): copy vendor/ into the PHP asset stage so package CSS resolves - #467

Merged
Hydralerne merged 3 commits into
oblien:feat/bugfix-batch-2026-09-16from
sudanese:fix/php-asset-stage-vendor
Sep 16, 2026
Merged

Hydralerne merged 3 commits into
oblien:feat/bugfix-batch-2026-09-16from
sudanese:fix/php-asset-stage-vendor

Conversation

@sudanese

@sudanese sudanese commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

PHP asset builds could not resolve stylesheets supplied by Composer packages because the Node stage copied only the source context. The asset stage now copies the completed builder workspace, including installed packages and generated files, before running the JavaScript build.

Adapted the original contributor fix for #892 while retaining its history. Reusing the whole workspace handles ordinary vendor directories, custom Composer vendor-dir settings, monorepo sub-applications and disabled/custom install commands without requiring a hard-coded vendor path or a second context copy.

Validation: 33 Dockerfile recipe tests pass. Two real Docker builds execute the generated asset stage with an installer-created stylesheet, covering a root application and a monorepo/custom dependency path; both fail with main’s recipe and pass after the fix. The fixture supplies the installer output; these tests do not compile PHP extensions. API TypeScript passes.

Fixes #501 when #892 merges into main.

…esolves

The generated PHP Dockerfile compiles front-end assets in a separate Node
stage that never receives the Composer vendor/ tree. Any Laravel app whose
CSS pulls from a Composer package — Flux, Filament, or anything that ships a
stylesheet — dies at `npm run build` with
`Can't resolve ../../vendor/livewire/flux/dist/flux.css`.

generatePhpDockerfile emits a `builder` (Composer) stage, an optional node:*
asset stage, and the FrankenPHP runtime. The asset stage's `COPY . /workspace`
brings the repo but not vendor/ (git-ignored, so never in the build context).
resources/css/app.css @imports package CSS straight out of vendor/, and
Tailwind 4 @source-scans it — both resolved by npm run build, which then fails.

Copy vendor/ from the builder into the asset stage before the build. Reuses
sourceDir so a rootDirectory monorepo sub-app copies the right path, and is
guarded on installLine (vendor/ exists only when composer install ran).
@Hydralerne
Hydralerne changed the base branch from main to feat/bugfix-batch-2026-09-16 September 16, 2026 00:48
@Hydralerne
Hydralerne merged commit d8dbf53 into oblien:feat/bugfix-batch-2026-09-16 Sep 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Laravel asset build fails when a package ships CSS from vendor/ (Livewire Flux, Filament) — the asset stage has no vendor/

2 participants