jerone / UserScripts

🐵 My UserScripts
https://github.com/jerone/UserScripts#readme
GNU General Public License v3.0
339 stars 39 forks source link

Added support for Packagist with Composer (fixes #89) #90

Closed jerone closed 8 years ago

jerone commented 8 years ago

Added support for Packagist with Composer (fixes #89).

/cc @rugk Time to test ?

rugk commented 8 years ago

Here I can see ext-libsodium linked. However AFAIK ext-... actually is PHP module which cannot be found on Packagist. The same of course applies to "php" - but this is not linked anyway currently - which is good. Here it is linked quite well. However here and here it does not link at all.

Generally this PR also does not pay attention on other package linkers like require-dev, conflict, replace, provide (although I do not know whether linking would be useful here) and suggest. This file is a good example with many such packages.

Also note that the composer.json does not have to be at the root of a project.

FYI Packagist != Composer - you can also use composer with other sites, but most people use Packagist.

jerone commented 8 years ago

Thanks for testing!

Here I can see ext-libsodium linked. However AFAIK ext-... actually is PHP module which cannot be found on Packagist.

How do you want me to resolve this?

"php" - but this is not linked anyway currently

Yeah I noticed that PHP wasn't a package and is probably used as engine.

However here and here it does not link at all.

Linking does work for me...

Generally this PR also does not pay attention on other package linkers like require-dev, conflict, replace, provide and suggest.

I can add those. Those don't seem to conflict with the already supported json package types. So I can add?:

Also note that the composer.json does not have to be at the root of a project.

The script runs on every page load where the url ends with composer.json.

FYI Packagist != Composer

What do you mean by this?


Remember that I never have used Composer or Packagist and I'm pretty sure I never will (am a C# developer). I'm all for adding simple support for other dependency package type, but you have to provide the information needed.

rugk commented 8 years ago

@jerone commented on 9. Dez. 2015, 20:58 MEZ:

Here I can see ext-libsodium linked. However AFAIK ext-... actually is PHP module which cannot be found on Packagist.

How do you want me to resolve this?

Possibly exclude all packages starting with ext-.

"php" - but this is not linked anyway currently

Yeah I noticed that PHP wasn't a package and is probably used as engine.

Yeah... and now I also found a list of these "special cases": https://getcomposer.org/doc/02-libraries.md#platform-packages So this are the packages you may want to exclude.

However here and here it does not link at all.

Linking does work for me...

Correct. Just tested it again and it works.

Generally this PR also does not pay attention on other package linkers like require-dev, conflict, replace, provide and suggest.

I can add those. Those don't seem to conflict with the already supported json package types. So I can add?:

  • require-dev
  • conflict
  • replace
  • provide
  • suggest

Yes, looks good.

Also note that the composer.json does not have to be at the root of a project.

The script runs on every page load where the url ends with composer.json.

FYI Packagist != Composer

What do you mean by this?

Packagist <> Composer I just visualized the difference between Packagist and Composer. :wink: (see my link above)

Remember that I never have used Composer or Packagist and I'm pretty sure I never will (am a C# developer). I'm all for adding simple support for other dependency package type, but you have to provide the information needed.

I'll do what I can. But there are pretty much PHP developers outside there, which also use composer... :smiley: And I think the docs of Composer already help a lot.

rugk commented 8 years ago

Any news on this?

jerone commented 8 years ago

Sorry @rugk, I've got no real interest to update this PR. If you still want this feature you can fork this PR, send me a completed PR and I'll consider it again.