[stable30] Get PDF.js version from "package-lock.json"#1161
Merged
Conversation
The "pdfjs-get.js" script downloads and unpacks "pdfjs-dist" in "js/pdfjs" so it can be loaded from the PDF viewer. However, the PDF.js version to download was got from "package.json", which just specifies the desired ranges of versions to use, but not the exact versions actually being built. Due to that it could happen, for example after running "npm audit fix", that "pdfjs-get.js" downloaded version X.Y, as it was the minimum desired version specified in "package.json", but the dependencies were resolved and built against version X.Z, as it was the actual version specified in "package-lock.json". To solve that now the PDF.js version is got from "package-lock.json" instead, which provides the exact version to use. Note, however, that this is just a "safety net" to avoid unexpected mismatches as a result of running "npm audit fix" or similar; in general the PDF.js version is expected to be in sync between "package.json" and "package-lock.json". Signed-off-by: Daniel Calviño Sánchez <[email protected]>
szaimen
approved these changes
Feb 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of PR #1159