Improve JanePHP recipes first-run experience (#2033)

* Improve JanePHP recipes first-run experience

Recipes pointed the generator configs to specification files they never
created, hid all generator output behind a NullOutput (so failures showed
up as raw PHP fatals and successes printed nothing) and always exited 0,
even when generation failed.

- document every config key and the spec file prerequisite in
  config/jane/*.php
- render generator output, format thrown errors and propagate exit codes
  in the recipe bin scripts
- reorder post-install steps: placing the specification file now comes
  before running the generator
- explain when/how to uncomment the generated normalizer service in
  config/packages/jane.yaml

Refs: https://github.com/janephp/janephp/issues/860

* Point recipes to the current documentation website

jane.readthedocs.io is outdated, jane.jolicode.com/latest/ is the
current documentation home.

* Re-trigger QA after adding the license header to the PR description
This commit is contained in:
Baptiste Leduc
2026-08-25 11:38:39 +02:00
committed by GitHub
parent f736facf8f
commit 7101db71f0
16 changed files with 132 additions and 30 deletions
@@ -4,13 +4,21 @@
require __DIR__ . '/../vendor/autoload.php';
use Jane\OpenApiCommon\Console\Command\GenerateCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use Jane\OpenApiCommon\Console\Loader\ConfigLoader;
use Jane\OpenApiCommon\Console\Loader\OpenApiMatcher;
use Jane\OpenApiCommon\Console\Loader\SchemaLoader;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
$command = new GenerateCommand(new ConfigLoader(), new SchemaLoader(), new OpenApiMatcher());
$inputArray = new ArrayInput(['--config-file' => __DIR__ . '/../config/jane/open_api.php'], $command->getDefinition());
$output = new ConsoleOutput();
$command->execute($inputArray, new NullOutput());
try {
exit($command->execute($inputArray, $output));
} catch (\Throwable $throwable) {
(new Application())->renderThrowable($throwable, $output->getErrorOutput());
exit(1);
}