patch-package
patch-package copied to clipboard
chore: replace fs-extra with native Node.js fs APIs
Summary
- Replaces all
fs-extrausage with native Node.jsfsmodule equivalents - Adds inline
copySynchelper with file permission preservation and symlink dereferencing support - Removes
fs-extraand@types/fs-extrafrom dependencies, bumps@types/nodeto^14.14.0
Changes
Source files:
src/makePatch.ts— AddedcopySynchelper usingcopyFileSync+chmodSyncfor permission preservation; replacedmkdirpSync→mkdirSync({recursive}),removeSync→rmSync({recursive, force})src/patch/apply.ts—moveSync→renameSync,ensureDirSync→mkdirSync({recursive})src/filterFiles.ts—removeSync→rmSync({force})src/applyPatches.ts,src/detectPackageManager.ts,src/getAppRootPath.ts,src/getPackageResolution.ts,src/patch/read.ts— Import swap fromfs-extratofs
Test files:
src/patch/read.test.ts— Updated mock fromfs-extratofsproperty-based-tests/executeTestCase.ts— Rewrote mock to spreadjest.requireActual("fs")with selective overridesintegration-tests/runIntegrationTest.ts— Replacedfs-extra+rimrafwith nativefsintegration-tests/newIntegrationTest.ts—mkdirpSync→mkdirSync({recursive})
Dependencies:
package.json— Removedfs-extra,@types/fs-extra; bumped@types/nodeto^14.14.0
Testing
- 9 test suites pass (7 unit + 2 property-based), 467 tests passing
- TypeScript compiles clean
- All linting passes
Addresses #499
@ds300 LGTM