The Game Panel Design record
The Game Panel
ADR-0012 Accepted

Modules are installed Install modules with Composer used as a library

Comparing
v1 to v2
Current
Read the document

Context

Modules Modules come from two sources: places. A bundled modules, shipped inside module ships inside the binary as part of the panel's own codebase, per as ADR-0009, and decides for the whole application. An external modules, installed module is installed alongside itthe binary. External modules are Composer Composer packages with dependencies of their own, , and some of which those dependencies are packages the panel already provides. The panel depends on composer/composer, added for installing them.

The panel depends on composer/composer, added for installing external modules.

Decision

External modules are I will make an external module a Composer packages package of type tgp-module, installed into into a separate Composer project of its own in the the modules directory, with its own composer.json and vendor/. The panel drives will drive Composer as a PHP library rather than than running it as a standalone tool, and includes will include the modules autoloader project's autoloader alongside its own.

Alternatives

Running Composer as a standalone tool. Using it I rejected this because using Composer as a library instead gives full the panel full programmatic control over repository resolution resolving repositories and installationinstalling packages.

No other way of installing modules was weighed.

Consequences

Easier:

  • The panel will have full programmatic control over resolving repositories and installing modulesinstalling modules.
  • External modules An external module will declare their its dependencies as ordinary Composer packages, and and Composer will not install the the ones the panel already provides.

Harder:

  • Composer will be a runtime library of the panel, so its vulnerabilities will be the panel's to patch.
  • Composer's own extension requirements will become requirements of the binary.
  • The modules project's provide block will need generating have to be generated from the panel's own lock file, and keeping kept in sync step whenever modules are added, removed or updated.

Constrained:

  • Module metadata that Composer's schema does not carry will live under extra.tgp in each each module's s composer.json.

Sources

  • Issue #35, Engine - Modules, original text of in its edit history: the decision, which is both both created and decided, the reason for using Composer as a library, the separate Composer project, the modules modules autoloader and and the provide block.
  • Issue #36, Engine - Modules - Discovery and Manifest, : packages of type tgp-module, and metadata under metadata under extra.tgp.
  • composer.json at 7fad8cd, the initial initial commit: : composer/composer, added for installing modules before the design was written.
  • PR #75, chore: Rename package, add licence and patch Composer CVE, merged and squashed as 3372f20: Composer's vulnerabilities and extension requirements becoming the panel's, taken from what followed rather than anticipated. composer/composer was updated to 2.10.3 because 2.10.2 is affected by CVE-2026-84361, and 2.10.3 declares ext-filter and ext-hash, which the single-binary build will need to compile in.

Source adr/0012-composer-installs.md · commit 9444a99 · published