• composer: dependences and dependents

    From SupaPlex@21:1/5 to All on Wed Jun 22 11:08:19 2022
    $ cat .composer/config.json
    {
    "repositories": {
    "a": {
    "type": "path",
    "url": "repo/a"
    },
    "b": {
    "type": "path",
    "url": "repo/b"
    },
    "c": {
    "type": "path",
    "url": "repo/c"
    }
    }
    }
    $ cat repo/a/composer.json
    {
    "name": "my/a",
    "require": {
    "my/b": "dev-master"
    }
    }
    $ cat repo/b/composer.json
    {
    "name": "my/b",
    "require": {
    "my/c": "dev-master"
    }
    }
    $ cat repo/c/composer.json
    {
    "name": "my/c"
    }

    How do you see

    my/a requires my/b
    my/b requires my/c

    But I wanted to know if there is a way to view *quickly* the whole
    structure of dependences.
    Above all, I would like to know the *dependents*.

    I tried like this

    $ COMPOSER_HOME=.composer composer show -a my/b
    No composer.json found in the current directory, showing available
    packages from a, b, c, packagist.org
    name : my/b
    descrip. :
    keywords :
    versions : dev-master
    type : library
    homepage :
    source : []
    dist : [path] repo/b 6de0f9e677dcab7051f94dbbf05893d0165bb826
    names : my/b

    requires
    my/c dev-master

    In summary

    $ COMPOSER_HOME=.composer composer show -a my/b \
    | grep my/
    No composer.json found in the current directory, showing available
    packages from a, b, c, packagist.org
    name : my/b
    names : my/b
    my/c dev-master

    It tell me that

    my/b requires my/c

    but it doesn't tell me that

    my/b is required from my/a (this is the thing that interests me most).

    For example, if I have to remove a package (obsolete package), how can I
    verify that it does not have dependents?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Wed Jun 22 14:33:03 2022
    SupaPlex:

    [...]
    For example, if I have to remove a package (obsolete package), how can I verify that it does not have dependents?

    You can try: composer show --tree




    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SupaPlex@21:1/5 to All on Wed Jun 22 15:12:00 2022
    Il 22/06/22 14:33, Arno Welzel ha scritto:
    SupaPlex:

    [...]
    For example, if I have to remove a package (obsolete package), how can I
    verify that it does not have dependents?

    You can try: composer show --tree





    Composer could not find a composer.json file
    To initialize a project, please create a composer.json file as described
    in the https://getcomposer.org/ "Getting Started" section

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Wed Jun 22 16:07:07 2022
    SupaPlex:

    Il 22/06/22 14:33, Arno Welzel ha scritto:
    SupaPlex:

    [...]
    For example, if I have to remove a package (obsolete package), how can I >>> verify that it does not have dependents?

    You can try: composer show --tree





    Composer could not find a composer.json file
    To initialize a project, please create a composer.json file as described
    in the https://getcomposer.org/ "Getting Started" section

    Why do you try to use Composer outside a folder with composer.json?

    Of course you need to call this inside repo/a, repo/b and repo/c.


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SupaPlex@21:1/5 to All on Wed Jun 22 17:13:19 2022
    Il 22/06/22 16:37, Arno Welzel ha scritto:
    SupaPlex:

    Il 22/06/22 16:07, Arno Welzel ha scritto:
    Why do you try to use Composer outside a folder with composer.json?

    why shouldn't I do it?

    Because composer.json is the file where your dependencies are defined.

    Also see: <https://getcomposer.org/doc/01-basic-usage.md>



    What dependencies should i define?
    The info I want is for packages global level, not for single project (*/composer.json).

    -----BEGIN PGP MESSAGE-----

    hQGMAyHa6HqE1N3qAQv+JiLsavPR603Uiqd2XvBLMV0UIp+6RmdSADu6E+MVIf/H xWGPN68rIfRxVoQptDQRX8nW3EkA7/2agJKLhjbiNs6MuWz9M62pBcGArL1q2p7T tiHqtPpW5nVN87hPZPi/NO6Lb/B6mW0Eytj4PsAL977oUeK1iFaxnMSGCfeBCnH3 yZVI1CoM4e5bSA668avRxMItFeIkY0+uRhPzHcvrT1/MJy/NDdil9sHoJGDj0YC/ 5nwfP8FtkbU31N3xsH/2jW7OtGllN3ef1zNbiCnrNmLfMWEjPKiU451qU8qpC7mZ WQ4xwprnxb2gTs4JxqLNEuWSRIz34K4sDb215edkWdlY3n8xk7kABscyaLv9ZP2w as2n2dgp7o3VAR+skNh8Qp6jDrwpa8MSxhRzOw3QX+Nq3cGtm1TQeTHLvJ3n5Dzi 0xS93r+cUM6iDEtG2gXWoJUKdlmDVyp7fetVN4/6iybN6BdxWtlA7wG6b+Tq494T R9B5fWnwUMQJIFo3rVlj0oEB1N3inMgJmdGriviq27JtTcoAhQq6ElnJ9DwZAmqT j9ffYkhB6DuX4NsFDNg/MU6m+UAqEpySIX2Cm4pIjmEicQGsu1EhupfaA+SFFDA3 kJByFSdczDn/DJwln+iXwdNTOhDs7G11o0NxaLbi6tEL+dlEsolXMAOEmu9s0oiP
    Nsg=
    =hSlH
    -----END PGP MESSAGE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From SupaPlex@21:1/5 to All on Wed Jun 22 16:35:41 2022
    Il 22/06/22 16:07, Arno Welzel ha scritto:
    Why do you try to use Composer outside a folder with composer.json?

    why shouldn't I do it?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Wed Jun 22 16:37:30 2022
    SupaPlex:

    Il 22/06/22 16:07, Arno Welzel ha scritto:
    Why do you try to use Composer outside a folder with composer.json?

    why shouldn't I do it?

    Because composer.json is the file where your dependencies are defined.

    Also see: <https://getcomposer.org/doc/01-basic-usage.md>


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Fri Jun 24 13:31:04 2022
    SupaPlex:

    Il 22/06/22 16:37, Arno Welzel ha scritto:
    SupaPlex:

    Il 22/06/22 16:07, Arno Welzel ha scritto:
    Why do you try to use Composer outside a folder with composer.json?

    why shouldn't I do it?

    Because composer.json is the file where your dependencies are defined.

    Also see: <https://getcomposer.org/doc/01-basic-usage.md>



    What dependencies should i define?
    The info I want is for packages global level, not for single project (*/composer.json).

    There is no "global" level.

    Each composer.json defines the dependencies for that very project. There
    are no "global" dependencies covering multiple projects. If a project
    wants to uses a component, it *must* have a reference for that in composer.json. The specific version used when installing the components
    using "composer install" are then recorded in composer.lock.


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)