Skip to content

Commit

Permalink
Patch pdfjs-dist to allow unit tests to run
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed May 29, 2024
1 parent f527816 commit 6058e60
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .yarn/patches/pdfjs-dist-npm-4.3.136-35a0e70ced.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/build/pdf.mjs b/build/pdf.mjs
index 003035596c3797888692cafd43f9466f96607d55..e69bc909492626f188ccff66b24a8d586fd96a30 100644
--- a/build/pdf.mjs
+++ b/build/pdf.mjs
@@ -5303,8 +5303,9 @@ if (isNodeJS) {
const fs = await import( /*webpackIgnore: true*/"fs"),
http = await import( /*webpackIgnore: true*/"http"),
https = await import( /*webpackIgnore: true*/"https"),
- url = await import( /*webpackIgnore: true*/"url");
- let canvas, path2d;
+ url = await import( /*webpackIgnore: true*/"url"),
+ canvas = await import( /*webpackIgnore: true*/"canvas");
+ let path2d;
return new Map(Object.entries({
fs,
http,
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"prettier": "^3.2.0"
},
"resolutions": {
"eslint-plugin-import": "npm:eslint-plugin-i@^2.28.0"
"eslint-plugin-import": "npm:eslint-plugin-i@^2.28.0",
"pdfjs-dist": "patch:pdfjs-dist@npm:4.3.136#.yarn/patches/pdfjs-dist-npm-4.3.136-35a0e70ced.patch"
},
"packageManager": "[email protected]"
}
15 changes: 15 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4312,6 +4312,21 @@ __metadata:
languageName: node
linkType: hard

"pdfjs-dist@patch:pdfjs-dist@npm:4.3.136#.yarn/patches/pdfjs-dist-npm-4.3.136-35a0e70ced.patch::locator=react-pdf-monorepo%40workspace%3A.":
version: 4.3.136
resolution: "pdfjs-dist@patch:pdfjs-dist@npm%3A4.3.136#.yarn/patches/pdfjs-dist-npm-4.3.136-35a0e70ced.patch::version=4.3.136&hash=d78cd3&locator=react-pdf-monorepo%40workspace%3A."
dependencies:
canvas: "npm:^2.11.2"
path2d: "npm:^0.2.0"
dependenciesMeta:
canvas:
optional: true
path2d:
optional: true
checksum: 10c0/df1b908fa225e5b5a58382b43d0e5462d0de9dc8a7a396f354236b44892cc648c13e1cc90c5e34c1177801c9eb5a6e794dbc67f1a3185b224a4f0846cf20c8de
languageName: node
linkType: hard

"picocolors@npm:^1.0.0":
version: 1.0.0
resolution: "picocolors@npm:1.0.0"
Expand Down

0 comments on commit 6058e60

Please sign in to comment.