Skip to content

chore: replace fs-extra with Node's fs #866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .yarn/install-state.gz
Binary file not shown.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"chokidar": "^4.0.1",
"cosmiconfig": "^8.2.0",
"deepmerge": "^4.2.2",
"fs-extra": "^10.0.0",
"memfs": "^3.4.1",
"minimatch": "^3.0.4",
"node-abort-controller": "^3.0.1",
Expand All @@ -81,7 +80,6 @@
"@semantic-release/release-notes-generator": "^9.0.3",
"@types/babel__code-frame": "^7.0.3",
"@types/cross-spawn": "^6.0.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.4.0",
"@types/json-schema": "^7.0.9",
"@types/minimatch": "^3.0.5",
Expand Down
2 changes: 1 addition & 1 deletion src/formatter/code-frame-formatter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs';
import os from 'os';

import { codeFrameColumns } from '@babel/code-frame';
import fs from 'fs-extra';

import { createBasicFormatter } from './basic-formatter';
import type { Formatter } from './formatter';
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/type-script-support.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs';
import os from 'os';

import fs from 'fs-extra';
import * as semver from 'semver';

import type { TypeScriptWorkerConfig } from './type-script-worker-config';
Expand Down
3 changes: 1 addition & 2 deletions src/typescript/worker/lib/file-system/real-file-system.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Dirent, Stats } from 'fs';
import fs from 'fs';
import { dirname, basename, join, normalize } from 'path';

import * as fs from 'fs-extra';

import type { FileSystem } from './file-system';

const existsCache = new Map<string, boolean>();
Expand Down
4 changes: 2 additions & 2 deletions test/unit/typescript/type-script-support.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('typescript/type-script-support', () => {

it("doesn't throw error if typescript version is greater or equal 3.6.0", async () => {
jest.setMock('typescript', { version: '3.6.0' });
jest.setMock('fs-extra', { existsSync: () => true });
jest.setMock('fs', { existsSync: () => true });

const { assertTypeScriptSupport } = await import('src/typescript/type-script-support');

Expand All @@ -60,7 +60,7 @@ describe('typescript/type-script-support', () => {

it('throws error if there is no tsconfig.json file', async () => {
jest.setMock('typescript', { version: '3.8.0' });
jest.setMock('fs-extra', { existsSync: () => false });
jest.setMock('fs', { existsSync: () => false });

const { assertTypeScriptSupport } = await import('src/typescript/type-script-support');

Expand Down
11 changes: 0 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1660,15 +1660,6 @@ __metadata:
languageName: node
linkType: hard

"@types/fs-extra@npm:^9.0.13":
version: 9.0.13
resolution: "@types/fs-extra@npm:9.0.13"
dependencies:
"@types/node": "npm:*"
checksum: 10c0/576d4e9d382393316ed815c593f7f5c157408ec5e184521d077fcb15d514b5a985245f153ef52142b9b976cb9bd8f801850d51238153ebd0dc9e96b7a7548588
languageName: node
linkType: hard

"@types/glob@npm:*":
version: 8.1.0
resolution: "@types/glob@npm:8.1.0"
Expand Down Expand Up @@ -4496,7 +4487,6 @@ __metadata:
"@semantic-release/release-notes-generator": "npm:^9.0.3"
"@types/babel__code-frame": "npm:^7.0.3"
"@types/cross-spawn": "npm:^6.0.2"
"@types/fs-extra": "npm:^9.0.13"
"@types/jest": "npm:^27.4.0"
"@types/json-schema": "npm:^7.0.9"
"@types/minimatch": "npm:^3.0.5"
Expand All @@ -4516,7 +4506,6 @@ __metadata:
eslint-plugin-import: "npm:^2.25.4"
eslint-plugin-node: "npm:^11.1.0"
eslint-plugin-prettier: "npm:^4.0.0"
fs-extra: "npm:^10.0.0"
git-cz: "npm:^4.8.0"
husky: "npm:^7.0.4"
jest: "npm:^27.4.7"
Expand Down