v1.1.0 — cross-component link awareness + --target test
Added
- Cross-component link awareness via
extra.cwm-build-tools.joomlaLinks.
Each CWM Composer package can now declare its Joomla install footprint
in its owncomposer.json:Consumers'{ "extra": { "cwm-build-tools": { "joomlaLinks": [ { "type": "library", "name": "cwmscripturelinks" }, { "type": "plugin", "group": "content", "element": "cwmsl_autolink" }, { "type": "module", "name": "mod_cwm_widget", "client": "site" }, { "type": "component","name": "com_cwmthing" } ] } } }cwm-linkandcwm-verifydiscover these declarations via
vendor/composer/installed.jsonand operate on them automatically —
no per-consumer wiring required.- New
CWM\BuildTools\Config\InstalledPackageReaderparses
installed.jsondirectly (Laravel-style —\Composer\InstalledVersions
stripsextrafrom its accessors), surfacing each CWM dep's version,
install path, path-repo source path (if installed via a path
repository), and validated joomlaLinks tuples. - New value object
CWM\BuildTools\Config\CwmPackage.
- New
cwm-linkwalks CWM Composer deps in addition to the consumer's own
extensions. Per-dep links land at the same canonical Joomla paths
(libraries/<name>,plugins/<group>/<element>, etc.) — re-running
cwm-linkfrom a different consuming repo is idempotent on shared
targets.- Conflict detection: when a symlink already exists at the expected
target but points somewhere other than this run's source, the
conflict is reported and skipped (exit 1) rather than silently
overwritten. New--forceflag reinstates overwrite for the rare
case where a developer actually wants to replace someone else's
link. Linker::check()return shape gainsexistingRealpathfor ok/wrong/
broken statuses so callers can compare without re-reading the link.
- Conflict detection: when a symlink already exists at the expected
build.propertiesinstall role. Each install can now declare
role = dev(the default — symlink-style working install where
cwm-linkdeploys) orrole = test(artifact-style install for the
newcwm-install-zipcommand). Multiple installs may share a role
(e.g.j5andj6both as dev). Legacy flat Proclaim-style
build.propertiesfiles default every install torole = dev.- New
PropertiesReader::installsFor(string $role)filters by role. InstallConfiggains aroleconstructor argument and
ROLE_DEV/ROLE_TESTconstants.
- New
cwm-install-zipcommand. New companion tocwm-link: builds nothing
itself, but takes the most recent dist zip produced bycwm-build
(matched viabuild.outputGlob) and installs it into every Joomla
install withrole = testby invoking the bundled Joomla CLI:Re-running on an existing extension triggers Joomla's upgrade path —php <joomlaRoot>/cli/joomla.php extension:install --path=<zip>
install scriptfileupdate()runs, manifestupdate.sqlmigrations
apply. Use this to exercise the SHIPPED artifact end-to-end (install
scriptfile, dist exclusions, schema migrations) before a release,
separately from the symlink-style dev workflow.- Implementation: new
src/Dev/ExtensionInstaller.phpand
src/Dev/InstallResult.php; thin bin wrapper at
bin/cwm-install-zip. --zip <path>flag to override theoutputGlobresolution.proc_openis invoked array-form (no shell) per CLAUDE.md guardrails.
- Implementation: new
cwm-verify --target <role>flag. Filters which installs are
verified. Without--target, every install is verified per its
declared role.- For
role = devinstalls, the new
CWM\BuildTools\Dev\DevTargetVerifierchecks: every expected
symlink is in place (self + every CWM dep); each installed dep
version satisfies the constraint in the consuming project's
composer.json; each path-repo dep has a clean working tree
(git -C <source> status --porcelain). - For
role = testinstalls, the existingExtensionVerifiernow
also walks each CWM dep's declared joomlaLinks and confirms each
one is registered in#__extensionsat the right(type, element, folder, client_id)tuple. - New public method
ExtensionVerifier::expectedFromPackages(list<CwmPackage>): list<array>
folds dep declarations into the existing expected-extension shape. lookup()now filters byclient_idwhen supplied, so two modules
with the same element in different clients (site vs administrator)
resolve unambiguously.
- For
Changed (non-breaking)
Linker::check()return shape now includes anexistingRealpathkey
forok,wrong, andbrokenstatuses. Existing callers reading
onlystatusandmessageare unaffected.ExtensionVerifier::verify()signature gains an optional
array $packages = []parameter. Existing callers passing
(InstallConfig, bool)continue to work unchanged.templates/build.properties.tmpldocuments therolefield and ships
with a commented-out[j5-test]block for the new artifact-target
install.
Migration
Consumers pin to ^1.1. Per-repo migration:
composer require --dev cwm/build-tools:^1.1- Add
extra.cwm-build-tools.joomlaLinksto yourcomposer.json,
derived from yourmanifests.extensions[]in
cwm-build.config.json(one tuple per declared extension). - (Optional) Add a
[j5-test]block withrole = testto your
build.propertiesto enablecwm-install-zipand
cwm-verify --target test. - Re-run
composer cwm-link— output now shows the deps section;
existing links are reported as idempotent. - Re-run
composer cwm-verify— output now shows per-dep version,
link state, and (for path-repo deps) working-tree cleanliness.