Commit 6d0c277
committed
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
0 commit comments