Skip to content

Update to NodeJS 20#124

Draft
shartte wants to merge 2 commits intoKira-NT:masterfrom
shartte:master
Draft

Update to NodeJS 20#124
shartte wants to merge 2 commits intoKira-NT:masterfrom
shartte:master

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

@Kira-NT
Copy link
Owner

Kira-NT commented Jun 30, 2024

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