getgauge / gauge-js

JavaScript language plugin for Gauge
MIT License
81 stars 39 forks source link

Require Node 16+ while building/testing on Node 20 #596

Closed chadlwilson closed 11 months ago

chadlwilson commented 11 months ago

Node 16 is nearly EOL, and Node 20 is nearly LTS, so let's go straight there.

This PR also changes the way the plugin installs via gauge to use --omit=dev which is preferred above --production, which requires npm v7+. Since npm 7+ comes with NodeJS 15+ and NodeJS 16 is now EOL, this shouldn't be a concern, but bumping the plugin major version anyway, since this is technically not backward compatible.

gaugebot[bot] commented 11 months ago

@chadlwilson Thank you for contributing to gauge-js. Your pull request has been labeled as a release candidate 🎉🎉.

Merging this PR will trigger a release.

Please bump up the version as part of this PR.

Instructions to bump the version can found at CONTRIBUTING.md

If the CONTRIBUTING.md file does not exist or does not include instructions about bumping up the version, please looks previous commits in git history to see what changes need to be done.

chadlwilson commented 11 months ago

Currently I realised there is a problem with the use of --omit=dev via prepare or postinstall npm scripts due to the way the plugin is installed on user machines via gauge so might need to find another way to address the necessary patch of mock-fs that avoids the use of npm scripts, so converted back to draft.

chadlwilson commented 11 months ago

Moved the patch-package to run before tests, which is "non-canonical" usage of patch-package, but since npm doesn't now seem to have a "only runs when dev dependencies are installed" hook and doesn't have built-in support for patching like Yarn 2+ does - this seems the best workaround for now, until/unless mock-fs is fixed and released upstream.

mock-fs seems to be unmaintained as there is a PR at https://github.com/tschaub/mock-fs/pull/378 that would fix the issue on later Node versions without requiring one to change their production code in a way that avoids use of the more efficient "fast" code path for UTF-8 file reads.