From f1186203afea368a915e4269ced44591f8ca0e45 Mon Sep 17 00:00:00 2001 From: Jason Fields Date: Wed, 20 Oct 2021 16:12:34 -0400 Subject: [PATCH] Upgrade to node v14 Recent VS Code versions ship with electron 13, which is built from node 14. This just affects the docker environment we run tests in and the node type definitions. --- build/Dockerfile | 2 +- package.json | 2 +- src/platform/browser/fs.ts | 4 ++-- src/platform/node/fs.ts | 8 ++++---- yarn.lock | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 0b87626dd..6071f72d3 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 636c31457..7174ef531 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 eb8fd94d6..a052570ca 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 2c2e25249..31216ac53 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 696658cdf..c64d3a23a 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"