Set `engines` in `package.json`
It would be nice to know which NodeJS versions are supported by fdir.
All that needs to be done is to add the code below to package.json:
"engines": {
"node": ">= 16.0.0"
}
I deduced version 16 based on testing NodeJS on CI here.
Testing of 14 was removed in https://github.com/thecodrr/fdir/commit/3c608bd6c87d29534dd7b37a828db43ffcbf9ab3, but I don't think that actually introduced any new stuff; if the package really does support 14, it would be nice to declare that; mocha's engines are 14+ (as are TSs) so that would be sort of nice to have to replace glob or something.
Understandable if not.
i believe that the library intentionally doesn't use newer node features to maintain compatibility, if the engines field is added it should reflect on what versions it works in even if testing on <14 was dropped
If engines is set to v14 then CI must also add tests for node v14 to make sure things remain working and there are no breaking changes.
Update: the tests don't run on node@14. If anyone can make them work on node@14 that'd be good enough to add node 14 to engines.
adding an engines field to anything above >=12.0.0 would be a breaking change for tinyglobby users btw, would it be possible to keep engines compatibility with node 12 at least during this major version?
The version of vitest depended on in this repo only supports >=14.18, though I can't even seem to use that as something in the deps uses ||= somewhere.
The tests don't actually use any fancy features of vitest, so something simpler may be usable too, but I don't think this will be super simple. Not even vitest 0.1.0 supported Node 12.
@thecodrr The feature 'AbortController' used in this commit breaks compatibility with Node 12. Is this what we expected?
Er, well, no, given the package still doesn't declare which node versions it actually supports, and therefore it's assumed that it supports all of them.
The "right" way to do it would be to typeof AbortController !== "undefined" and then conditionally enable the feature, or similar.
EDIT: Oh, you mentioned me accidentally 😅
Er, well, no, given the package still doesn't declare which node versions it actually supports, and therefore it's assumed that it supports all of them.
The "right" way to do it would be to
typeof AbortController !== "undefined"and then conditionally enable the feature, or similar.EDIT: Oh, you mentioned me accidentally 😅
Ah yes, I mentioned you by accident 😅. Thanks for your kind reply
considering fdir started using AbortController recently, breaking compatibility with node 12 and 14, the engines field should probably be set to >=16.0.0 (despite being added in 14.17.0, AbortController was only unflagged in node 15.6.0, and using an odd numbered release for the engines field is likely not a good practice). the tests run on node 16 already so it shouldn't be a big deal. i'm considering adopting that range in tinyglobby SuperchupuDev/tinyglobby#134
the engines.node field ended up getting set to >=12.0.0 in #159. i suppose this issue is solved now?