Skip to content

Add links to repo to show/outdated commands package lists#10430

Merged
Seldaek merged 2 commits into
composer:mainfrom
Seldaek:add_links
Jan 5, 2022
Merged

Add links to repo to show/outdated commands package lists#10430
Seldaek merged 2 commits into
composer:mainfrom
Seldaek:add_links

Conversation

@Seldaek

@Seldaek Seldaek commented Jan 4, 2022

Copy link
Copy Markdown
Member

fixes #9367

image

If someone thinks of another good use case for this, do tell.

@ThomasLandauer

Copy link
Copy Markdown
Contributor

The general problem here is that there are two "standards" on how to display links in a console:

  1. Old-fashioned: Display the URL verbatim: https://github.com/symfony/..., and then rely on the terminal's auto-detection to make it clickable. This is (as far as I know) supported by every terminal.
  2. Fancy (i.e. HTML-like): Add some special characters to allow displaying a different link text. This is supported by some terminals: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

I don't know how the adoption of (2) will progress. But for Konsole (=default in KDE) it doesn't look too good: https://bugs.kde.org/show_bug.cgi?id=379294
And (frankly) I'm also not sure if it's a good idea at all...

What I originally had in mind in #9367 was to display the link instead of the description:

symfony/polyfill-ctype   v1.23.0   https://github.com/symfony/...

Or maybe introduce some configuration to let the user decide?

@Seldaek

Seldaek commented Jan 4, 2022

Copy link
Copy Markdown
Member Author

Yes to me the critical links that need to be seen need to be of the first type as even the dumbest terminal will let you copy paste the url. Here though it's kinda nice to have functionality and I feel like this approach lets us pack more info and functionality in the same amount of text/output which is good.

Letting the user decide is always an option but it also adds complexity across the board (in code, docs, cognitive for users,..) so in this case I don't particularly feel it's justified as one can also easily get the info somewhere else if needed.

@staabm

staabm commented Jan 5, 2022

Copy link
Copy Markdown
Contributor

Looking at it, it might be usefull to have the version number link to packagist

@Seldaek

Seldaek commented Jan 5, 2022

Copy link
Copy Markdown
Member Author

@staabm that's unfortunately quite messy to do as we don't have a direct link to packagist available there.

I have now added more links in various other commands though.

@Seldaek

Seldaek commented Jan 5, 2022

Copy link
Copy Markdown
Member Author

Think I am going to merge as is, sorry @ThomasLandauer if this doesn't quite match what you had in mind, but note that you can use --format=json output to get to the URLs otherwise. Combined with jq this should kinda easily let you script this yourself.

@Seldaek Seldaek merged commit b96c419 into composer:main Jan 5, 2022
@Seldaek Seldaek deleted the add_links branch January 5, 2022 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: Display package's "homepage" instead of "description" in composer show list

3 participants