Skip to content

Commit 25adbba

Browse files
committed
Turbopack: add sharp 0.34 to NFT test
1 parent e074653 commit 25adbba

File tree

4 files changed

+309
-31
lines changed

4 files changed

+309
-31
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ 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"))]
161167
#[cfg_attr(
162168
target_os = "windows",
163169
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()

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@
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+
"sharp": "^0.34.0",
105106
"shiki": "^0.14.5",
106107
"socket.io": "^2.4.0",
107108
"socket.io-client": "^2.2.0",

0 commit comments

Comments
 (0)