Skip to content

Commit dedd37f

Browse files
authored
chore(gatsby-plugin-sharp, gatsby-transformer-sharp): update dependencies (#26259)
1 parent 7975b91 commit dedd37f

File tree

10 files changed

+297
-138
lines changed

10 files changed

+297
-138
lines changed

packages/gatsby-plugin-manifest/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@babel/runtime": "^7.10.3",
1111
"gatsby-core-utils": "^1.3.18",
1212
"semver": "^7.3.2",
13-
"sharp": "^0.25.1"
13+
"sharp": "^0.25.4"
1414
},
1515
"devDependencies": {
1616
"@babel/cli": "^7.10.3",

packages/gatsby-plugin-sharp/package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
},
99
"dependencies": {
1010
"@babel/runtime": "^7.10.3",
11-
"async": "^2.6.3",
11+
"async": "^3.2.0",
1212
"bluebird": "^3.7.2",
13-
"fs-extra": "^8.1.0",
13+
"fs-extra": "^9.0.1",
1414
"gatsby-core-utils": "^1.3.18",
15-
"got": "^8.3.2",
16-
"imagemin": "^6.1.0",
17-
"imagemin-mozjpeg": "^8.0.0",
18-
"imagemin-pngquant": "^6.0.1",
19-
"lodash": "^4.17.15",
15+
"got": "^10.7.0",
16+
"imagemin": "^7.0.1",
17+
"imagemin-mozjpeg": "^9.0.0",
18+
"imagemin-pngquant": "^9.0.0",
19+
"lodash": "^4.17.19",
2020
"mini-svg-data-uri": "^1.2.3",
2121
"potrace": "^2.1.8",
22-
"probe-image-size": "^4.1.1",
22+
"probe-image-size": "^5.0.0",
2323
"progress": "^2.0.3",
2424
"semver": "^7.3.2",
25-
"sharp": "^0.25.1",
25+
"sharp": "^0.25.4",
2626
"svgo": "1.3.2",
2727
"uuid": "^8.3.0"
2828
},

packages/gatsby-plugin-sharp/src/__tests__/scheduler.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ describe(`scheduler`, () => {
170170
expect(got.post).toHaveBeenCalledWith(
171171
process.env.GATSBY_CLOUD_IMAGE_SERVICE_URL,
172172
{
173-
body: {
173+
json: {
174174
file: job.inputPaths[0],
175175
hash: expect.any(String),
176176
transforms: job.args.operations,
177177
options: job.args.pluginOptions,
178178
},
179-
json: true,
179+
responseType: `json`,
180180
}
181181
)
182182
})

packages/gatsby-plugin-sharp/src/process-file.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ const compressPng = (pipeline, outputPath, options) =>
194194
.buffer(sharpBuffer, {
195195
plugins: [
196196
imageminPngquant({
197-
quality: `${options.pngQuality || options.quality}-${Math.min(
198-
(options.pngQuality || options.quality) + 25,
199-
100
200-
)}`, // e.g. 40-65
197+
quality: [
198+
(options.pngQuality || options.quality) / 100,
199+
Math.min(((options.pngQuality || options.quality) + 25) / 100, 1),
200+
], // e.g. [0.4, 0.65]
201201
speed: options.pngCompressionSpeed
202202
? options.pngCompressionSpeed
203203
: undefined,

packages/gatsby-plugin-sharp/src/scheduler.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ const scheduleJob = async (job, boundActionCreators, reporter) => {
4747
if (process.env.GATSBY_CLOUD_IMAGE_SERVICE_URL) {
4848
const cloudJob = got
4949
.post(process.env.GATSBY_CLOUD_IMAGE_SERVICE_URL, {
50-
body: {
50+
json: {
5151
file: job.inputPaths[0],
5252
hash: createContentDigest(job),
5353
transforms: job.args.operations,
5454
options: job.args.pluginOptions,
5555
},
56-
json: true,
56+
responseType: `json`,
5757
})
5858
.then(() => {})
5959

packages/gatsby-remark-copy-linked-files/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"is-relative-url": "^3.0.0",
1414
"lodash": "^4.17.15",
1515
"path-is-inside": "^1.0.2",
16-
"probe-image-size": "^4.1.1",
16+
"probe-image-size": "^5.0.0",
1717
"unist-util-visit": "^1.4.1"
1818
},
1919
"devDependencies": {

packages/gatsby-remark-images-contentful/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"is-relative-url": "^3.0.0",
2323
"lodash": "^4.17.15",
2424
"semver": "^7.3.2",
25-
"sharp": "^0.25.1",
25+
"sharp": "^0.25.4",
2626
"unist-util-select": "^1.5.0"
2727
},
2828
"devDependencies": {

packages/gatsby-transformer-sharp/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"dependencies": {
1010
"@babel/runtime": "^7.10.3",
1111
"bluebird": "^3.7.2",
12-
"fs-extra": "^8.1.0",
12+
"fs-extra": "^9.0.1",
1313
"potrace": "^2.1.8",
14-
"probe-image-size": "^4.1.1",
14+
"probe-image-size": "^5.0.0",
1515
"semver": "^7.3.2",
16-
"sharp": "^0.25.1"
16+
"sharp": "^0.25.4"
1717
},
1818
"devDependencies": {
1919
"@babel/cli": "^7.10.3",

packages/gatsby-transformer-sharp/src/customize-schema.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ const {
1717
} = require(`gatsby-plugin-sharp`)
1818

1919
const sharp = require(`./safe-sharp`)
20-
const fs = require(`fs`)
21-
const fsExtra = require(`fs-extra`)
20+
const fs = require(`fs-extra`)
2221
const imageSize = require(`probe-image-size`)
2322
const path = require(`path`)
2423

@@ -434,14 +433,11 @@ const createFields = ({
434433
imageName
435434
)
436435

437-
if (
438-
!fsExtra.existsSync(publicPath) &&
439-
!inProgressCopy.has(publicPath)
440-
) {
436+
if (!fs.existsSync(publicPath) && !inProgressCopy.has(publicPath)) {
441437
// keep track of in progress copy, we should rely on `existsSync` but
442438
// a race condition exists between the exists check and the copy
443439
inProgressCopy.add(publicPath)
444-
fsExtra.copy(details.absolutePath, publicPath, err => {
440+
fs.copy(details.absolutePath, publicPath, err => {
445441
// this is no longer in progress
446442
inProgressCopy.delete(publicPath)
447443
if (err) {

0 commit comments

Comments
 (0)