@depup/serverless 4.33.0-depup.1 → 4.33.2-depup.0
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 +4 -4
- package/binary.js +68 -24
- package/changes.json +6 -6
- package/package.json +10 -12
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/serverless
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [serverless](https://www.npmjs.com/package/serverless) @ 4.33.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [serverless](https://www.npmjs.com/package/serverless) @ 4.33.2 |
|
|
17
|
+
| Processed | 2026-04-01 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
19
|
| Deps updated | 2 |
|
|
20
20
|
|
|
@@ -22,8 +22,8 @@ npm install @depup/serverless
|
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
25
|
+
| rimraf | 5.0.10 | ^6.1.3 |
|
|
26
|
+
| undici | 6.24.1 | ^7.24.6 |
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
package/binary.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const os = require('os')
|
|
2
|
-
const {
|
|
3
|
-
const axios = require('axios')
|
|
2
|
+
const { ProxyAgent } = require('undici')
|
|
4
3
|
|
|
5
|
-
const { existsSync, mkdirSync, rmSync,
|
|
4
|
+
const { existsSync, mkdirSync, rmSync, writeFileSync } = require('fs')
|
|
6
5
|
const { join } = require('path')
|
|
7
6
|
const { spawnSync } = require('child_process')
|
|
8
7
|
|
|
@@ -13,6 +12,55 @@ const error = (msg) => {
|
|
|
13
12
|
process.exit(1)
|
|
14
13
|
}
|
|
15
14
|
|
|
15
|
+
const formatHostName = (hostname) => hostname.replace(/^\.*/, '.').toLowerCase()
|
|
16
|
+
|
|
17
|
+
const parseNoProxyZone = (zone) => {
|
|
18
|
+
zone = zone.trim()
|
|
19
|
+
const zoneParts = zone.split(':', 2)
|
|
20
|
+
const zoneHost = formatHostName(zoneParts[0])
|
|
21
|
+
const zonePort = zoneParts[1]
|
|
22
|
+
const hasPort = zone.indexOf(':') > -1
|
|
23
|
+
return { hostname: zoneHost, port: zonePort, hasPort }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const shouldBypassProxy = (requestURL) => {
|
|
27
|
+
const noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
|
|
28
|
+
if (noProxy === '*') return true
|
|
29
|
+
if (noProxy === '') return false
|
|
30
|
+
|
|
31
|
+
const port =
|
|
32
|
+
requestURL.port || (requestURL.protocol === 'https:' ? '443' : '80')
|
|
33
|
+
const hostname = formatHostName(requestURL.hostname)
|
|
34
|
+
|
|
35
|
+
return noProxy
|
|
36
|
+
.split(',')
|
|
37
|
+
.map(parseNoProxyZone)
|
|
38
|
+
.some((noProxyZone) => {
|
|
39
|
+
const isMatchedAt = hostname.indexOf(noProxyZone.hostname)
|
|
40
|
+
const hostnameMatched =
|
|
41
|
+
isMatchedAt > -1 &&
|
|
42
|
+
isMatchedAt === hostname.length - noProxyZone.hostname.length
|
|
43
|
+
if (noProxyZone.hasPort) {
|
|
44
|
+
return port === noProxyZone.port && hostnameMatched
|
|
45
|
+
}
|
|
46
|
+
return hostnameMatched
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const getProxyUrl = (url) => {
|
|
51
|
+
const requestURL = new URL(url)
|
|
52
|
+
|
|
53
|
+
if (shouldBypassProxy(requestURL)) return null
|
|
54
|
+
|
|
55
|
+
if (requestURL.protocol === 'http:') {
|
|
56
|
+
return process.env.HTTP_PROXY || process.env.http_proxy || null
|
|
57
|
+
}
|
|
58
|
+
if (requestURL.protocol === 'https:') {
|
|
59
|
+
return process.env.HTTPS_PROXY || process.env.https_proxy || null
|
|
60
|
+
}
|
|
61
|
+
return null
|
|
62
|
+
}
|
|
63
|
+
|
|
16
64
|
class Binary {
|
|
17
65
|
constructor(name, url, version, config) {
|
|
18
66
|
const errors = []
|
|
@@ -87,7 +135,7 @@ class Binary {
|
|
|
87
135
|
}
|
|
88
136
|
}
|
|
89
137
|
|
|
90
|
-
install(
|
|
138
|
+
install(suppressLogs = false) {
|
|
91
139
|
if (this.exists()) {
|
|
92
140
|
if (!suppressLogs) {
|
|
93
141
|
console.error(
|
|
@@ -117,19 +165,20 @@ class Binary {
|
|
|
117
165
|
this.removeBinary()
|
|
118
166
|
})
|
|
119
167
|
|
|
120
|
-
|
|
168
|
+
const proxyUrl = getProxyUrl(this.url)
|
|
169
|
+
const fetchOptions = proxyUrl
|
|
170
|
+
? { dispatcher: new ProxyAgent(proxyUrl) }
|
|
171
|
+
: {}
|
|
172
|
+
|
|
173
|
+
return fetch(this.url, fetchOptions)
|
|
121
174
|
.then((res) => {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
reject(err)
|
|
130
|
-
})
|
|
131
|
-
writeStream.on('close', () => resolve())
|
|
132
|
-
})
|
|
175
|
+
if (!res.ok) {
|
|
176
|
+
throw new Error(`HTTP ${res.status}: ${res.statusText}`)
|
|
177
|
+
}
|
|
178
|
+
return res.arrayBuffer()
|
|
179
|
+
})
|
|
180
|
+
.then((buffer) => {
|
|
181
|
+
writeFileSync(this.binaryPath, Buffer.from(buffer), { mode: 0o755 })
|
|
133
182
|
})
|
|
134
183
|
.then(() => {
|
|
135
184
|
if (!suppressLogs) {
|
|
@@ -142,10 +191,8 @@ class Binary {
|
|
|
142
191
|
})
|
|
143
192
|
}
|
|
144
193
|
|
|
145
|
-
run(
|
|
146
|
-
const promise = !this.exists()
|
|
147
|
-
? this.install(fetchOptions, true)
|
|
148
|
-
: Promise.resolve()
|
|
194
|
+
run() {
|
|
195
|
+
const promise = !this.exists() ? this.install(true) : Promise.resolve()
|
|
149
196
|
|
|
150
197
|
promise
|
|
151
198
|
.then(() => {
|
|
@@ -213,10 +260,7 @@ const getBinary = () => {
|
|
|
213
260
|
|
|
214
261
|
const install = async () => {
|
|
215
262
|
const binary = getBinary()
|
|
216
|
-
|
|
217
|
-
const proxy = configureProxy(binary.url)
|
|
218
|
-
|
|
219
|
-
return binary.install(proxy, true) // Suppresses logs from binary-install
|
|
263
|
+
return binary.install(true) // Suppresses logs from binary-install
|
|
220
264
|
}
|
|
221
265
|
|
|
222
266
|
const run = async () => {
|
package/changes.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bumped": {
|
|
3
|
-
"axios": {
|
|
4
|
-
"from": "^1.13.5",
|
|
5
|
-
"to": "^1.14.0"
|
|
6
|
-
},
|
|
7
3
|
"rimraf": {
|
|
8
|
-
"from": "
|
|
4
|
+
"from": "5.0.10",
|
|
9
5
|
"to": "^6.1.3"
|
|
6
|
+
},
|
|
7
|
+
"undici": {
|
|
8
|
+
"from": "6.24.1",
|
|
9
|
+
"to": "^7.24.6"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"timestamp": "2026-
|
|
12
|
+
"timestamp": "2026-04-01T00:44:24.594Z",
|
|
13
13
|
"totalUpdated": 2
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/serverless",
|
|
3
|
-
"version": "4.33.
|
|
3
|
+
"version": "4.33.2-depup.0",
|
|
4
4
|
"description": "serverless with all dependencies updated to latest",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,30 +27,28 @@
|
|
|
27
27
|
"sls": "run.js"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"axios": "^1.14.0",
|
|
31
|
-
"axios-proxy-builder": "^0.1.2",
|
|
32
30
|
"rimraf": "^6.1.3",
|
|
33
|
-
"
|
|
31
|
+
"undici": "^7.24.6"
|
|
34
32
|
},
|
|
35
33
|
"devDependencies": {},
|
|
36
34
|
"engines": {
|
|
37
|
-
"node": ">=18.
|
|
35
|
+
"node": ">=18.17.0"
|
|
38
36
|
},
|
|
39
37
|
"depup": {
|
|
40
38
|
"changes": {
|
|
41
|
-
"axios": {
|
|
42
|
-
"from": "^1.13.5",
|
|
43
|
-
"to": "^1.14.0"
|
|
44
|
-
},
|
|
45
39
|
"rimraf": {
|
|
46
|
-
"from": "
|
|
40
|
+
"from": "5.0.10",
|
|
47
41
|
"to": "^6.1.3"
|
|
42
|
+
},
|
|
43
|
+
"undici": {
|
|
44
|
+
"from": "6.24.1",
|
|
45
|
+
"to": "^7.24.6"
|
|
48
46
|
}
|
|
49
47
|
},
|
|
50
48
|
"depsUpdated": 2,
|
|
51
49
|
"originalPackage": "serverless",
|
|
52
|
-
"originalVersion": "4.33.
|
|
53
|
-
"processedAt": "2026-
|
|
50
|
+
"originalVersion": "4.33.2",
|
|
51
|
+
"processedAt": "2026-04-01T00:44:25.620Z",
|
|
54
52
|
"smokeTest": "failed"
|
|
55
53
|
}
|
|
56
54
|
}
|