@vercel/client 13.4.17 → 13.4.18
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/dist/upload.js +8 -3
- package/dist/utils/hashes.d.ts +1 -0
- package/package.json +3 -3
package/dist/upload.js
CHANGED
|
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(upload_exports);
|
|
|
34
34
|
var import_http = __toESM(require("http"));
|
|
35
35
|
var import_https = __toESM(require("https"));
|
|
36
36
|
var import_stream = require("stream");
|
|
37
|
-
var
|
|
37
|
+
var import_node_events = __toESM(require("node:events"));
|
|
38
38
|
var import_async_retry = __toESM(require("async-retry"));
|
|
39
39
|
var import_async_sema = require("async-sema");
|
|
40
40
|
var import_utils = require("./utils");
|
|
@@ -82,6 +82,8 @@ async function* upload(files, clientOptions, deploymentOptions) {
|
|
|
82
82
|
debug("Building an upload list...");
|
|
83
83
|
const semaphore = new import_async_sema.Sema(50, { capacity: 50 });
|
|
84
84
|
const defaultAgent = apiUrl?.startsWith("https://") ? new import_https.default.Agent({ keepAlive: true }) : new import_http.default.Agent({ keepAlive: true });
|
|
85
|
+
const abortController = new AbortController();
|
|
86
|
+
import_node_events.default.setMaxListeners(50);
|
|
85
87
|
shas.forEach((sha, index) => {
|
|
86
88
|
const uploadProgress = uploads[index];
|
|
87
89
|
uploadList[sha] = (0, import_async_retry.default)(
|
|
@@ -131,7 +133,9 @@ async function* upload(files, clientOptions, deploymentOptions) {
|
|
|
131
133
|
body,
|
|
132
134
|
teamId,
|
|
133
135
|
apiUrl,
|
|
134
|
-
userAgent
|
|
136
|
+
userAgent,
|
|
137
|
+
// @ts-expect-error: typescript is getting confused with the signal types from node (web & server) and node-fetch (server only)
|
|
138
|
+
signal: abortController.signal
|
|
135
139
|
},
|
|
136
140
|
clientOptions.debug
|
|
137
141
|
);
|
|
@@ -166,6 +170,7 @@ ${e}`);
|
|
|
166
170
|
throw err;
|
|
167
171
|
} else {
|
|
168
172
|
debug("Other error, bailing: " + err.message);
|
|
173
|
+
abortController.abort();
|
|
169
174
|
return bail(err);
|
|
170
175
|
}
|
|
171
176
|
}
|
|
@@ -206,7 +211,7 @@ ${e}`);
|
|
|
206
211
|
yield { type: "error", payload: e };
|
|
207
212
|
}
|
|
208
213
|
}
|
|
209
|
-
class UploadProgress extends
|
|
214
|
+
class UploadProgress extends import_node_events.EventEmitter {
|
|
210
215
|
constructor(sha, file) {
|
|
211
216
|
super();
|
|
212
217
|
this.sha = sha;
|
package/dist/utils/hashes.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/client",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.18",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"homepage": "https://vercel.com",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@types/jest": "27.4.1",
|
|
23
23
|
"@types/minimatch": "3.0.5",
|
|
24
24
|
"@types/ms": "0.7.30",
|
|
25
|
-
"@types/node": "
|
|
25
|
+
"@types/node": "16.18.119",
|
|
26
26
|
"@types/node-fetch": "2.5.4",
|
|
27
27
|
"@types/recursive-readdir": "2.2.0",
|
|
28
28
|
"@types/tar-fs": "1.16.1",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"typescript": "4.9.5"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@vercel/build-utils": "8.
|
|
33
|
+
"@vercel/build-utils": "8.5.0",
|
|
34
34
|
"@vercel/error-utils": "2.0.3",
|
|
35
35
|
"@vercel/routing-utils": "3.1.0",
|
|
36
36
|
"async-retry": "1.2.3",
|