kessler / license-report

create a short report about a project's dependencies (license, url etc)
MIT License
226 stars 39 forks source link

Recursion? #49

Closed pluma closed 2 years ago

pluma commented 3 years ago

It would be neat if packages were checked recursively (with dependencies of dependencies acting as if --only prod was enabled because their devDependencies are irrelevant).

BePo65 commented 3 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?

mistic100 commented 2 years ago

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.

BePo65 commented 2 years ago

I have to think about a possible implementation - not sure that it can be done without some major refactoring. Give me some time.

mistic100 commented 2 years ago

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 :-)

pluma commented 2 years ago

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.

k-funk commented 2 years ago

+1

BePo65 commented 2 years ago

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).

BePo65 commented 2 years ago

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.

BePo65 commented 2 years ago

I made a first version of such a wrapper application named license-report-recursive.

Is this what would be needed?