mwittig / npm-license-crawler

Analyzes license information for multiple node.js modules (package.json files) as part of your software project.
BSD 3-Clause "New" or "Revised" License
234 stars 45 forks source link

License URL issues in submodule packages #32

Open bnash2501 opened 5 years ago

bnash2501 commented 5 years ago

We've recently started using npm-license-crawler to generate our dependency list so our React Native app can have a license list that can link to the license files directly.

There are two issues with the generated license URLs that we have found in regards to submodules, in some cases.

For example, AppCenter-SDK-React-Native has several child packages that we use. The main repository uses LICENSE while the submodules use LICENSE.MD. Would it be possible for submodules to refer to the actual submodule license file instead of using the parent url? Or even possibly, check that the URL to the generated license file is even valid?

I've additionally opened an issue with AppCenter Issues to fix their file extension mismatches, but was hoping this was an edge case that could also be accounted for here as well.

mwittig commented 5 years ago

Hi, Thanks for using npm-license-crawler and your report. I'll will look into this asap.

bnash2501 commented 5 years ago

Thanks so much!

mwittig commented 5 years ago

Hi. I have briefly investigated the case. Generally, if a sub-module uses a LICENSE.MD file this discovered and the license URL is output accordingly. However, in the example "AppCenter-SDK-React-Native" the problem is that the submodule package.json contains the "repository.url" property of the top-level repository. As the URL is constructed using the Repository URL plus the filename this leads to a wrong URL path in the given case. Even though it is a edge case in my opinion I would like to find a solution for it.

bnash2501 commented 5 years ago

Cool, thanks for spending time looking into it. AppCenter maintainers have said they will be fixing the name mismatches.