Skip to content

Bump @dittowords/text-extract to 0.5.0 - #163

Merged
jholiga merged 3 commits into
masterfrom
joey/text-extract-0.5.0
Nov 18, 2026
Merged

jholiga merged 3 commits into
masterfrom
joey/text-extract-0.5.0

Conversation

@jholiga

@jholiga jholiga commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Overview

This PR bumps @dittowords/text-extract from ^0.4.1 to ^0.5.0. It also bumps the CLI from 5.13.0 to 5.14.0.

In 0.5.0, a line longer than 4,000 characters or slower than 1 s to tokenize is skipped, so one line cannot block a scan. A skipped line has no candidates. The one code change logs lines.skipped in the scan summary, with the file and line of each skipped line (up to 20), from the new linesStoppedEarly and stoppedEarlyLines fields.

Links

Test plan

  • Run a scan from the CLI normally and ensure the scan completes successfully
  • Run a local scan of a file with two long lines, and ensure lines.skipped lists both lines. You can use this command to simulate:
    mkdir -p /tmp/ditto-long-line-demo && node -e '
    const path = "M12 2L2 7l10 5 10-5-10-5z ".repeat(250);
    const png = "iVBORw0KGgo".repeat(500);
    const pad = Array.from({ length: 40 }, (_, i) => `const pad${i} = ${i};`);
    require("fs").writeFileSync("/tmp/ditto-long-line-demo/Icon.tsx", [
      "export const title = \"Before the icon\";",
      "const icon = `<svg viewBox=\"0 0 24 24\">",
      `  <path d="${path}"/>`,
      "</svg>`;",
      `const logo = "data:image/png;base64,${png}";`,
      "export const Save = () => <button>Save changes</button>;",
      "export const Empty = () => <p>No results found</p>;",
      ...pad,
      "",
    ].join("\n"));'
    yarn start scan /tmp/ditto-long-line-demo --local --out-dir /tmp/ditto-long-line-out
    The expected output has lines.skipped: 2, then Icon.tsx:3 and Icon.tsx:5. The 40 short pad lines keep the file under the minified-file limit.
  • Open /tmp/ditto-long-line-out/candidates.ndjson, and ensure that it has 5 candidates, including Save changes and No results found. Those strings come after the long lines.

Log the lines that text-extract skipped in the scan summary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jholiga
jholiga marked this pull request as ready for review October 22, 2026 14:20
@jholiga
jholiga requested a review from laurakoye October 22, 2026 14:20
@jholiga
jholiga force-pushed the joey/text-extract-0.5.0 branch from 30b5b05 to c89dbef Compare November 18, 2026 01:04
@jholiga
jholiga force-pushed the joey/text-extract-0.5.0 branch from c89dbef to d15276c Compare November 18, 2026 01:06
@jholiga
jholiga merged commit 0ffacb9 into master Nov 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants