Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Older NPM repositorys may have used objects when defining licences. #87

Closed
richgerdes opened this issue Jun 19, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@richgerdes
Copy link

An over version of the NPM package spec defined that packages could use object notation to define licenses. The npm specification included support for defining custom licenses using a object, containing structure similar to:

{ "license" :
  { "type" : "ISC"
  , "url" : "https://opensource.org/licenses/ISC"
  }
}

The specification notes that this format, is no longer supported, but some npm/bower packages have not been updated and still use this format. Composer does not support this format for licenses. Thus, the existence of packages with this license format, can cause issues with satis instances which mirror asset packaging dependencies, or php libraries that otherwise parse the composer package definitions following specifications.

In particular, I ran into this issue when including a packages that had tv4 and debuglog as dependencies. Both of these packages have version which include the outdated license spec, and as a result, cause the satis instance to fail when processing the default package.html.twig template.

In package.html.twig line 48:
An exception has been thrown during the rendering of a template ("Array to string conversion").

Since Asset packagist is doing the conversion between npm/bower and composer package formats, it should be handling the conversion and formatting of the license format. Since the old format required urls in for the licence object, the url should be kept and and other metadata should be dropped. If the format doesn't contain a url, the name can be kept as a stand in, otherwise, it should be dropped all together.

@hiqsol
Copy link
Member

hiqsol commented Jul 5, 2018

Fixed in composer-asset-plugin.

@hiqsol hiqsol closed this as completed Jul 5, 2018
@richgerdes
Copy link
Author

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants