Scripts: Enhance check-engines to consider "latest" versions
#14201 opened on Mar 1, 2019
Description
Previously: #12721 Related: https://github.com/WordPress/gutenberg/pull/14192#issuecomment-468732835
Currently, wp-scripts check-engines is hard-coded to default to Node >=10.0.0 and npm >=6.0.0:
This doesn't faithfully represent the versions Gutenberg expects, which are respectively "latest Node LTS" and "latest npm version"
You should be running a Node version matching the current active LTS release or newer for this plugin to work correctly.
You also should have the latest release of npm installed.
https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md#getting-started
If the check-engines script is intended to adhere to this recommendation, it should ideally do so in a way which doesn't require manual updates.
It does not appear that the underlying check-node-version project supports this, but perhaps part of the script can be to retrieve the latest versions information.
- For npm, the
data[ 'dist-tags' ].latestresult from https://registry.npmjs.org/npm JSON blob - For Node, the result of
data, firstversionof sorted by date, filtered byltsvalue equal to the current LTS codename (currently "Dubnium", may need to be manually updated) from https://nodejs.org/dist/index.json
cc @gziolo @ntwb @adamsilverstein