chore: Update @types/node to v12.20.42

Change-type: patch
This commit is contained in:
Paulo Castro 2022-01-19 21:40:53 +00:00
parent d1c61c62ab
commit c0f27a663d
11 changed files with 54 additions and 32 deletions

View File

@ -36,8 +36,8 @@ const run = async (cmd: string) => {
}
resolve({ stdout, stderr });
});
p.stdout.pipe(process.stdout);
p.stderr.pipe(process.stderr);
p.stdout?.pipe(process.stdout);
p.stderr?.pipe(process.stderr);
});
};

View File

@ -117,7 +117,7 @@ export async function which(program: string): Promise<string> {
*/
export async function whichSpawn(
programName: string,
args?: string[],
args: string[] = [],
): Promise<void> {
const program = await which(programName);
let error: Error | undefined;

View File

@ -27,14 +27,7 @@ import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
// `@types/node` does not know about `options: { bigint?: boolean }`
type statT = (
fPath: string,
options: { bigint?: boolean },
) => fs.Stats | Promise<fs.Stats>;
// async stat does not work with pkg's internal `/snapshot` filesystem
const stat: statT = process.pkg ? fs.statSync : fs.promises.stat;
const stat = process.pkg ? fs.statSync : fs.promises.stat;
let fastBootStarted = false;

View File

@ -212,7 +212,7 @@ function handleBuilderMetadata(obj: BuilderMessage, build: RemoteBuild) {
}
const value = match[1];
const amount = match[2] || 1;
const amount = Number(match[2]) || 1;
switch (value) {
case 'erase':

View File

@ -77,7 +77,7 @@ export async function exec(
.on('error', reject)
.on('close', resolve);
if (stdout) {
if (stdout && ps.stdout) {
ps.stdout.pipe(stdout);
}
});

View File

@ -98,7 +98,7 @@ async function spawnAndPipe(
resolve();
}
});
if (stderr) {
if (stderr && ps.stderr) {
ps.stderr.pipe(stderr);
}
});

46
npm-shrinkwrap.json generated
View File

@ -1321,14 +1321,6 @@
"tslint-no-unused-expression-chai": "^0.1.4",
"typescript": "^4.2.4",
"yargs": "^16.2.0"
},
"dependencies": {
"@types/node": {
"version": "12.20.37",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.37.tgz",
"integrity": "sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA==",
"dev": true
}
}
},
"@balena/node-beaglebone-usbboot": {
@ -2840,9 +2832,9 @@
}
},
"@types/node": {
"version": "10.17.60",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
"version": "12.20.42",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.42.tgz",
"integrity": "sha512-aI3/oo5DzyiI5R/xAhxxRzfZlWlsbbqdgxfTPkqu/Zt+23GXiJvMCyPJT4+xKSXOnLqoL8jJYMLTwvK2M3a5hw=="
},
"@types/node-cleanup": {
"version": "2.1.2",
@ -3773,6 +3765,11 @@
"rimraf": "^3.0.2"
},
"dependencies": {
"@types/node": {
"version": "10.17.60",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
},
"balena-sdk": {
"version": "15.59.2",
"resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-15.59.2.tgz",
@ -3840,6 +3837,11 @@
"unzipper": "^0.8.14"
},
"dependencies": {
"@types/node": {
"version": "10.17.60",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
},
"archiver": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.1.tgz",
@ -4047,6 +4049,11 @@
"tslib": "^2.1.0"
},
"dependencies": {
"@types/node": {
"version": "10.17.60",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
},
"balena-hup-action-utils": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/balena-hup-action-utils/-/balena-hup-action-utils-4.1.0.tgz",
@ -4113,6 +4120,13 @@
"@types/node": "^10.17.26",
"balena-errors": "^4.7.1",
"tslib": "^2.0.0"
},
"dependencies": {
"@types/node": {
"version": "10.17.60",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
}
}
},
"balena-sync": {
@ -4141,6 +4155,11 @@
"typed-error": "^2.0.0"
},
"dependencies": {
"@types/node": {
"version": "10.17.60",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
},
"balena-sdk": {
"version": "15.59.2",
"resolved": "https://registry.npmjs.org/balena-sdk/-/balena-sdk-15.59.2.tgz",
@ -14736,6 +14755,11 @@
"@types/node": "*"
}
},
"@types/node": {
"version": "10.17.60",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz",
"integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw=="
},
"bl": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz",

View File

@ -147,7 +147,7 @@
"@types/ndjson": "^2.0.1",
"@types/net-keepalive": "^0.4.1",
"@types/nock": "^11.1.0",
"@types/node": "^10.17.60",
"@types/node": "^12.20.42",
"@types/node-cleanup": "^2.1.2",
"@types/parse-link-header": "^1.0.1",
"@types/prettyjson": "^0.0.30",

View File

@ -160,8 +160,9 @@ async function startMockSshServer(): Promise<[Server, number]> {
});
return new Promise<[Server, number]>((resolve, reject) => {
// port 0: let the OS allocation any available TCP port number
const listener = server.listen(0, '127.0.0.1', (err: Error) => {
// TODO: remove 'as any' below. According to @types/node v12.20.42, the
// callback type is `() => void`, but our code assumes `(err: Error) => void`
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
// this callback is called for the 'listening' event
if (err) {
console.error(`Error starting mock ssh server:\n${err}`);

View File

@ -141,10 +141,10 @@ describe('DeprecationChecker', function () {
getStub.resolves(mockCache);
// Force isTTY to be false (undefined). It happens to be true when
// Force isTTY to be false. It happens to be true when
// the tests run on balenaCI on macOS and Linux.
const originalIsTTY = process.stderr.isTTY;
process.stderr.isTTY = undefined;
process.stderr.isTTY = false;
let result: TestOutput;
try {
result = await runCommand('version');

View File

@ -113,7 +113,9 @@ async function createProxyServer(): Promise<[number, number]> {
let proxyPort = 0; // TCP port number, 0 means automatic allocation
await new Promise<void>((resolve, reject) => {
const listener = server.listen(0, '127.0.0.1', (err: Error) => {
// TODO: remove 'as any' below. According to @types/node v12.20.42, the
// callback type is `() => void`, but our code assumes `(err: Error) => void`
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
if (err) {
console.error(`Error starting proxy server:\n${err}`);
reject(err);
@ -195,7 +197,9 @@ async function createInterceptorServer(): Promise<number> {
let interceptorPort = 0;
await new Promise<void>((resolve, reject) => {
const listener = server.listen(0, '127.0.0.1', (err: Error) => {
// TODO: remove 'as any' below. According to @types/node v12.20.42, the
// callback type is `() => void`, but our code assumes `(err: Error) => void`
const listener = (server.listen as any)(0, '127.0.0.1', (err: Error) => {
if (err) {
console.error(`Error starting interceptor server:\n${err}`);
reject(err);