first commit
This commit is contained in:
30
patches/@google-cloud+storage++retry-request+5.0.2.patch
Normal file
30
patches/@google-cloud+storage++retry-request+5.0.2.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
diff --git a/node_modules/@google-cloud/storage/node_modules/retry-request/index.js b/node_modules/@google-cloud/storage/node_modules/retry-request/index.js
|
||||
index a293298..df21af6 100644
|
||||
--- a/node_modules/@google-cloud/storage/node_modules/retry-request/index.js
|
||||
+++ b/node_modules/@google-cloud/storage/node_modules/retry-request/index.js
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
-const {PassThrough} = require('stream');
|
||||
+const { PassThrough, pipeline } = require('stream');
|
||||
const debug = require('debug')('retry-request');
|
||||
const extend = require('extend');
|
||||
|
||||
@@ -166,7 +166,7 @@ function retryRequest(requestOpts, opts, callback) {
|
||||
})
|
||||
.on('complete', retryStream.emit.bind(retryStream, 'complete'));
|
||||
|
||||
- requestStream.pipe(delayStream);
|
||||
+ pipeline(requestStream, delayStream, () => {});
|
||||
} else {
|
||||
activeRequest = opts.request(requestOpts, onResponse);
|
||||
}
|
||||
@@ -232,7 +232,7 @@ function retryRequest(requestOpts, opts, callback) {
|
||||
// No more attempts need to be made, just continue on.
|
||||
if (streamMode) {
|
||||
retryStream.emit('response', response);
|
||||
- delayStream.pipe(retryStream);
|
||||
+ pipeline(delayStream, retryStream, () => {});
|
||||
requestStream.on('error', err => {
|
||||
retryStream.destroy(err);
|
||||
});
|
50
patches/@google-cloud+storage++teeny-request+8.0.2.patch
Normal file
50
patches/@google-cloud+storage++teeny-request+8.0.2.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
diff --git a/node_modules/@google-cloud/storage/node_modules/teeny-request/build/src/index.js b/node_modules/@google-cloud/storage/node_modules/teeny-request/build/src/index.js
|
||||
index a2251ca..e29e796 100644
|
||||
--- a/node_modules/@google-cloud/storage/node_modules/teeny-request/build/src/index.js
|
||||
+++ b/node_modules/@google-cloud/storage/node_modules/teeny-request/build/src/index.js
|
||||
@@ -166,27 +166,27 @@ function teenyRequest(reqOpts, callback) {
|
||||
}
|
||||
if (callback === undefined) {
|
||||
// Stream mode
|
||||
- const requestStream = streamEvents(new stream_1.PassThrough());
|
||||
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
- let responseStream;
|
||||
- requestStream.once('reading', () => {
|
||||
- if (responseStream) {
|
||||
- responseStream.pipe(requestStream);
|
||||
- }
|
||||
- else {
|
||||
- requestStream.once('response', () => {
|
||||
- responseStream.pipe(requestStream);
|
||||
- });
|
||||
- }
|
||||
- });
|
||||
+ const requestStream = new stream_1.PassThrough();
|
||||
+ // // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
+ // let responseStream;
|
||||
+ // requestStream.once('reading', () => {
|
||||
+ // if (responseStream) {
|
||||
+ // responseStream.pipe(requestStream);
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // requestStream.once('response', () => {
|
||||
+ // responseStream.pipe(requestStream);
|
||||
+ // });
|
||||
+ // }
|
||||
+ // });
|
||||
options.compress = false;
|
||||
teenyRequest.stats.requestStarting();
|
||||
(0, node_fetch_1.default)(uri, options).then(res => {
|
||||
- teenyRequest.stats.requestFinished();
|
||||
- responseStream = res.body;
|
||||
- responseStream.on('error', (err) => {
|
||||
- requestStream.emit('error', err);
|
||||
- });
|
||||
+ teenyRequest.stats.requestFinished(); stream_1.pipeline(res.body, requestStream, () => {});
|
||||
+ // responseStream = res.body;
|
||||
+ // responseStream.on('error', (err) => {
|
||||
+ // requestStream.emit('error', err);
|
||||
+ // });
|
||||
const response = fetchToRequestResponse(options, res);
|
||||
requestStream.emit('response', response);
|
||||
}, err => {
|
1
patches/README.md
Normal file
1
patches/README.md
Normal file
@@ -0,0 +1 @@
|
||||
The patches in this folder are applied by `patch-package` to dependencies, particularly those which need changes that are difficult to apply upstream.
|
44
patches/body-parser+1.20.3.patch
Normal file
44
patches/body-parser+1.20.3.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
diff --git a/node_modules/body-parser/lib/read.js b/node_modules/body-parser/lib/read.js
|
||||
index fce6283..6131c31 100644
|
||||
--- a/node_modules/body-parser/lib/read.js
|
||||
+++ b/node_modules/body-parser/lib/read.js
|
||||
@@ -18,7 +18,7 @@ var iconv = require('iconv-lite')
|
||||
var onFinished = require('on-finished')
|
||||
var unpipe = require('unpipe')
|
||||
var zlib = require('zlib')
|
||||
-
|
||||
+var Stream = require('stream')
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
@@ -166,25 +166,25 @@ function contentstream (req, debug, inflate) {
|
||||
case 'deflate':
|
||||
stream = zlib.createInflate()
|
||||
debug('inflate body')
|
||||
- req.pipe(stream)
|
||||
+ // req.pipe(stream)
|
||||
break
|
||||
case 'gzip':
|
||||
stream = zlib.createGunzip()
|
||||
debug('gunzip body')
|
||||
- req.pipe(stream)
|
||||
+ // req.pipe(stream)
|
||||
break
|
||||
case 'identity':
|
||||
stream = req
|
||||
stream.length = length
|
||||
- break
|
||||
+ return req
|
||||
default:
|
||||
throw createError(415, 'unsupported content encoding "' + encoding + '"', {
|
||||
encoding: encoding,
|
||||
type: 'encoding.unsupported'
|
||||
})
|
||||
}
|
||||
-
|
||||
- return stream
|
||||
+ var pass = new Stream.PassThrough(); Stream.pipeline(req, stream, pass, () => {})
|
||||
+ return pass
|
||||
}
|
||||
|
||||
/**
|
13
patches/forwarded+0.2.0.patch
Normal file
13
patches/forwarded+0.2.0.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/node_modules/forwarded/index.js b/node_modules/forwarded/index.js
|
||||
index b2b6bdd..75e6254 100644
|
||||
--- a/node_modules/forwarded/index.js
|
||||
+++ b/node_modules/forwarded/index.js
|
||||
@@ -46,7 +46,7 @@ function forwarded (req) {
|
||||
function getSocketAddr (req) {
|
||||
return req.socket
|
||||
? req.socket.remoteAddress
|
||||
- : req.connection.remoteAddress
|
||||
+ : req.connection && req.connection.remoteAddress
|
||||
}
|
||||
|
||||
/**
|
76
patches/node-fetch+2.7.0.patch
Normal file
76
patches/node-fetch+2.7.0.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/node-fetch/lib/index.js
|
||||
index 567ff5d..8eb45f7 100644
|
||||
--- a/node_modules/node-fetch/lib/index.js
|
||||
+++ b/node_modules/node-fetch/lib/index.js
|
||||
@@ -545,8 +545,8 @@ function clone(instance) {
|
||||
// tee instance body
|
||||
p1 = new PassThrough();
|
||||
p2 = new PassThrough();
|
||||
- body.pipe(p1);
|
||||
- body.pipe(p2);
|
||||
+ Stream.pipeline(body, p1, () => {});
|
||||
+ Stream.pipeline(body, p2, () => {});
|
||||
// set instance body to teed body and return the other teed body
|
||||
instance[INTERNALS].body = p1;
|
||||
body = p2;
|
||||
@@ -648,14 +648,14 @@ function writeToStream(dest, instance) {
|
||||
// body is null
|
||||
dest.end();
|
||||
} else if (isBlob(body)) {
|
||||
- body.stream().pipe(dest);
|
||||
+ Stream.pipeline(body.stream(), dest, () => {});
|
||||
} else if (Buffer.isBuffer(body)) {
|
||||
// body is buffer
|
||||
dest.write(body);
|
||||
dest.end();
|
||||
} else {
|
||||
// body is stream
|
||||
- body.pipe(dest);
|
||||
+ Stream.pipeline(body, dest, () => {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1638,7 +1638,7 @@ function fetch(url, opts) {
|
||||
res.once('end', function () {
|
||||
if (signal) signal.removeEventListener('abort', abortAndFinalize);
|
||||
});
|
||||
- let body = res.pipe(new PassThrough$1());
|
||||
+ let body = Stream.pipeline(res, new PassThrough(), error => { if (error) reject(error); });
|
||||
|
||||
const response_options = {
|
||||
url: request.url,
|
||||
@@ -1679,7 +1679,7 @@ function fetch(url, opts) {
|
||||
|
||||
// for gzip
|
||||
if (codings == 'gzip' || codings == 'x-gzip') {
|
||||
- body = body.pipe(zlib.createGunzip(zlibOptions));
|
||||
+ body = Stream.pipeline(body, zlib.createGunzip(zlibOptions), error => { if (error) reject(error); });
|
||||
response = new Response(body, response_options);
|
||||
resolve(response);
|
||||
return;
|
||||
@@ -1689,13 +1689,13 @@ function fetch(url, opts) {
|
||||
if (codings == 'deflate' || codings == 'x-deflate') {
|
||||
// handle the infamous raw deflate response from old servers
|
||||
// a hack for old IIS and Apache servers
|
||||
- const raw = res.pipe(new PassThrough$1());
|
||||
+ const raw = Stream.pipeline(res, new PassThrough(), error => { if (error) reject(error); });
|
||||
raw.once('data', function (chunk) {
|
||||
// see http://stackoverflow.com/questions/37519828
|
||||
if ((chunk[0] & 0x0F) === 0x08) {
|
||||
- body = body.pipe(zlib.createInflate());
|
||||
+ body = Stream.pipeline(body, zlib.createInflate(), error => { if (error) reject(error); });
|
||||
} else {
|
||||
- body = body.pipe(zlib.createInflateRaw());
|
||||
+ body = Stream.pipeline(body, zlib.createInflateRaw(), error => { if (error) reject(error); });
|
||||
}
|
||||
response = new Response(body, response_options);
|
||||
resolve(response);
|
||||
@@ -1712,7 +1712,7 @@ function fetch(url, opts) {
|
||||
|
||||
// for br
|
||||
if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
|
||||
- body = body.pipe(zlib.createBrotliDecompress());
|
||||
+ body = Stream.pipeline(body, zlib.createBrotliDecompress(), error => { if (error) reject(error); });
|
||||
response = new Response(body, response_options);
|
||||
resolve(response);
|
||||
return;
|
13
patches/passport-oauth2+1.6.1.patch
Normal file
13
patches/passport-oauth2+1.6.1.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/node_modules/passport-oauth2/lib/utils.js b/node_modules/passport-oauth2/lib/utils.js
|
||||
index 486f9e1..4584507 100644
|
||||
--- a/node_modules/passport-oauth2/lib/utils.js
|
||||
+++ b/node_modules/passport-oauth2/lib/utils.js
|
||||
@@ -24,7 +24,7 @@ exports.originalURL = function(req, options) {
|
||||
var trustProxy = options.proxy;
|
||||
|
||||
var proto = (req.headers['x-forwarded-proto'] || '').toLowerCase()
|
||||
- , tls = req.connection.encrypted || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0])
|
||||
+ , tls = (req.connection && req.connection.encrypted) || (trustProxy && 'https' == proto.split(/\s*,\s*/)[0])
|
||||
, host = (trustProxy && req.headers['x-forwarded-host']) || req.headers.host
|
||||
, protocol = tls ? 'https' : 'http'
|
||||
, path = req.url || '';
|
30
patches/retry-request+4.2.2.patch
Normal file
30
patches/retry-request+4.2.2.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
diff --git a/node_modules/retry-request/index.js b/node_modules/retry-request/index.js
|
||||
index 6cd6f65..39efb89 100644
|
||||
--- a/node_modules/retry-request/index.js
|
||||
+++ b/node_modules/retry-request/index.js
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
-var { PassThrough } = require('stream');
|
||||
+var { PassThrough, pipeline } = require('stream');
|
||||
var debug = require('debug')('retry-request');
|
||||
var extend = require('extend');
|
||||
|
||||
@@ -164,7 +164,7 @@ function retryRequest(requestOpts, opts, callback) {
|
||||
})
|
||||
.on('complete', retryStream.emit.bind(retryStream, 'complete'));
|
||||
|
||||
- requestStream.pipe(delayStream);
|
||||
+ pipeline(requestStream, delayStream, () => {});
|
||||
} else {
|
||||
activeRequest = opts.request(requestOpts, onResponse);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ function retryRequest(requestOpts, opts, callback) {
|
||||
// No more attempts need to be made, just continue on.
|
||||
if (streamMode) {
|
||||
retryStream.emit('response', response);
|
||||
- delayStream.pipe(retryStream);
|
||||
+ pipeline(delayStream, retryStream, () => {});
|
||||
requestStream.on('error', function (err) {
|
||||
retryStream.destroy(err);
|
||||
});
|
57
patches/send+0.19.0.patch
Normal file
57
patches/send+0.19.0.patch
Normal file
@@ -0,0 +1,57 @@
|
||||
diff --git a/node_modules/send/index.js b/node_modules/send/index.js
|
||||
index 768f8ca..a882f4d 100644
|
||||
--- a/node_modules/send/index.js
|
||||
+++ b/node_modules/send/index.js
|
||||
@@ -788,29 +788,29 @@ SendStream.prototype.stream = function stream (path, options) {
|
||||
// pipe
|
||||
var stream = fs.createReadStream(path, options)
|
||||
this.emit('stream', stream)
|
||||
- stream.pipe(res)
|
||||
-
|
||||
- // cleanup
|
||||
- function cleanup () {
|
||||
- destroy(stream, true)
|
||||
- }
|
||||
-
|
||||
- // response finished, cleanup
|
||||
- onFinished(res, cleanup)
|
||||
-
|
||||
- // error handling
|
||||
- stream.on('error', function onerror (err) {
|
||||
- // clean up stream early
|
||||
- cleanup()
|
||||
-
|
||||
- // error
|
||||
- self.onStatError(err)
|
||||
- })
|
||||
-
|
||||
- // end
|
||||
- stream.on('end', function onend () {
|
||||
- self.emit('end')
|
||||
- })
|
||||
+ Stream.pipeline(stream, res, err => { if (err) { self.onStatError(err) } else { self.emit('end') } })
|
||||
+
|
||||
+ // // cleanup
|
||||
+ // function cleanup () {
|
||||
+ // destroy(stream, true)
|
||||
+ // }
|
||||
+ //
|
||||
+ // // response finished, cleanup
|
||||
+ // onFinished(res, cleanup)
|
||||
+ //
|
||||
+ // // error handling
|
||||
+ // stream.on('error', function onerror (err) {
|
||||
+ // // clean up stream early
|
||||
+ // cleanup()
|
||||
+ //
|
||||
+ // // error
|
||||
+ // self.onStatError(err)
|
||||
+ // })
|
||||
+ //
|
||||
+ // // end
|
||||
+ // stream.on('end', function onend () {
|
||||
+ // self.emit('end')
|
||||
+ // })
|
||||
}
|
||||
|
||||
/**
|
49
patches/teeny-request+7.1.3.patch
Normal file
49
patches/teeny-request+7.1.3.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
diff --git a/node_modules/teeny-request/build/src/index.js b/node_modules/teeny-request/build/src/index.js
|
||||
index f209888..e9fe982 100644
|
||||
--- a/node_modules/teeny-request/build/src/index.js
|
||||
+++ b/node_modules/teeny-request/build/src/index.js
|
||||
@@ -166,27 +166,27 @@ function teenyRequest(reqOpts, callback) {
|
||||
}
|
||||
if (callback === undefined) {
|
||||
// Stream mode
|
||||
- const requestStream = streamEvents(new stream_1.PassThrough());
|
||||
+ const requestStream = new stream_1.PassThrough();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
- let responseStream;
|
||||
- requestStream.once('reading', () => {
|
||||
- if (responseStream) {
|
||||
- responseStream.pipe(requestStream);
|
||||
- }
|
||||
- else {
|
||||
- requestStream.once('response', () => {
|
||||
- responseStream.pipe(requestStream);
|
||||
- });
|
||||
- }
|
||||
- });
|
||||
+ // let responseStream;
|
||||
+ // requestStream.once('reading', () => {
|
||||
+ // if (responseStream) {
|
||||
+ // responseStream.pipe(requestStream);
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // requestStream.once('response', () => {
|
||||
+ // responseStream.pipe(requestStream);
|
||||
+ // });
|
||||
+ // }
|
||||
+ // });
|
||||
options.compress = false;
|
||||
teenyRequest.stats.requestStarting();
|
||||
node_fetch_1.default(uri, options).then(res => {
|
||||
- teenyRequest.stats.requestFinished();
|
||||
- responseStream = res.body;
|
||||
- responseStream.on('error', (err) => {
|
||||
- requestStream.emit('error', err);
|
||||
- });
|
||||
+ teenyRequest.stats.requestFinished(); stream_1.pipeline(res.body, requestStream, () => {});
|
||||
+ // responseStream = res.body;
|
||||
+ // responseStream.on('error', (err) => {
|
||||
+ // requestStream.emit('error', err);
|
||||
+ // });
|
||||
const response = fetchToRequestResponse(options, res);
|
||||
requestStream.emit('response', response);
|
||||
}, err => {
|
81
patches/thread-loader+4.0.2.patch
Normal file
81
patches/thread-loader+4.0.2.patch
Normal file
@@ -0,0 +1,81 @@
|
||||
diff --git a/node_modules/thread-loader/dist/WorkerPool.js b/node_modules/thread-loader/dist/WorkerPool.js
|
||||
index 4145779..f0ff068 100644
|
||||
--- a/node_modules/thread-loader/dist/WorkerPool.js
|
||||
+++ b/node_modules/thread-loader/dist/WorkerPool.js
|
||||
@@ -258,6 +258,19 @@ class PoolWorker {
|
||||
finalCallback();
|
||||
break;
|
||||
}
|
||||
+ case 'logMessage':
|
||||
+ {
|
||||
+ const {
|
||||
+ data: { loggerName, methodName, args }
|
||||
+ } = message;
|
||||
+ const {
|
||||
+ data: jobData
|
||||
+ } = this.jobs[id];
|
||||
+ const logger = jobData.getLogger(loggerName);
|
||||
+ logger[methodName].apply(logger, args);
|
||||
+ finalCallback();
|
||||
+ break;
|
||||
+ }
|
||||
case 'emitWarning':
|
||||
{
|
||||
const {
|
||||
diff --git a/node_modules/thread-loader/dist/index.js b/node_modules/thread-loader/dist/index.js
|
||||
index 75cd30f..d834af6 100644
|
||||
--- a/node_modules/thread-loader/dist/index.js
|
||||
+++ b/node_modules/thread-loader/dist/index.js
|
||||
@@ -43,6 +43,7 @@ function pitch() {
|
||||
sourceMap: this.sourceMap,
|
||||
emitError: this.emitError,
|
||||
emitWarning: this.emitWarning,
|
||||
+ getLogger: this.getLogger,
|
||||
loadModule: this.loadModule,
|
||||
resolve: this.resolve,
|
||||
getResolve: this.getResolve,
|
||||
diff --git a/node_modules/thread-loader/dist/worker.js b/node_modules/thread-loader/dist/worker.js
|
||||
index 8e67959..aca94f1 100644
|
||||
--- a/node_modules/thread-loader/dist/worker.js
|
||||
+++ b/node_modules/thread-loader/dist/worker.js
|
||||
@@ -90,6 +90,22 @@ function writeJson(data) {
|
||||
writePipeWrite(lengthBuffer);
|
||||
writePipeWrite(messageBuffer);
|
||||
}
|
||||
+const LOGGER_METHODS = ['error', 'warn', 'info', 'log', 'debug', 'trace', 'group', 'groupEnd', 'groupCollapsed', 'status', 'clear', 'profile', 'profileEnd'];
|
||||
+class Logger {
|
||||
+ constructor(id, loggerName) {
|
||||
+ this.id = id
|
||||
+ this.loggerName = loggerName
|
||||
+ for (const methodName of LOGGER_METHODS) {
|
||||
+ this[methodName] = (...args) => {
|
||||
+ writeJson({
|
||||
+ type: 'logMessage',
|
||||
+ id: this.id,
|
||||
+ data: { loggerName, methodName, args }
|
||||
+ })
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
const queue = (0, _queue.default)(({
|
||||
id,
|
||||
data
|
||||
@@ -190,6 +206,7 @@ const queue = (0, _queue.default)(({
|
||||
}
|
||||
return options;
|
||||
},
|
||||
+ getLogger: (name) => new Logger(id, name),
|
||||
emitWarning: warning => {
|
||||
writeJson({
|
||||
type: 'emitWarning',
|
||||
@@ -211,6 +228,9 @@ const queue = (0, _queue.default)(({
|
||||
module._compile(code, filename); // eslint-disable-line no-underscore-dangle
|
||||
return module.exports;
|
||||
},
|
||||
+ addDependency: filename => {
|
||||
+ buildDependencies.push(filename);
|
||||
+ },
|
||||
addBuildDependency: filename => {
|
||||
buildDependencies.push(filename);
|
||||
},
|
Reference in New Issue
Block a user