Search by

splash / bridge-builder

BadPixxel

Splash Bridge Builder - Package Connectors as Isolated PHAR Workers

Package info

gitlab.com/SplashTools/bridge-builder

Issues

pkg:composer/splash/bridge-builder

Statistics

Installs: 1 568

Dependents: 11

Suggesters: 0

Stars: 0

3.0.x-dev 2026-09-11 14:42 UTC

This package is auto-updated.

Last update: 2026-09-11 12:42:39 UTC


README

The Bridge Builder packages any Splash connector into an isolated, standalone worker that communicates via JSON-RPC over stdin/stdout. This is the build-time companion to the Bridge Bundle, which consumes these workers at runtime.

Splash connectors are Symfony bundles with their own dependencies; running each one in its own isolated PHP process with its own vendor directory removes every dependency conflict. The result is a single self-contained .splx binary: zero dependency conflicts, zero PHP installation required on the target, sub-millisecond runtime latency.

composer require --dev splash/bridge-builder
php -d phar.readonly=0 vendor/bin/bridge-builder        # => dist/{name}.splx

Documentation

  • Getting started — why, output formats, install, build commands, output layout
  • Configurationextra.splash-bridge reference, post-build scripts, static-php build variants
  • Build pipeline — the 8 steps, testing a worker manually, reverse callbacks
  • Connector constraints — what a connector must satisfy to run as a worker
  • Publishing — GitLab Package Registry upload

AI coding agents: see llms.txt, and the splash-connector skill (splash/skills).

Architecture

Php-BridgeBuilder/
  src/                        <- Splash\BridgeBuilder namespace
    Collectors/
      ConfigCollector.php     <- Reads extra.splash-bridge from composer.json
    Builders/
      ProjectBuilder.php      <- Step 1: copies stubs + sources
      ComposerBuilder.php     <- Step 2: generates composer.json + install
      WorkerBuilder.php       <- Step 3: injects connector FQCN into services.yaml
      ScriptsBuilder.php      <- Step 4: runs post-build-cmd
      ManifestBuilder.php     <- Step 5: generates manifest.json (multi-locale)
      VerifyBuilder.php       <- Step 6: ping verification
      PharBuilder.php         <- Step 7: packages into .phar (GZ compressed)
      SplxBuilder.php         <- Step 8: downloads micro.sfx + concatenates into .splx
    Publishers/
      GitlabPublisher.php     <- --publish: GitLab Generic Package Registry

  stubs/                      <- Template files copied into every build
    bridge/                   <- Splash\BridgeWorker namespace (runtime code)
      Kernel.php              <- MicroKernel with 3-step bundle loading
      BridgeWorkerBundle.php  <- CompilerPass wires WorkerService to connector
      Services/
        WorkerService.php     <- Public entry point (connector injected via DI)
        WorkerRunner.php      <- stdin/stdout JSON-RPC loop
        RpcResponseBuilder.php<- Encodes responses + Splash logs
        CallbackService.php   <- Sends reverse callbacks to the bridge
        LocaleContext.php     <- Holds current locale for translations
        TransportService.php  <- stdin/stdout I/O with idle timeout
        Dispatcher/           <- Profile, Form, Template, Config, Action dispatchers
        Listener/             <- File, Commit, IdChanged, ConfigUpdate callback listeners
      Dictionary/ProtocolMessages.php
      DependencyInjection/Compiler/WorkerConnectorPass.php
      Resources/config/services.yaml
    worker.php                <- Bootstrap: boots Kernel → WorkerService::run()

  bin/bridge-builder          <- CLI entry point

License

MIT - See LICENSE