hiqdev / asset-packagist

Asset Packagist
https://asset-packagist.org
BSD 3-Clause "New" or "Revised" License
247 stars 24 forks source link

Provide separate URLs for bower and npm assets #67

Closed schmunk42 closed 4 years ago

schmunk42 commented 6 years ago

Could you provide separate URLs for bower and npm assets?

The background is that, while composer and bower work in a similar way concerning flat-installation of dependencies, npm works completely different. See details

This might (will) lead to other solutions regarding management of npm packages, ie. https://github.com/foxypkg/foxy/issues/8 - while using asset-packagist for bower still is a very practical solution.

By having separate URLs developers could choose freely which service they use for which packages.

hiqsol commented 6 years ago

You propose to make something like bower-packagist.org and npm-packagist.org ? Did I get you correctly? It is possible of course. But I didn't get any profit for anybody. Could you please clarify?

schmunk42 commented 6 years ago

Don't need to be separate domains, URLs would be fine:

https://asset-packagist.org/bower
https://asset-packagist.org/npm

As outlined in the linked foxy issue, there's a way to convert requirements like npm-asset into native package.json entries, while still keeping the existing syntax (and ability to use ap) in composer.json. This won't be supported for bower.

I'd like to have the option to use asset-packagist for bower, but not for npm.

hiqsol commented 6 years ago

Ok, now I see. Good idea. Need time to investigate it more.

hiqsol commented 6 years ago

It's only necessary to return only bower packages on bower url. Or more?

francoispluchino commented 6 years ago

@schmunk42 Good idea! In this case, I can add automatically the asset-packagist repository in Composer with the Composer Asset Plugin Legacy. If @hiqsol accepts.

francoispluchino commented 6 years ago

@hiqsol In connection with my comment on the problem to create a bridge between CAP/Asset-Packagist and Foxy.

Is it possible for asset-packagist to return a mock for NPM packages, as well as a ZIP archive containing only a package.json file with the minimum information?

hiqsol commented 6 years ago

@francoispluchino Yes, it is possible. But I'm a bit busy right now and can't spend enough time to read all the given links thoroughly, so I feel that I lose enough understanding what do you want to achieve.

How this mock should look? If you are ready to make a PR I'll be glad to help.

francoispluchino commented 6 years ago

A package.json file containing only the name in the ZIP archive. I think it may be generic (like composer-asset-package-mock). This is only for Composer to not throw an exception for NPM packages.

Regarding the resolution of package dependencies, I don't know how your server work, but to make it simple, a Composer package mock must be created for each asset package version required during the resolution (retrieved from the true package.json file, but with empty lists for dependencies and devDependencies sections of the converted package.json file to composer.json file).

Regarding the ZIP archive downloading, return a ZIP archive for any versions of any packages (without checking).

github-actions[bot] commented 4 years ago

Stale issue message

razvanphp commented 5 months ago

Can we reopen this? Seems to be necessary for some improvements in foxy.

schmunk42 commented 5 months ago

Can we reopen this? Seems to be necessary for some improvements in foxy.

@razvanphp How is asset-packagist related to foxy?

razvanphp commented 5 months ago

I don't know, saw those discussions and you mentioning it in the OP 🙂