Support node >= v18, update JSDoc, add npm badge #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Many of these changes are JSDoc updates. Adds a npm badge to the README in advance. This also removes the technically unnecessary and technically incorrect copyright declaration at the top of LICENSE.txt.
The most important change was adding
"node": ">=18.0.0"
to the "engines" field of package.json. Doing this required moving the existing test/fixtures/jsdocStub/jsdoc script to jsdoc.js and adding a newjsdoc
shell wrapper.The following explanation for this is from the file comment of the new wrapper script.
[This wrapper] is necessary to support older Node versions as package.json engines without removing the
"type": "module"
specifier. Without this shim, runningpnpm test
under many older verions caused runJsdoc.test.js and main.test.js to fail on the spawn(jsdocPath) call within runJsdoc().These older versions couldn't grok that the previous
jsdoc
stub was really written in ECMAScript Module style without a file extension:I tried adding the
--experimental-default-type=module
flag to the shebang line of the formerjsdoc
stub. Only after trying that did I realize that#!/usr/bin/env
style shebangs don't support passing command line arguments to the specified interpreter.Hence moving the original
jsdoc
stub tojsdoc.js
and invoking it via this one-line wrapper.