mjeanroy / rollup-plugin-license

Rollup plugin to add license banner to the final bundle and output third party licenses
MIT License
111 stars 21 forks source link

Allow adding the license for the package itself into the thirdParty output #1685

Closed mitar closed 5 months ago

mitar commented 7 months ago

I suggest that the package.json of the main package is read as well and added to the top of the thirdParty output (in that case though thirdParty is badly named, but I think it is still OK). Maybe an option includeSelf: true.

The reason for this is that if I make a web app which I license under some license which requires attribution (e.g., MIT) and then deploy that app. The deployed app has to satisfy the license as well for the main code and not just dependencies. So for the main code the requirement is attribution. So it should also be inside the file with all attributions/notices.

It makes even more sense if I imagine somebody else taking my open source web app and deploying it. Deployed app should include the source code license of the whole web app as that somebody is distributing the app.

mjeanroy commented 5 months ago

Hi, I just released version 3.4.0 including the includeSelf option (as you suggested!), thanks again for the report :)

mitar commented 5 months ago

Awesome! Thank you!

mitar commented 4 months ago

I do not see 3.4.0 on NPM? https://www.npmjs.com/package/rollup-plugin-license

mjeanroy commented 4 months ago

Oups, good catch @mitar, I forgot to publish, I just did it :)

mitar commented 4 months ago

Thanks! I tested it now and I noticed one small issue. I have to set both includeSelf and includePrivate to include a private self package. I think includeSelf should have precedence and allow me to include self no matter if private or not. So that I can then use includePrivate to include private dependencies (or not).

mjeanroy commented 3 months ago

Hi @mitar, Sorry for the delay, I just published version 3.4.1 with the fix!

mitar commented 3 months ago

Thanks!