[ComposerScriptsConfigurator] Auto-wire @auto-scripts into post-install-cmd and post-update-cmd#1089
Draft
wachterjohannes wants to merge 1 commit into
Draft
Conversation
…tall-cmd and post-update-cmd
This was referenced May 3, 2026
Author
|
Cross-references for the 4-PR plan in symfony/ai#1994:
|
This was referenced May 3, 2026
chr-hertel
added a commit
to symfony/ai
that referenced
this pull request
May 4, 2026
… command (wachterjohannes) This PR was merged into the main branch. Discussion ---------- [Mate] Add `--ignore-missing-file` option to `discover` command | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Docs? | no | Issues | Fix #1994 (partial) | License | MIT Adds an `--ignore-missing-file` option to `mate discover` that exits `0` as a no-op when `mate/extensions.php` does not exist. Required so the upcoming `symfony/ai-mate` Symfony Flex recipe can invoke `mate discover` unconditionally from Composer scripts. ## Cross-repo PRs | # | Repo | PR | What | Status | |---|---|---|---|---| | 1 | symfony/ai | [#2027](#2027) | `mate discover --ignore-missing-file` | **this PR** | | 2 | symfony/ai | [#2026](#2026) | Drop `symfony/ai-mate-composer-plugin` from `symfony/ai-mate`'s require list (depends on #2027) | draft | | 3 | symfony/flex | [symfony/flex#1089](symfony/flex#1089) | Auto-wire ``@auto`-scripts` into `post-install-cmd` / `post-update-cmd` | draft | | 4 | symfony/recipes | [symfony/recipes#1535](symfony/recipes#1535) | The `symfony/ai-mate` recipe | draft | | 5 | symfony/ai | _follow-up_ | Delete the composer plugin source | not started | ## Summary - Adds `--ignore-missing-file` option to `mate discover`: exits `0` when `mate/extensions.php` does not exist. ## Usage The Flex recipe (symfony/recipes#1535) wires `vendor/bin/mate discover --composer --ignore-missing-file` into ``@auto`-scripts`, so it runs unconditionally on every `composer install` / `composer update` — including the first one, before `mate init` has been executed. Commits ------- 439cabe [Mate] Add --ignore-missing-file option to discover command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a recipe declares
composer-scripts, Flex now also ensures@auto-scriptsis wired intoscripts.post-install-cmdandscripts.post-update-cmdin the user'scomposer.json. Restores parity with composer plugins for non-skeleton projects, where these hooks aren't pre-configured.Cross-repo PRs
mate discover --ignore-missing-filesymfony/ai-mate-composer-pluginfromsymfony/ai-mate's require list (depends on symfony/ai#2027)@auto-scriptsintopost-install-cmd/post-update-cmdsymfony/ai-materecipeSummary
ComposerScriptsConfigurator::configure()now, in addition to merging intoscripts.auto-scripts, ensures@auto-scriptsis present in bothpost-install-cmdandpost-update-cmd:["@auto-scripts"].@auto-scripts→ appended.@auto-scripts→ no-op (idempotent).unconfigure()is intentionally untouched — the wiring stays even when the package is uninstalled, because other recipes may depend on it.Usage
Recipes can now declare
composer-scriptsand rely on the script running automatically in any project — including plain PHP projects without the Symfony skeleton's pre-wired hooks.