Skip to content

chore: replace fs-extra with native node:fs - #1016

Closed
roli-lpci wants to merge 1 commit into
commitizen:masterfrom
roli-lpci:chore/remove-fs-extra
Closed

roli-lpci wants to merge 1 commit into
commitizen:masterfrom
roli-lpci:chore/remove-fs-extra

Conversation

@roli-lpci

Copy link
Copy Markdown

Summary

  • Replace fs-extra dependency with native node:fs equivalents
  • Node.js has supported fs.mkdir({ recursive: true }), fs.rmSync, and fs.cpSync natively since v16, which is well within the project's engine requirement of >= 12
  • Reduces dependency count and install footprint

Changes

  • src/commitizen/commit.js: Replace ensureDir() from fs-extra with native fs.mkdir() with { recursive: true } callback
  • test/tools/clean.js: Replace fs.removeSync() with fs.rmSync(), fs.copySync() with fs.cpSync(), using native fs import
  • package.json: Remove fs-extra from dependencies

Testing

  • All 50 existing tests pass
  • Coverage thresholds met (statements 80%, branches 80%, functions 80%, lines 80%)

Part of the e18e ecosystem cleanup.

Replace fs-extra dependency with native Node.js fs module equivalents:
- ensureDir() -> fs.mkdir() with { recursive: true }
- fs.removeSync() -> fs.rmSync() with { recursive: true, force: true }
- fs.copySync() -> fs.cpSync() with { recursive: true }

All replacements use APIs available since Node.js v16, which is well
within the project's engine requirement of >= 12.

Relates to e18e/ecosystem-issues#33

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roli-lpci

Copy link
Copy Markdown
Author

Closing this rather than leaving a broken dependency-removal change open: the full CI matrix is red and the branch has had no maintainer signal. A future attempt should first reproduce and fix the cross-platform regressions before reopening.

@roli-lpci roli-lpci closed this Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant