From dc1b51b65993248a934cd9d2a35b91fed6576430 Mon Sep 17 00:00:00 2001 From: Steve Larson <9larsons@gmail.com> Date: Mon, 2 Mar 2026 11:33:07 -0600 Subject: [PATCH] Remove fs-extra from @tryghost/zip Replace fs-extra with native node:fs in tests. The only fs-extra-specific function used was removeSync, replaced with fs.rmSync({recursive, force}). --- packages/zip/package.json | 1 - packages/zip/test/zip.test.js | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/zip/package.json b/packages/zip/package.json index 2eb012923..ba5eed56f 100644 --- a/packages/zip/package.json +++ b/packages/zip/package.json @@ -25,7 +25,6 @@ "devDependencies": { "c8": "11.0.0", "folder-hash": "4.1.1", - "fs-extra": "11.3.3", "mocha": "11.7.5", "sinon": "21.0.1" }, diff --git a/packages/zip/test/zip.test.js b/packages/zip/test/zip.test.js index 824d2b32e..1e3e34c9a 100644 --- a/packages/zip/test/zip.test.js +++ b/packages/zip/test/zip.test.js @@ -1,6 +1,6 @@ const assert = require('assert/strict'); const path = require('path'); -const fs = require('fs-extra'); +const fs = require('fs'); const {hashElement} = require('folder-hash'); const archiver = require('archiver'); const EventEmitter = require('events'); @@ -13,9 +13,9 @@ describe('Compress and Extract should be opposite functions', function () { let symlinkPath, themeFolder, zipDestination, unzipDestination; const cleanUp = () => { - fs.removeSync(symlinkPath); - fs.removeSync(zipDestination); - fs.removeSync(unzipDestination); + fs.rmSync(symlinkPath, {recursive: true, force: true}); + fs.rmSync(zipDestination, {recursive: true, force: true}); + fs.rmSync(unzipDestination, {recursive: true, force: true}); }; before(function () { @@ -107,19 +107,19 @@ describe('Extract zip', function () { afterEach(function () { if (fs.existsSync(zipDestination)) { - fs.removeSync(zipDestination); + fs.rmSync(zipDestination, {recursive: true, force: true}); } if (fs.existsSync(unzipDestination)) { - fs.removeSync(unzipDestination); + fs.rmSync(unzipDestination, {recursive: true, force: true}); } if (fs.existsSync(symLinkPath)) { - fs.removeSync(symLinkPath); + fs.rmSync(symLinkPath, {recursive: true, force: true}); } if (fs.existsSync(longFilePath)) { - fs.removeSync(longFilePath); + fs.rmSync(longFilePath, {recursive: true, force: true}); } });