From 32daa17e0d99f143f94cacd309cf76e796abd8be Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Tue, 14 Jul 2026 13:14:31 +0200 Subject: [PATCH] Add a typescript watch service so TS assets rebuild automatically Previously the compiled TypeScript output only existed after manually running `bin/console typescript:build`, so a fresh checkout/worktree (or a `just clean`) would 500 on any page rendering a TS asset until someone remembered to build it by hand. Mirrors the existing sass watch service, including sharing a named volume with php since the Dockerfile's `VOLUME /app/var/` otherwise gives every container its own private, unsynced /app/var. Also add a `just compose` passthrough recipe for ad-hoc docker compose commands (logs, ps, top, etc.) using the worktree's env. --- Justfile | 3 +++ compose.override.yaml | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Justfile b/Justfile index a527902..4dcc622 100644 --- a/Justfile +++ b/Justfile @@ -71,6 +71,9 @@ up *args: init set +a docker compose up -d {{ args }} +compose *args: + docker compose {{ args }} + down *args: docker compose down --remove-orphans {{ args }} diff --git a/compose.override.yaml b/compose.override.yaml index 67ef051..51f0680 100644 --- a/compose.override.yaml +++ b/compose.override.yaml @@ -12,6 +12,7 @@ services: - ./frankenphp/conf.d/20-app.dev.ini:/usr/local/etc/php/app.conf.d/20-app.dev.ini:ro - ${CADDY_DATA_DIR:-./frankenphp/data}:/data - sass:/app/var/sass + - typescript:/app/var/typescript environment: MERCURE_EXTRA_DIRECTIVES: demo # See https://xdebug.org/docs/all_settings#mode @@ -49,7 +50,23 @@ services: - -v healthcheck: disable: true - + + typescript: + image: ${IMAGES_PREFIX:-}app-php + volumes: + - ./:/app:ro + - typescript:/app/var/typescript + entrypoint: '' + depends_on: + - php + command: + - bin/console + - typescript:build + - --watch + - -v + healthcheck: + disable: true + ###> symfony/mercure-bundle ### ###< symfony/mercure-bundle ### @@ -77,3 +94,4 @@ services: volumes: sass: + typescript: