Skip to content

Commit e7e1b6d

Browse files
[docs] Refresh dependency and reporting guides (#105) (#106)
* [docs] Refresh dependency and reporting guides (#105) * Update wiki submodule pointer for PR #106 --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 68c742f commit e7e1b6d

11 files changed

Lines changed: 128 additions & 93 deletions

File tree

.github/wiki

Submodule wiki updated from 8390424 to 4b06b39

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ composer require --dev fast-forward/dev-tools:dev-main
3434

3535
## 🛠️ Usage
3636

37-
Once installed, the plugin automatically exposes the `dev-tools` command via Composer.
37+
Once installed, the plugin automatically exposes the aggregated `dev-tools`
38+
command and the individual Composer commands described below.
3839

3940
```bash
4041
# Run all standard checks (refactoring, code styling, docs, tests, and reports)
@@ -50,57 +51,56 @@ You can also run individual commands for specific development tasks:
5051
# Run PHPUnit tests
5152
composer dev-tools tests
5253

53-
# Analyze missing and unused Composer dependencies
54+
# Analyze missing, unused, and outdated Composer dependencies
5455
composer dependencies
55-
vendor/bin/dev-tools dependencies
56-
composer dev-tools dependencies -- --max-outdated=8
57-
composer dev-tools dependencies -- --dev
58-
composer dev-tools dependencies -- --upgrade --dev
56+
composer dependencies --max-outdated=8
57+
composer dependencies --dev
58+
composer dependencies --upgrade --dev
5959

6060
# Analyze code metrics with PhpMetrics
6161
composer metrics
62-
composer dev-tools metrics -- --target=build/metrics
63-
composer dev-tools metrics -- --working-dir=packages/example
62+
composer metrics --target=build/metrics
63+
composer --working-dir=packages/example metrics
6464

6565
# Check and fix code style using ECS and Composer Normalize
66-
composer dev-tools code-style
66+
composer code-style
6767

6868
# Refactor code using Rector
69-
composer dev-tools refactor
69+
composer refactor
7070

7171
# Check and fix PHPDoc comments
72-
composer dev-tools phpdoc
72+
composer phpdoc
7373

7474
# Generate HTML API documentation using phpDocumentor
75-
composer dev-tools docs
75+
composer docs
7676

7777
# Generate Markdown documentation for the wiki
78-
composer dev-tools wiki
78+
composer wiki
7979

8080
# Generate documentation frontpage and related reports
81-
composer dev-tools reports
82-
composer dev-tools reports -- --metrics
81+
composer reports
82+
composer reports --target=build --coverage=build/coverage
8383

8484
# Synchronize packaged agent skills into .agents/skills
85-
composer dev-tools skills
85+
composer skills
8686

8787
# Merges and synchronizes .gitignore files
88-
composer dev-tools gitignore
88+
composer gitignore
8989

9090
# Manages .gitattributes export-ignore rules for leaner package archives
91-
composer dev-tools gitattributes
91+
composer gitattributes
9292

9393
# Generates a LICENSE file from composer.json license information
94-
composer dev-tools license
94+
composer license
9595

9696
# Copies packaged or local resources into the consumer repository
97-
composer dev-tools copy-resource --source resources/docblock --target .docheader
97+
composer copy-resource --source resources/docblock --target .docheader
9898

9999
# Installs Fast Forward Git hooks
100-
composer dev-tools git-hooks
100+
composer git-hooks
101101

102102
# Updates the composer.json file to match the packaged schema
103-
composer dev-tools update-composer-json --force
103+
composer update-composer-json --force
104104

105105
# Installs and synchronizes dev-tools scripts, GitHub Actions workflows,
106106
# .editorconfig, .gitignore rules, packaged skills, and the repository wiki
@@ -128,12 +128,12 @@ automation assets.
128128
| Command | Purpose |
129129
|---------|---------|
130130
| `composer dev-tools` | Runs the full `standards` pipeline. |
131-
| `composer dev-tools tests` | Runs PHPUnit with local-or-packaged configuration. |
132-
| `composer dev-tools dependencies` | Previews Jack dependency updates, then reports missing, unused, and overly outdated Composer dependencies. |
133-
| `composer dev-tools metrics` | Runs PhpMetrics for a working directory and generates requested report artifacts. |
134-
| `composer dev-tools docs` | Builds the HTML documentation site from PSR-4 code and `docs/`. |
135-
| `composer dev-tools skills` | Creates or repairs packaged skill links in `.agents/skills`. |
136-
| `composer dev-tools gitattributes` | Manages export-ignore rules in .gitattributes. |
131+
| `composer tests` | Runs PHPUnit with local-or-packaged configuration. |
132+
| `composer dependencies` | Previews Jack dependency updates, then reports missing, unused, and overly outdated Composer dependencies. |
133+
| `composer metrics` | Runs PhpMetrics for the current project and generates requested report artifacts. |
134+
| `composer docs` | Builds the HTML documentation site from PSR-4 code and `docs/`. |
135+
| `composer skills` | Creates or repairs packaged skill links in `.agents/skills`. |
136+
| `composer gitattributes` | Manages export-ignore rules in `.gitattributes`. |
137137
| `composer dev-tools:sync` | Updates scripts, workflow stubs, `.editorconfig`, `.gitignore`, `.gitattributes`, wiki setup, and packaged skills. |
138138

139139
## 🔌 Integration

docs/api/commands.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ dependencies through constructor injection. The architecture uses
2828
- Runs PHPUnit with optional coverage output.
2929
* - ``FastForward\DevTools\Console\Command\DependenciesCommand``
3030
- ``dependencies``
31-
- Reports missing and unused Composer dependencies.
31+
- Reports missing, unused, and outdated Composer dependencies.
32+
* - ``FastForward\DevTools\Console\Command\MetricsCommand``
33+
- ``metrics``
34+
- Builds the PhpMetrics site and JSON artifacts for the current project.
3235
* - ``FastForward\DevTools\Console\Command\DocsCommand``
3336
- ``docs``
3437
- Builds the HTML documentation site.
@@ -37,7 +40,7 @@ dependencies through constructor injection. The architecture uses
3740
- Builds Markdown API documentation.
3841
* - ``FastForward\DevTools\Console\Command\ReportsCommand``
3942
- ``reports``
40-
- Combines the documentation build with coverage generation.
43+
- Combines documentation, coverage, and metrics generation.
4144
* - ``FastForward\DevTools\Console\Command\SkillsCommand``
4245
- ``skills``
4346
- Synchronizes packaged agent skills into ``.agents/skills``.

docs/commands/dependencies.rst

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
dependencies
22
=============
33

4-
Analyzes missing and unused Composer dependencies.
4+
Analyzes missing, unused, and outdated Composer dependencies.
55

66
Description
77
-----------
88

99
The ``dependencies`` command (alias: ``deps``) analyzes missing, unused, and
10-
overly outdated
11-
Composer dependencies using two tools:
10+
overly outdated Composer dependencies using three tools:
1211

1312
- ``composer-unused`` - detects unused packages
1413
- ``composer-dependency-analyser`` - detects missing packages
1514
- ``jack breakpoint`` - fails when too many outdated packages accumulate
1615

17-
This command ships as a direct dependency of ``fast-forward/dev-tools``.
16+
These analyzers ship as direct dependencies of ``fast-forward/dev-tools``, so
17+
consumer repositories do not need extra setup before running the command.
1818

1919
Usage
2020
-----
2121

2222
.. code-block:: bash
2323
2424
composer dependencies
25-
composer dev-tools dependencies
25+
composer dependencies [options]
2626
2727
composer deps
28-
composer dev-tools deps
29-
30-
vendor/bin/dev-tools dependencies
31-
vendor/bin/dev-tools deps
28+
vendor/bin/dev-tools dependencies [options]
3229
3330
Options
3431
-------
@@ -41,9 +38,10 @@ Options
4138
``--upgrade`` (optional)
4239
Applies the Jack upgrade workflow before the analyzers:
4340

44-
- ``vendor/bin/jack open-versions``
4541
- ``vendor/bin/jack raise-to-installed``
42+
- ``vendor/bin/jack open-versions``
4643
- ``composer update -W``
44+
- ``composer normalize``
4745

4846
Without ``--upgrade``, the command runs the Jack workflow in preview mode
4947
before the analyzers.
@@ -64,19 +62,19 @@ Allow up to 10 outdated packages:
6462

6563
.. code-block:: bash
6664
67-
composer dev-tools dependencies -- --max-outdated=10
65+
composer dependencies --max-outdated=10
6866
6967
Preview the upgrade workflow:
7068

7169
.. code-block:: bash
7270
73-
composer dev-tools dependencies -- --dev
71+
composer dependencies --dev
7472
7573
Apply the upgrade workflow and then analyze dependencies:
7674

7775
.. code-block:: bash
7876
79-
composer dev-tools dependencies -- --upgrade --dev
77+
composer dependencies --upgrade --dev
8078
8179
Using the alias:
8280

@@ -98,18 +96,18 @@ Exit Codes
9896
- Failure. A dependency analyzer or Jack reported findings or errors.
9997

10098
Behavior
101-
---------
99+
--------
102100

101+
- Always previews or applies ``jack raise-to-installed`` first and then
102+
``jack open-versions`` before running the analyzers.
103103
- Runs ``composer-unused``, ``composer-dependency-analyser``, and
104-
``jack breakpoint``.
104+
``jack breakpoint`` after the Jack preview or upgrade phase.
105105
- ``composer-dependency-analyser`` is configured with:
106106
- ``--ignore-unused-deps`` (leaves unused detection to ``composer-unused``)
107107
- ``--ignore-prod-only-in-dev-deps`` (ignores dev-only usage in production code)
108108
- ``jack breakpoint`` maps ``--max-outdated`` to Jack's ``--limit`` option.
109-
- It always previews Jack's ``open-versions`` and ``raise-to-installed``
110-
commands before the analyzers.
111-
- ``--upgrade`` applies Jack's ``open-versions`` and ``raise-to-installed``
112-
commands before ``composer update -W``.
109+
- ``--upgrade`` applies Jack's ``raise-to-installed`` and ``open-versions``
110+
commands before ``composer update -W`` and ``composer normalize``.
113111
- Returns a non-zero exit code when missing, unused, or too many outdated
114112
dependencies are found.
115113
- All three tools must be available in ``vendor/bin/``.

docs/commands/metrics.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ Usage
1616
.. code-block:: bash
1717
1818
composer metrics
19-
composer dev-tools metrics -- [options]
19+
composer metrics [options]
2020
vendor/bin/dev-tools metrics [options]
2121
2222
Options
2323
-------
2424

2525
``--working-dir=<path>``
26-
Composer's inherited working-directory option. Use it when you want to run
27-
the command from another directory without changing your current shell
28-
session.
26+
Composer's inherited working-directory option. Use it when you invoke the
27+
command through Composer and want to analyze another checkout without
28+
changing your current shell session first.
2929

3030
Default: the current working directory.
3131

@@ -59,13 +59,19 @@ Generate an HTML report for manual inspection:
5959

6060
.. code-block:: bash
6161
62-
composer dev-tools metrics -- --target=build/metrics
62+
composer metrics --target=build/metrics
6363
6464
Generate the full metrics artifact set for CI previews:
6565

6666
.. code-block:: bash
6767
68-
vendor/bin/dev-tools metrics --target=build/metrics
68+
composer metrics --target=build/metrics
69+
70+
Analyze another checkout through Composer's inherited working directory:
71+
72+
.. code-block:: bash
73+
74+
composer --working-dir=packages/example metrics
6975
7076
Behavior
7177
--------

docs/commands/reports.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ Generates the frontpage for Fast Forward documentation.
66
Description
77
-----------
88

9-
The ``reports`` command generates the documentation frontpage and runs tests with
10-
coverage. It combines:
9+
The ``reports`` command generates the documentation frontpage, runs tests with
10+
coverage, and generates code metrics. It combines:
1111

1212
- ``docs --target`` - generates API documentation
1313
- ``tests --coverage`` - generates test coverage reports
14-
- optionally ``metrics --target`` - generates PhpMetrics HTML and JSON reports
14+
- ``metrics --target`` - generates PhpMetrics HTML and JSON reports
1515

16-
These are run in parallel for efficiency.
16+
The documentation build runs in parallel with PHPUnit, and the metrics step
17+
runs after PHPUnit so it can reuse the generated JUnit report.
1718

1819
Usage
1920
-----
@@ -36,8 +37,8 @@ Options
3637
Default: ``public/coverage``.
3738

3839
``--metrics`` (optional)
39-
Generate the metrics HTML report. When passed without a value, the report is
40-
generated in ``public/metrics``.
40+
The target directory for the generated metrics report.
41+
Default: ``public/metrics``.
4142

4243
Examples
4344
--------
@@ -54,11 +55,10 @@ Generate to custom directories:
5455
5556
composer reports --target=build --coverage=build/coverage
5657
57-
Generate reports including metrics:
58+
Generate reports with a custom metrics directory:
5859

5960
.. code-block:: bash
6061
61-
composer reports --metrics
6262
composer reports --metrics=build/metrics
6363
6464
Exit Codes
@@ -70,16 +70,17 @@ Exit Codes
7070
* - Code
7171
- Meaning
7272
* - 0
73-
- Success. Both docs and coverage generated.
73+
- Success. Documentation, coverage, and metrics generated successfully.
7474
* - 1
75-
- Failure. One or both commands failed.
75+
- Failure. One or more report stages failed.
7676

7777
Behavior
7878
---------
7979

80-
- Runs ``docs`` and ``tests --coverage`` in parallel.
81-
- Runs ``metrics --target`` after tests when ``--metrics`` is enabled.
80+
- Runs ``docs`` in parallel with ``tests --coverage``.
81+
- Runs ``metrics --target`` after tests so the JUnit report is available.
8282
- Runs tests with ``--no-progress`` and ``--coverage-summary`` so report builds
8383
keep PHPUnit output concise.
84+
- Passes ``--junit <coverage>/junit.xml`` to the metrics step.
8485
- Used by the ``standards`` command as the final phase.
8586
- This is the reporting stage used by GitHub Pages.

docs/links/dependencies.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Runtime and Composer Integration
1414
- Why it matters
1515
* - ``composer/composer`` and ``composer-plugin-api``
1616
- Provide the Composer plugin API, command integration, and script hooks.
17-
* - ``phpro/grumphp``
18-
- Supplies the default GrumPHP configuration referenced by
17+
* - ``phpro/grumphp-shim``
18+
- Supplies the default GrumPHP executable and configuration referenced by
1919
``dev-tools:sync``.
2020

2121
QA and Refactoring
@@ -36,6 +36,13 @@ QA and Refactoring
3636
- Extends the default Rector configuration with shared rules.
3737
* - ``friendsofphp/php-cs-fixer``
3838
- Powers the PHPDoc fixer phase.
39+
* - ``icanhazstring/composer-unused``
40+
- Reports unused Composer dependencies in ``dependencies``.
41+
* - ``shipmonk/composer-dependency-analyser``
42+
- Reports missing Composer dependencies in ``dependencies``.
43+
* - ``rector/jack``
44+
- Previews or applies dependency version updates and enforces the
45+
outdated dependency threshold.
3946
* - ``thecodingmachine/safe``
4047
- Enables optional Safe migration rules when present.
4148

@@ -53,6 +60,9 @@ Documentation and Reporting
5360
- Generates the Markdown API pages for the wiki.
5461
* - ``fast-forward/phpdoc-bootstrap-template``
5562
- Provides the default HTML theme used by ``docs``.
63+
* - ``phpmetrics/phpmetrics``
64+
- Generates the metrics site and JSON artifacts used by ``metrics`` and
65+
``reports``.
5666
* - ``esi/phpunit-coverage-check``
5767
- Enforces the minimum coverage threshold in the reusable test workflow.
5868

@@ -66,6 +76,12 @@ Testing and Local Developer Experience
6676
- Why it matters
6777
* - ``phpunit/phpunit``
6878
- Runs the test suite.
79+
* - ``phpunit/php-code-coverage``
80+
- Provides the coverage exporters consumed by ``tests`` and ``reports``.
81+
* - ``php-parallel-lint/php-parallel-lint``
82+
- Supports linting and validation in the packaged development workflow.
83+
* - ``phpspec/prophecy``
84+
- Provides Prophecy doubles used throughout the packaged test suite.
6985
* - ``phpspec/prophecy-phpunit``
7086
- Supports the repository's Prophecy-based test doubles.
7187
* - ``dg/bypass-finals``

0 commit comments

Comments
 (0)