chore: fix update-specs script, use builtin fetch #3528
Merged
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.
Description
Fixes the update specs script being broken, removes unnecessary dependency
In master, when you run update specs, it fails to update commonmark specs.
This is because the place it pulls from,
https://spec.commonmark.org/<version>/spec.json
seems like it doesn't accept versions numbers without a patch anymore, and the current script sends a request formajor.minor
. It also doesn't accept requests formajor.minor.0
, or, as far as I could tell, anything except the current version. Therefore, we can just use the version from commonmark's package.json instead of lowering it tomajor.minor
.This does mean the resulting spec file gets renamed, but I think having the full version is better if we're actually pulling from the full version.
The script was also using node-fetch, but fetch has existed natively in node since (I think) node 18 so it's within marked's support window.
-->
Contributor
Committer
In most cases, this should be a different person than the contributor.