Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to NodeJS 20 #124

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Update to NodeJS 20 #124

wants to merge 2 commits into from

Conversation

shartte
Copy link

@shartte shartte commented Jun 24, 2024

What it says on the tin :-)

Fixes #108

Tests are broken. Working on that.

mock-fs seems unmaintained and affected by changes in NodeJS 20. Relevant issue: tschaub/mock-fs#377

@shartte
Copy link
Author

shartte commented Jun 24, 2024

After further investigation:

  • mock-fs is unmaintained and incompatible with NodeJS20
  • there is fs-monkey/memfs, but they do not implement all of the APIs you use
  • I converted tests that use mockFs to use a temp directory instead
  • During conversion to a tempDir, I noticed that StreamZip is also unmaintained and has a 2-year old bug that prevents Zips from being closed when they fail to open properly: File handle is never closed when zip file is unreadable antelle/node-stream-zip#96

@Kir-Antipov
Copy link
Owner

Hi! Thanks a lot for your determination to help :)

Just a few things I wanted to mention:

  1. Please, do not include auto-generated files in the PR. I.e., *.g.ts, dist/*, and action.yml should never be committed. I almost had a heart attack when I saw "-564" on this PR :D I thought this was obvious, but I guess I need to explicitly state this in the contributing guidelines.
  2. Please try to keep the commit history of the PR clean from meaningless commits like "Trigger CI." This particular one is going to be squashed anyway, but it’s a good practice to maintain in general.

Now, to the matters of the PR itself.

  1. I'm not a big fan of mock-fs either, as it behaves pretty strangely even now: if a test that utilizes it fails, it may lead to random failures in other tests. So, I would be happy to replace it with something more mature and up-to-date. What are the problems with the suggested alternatives? I assume they don't implement async operations?
  2. I didn't want to implement tests using temp files for two reasons: personally, I dislike unnecessary file operations when everything can be stored in memory; and arguably more importantly, this approach usually ends up being pretty messy and intertwined, but I haven't seen your solution, so I cannot speak on its behalf yet :)
  3. Surprisingly, there aren't many lightweight packages for Node that deal with zip archives, so the choice was pretty limited. I didn't want to reinvent yet another wheel for this project at the time because I was kinda burnt out, so I just stuck with node-stream-zip as it did an okay job.

@shartte
Copy link
Author

shartte commented Jun 30, 2024 via email

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.

Node.js 16 is deprecated
2 participants