Skip to content

build: cap comment-parser below 1.4.2#337

Open
ChristianMurphy wants to merge 1 commit into
remarkjs:mainfrom
ChristianMurphy:build/pin-comment-parser
Open

build: cap comment-parser below 1.4.2#337
ChristianMurphy wants to merge 1 commit into
remarkjs:mainfrom
ChristianMurphy:build/pin-comment-parser

Conversation

@ChristianMurphy

Copy link
Copy Markdown
Member

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything or linked relevant results below
  • I made sure the docs are up to date
  • I included tests (or that’s not needed)

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 @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.

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.
@github-actions github-actions Bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jun 7, 2026
@remcohaszing

Copy link
Copy Markdown
Member

We know the tests don’t pass for other reasons. Just merge this if you feel comfortable with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤞 phase/open Post is being triaged manually

Development

Successfully merging this pull request may close these issues.

2 participants