typicode / json-server

Get a full fake REST API with zero coding in less than 30 seconds (seriously)
Other
72.67k stars 7.01k forks source link

Add explicit Node version support #1478

Closed textbook closed 8 months ago

textbook commented 8 months ago

parseArgs was added to node:util in v16.17/v8.3. Given the CI workflow is only testing 18.x and 20.x, >=18.3 seemed appropriate.

I also considered adding 18.3 explicitly to the node-version list in CI. However, note that the tests rely on the --import flag, new in v18.181, so support for v18.3 can't be automatically validated. It would be possible to add some higher-level tests that start and make requests to lib/bin.js (I tried this out in v18.3, basically copied src/app.test.ts and made it JS, and it works fine).

1 _Also it won't run in 18.18.2, the imports in the tests error out with TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts", but everything's fine as of 18.19.0._

typicode commented 8 months ago

Thank you!