Skip to content

Commit e81d12e

Browse files
committed
refactor: use node v12 types, matching WORKSPACE version
1 parent a7cf22c commit e81d12e

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.13
1+
12.14

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"@types/loader-utils": "^1.1.3",
109109
"@types/minimatch": "3.0.3",
110110
"@types/minimist": "^1.2.0",
111-
"@types/node": "10.12.30",
111+
"@types/node": "13.13.5",
112112
"@types/node-fetch": "^2.1.6",
113113
"@types/npm-package-arg": "^6.1.0",
114114
"@types/progress": "^2.0.3",

packages/angular_devkit/core/node/host.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ function loadFSWatcher() {
5858
}
5959
}
6060

61-
type FsFunction0<R> = (cb: (err?: Error, result?: R) => void) => void;
62-
type FsFunction1<R, T1> = (p1: T1, cb: (err?: Error, result?: R) => void) => void;
61+
type FsFunction0<R> = (cb: (err?: Error|null, result?: R) => void) => void;
62+
type FsFunction1<R, T1> = (p1: T1, cb: (err?: Error|null, result?: R) => void) => void;
6363
type FsFunction2<R, T1, T2>
64-
= (p1: T1, p2: T2, cb: (err?: Error, result?: R) => void) => void;
64+
= (p1: T1, p2: T2, cb: (err?: Error|null, result?: R) => void) => void;
6565

6666

6767
function _callFs<R>(fn: FsFunction0<R>): Observable<R>;
@@ -70,7 +70,7 @@ function _callFs<R, T1, T2>(fn: FsFunction2<R, T1, T2>, p1: T1, p2: T2): Observa
7070

7171
function _callFs<ResultT>(fn: Function, ...args: {}[]): Observable<ResultT> {
7272
return new Observable(obs => {
73-
fn(...args, (err?: Error, result?: ResultT) => {
73+
fn(...args, (err?: Error|null, result?: ResultT) => {
7474
if (err) {
7575
obs.error(err);
7676
} else {
@@ -176,12 +176,12 @@ export class NodeJsAsyncHost implements virtualFs.Host<fs.Stats> {
176176
}
177177

178178
isDirectory(path: Path): Observable<boolean> {
179-
return _callFs(fs.stat, getSystemPath(path)).pipe(
179+
return _callFs<fs.Stats, string>(fs.stat, getSystemPath(path)).pipe(
180180
map(stat => stat.isDirectory()),
181181
);
182182
}
183183
isFile(path: Path): Observable<boolean> {
184-
return _callFs(fs.stat, getSystemPath(path)).pipe(
184+
return _callFs<fs.Stats, string>(fs.stat, getSystemPath(path)).pipe(
185185
map(stat => stat.isFile()),
186186
);
187187
}

packages/angular_devkit/core/src/terminal/caps.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
import ReadableStream = NodeJS.ReadableStream;
99
import WriteStream = NodeJS.WriteStream;
10-
import Socket = NodeJS.Socket;
1110
const supportsColor = require('../../third_party/github.com/chalk/supports-color');
1211

1312
/**
@@ -76,7 +75,7 @@ function _getColumns() {
7675

7776

7877
function _createCapabilities(
79-
stream: Socket,
78+
stream: WriteStream,
8079
isTerminalStream: boolean,
8180
level: 0|1|2|3 = supportsColor.stdout.level,
8281
): StreamCapabilities {
@@ -96,7 +95,7 @@ function _createCapabilities(
9695

9796

9897
export function getCapabilities(
99-
stream: Socket,
98+
stream: WriteStream,
10099
isTerminalStream = !!stream.isTTY,
101100
): StreamCapabilities {
102101
let maybeCaps = streamMap.get(stream);

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"./node_modules/@types"
2828
],
2929
"types": [
30-
"node"
30+
"node/v12"
3131
],
3232
"paths": {
3333
"@_/benchmark": [ "./packages/_/benchmark/src/index" ],

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,10 +1453,10 @@
14531453
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.4.tgz#1581d6c16e3d4803eb079c87d4ac893ee7501c2c"
14541454
integrity sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==
14551455

1456-
"@types/node@10.12.30":
1457-
version "10.12.30"
1458-
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.30.tgz#4c2b4f0015f214f8158a347350481322b3b29b2f"
1459-
integrity sha512-nsqTN6zUcm9xtdJiM9OvOJ5EF0kOI8f1Zuug27O/rgtxCRJHGqncSWfCMZUP852dCKPsDsYXGvBhxfRjDBkF5Q==
1456+
"@types/node@13.13.5":
1457+
version "13.13.5"
1458+
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.5.tgz#96ec3b0afafd64a4ccea9107b75bf8489f0e5765"
1459+
integrity sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==
14601460

14611461
"@types/node@^10.1.0":
14621462
version "10.17.21"

0 commit comments

Comments
 (0)