Skip to content

Commit 4e9757a

Browse files
committed
Turbopack: add sharp 0.34 to NFT test
1 parent 021cb11 commit 4e9757a

File tree

5 files changed

+542
-31
lines changed

5 files changed

+542
-31
lines changed

turbopack/crates/turbopack/tests/node-file-trace.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ static ALLOC: turbo_tasks_malloc::TurboMalloc = turbo_tasks_malloc::TurboMalloc;
158158
#[case::sentry("integration/sentry.js")]
159159
#[case::sequelize("integration/sequelize.js")]
160160
#[case::serialport("integration/serialport.js")]
161+
#[cfg_attr(
162+
target_os = "windows",
163+
should_panic(expected = "Something went wrong installing the \"sharp\" module"),
164+
case::sharp030("integration/sharp030.js")
165+
)]
166+
#[cfg_attr(not(target_os = "windows"), case::sharp030("integration/sharp030.js"))]
167+
#[cfg_attr(
168+
target_os = "windows",
169+
should_panic(expected = "Something went wrong installing the \"sharp\" module"),
170+
case::sharp033("integration/sharp033.js")
171+
)]
172+
#[cfg_attr(not(target_os = "windows"), case::sharp033("integration/sharp033.js"))]
161173
#[cfg_attr(
162174
target_os = "windows",
163175
should_panic(expected = "Something went wrong installing the \"sharp\" module"),
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const sharp = require('sharp030')
2+
const path = require('path')
3+
4+
const roundedCorners = Buffer.from(
5+
'<svg><rect x="0" y="0" width="200" height="200" rx="50" ry="50"/></svg>'
6+
)
7+
8+
sharp(roundedCorners).resize(200, 200).png().toBuffer()
9+
10+
sharp(path.resolve(__dirname, 'fixtures/vercel.svg'))
11+
.resize({ width: 100, height: 100 })
12+
.jpeg()
13+
.toBuffer()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const sharp = require('sharp033')
2+
const path = require('path')
3+
4+
const roundedCorners = Buffer.from(
5+
'<svg><rect x="0" y="0" width="200" height="200" rx="50" ry="50"/></svg>'
6+
)
7+
8+
sharp(roundedCorners).resize(200, 200).png().toBuffer()
9+
10+
sharp(path.resolve(__dirname, 'fixtures/vercel.svg'))
11+
.resize({ width: 100, height: 100 })
12+
.jpeg()
13+
.toBuffer()

turbopack/crates/turbopack/tests/node-file-trace/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@
101101
"semver": "^7.1.1",
102102
"sequelize": "^5.9.3",
103103
"serialport": "^13.0.0",
104-
"sharp": "^0.30.0",
104+
"sharp030": "npm:sharp@^0.30.0",
105+
"sharp033": "npm:sharp@^0.33.0",
106+
"sharp": "^0.34.0",
105107
"shiki": "^0.14.5",
106108
"socket.io": "^2.4.0",
107109
"socket.io-client": "^2.2.0",

0 commit comments

Comments
 (0)