Skip to content

Commit 6d0c277

Browse files
build: cap comment-parser below 1.4.2
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.
1 parent ce81d46 commit 6d0c277

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@ungap/structured-clone": "^1.0.0",
3737
"@wooorm/starry-night": "^3.0.0",
3838
"c8": "^10.0.0",
39-
"comment-parser": "^1.0.0",
39+
"comment-parser": "^1.0.0 <1.4.2",
4040
"control-pictures": "^2.0.0",
4141
"estree-util-is-identifier-name": "^3.0.0",
4242
"estree-util-visit": "^2.0.0",

0 commit comments

Comments
 (0)