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 modulesAn external module will declaretheirits dependencies as ordinary Composer packages,andand Composer will not installthethe 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
provideblock willneed generatinghave to be generated from the panel's own lock file, andkeepingkept insyncstep whenever modules are added, removed or updated.
Constrained:
- Module metadata that Composer's schema does not carry will live under
extra.tgpineacheach module'sscomposer.json.
Sources
- Issue #35, Engine - Modules, original text of in its edit history: the decision, which is
bothbothcreatedanddecided, the reason for using Composer as a library, the separate Composer project, themodulesmodules autoloaderandand theprovideblock. - Issue #36, Engine - Modules - Discovery and Manifest, : packages of type
tgp-module, andmetadata undermetadata underextra.tgp. composer.jsonat 7fad8cd, theinitialinitial 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/composerwas updated to 2.10.3 because 2.10.2 is affected by CVE-2026-84361, and 2.10.3 declaresext-filterandext-hash, which the single-binary build will need to compile in.
Source adr/0012-composer-installs.md · commit 9444a99 · published