Closed pluma closed 2 years ago
Technically this is not so easy (recursion never is :-) - especially when it comes to output formats. Can you tell us, why you need recursion?
Can you tell us, why you need recursion?
Personally I work on a B2B solution and some clients require to have the license of ALL software used.
I have to think about a possible implementation - not sure that it can be done without some major refactoring. Give me some time.
Don't bother for me. I implemented a custom solution with yarn licenses list --prod --json --no-progress
, I use it to generate a markdown table which is included in my compodoc site.
But surely @pluma will be glad to have a solution :-)
Nevermind me, I'm now using license-checker
and a script that allows me to patch missing license files and compile the list into a JSON file I can present in the frontend.
To be clear about the need for this: while most license holders are very forgiving about the interpretation of their licenses, it's a good idea to preemptively provide a list of all licenses of bundled code for some applications. Mobile apps frequently hide this somewhere in their settings view but web apps usually just forego this. I prefer erring on the side of caution.
+1
I did not forget this issue. As this probably would be a major modification, I did not yet find the time to care about the details.
I am thinking about some kind of "add-on" (like my license-downloader).
To keep license-report focused I am working on a wrapper around license-report.
Generating a flat list of all dependencies should not be too much of a problem. This way we can keep all the output options.
But do we need a tree format? and how should this look like?
Any ideas appreciated.
I made a first version of such a wrapper application named license-report-recursive.
Is this what would be needed?
It would be neat if packages were checked recursively (with dependencies of dependencies acting as if
--only prod
was enabled because theirdevDependencies
are irrelevant).