diff --git a/package-lock.json b/package-lock.json index 7868f3e2f08..a9a991c14e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -126,7 +126,6 @@ "@netlify/eslint-config-node": "7.0.1", "@netlify/functions": "3.0.0", "@sindresorhus/slugify": "2.2.1", - "@types/fs-extra": "11.0.4", "@types/inquirer": "9.0.7", "@types/jsonwebtoken": "9.0.7", "@types/lodash": "4.17.15", @@ -143,7 +142,6 @@ "eslint-plugin-sort-destructure-keys": "2.0.0", "eslint-plugin-workspace": "file:./tools/lint-rules", "form-data": "4.0.1", - "fs-extra": "11.2.0", "husky": "8.0.3", "is-ci": "3.0.1", "nock": "13.5.6", @@ -5597,16 +5595,6 @@ "@types/range-parser": "*" } }, - "node_modules/@types/fs-extra": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", - "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", - "dev": true, - "dependencies": { - "@types/jsonfile": "*", - "@types/node": "*" - } - }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -5678,15 +5666,6 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, - "node_modules/@types/jsonfile": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", - "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/jsonwebtoken": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.7.tgz", @@ -13232,20 +13211,6 @@ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, - "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -27430,16 +27395,6 @@ "@types/range-parser": "*" } }, - "@types/fs-extra": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", - "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", - "dev": true, - "requires": { - "@types/jsonfile": "*", - "@types/node": "*" - } - }, "@types/http-cache-semantics": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", @@ -27513,15 +27468,6 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, - "@types/jsonfile": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", - "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/jsonwebtoken": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.7.tgz", @@ -32896,17 +32842,6 @@ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, - "fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, "fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", diff --git a/package.json b/package.json index 231abb30c02..ec3cf1fb642 100644 --- a/package.json +++ b/package.json @@ -182,7 +182,6 @@ "@netlify/eslint-config-node": "7.0.1", "@netlify/functions": "3.0.0", "@sindresorhus/slugify": "2.2.1", - "@types/fs-extra": "11.0.4", "@types/inquirer": "9.0.7", "@types/jsonwebtoken": "9.0.7", "@types/lodash": "4.17.15", @@ -199,7 +198,6 @@ "eslint-plugin-sort-destructure-keys": "2.0.0", "eslint-plugin-workspace": "file:./tools/lint-rules", "form-data": "4.0.1", - "fs-extra": "11.2.0", "husky": "8.0.3", "is-ci": "3.0.1", "nock": "13.5.6", diff --git a/tests/integration/utils/fixture.ts b/tests/integration/utils/fixture.ts index 23d58ffdb6e..c6fed0572dd 100644 --- a/tests/integration/utils/fixture.ts +++ b/tests/integration/utils/fixture.ts @@ -1,8 +1,8 @@ +import { cp } from 'fs/promises' import { join } from 'path' import { fileURLToPath } from 'url' import type { NodeOptions } from 'execa' -import { copy } from 'fs-extra' import { temporaryDirectory } from 'tempy' import { afterAll, afterEach, beforeAll, beforeEach, describe } from 'vitest' @@ -75,7 +75,10 @@ export class Fixture { static async create(fixturePath: string, options?: FixtureSettings): Promise { const fixture = new Fixture(fixturePath, temporaryDirectory(), options) - await copy(join(FIXTURES_DIRECTORY, fixturePath), fixture.directory) + await cp(join(FIXTURES_DIRECTORY, fixturePath), fixture.directory, { + recursive: true, + verbatimSymlinks: true, + }) return fixture } diff --git a/tests/unit/utils/get-global-config.test.js b/tests/unit/utils/get-global-config.test.js index 7b3eb3871be..2a6e742fc18 100644 --- a/tests/unit/utils/get-global-config.test.js +++ b/tests/unit/utils/get-global-config.test.js @@ -1,9 +1,8 @@ import { existsSync } from 'fs' -import { mkdir, readFile, rm, writeFile } from 'fs/promises' +import { cp, mkdir, readFile, rm, writeFile } from 'fs/promises' import os from 'os' import { join } from 'path' -import { copy } from 'fs-extra' import { afterAll, beforeAll, beforeEach, expect, test } from 'vitest' import { getLegacyPathInHome, getPathInHome } from '../../../dist/lib/settings.js' @@ -20,7 +19,7 @@ const tmpConfigBackupPath = join(os.tmpdir(), `netlify-config-backup-${Date.now( beforeAll(async () => { // backup current user config directory if (existsSync(configPath)) { - await copy(configPath, tmpConfigBackupPath) + await cp(configPath, tmpConfigBackupPath, { recursive: true }) } }) @@ -34,7 +33,7 @@ afterAll(async () => { // Restore user config directory if exists if (existsSync(tmpConfigBackupPath)) { await mkdir(configPath) - await copy(tmpConfigBackupPath, configPath) + await cp(tmpConfigBackupPath, configPath, { recursive: true }) // Remove tmp backup await rm(tmpConfigBackupPath, { force: true, recursive: true }) }