8000 Feature request: integrate custom, complete Symfony Console scripts · Issue #11134 · composer/composer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Feature request: integrate custom, complete Symfony Console scripts #11134
Closed
@igorsantos07

Description

@igorsantos07

It's possible to include simple CLI scripts into Composer's scripts/scripts-descriptions list.
It's also possible to point static methods/functions to run as complex-ish scripts.
Lastly, under the hood, Composer uses the (great) Symfony Console library.

Thus, is there any chance it's possible to include complete Symfony Console scripts into the main list of scripts a project uses, without having to duplicate command names and descriptions into composer.json?

I see it's possible to include custom commands from plugins, but what about doing that directly from the main project? It's an overshoot to create a whole plugin to include commands to manage a single project (but it still looks better than the current flow of having a separate executable for that lol).

What I'm thinking is something like a scripts-folder config entry which will import all classes found under it into the project's composer executable, much like scripts does with CLI commands. The end result is being able to seamlessly see our (complex) custom scripts when running composer list, including the description and help content configured in a subclass of \Symfony\Component\Console\Command\Command.

Example:
I'm writing some i18n scripts to extract/upload/download translations, and that's best done from a CLI tool such as Symfony Console, which allows for processing of arguments, options, and console I/O. In the meantime, we already have a bunch of one-liners as Composer scripts (such as clear DB cache, compile frontend, migrations work) which work great being defined directly in composer.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0