Skip to content

Add Javascript licence information automatically #5297

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

Conversation

syeopite
Copy link
Member

@syeopite syeopite commented May 11, 2025

This commit automates the process of documenting the licenses of Invidious Javascript files through a compile time macro in the licenses.ecr template file.

The script it calls is much smaller and does not depend on external IO so Invidious' compile-time is not impacted significantly.

This should hopefully help keep the licence documentation up-to-date and allow extensions like LibreJS to always be able to load the latest Javascript files of Invidious.

Currently only Invidious's first-party Javascript files are supported. In the future it should be possible to leverage videojs-dependencies.yml to automatically document the Javascript licenses for VideoJS and co. as well.

This should be merged after #5292

Screenshot of Invidious' /licenses page with this PR

This commit automates the process of documenting the licenses of
Invidious Javascript files through a compile time macro in the
licenses.ecr template file.

This should hopefully help keep the license documentation up-to-date
and allow extensions like LibreJS to always be able to load the latest
Javascript files of Invidious.

Currently only Invidious's first-party Javascript files are supported.
In the future it should be possible to leverage videojs-dependencies.yml
to automatically document the Javascript licenses for
VideoJS and co. as well.
@syeopite syeopite requested a review from a team as a code owner May 11, 2025 01:51
@syeopite syeopite requested review from SamantazFox and removed request for a team May 11, 2025 01:51
Copy link
Member

@Fijxu Fijxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking about this after submitting my PR.

Copy link
Contributor

@alexmaras alexmaras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works in its current form, but the quoting around each <tr> block isn't really necessary. The suggestions here just make it so that you don't have to do that quote-wrapping, and so don't need to escape the quotes inside the here doc.

@syeopite
Copy link
Member Author

Unfortunately this approach will break the string interpolation needed for displaying the translated "source" string at runtime

@alexmaras
Copy link
Contributor

Ah, well caught. That's a pity.

Copy link
Contributor

@alexmaras alexmaras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All working correctly on my local

@syeopite syeopite added the ready label May 15, 2025
@syeopite syeopite merged commit 475bf74 into iv-org:master May 18, 2025
7 of 8 checks passed
@syeopite syeopite deleted the document-first-party-js-licenses-automatically branch May 18, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants