Skip to content

[refactor] added check for node version + updated rmSync call - #21

Merged
3cp merged 2 commits into
makesjs:masterfrom
ivanbacher:issue-fix
Nov 11, 2026
Merged

3cp merged 2 commits into
makesjs:masterfrom
ivanbacher:issue-fix

Conversation

@ivanbacher

Copy link
Copy Markdown
Contributor

Added cleanup checks the Node major version: Node 26+ uses fs.rmSync; older versions use fs.rmdirSync. Both remove the temporary folder recursively.

@ivanbacher

Copy link
Copy Markdown
Contributor Author

#20

@3cp

3cp commented Nov 11, 2026

Copy link
Copy Markdown
Member

Thx! One question, the rmSync seems working on old node version too. At least since v16.14.0 according to the doc. So why we need the branches for both instead of just rmSync?

@3cp

3cp commented Nov 11, 2026

Copy link
Copy Markdown
Member

I saw I already had the comment in the code :)

      // TODO after dropping nodejs v12 support,
      // move to rmSync with recursive and force instead.
      // rmdirSync is deprecated.

@3cp

3cp commented Nov 11, 2026

Copy link
Copy Markdown
Member

mock-fs doesn't work on newer nodejs. I will merge this and fix those tests later.

@3cp
3cp merged commit 4cbadc4 into makesjs:master Nov 11, 2026
0 of 6 checks passed
@ivanbacher
ivanbacher deleted the issue-fix branch November 12, 2026 11:29
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.

2 participants