netlify-cli 17.3.0 → 17.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/npm-shrinkwrap.json +8 -8
- package/package.json +1 -1
- package/src/lib/images/proxy.mjs +16 -24
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ See the [CLI command line reference](https://cli.netlify.com/commands/) to get s
|
|
|
47
47
|
|
|
48
48
|
## Installation
|
|
49
49
|
|
|
50
|
-
Netlify CLI requires [Node.js](https://nodejs.org) version 14 or above. To install, run the following command from any
|
|
50
|
+
Netlify CLI requires [Node.js](https://nodejs.org) version 18.14.0 or above. To install, run the following command from any
|
|
51
51
|
directory in your terminal:
|
|
52
52
|
|
|
53
53
|
```bash
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "17.3.
|
|
3
|
+
"version": "17.3.2",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "17.3.
|
|
9
|
+
"version": "17.3.2",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
@@ -13307,9 +13307,9 @@
|
|
|
13307
13307
|
}
|
|
13308
13308
|
},
|
|
13309
13309
|
"node_modules/postcss": {
|
|
13310
|
-
"version": "8.4.
|
|
13311
|
-
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.
|
|
13312
|
-
"integrity": "sha512-
|
|
13310
|
+
"version": "8.4.31",
|
|
13311
|
+
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
|
13312
|
+
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
|
|
13313
13313
|
"funding": [
|
|
13314
13314
|
{
|
|
13315
13315
|
"type": "opencollective",
|
|
@@ -25629,9 +25629,9 @@
|
|
|
25629
25629
|
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs="
|
|
25630
25630
|
},
|
|
25631
25631
|
"postcss": {
|
|
25632
|
-
"version": "8.4.
|
|
25633
|
-
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.
|
|
25634
|
-
"integrity": "sha512-
|
|
25632
|
+
"version": "8.4.31",
|
|
25633
|
+
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
|
25634
|
+
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
|
|
25635
25635
|
"requires": {
|
|
25636
25636
|
"nanoid": "^3.3.6",
|
|
25637
25637
|
"picocolors": "^1.0.0",
|
package/package.json
CHANGED
package/src/lib/images/proxy.mjs
CHANGED
|
@@ -59,14 +59,24 @@ export const isImageRequest = function (req) {
|
|
|
59
59
|
|
|
60
60
|
export const transformImageParams = function (query) {
|
|
61
61
|
const params = {}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
|
|
63
|
+
const width = query.w || query.width || null
|
|
64
|
+
const height = query.h || query.height || null
|
|
65
|
+
|
|
66
|
+
if (width && height) {
|
|
67
|
+
// eslint-disable-next-line id-length
|
|
68
|
+
params.s = `${width}x${height}`
|
|
69
|
+
} else {
|
|
70
|
+
// eslint-disable-next-line id-length
|
|
71
|
+
params.w = width
|
|
72
|
+
// eslint-disable-next-line id-length
|
|
73
|
+
params.h = height
|
|
74
|
+
}
|
|
75
|
+
|
|
66
76
|
params.quality = query.q || query.quality || null
|
|
67
77
|
params.format = query.fm || null
|
|
68
|
-
params.fit =
|
|
69
|
-
params.position = query.
|
|
78
|
+
params.fit = query.fit || null
|
|
79
|
+
params.position = query.position || null
|
|
70
80
|
|
|
71
81
|
return Object.entries(params)
|
|
72
82
|
.filter(([, value]) => value !== null)
|
|
@@ -74,24 +84,6 @@ export const transformImageParams = function (query) {
|
|
|
74
84
|
.join(',')
|
|
75
85
|
}
|
|
76
86
|
|
|
77
|
-
function mapImgixToFitIpx(fit, crop) {
|
|
78
|
-
if (crop) {
|
|
79
|
-
return 'cover'
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const fitMapping = {
|
|
83
|
-
// IPX doesn't have exact equivalent.
|
|
84
|
-
clamp: null,
|
|
85
|
-
clip: 'contain',
|
|
86
|
-
crop: 'cover',
|
|
87
|
-
max: 'inside',
|
|
88
|
-
min: 'outside',
|
|
89
|
-
scale: 'fill',
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return fitMapping[fit] ?? 'contain'
|
|
93
|
-
}
|
|
94
|
-
|
|
95
87
|
export const initializeProxy = async function ({ config }) {
|
|
96
88
|
const remoteDomains = await parseRemoteImageDomains({ config })
|
|
97
89
|
|