diff --git a/build/Dockerfile b/build/Dockerfile index 0b87626dd0b..6071f72d3b1 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12 +FROM node:14 ARG DEBIAN_FRONTEND=noninteractive diff --git a/package.json b/package.json index 636c31457a7..7174ef53158 100644 --- a/package.json +++ b/package.json @@ -1148,7 +1148,7 @@ "@types/glob": "7.2.0", "@types/lodash": "4.14.175", "@types/mocha": "9.0.0", - "@types/node": "12.20.33", + "@types/node": "14.17.27", "@types/parsimmon": "1.10.6", "@types/sinon": "10.0.4", "@types/source-map-support": "0.5.4", diff --git a/src/platform/browser/fs.ts b/src/platform/browser/fs.ts index eb8fd94d679..a052570caa4 100644 --- a/src/platform/browser/fs.ts +++ b/src/platform/browser/fs.ts @@ -80,7 +80,7 @@ export async function unlink(path: string): Promise { await vscode.workspace.fs.delete(vscode.Uri.parse(path)); } -export async function readFileAsync(path: string, encoding: string): Promise { +export async function readFileAsync(path: string, encoding: BufferEncoding): Promise { const ret = await vscode.workspace.fs.readFile(vscode.Uri.parse(path)); return ret.toString(); } @@ -92,7 +92,7 @@ export async function mkdirAsync(path: string, options: any): Promise { export async function writeFileAsync( path: string, content: string, - encoding: string + encoding: BufferEncoding ): Promise { return vscode.workspace.fs.writeFile(vscode.Uri.parse(path), Buffer.from(content)); } diff --git a/src/platform/node/fs.ts b/src/platform/node/fs.ts index 2c2e25249de..31216ac53a5 100644 --- a/src/platform/node/fs.ts +++ b/src/platform/node/fs.ts @@ -90,20 +90,20 @@ export async function unlink(path: string): Promise { fs.unlinkSync(path); } -export async function readFileAsync(path: string, encoding: string): Promise { +export async function readFileAsync(path: string, encoding: BufferEncoding): Promise { return promisify(fs.readFile)(path, encoding); } export async function mkdirAsync(path: string, options: any): Promise { - return promisify(fs.mkdir)(path, options); + await promisify(fs.mkdir)(path, options); } export async function writeFileAsync( path: string, content: string, - encoding: string + encoding: BufferEncoding ): Promise { - return promisify(fs.writeFile)(path, content, encoding); + await promisify(fs.writeFile)(path, content, encoding); } export async function accessAsync(path: string, mode: number) { diff --git a/yarn.lock b/yarn.lock index 696658cdf01..c64d3a23ab8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,7 +3,7 @@ "@babel/code-frame@^7.0.0": - version "7.10.7" + version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== dependencies: @@ -233,10 +233,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.2.tgz#2de1ed6670439387da1c9f549a2ade2b0a799256" integrity sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA== -"@types/node@12.20.33": - version "12.20.33" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.33.tgz#24927446e8b7669d10abacedd16077359678f436" - integrity sha512-5XmYX2GECSa+CxMYaFsr2mrql71Q4EvHjKS+ox/SiwSdaASMoBIWE6UmZqFO+VX1jIcsYLStI4FFoB6V7FeIYw== +"@types/node@14.17.27": + version "14.17.27" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.27.tgz#5054610d37bb5f6e21342d0e6d24c494231f3b85" + integrity sha512-94+Ahf9IcaDuJTle/2b+wzvjmutxXAEXU6O81JHblYXUg2BDG+dnBy7VxIPHKAyEEDHzCMQydTJuWvrE+Aanzw== "@types/parse-json@^4.0.0": version "4.0.0"