Skip to content

Commit 7669c2e

Browse files
committed
Use Fast Forward composer installer
1 parent 879da58 commit 7669c2e

4 files changed

Lines changed: 50 additions & 42 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
test -d .agents/skills
5454
test -f .agents/agents/issue-implementer.md
5555
test -f .agents/skills/github-pull-request/SKILL.md
56-
php -r '$composer = json_decode(file_get_contents("composer.json"), true, flags: JSON_THROW_ON_ERROR); if (($composer["type"] ?? null) !== "fast-forward-resource-bundle") { exit(1); } if (($composer["extra"]["installer-name"] ?? null) !== "agents") { exit(1); } if (($composer["extra"]["fast-forward-bundle"]["installer-path"] ?? null) !== ".agents/{\$name}/") { exit(1); }'
56+
php -r '$composer = json_decode(file_get_contents("composer.json"), true, flags: JSON_THROW_ON_ERROR); if (($composer["type"] ?? null) !== "fast-forward-resource-bundle") { exit(1); } if (($composer["require"]["fast-forward/composer-installers"] ?? null) !== "dev-main") { exit(1); } if (($composer["extra"]["fast-forward-bundle"]["payload-path"] ?? null) !== ".agents") { exit(1); }'
5757
5858
- name: Publish required test status
5959
if: ${{ always() && inputs.publish-required-statuses }}

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,32 @@ package split tracked by [php-fast-forward/dev-tools#195](https://github.com/php
1010

1111
The package uses the custom Composer type `fast-forward-resource-bundle`.
1212
Consumer repositories are expected to install Fast Forward resource bundles
13-
through Composer installer paths instead of copying or linking package contents
14-
manually.
13+
through `fast-forward/composer-installers` instead of copying or linking package
14+
contents manually.
1515

1616
```json
1717
{
18+
"require": {
19+
"fast-forward/agents": "dev-main"
20+
},
1821
"config": {
1922
"allow-plugins": {
20-
"composer/installers": true,
21-
"oomphinc/composer-installers-extender": true
23+
"fast-forward/composer-installers": true
2224
}
2325
},
2426
"extra": {
25-
"installer-types": ["fast-forward-resource-bundle"],
2627
"installer-paths": {
27-
".agents/{$name}/": ["fast-forward/agents"]
28+
".agents/": ["fast-forward/agents"]
2829
}
2930
}
3031
}
3132
```
3233

33-
`composer/installers` is required by this package so consumers do not need to
34-
require it explicitly. Because `fast-forward-resource-bundle` is a Fast Forward
35-
package type rather than one of the finite built-in `composer/installers` types,
36-
this package also requires `oomphinc/composer-installers-extender`.
34+
`fast-forward/composer-installers` is required by this package so consumers do
35+
not need to require the installer explicitly once the package is available from
36+
normal Composer metadata. Until the first tagged installer release exists,
37+
consumer smoke projects can add a repository entry for
38+
`php-fast-forward/composer-installers` and install the `dev-main` version.
3739

3840
The resource-bundle type is intentionally generic. Each bundle can still install
3941
to a different target by using a package-specific installer-path match. For
@@ -43,18 +45,19 @@ could declare:
4345
```json
4446
{
4547
"extra": {
46-
"installer-types": ["fast-forward-resource-bundle"],
4748
"installer-paths": {
48-
".agents/{$name}/": ["fast-forward/agents"],
49-
".github/workflows/{$name}/": ["fast-forward/github-workflows"]
49+
".agents/": ["fast-forward/agents"],
50+
".github/workflows/": ["fast-forward/github-workflows"]
5051
}
5152
}
5253
}
5354
```
5455

55-
Consumer roots still own the plugin allow-list and the `installer-types` /
56-
`installer-paths` entries because Composer treats those settings as root
57-
configuration.
56+
Consumer roots still own the plugin allow-list and the `installer-paths` entries
57+
because Composer treats those settings as root configuration. The installer
58+
copies only the declared payload contents into each target, so `fast-forward/agents`
59+
materializes `.agents/agents` and `.agents/skills` directly under the consumer
60+
`.agents/` directory.
5861

5962
`fast-forward/dev-tools` will use that stable installed package path in a later
6063
change so consumer sync commands can resolve packaged agent assets without

composer.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
"source": "https://github.com/php-fast-forward/agents",
2727
"docs": "https://php-fast-forward.github.io/agents/"
2828
},
29+
"repositories": [
30+
{
31+
"type": "vcs",
32+
"url": "https://github.com/php-fast-forward/composer-installers"
33+
}
34+
],
2935
"funding": [
3036
{
3137
"type": "github",
@@ -38,14 +44,13 @@
3844
],
3945
"require": {
4046
"php": "^8.3",
41-
"composer/installers": "^2.3",
42-
"oomphinc/composer-installers-extender": "^2.0"
47+
"fast-forward/composer-installers": "dev-main"
4348
},
44-
"minimum-stability": "stable",
49+
"minimum-stability": "dev",
50+
"prefer-stable": true,
4551
"config": {
4652
"allow-plugins": {
47-
"composer/installers": true,
48-
"oomphinc/composer-installers-extender": true
53+
"fast-forward/composer-installers": true
4954
},
5055
"platform": {
5156
"php": "8.3.0"
@@ -57,15 +62,11 @@
5762
"dev-main": "1.x-dev"
5863
},
5964
"fast-forward-bundle": {
60-
"installer-path": ".agents/{$name}/",
61-
"installer-path-match": "fast-forward/agents",
62-
"installer-type": "fast-forward-resource-bundle",
6365
"kind": "agents",
6466
"payload-path": ".agents",
6567
"project-agents-path": ".agents/agents",
6668
"skills-path": ".agents/skills"
67-
},
68-
"installer-name": "agents"
69+
}
6970
},
7071
"scripts": {
7172
"dev-tools": "composer global exec dev-tools -- --working-dir=\"$PWD\"",

docs/index.rst

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,33 @@ Composer Installation
2020
---------------------
2121

2222
Consumer repositories are expected to install Fast Forward resource bundles with
23-
Composer installer paths:
23+
``fast-forward/composer-installers``:
2424

2525
.. code-block:: json
2626
2727
{
28+
"require": {
29+
"fast-forward/agents": "dev-main"
30+
},
2831
"config": {
2932
"allow-plugins": {
30-
"composer/installers": true,
31-
"oomphinc/composer-installers-extender": true
33+
"fast-forward/composer-installers": true
3234
}
3335
},
3436
"extra": {
35-
"installer-types": ["fast-forward-resource-bundle"],
3637
"installer-paths": {
37-
".agents/{$name}/": ["fast-forward/agents"]
38+
".agents/": ["fast-forward/agents"]
3839
}
3940
}
4041
}
4142
42-
``composer/installers`` is a package dependency of this bundle, so consumers do
43-
not need to require it separately. The custom ``fast-forward-resource-bundle`` type
44-
is outside the finite list handled directly by ``composer/installers``, so the
45-
bundle also requires ``oomphinc/composer-installers-extender``. Consumer roots
46-
still own the plugin allow-list and the ``installer-types`` /
47-
``installer-paths`` configuration.
43+
``fast-forward/composer-installers`` is a package dependency of this bundle, so
44+
consumers do not need to require the installer separately once the package is
45+
available from normal Composer metadata. Until the first tagged installer
46+
release exists, consumer smoke projects can add a repository entry for
47+
``php-fast-forward/composer-installers`` and install the ``dev-main`` version.
48+
Consumer roots still own the plugin allow-list and the ``installer-paths``
49+
configuration.
4850

4951
The resource-bundle type is generic on purpose. Different bundle kinds can still
5052
install into different target directories by matching explicit package names in
@@ -54,16 +56,18 @@ install into different target directories by matching explicit package names in
5456
5557
{
5658
"extra": {
57-
"installer-types": ["fast-forward-resource-bundle"],
5859
"installer-paths": {
59-
".agents/{$name}/": ["fast-forward/agents"],
60-
".github/workflows/{$name}/": ["fast-forward/github-workflows"]
60+
".agents/": ["fast-forward/agents"],
61+
".github/workflows/": ["fast-forward/github-workflows"]
6162
}
6263
}
6364
}
6465
6566
This keeps the Composer type reusable while preserving one target directory per
66-
bundle package or bundle kind.
67+
bundle package or bundle kind. The installer copies only the declared payload
68+
contents into each target, so ``fast-forward/agents`` materializes
69+
``.agents/agents`` and ``.agents/skills`` directly under the consumer
70+
``.agents/`` directory.
6771

6872
The follow-up ``fast-forward/dev-tools`` work tracked in
6973
`php-fast-forward/dev-tools#195 <https://github.com/php-fast-forward/dev-tools/issues/195>`_

0 commit comments

Comments
 (0)