build: cap comment-parser below 1.4.2#337
Open
ChristianMurphy wants to merge 1 commit into
Open
Conversation
Problem: comment-parser 1.4.2 changed its type tokenizer to skip leading
blank lines and capture a `{...}` block on the line after a tag as the
JSDoc type. script/info.js writes example metadata as `@example`
followed by `{"name": "..."}` on the next line and reads that JSON from
`tag.description`. From 1.4.2 on the JSON is captured as `tag.type`
instead, so `JSON.parse` of the description's first line throws
"Unexpected end of JSON input", aborting `npm run generate` and the
tests. The dependency was `^1.0.0` with no lockfile, so fresh installs
and CI resolved 1.4.7 and broke.
Goal: restore readme generation and the test suite, keeping a range on
the dependency rather than an exact pin, until info.js is made robust to
the new tokenizer behaviour.
Changes:
- constrain `comment-parser` to `^1.0.0 <1.4.2`, which resolves to
1.4.1, the last release that keeps next-line example metadata in
`tag.description`
Notes: an `overrides` entry was tried first but npm rejects it with
EOVERRIDE because comment-parser is a direct dependency; overrides on a
direct dependency must share its exact spec. Bisected, 1.4.1 works and
1.4.2 breaks; the 1.4.2 changelog calls it "ensure type, name and
description on subsequent lines are properly parsed". The durable fix is
to parse examples with explicit tokenizers that do not treat `{...}` as
a type; this bound is the interim unblock.
remcohaszing
approved these changes
Jun 8, 2026
Member
|
We know the tests don’t pass for other reasons. Just merge this if you feel comfortable with it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Initial checklist
Description of changes
Problem: comment-parser 1.4.2 changed its type tokenizer to skip leading blank lines and capture a
{...}block on the line after a tag as the JSDoc type. script/info.js writes example metadata as@examplefollowed by{"name": "..."}on the next line and reads that JSON fromtag.description. From 1.4.2 on the JSON is captured astag.typeinstead, soJSON.parseof the description's first line throws "Unexpected end of JSON input", abortingnpm run generateand the tests. The dependency was^1.0.0with no lockfile, so fresh installs and CI resolved 1.4.7 and broke.Goal: restore readme generation and the test suite, keeping a range on the dependency rather than an exact pin, until info.js is made robust to the new tokenizer behaviour.
Changes:
comment-parserto^1.0.0 <1.4.2, which resolves to 1.4.1, the last release that keeps next-line example metadata intag.descriptionNotes: an
overridesentry was tried first but npm rejects it with EOVERRIDE because comment-parser is a direct dependency; overrides on a direct dependency must share its exact spec. Bisected, 1.4.1 works and 1.4.2 breaks; the 1.4.2 changelog calls it "ensure type, name and description on subsequent lines are properly parsed". The durable fix is to parse examples with explicit tokenizers that do not treat{...}as a type; this bound is the interim unblock.