Skip to content

Commit f2816c5

Browse files
committed
Remove 'async-file' dependency
1 parent 1742216 commit f2816c5

File tree

9 files changed

+68
-66
lines changed

9 files changed

+68
-66
lines changed

package-lock.json

Lines changed: 55 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@
9898
"@vscode/debugprotocol": "1.56.0",
9999
"@vscode/extension-telemetry": "^0.9.0",
100100
"@vscode/js-debug-browsers": "^1.1.0",
101-
"async-file": "2.0.2",
102101
"execa": "4.0.0",
103-
"fs-extra": "9.1.0",
102+
"fs-extra": "11.3.0",
104103
"http-proxy-agent": "7.0.0",
105104
"https-proxy-agent": "7.0.2",
106105
"jsonc-parser": "3.0.0",
@@ -128,7 +127,7 @@
128127
"@jest/globals": "^29.6.2",
129128
"@types/archiver": "5.1.0",
130129
"@types/del": "3.0.1",
131-
"@types/fs-extra": "5.0.4",
130+
"@types/fs-extra": "11.0.4",
132131
"@types/gulp": "4.0.5",
133132
"@types/minimist": "1.2.1",
134133
"@types/node": "20.14.8",

src/createTmpAsset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55
import * as tmp from 'tmp';
6-
import { rimraf } from 'async-file';
6+
import { rm } from 'fs-extra';
77
import { NestedError } from './nestedError';
88

99
export async function CreateTmpFile(): Promise<TmpAsset> {
@@ -43,7 +43,7 @@ export async function CreateTmpDir(unsafeCleanup: boolean): Promise<TmpAsset> {
4343
name: tmpDir.name,
4444
dispose: () => {
4545
if (unsafeCleanup) {
46-
rimraf(tmpDir.name).catch((rejectReason) => {
46+
rm(tmpDir.name).catch((rejectReason) => {
4747
throw new Error(`Failed to cleanup ${tmpDir.name} at ${tmpDir.fd}: ${rejectReason}`);
4848
}); //to delete directories that have folders inside them
4949
} else {

src/packageManager/zipInstaller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as fs from 'fs';
7-
import { mkdirp } from 'async-file';
7+
import { ensureDir } from 'fs-extra';
88
import * as path from 'path';
99
import * as yauzl from 'yauzl';
1010
import { EventStream } from '../eventStream';
@@ -38,7 +38,7 @@ export async function InstallZip(
3838
if (entry.fileName.endsWith('/')) {
3939
// Directory - create it
4040
try {
41-
await mkdirp(absoluteEntryPath, 0o775);
41+
await ensureDir(absoluteEntryPath, 0o775);
4242
zipFile.readEntry();
4343
} catch (err) {
4444
const error = err as NodeJS.ErrnoException; // Hack for TypeScript to type err correctly
@@ -54,7 +54,7 @@ export async function InstallZip(
5454
}
5555

5656
try {
57-
await mkdirp(path.dirname(absoluteEntryPath), 0o775);
57+
await ensureDir(path.dirname(absoluteEntryPath), 0o775);
5858

5959
// Make sure executable files have correct permissions when extracted
6060
const binaryPaths = binaries?.map((binary) => binary.value);

test/lsptoolshost/artifactTests/vsix.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { describe, test, expect } from '@jest/globals';
7-
import * as fs from 'async-file';
7+
import * as fs from 'fs-extra';
88
import * as glob from 'glob-promise';
99
import * as path from 'path';
1010

test/lsptoolshost/integrationTests/testAssets/testAssets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as fs from 'async-file';
6+
import * as fs from 'fs-extra';
77
import * as path from 'path';
88
import * as vscode from 'vscode';
99
import spawnGit from './spawnGit';
@@ -23,7 +23,7 @@ export class TestAssetProject {
2323
async addFileWithContents(fileName: string, contents: string): Promise<vscode.Uri> {
2424
const dir = this.projectDirectoryPath;
2525
const loc = path.join(dir, fileName);
26-
await fs.writeTextFile(loc, contents);
26+
await fs.writeFile(loc, contents);
2727
return vscode.Uri.file(loc);
2828
}
2929
}

test/omnisharp/omnisharpIntegrationTests/launchConfiguration.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { describe, expect, test, beforeAll, afterAll } from '@jest/globals';
7-
import * as fs from 'async-file';
7+
import * as fs from 'fs-extra';
88
import * as vscode from 'vscode';
99
import { activateCSharpExtension } from './integrationHelpers';
1010
import testAssetWorkspace from './testAssets/activeTestAssetWorkspace';

test/omnisharp/omnisharpUnitTests/packages/zipInstaller.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { describe, test, expect, beforeEach, afterEach } from '@jest/globals';
7-
import * as fs from 'async-file';
7+
import * as fs from 'fs-extra';
88
import * as path from 'path';
99
import * as util from '../../../../src/common';
1010
import { CreateTmpDir, TmpAsset } from '../../../../src/createTmpAsset';

0 commit comments

Comments
 (0)