Skip to content

chore: drop unused deps and align shared ones with consumers - #891

Merged
Kikobeats merged 2 commits into
masterfrom
Kikobeats/dedupe-deps
Nov 15, 2026
Merged

Kikobeats merged 2 commits into
masterfrom
Kikobeats/dedupe-deps

Conversation

@Kikobeats

@Kikobeats Kikobeats commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

What changed

  • metascraper-audio, metascraper-video: drop p-reflect (declared, never required).
  • metascraper-media-provider: drop p-reflect, p-retry, p-timeout (declared, never required); serialize-error ~13.0.2 → ~8.1.0.
  • metascraper-iframe, metascraper-telegram: p-reflect ~3.1.0 → ~2.1.0 (plain require, no .default).
  • @metascraper/helpers: tldts ~7.4.18 → ~7.5.4.

Why

In microlink-api, metascraper was the only source of a second major of each of these:

dep rest of the stack metascraper had
p-retry 4 (browserless, html-get, @browserless/function) 8 (unused)
p-timeout 4 (browserless, goto, function, api) 7 (unused)
p-reflect 2 (browserless ×5, keyv-s3, api) 3
serialize-error 8 (@browserless/errors, @keyvhq/offline, isolated-function, api) 13
tldts 7.5.4 (api) 7.4.x

Moving the api and browserless up instead would change behavior: serialize-error 13 serializes non-errors to NonError and adds cause/nested errors, and the api returns that payload to function callers. Here it only formats a debug line. p-reflect 2 and 3 return the same { isFulfilled, isRejected, value, reason }.

mime (helpers on 4, browserless/api on 3) is left as is: getExtension('image/jpeg') is jpeg on 3 and jpg on 4, so either direction changes output. That is decided separately.

How it was tested

  • pnpm test: metascraper-helpers 80 passed, metascraper-audio 28, metascraper-video 23, metascraper-iframe 18, metascraper-telegram 9.
  • metascraper-media-provider: 9 failures, identical set on unmodified master (live-network yt-dlp tests; binary not downloaded with --ignore-scripts); the retry/serialize test ("keep retrying youtube unsupported errors until retry limit") passes.
  • standard clean on every touched package.

🤖 Generated with Claude Code


Note

Low Risk
Dependency-only housekeeping with intentional downgrades chosen because runtime behavior stays equivalent for p-reflect and debug-only serialize-error usage.

Overview
Trims the dependency tree by removing p-reflect from metascraper-audio and metascraper-video where it was declared but never imported, and by removing unused p-reflect, p-retry, and p-timeout from metascraper-media-provider.

Aligns versions with the rest of the microlink stack: p-reflect is pinned to ~2.1.0 in metascraper-iframe and metascraper-telegram, with imports switched from require('p-reflect').default to require('p-reflect'); serialize-error in metascraper-media-provider moves from ~13 to ~8.1.0; and @metascraper/helpers bumps tldts from ~7.4.18 to ~7.5.4.

Reviewed by Cursor Bugbot for commit 07c7c90. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Chores
    • Updated the dependencies used by several metadata extraction features, including updates and removals.
    • No changes to public APIs or user-facing behavior are indicated.

metascraper-audio, metascraper-video and metascraper-media-provider
declared p-reflect, p-retry and p-timeout without requiring them. Their
majors (p-retry 8, p-timeout 7) were the only copies of those versions
in microlink-api, next to the p-retry 4 of browserless and html-get.

@metascraper/helpers moves tldts to ~7.5.4, the range microlink-api
already uses, so both resolve to one copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Package manifests remove or change dependencies. The iframe and Telegram packages update their p-reflect imports to use the module directly.

Changes: Package dependency updates

Layer / File(s) Summary
Update package dependency declarations
packages/metascraper-audio/package.json, packages/metascraper-video/package.json, packages/metascraper-media-provider/package.json, packages/metascraper-helpers/package.json
Audio and video remove p-reflect. Media-provider removes p-reflect, p-retry, and p-timeout, and changes serialize-error from ~13.0.2 to ~8.1.0. Helpers changes tldts from ~7.4.18 to ~7.5.4.
Align p-reflect versions and imports
packages/metascraper-iframe/package.json, packages/metascraper-iframe/src/from-html.js, packages/metascraper-iframe/src/from-provider.js, packages/metascraper-telegram/package.json, packages/metascraper-telegram/src/index.js
Iframe and Telegram change the p-reflect range from ~3.1.0 to ~2.1.0. Their source imports use the module directly instead of its .default property.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to 07c7c

This change removes unused dependencies and aligns a few package versions. No concrete regression has been identified, so it looks safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "chore: drop unused deps and align shared ones with consumers" matches the main change. The PR removes unused dependencies (p-reflect, p-retry, p-timeout) from metascraper-audio, metascraper…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "chore: drop unused deps and align shared ones with consumers" matches the main change. The PR removes unused dependencies (p-reflect, p-retry, p-timeout) from metascraper-audio, metascraper-video, and metascraper-media-provider. It also aligns shared versions: p-reflect in iframe and telegram, serialize-error in media-provider, and tldts in helpers. The title is specific, concise, and uses the conventional commit prefix.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ecb307d-5ab3-4c2b-ba30-a2d36fa9d1f7
Commits

Reviewing files that changed from the base of the PR and between 6c8558b and 07c7c90.

Files selected for processing: 6

  • packages/metascraper-iframe/package.json
  • packages/metascraper-iframe/src/from-html.js
  • packages/metascraper-iframe/src/from-provider.js
  • packages/metascraper-media-provider/package.json
  • packages/metascraper-telegram/package.json
  • packages/metascraper-telegram/src/index.js

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@coveralls

coveralls commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage is 95.017% — Kikobeats/dedupe-deps into master. No base build found for master.

browserless (5 packages), keyv-s3 and microlink-api use p-reflect 2;
@browserless/errors, @keyvhq/offline, isolated-function and
microlink-api use serialize-error 8. metascraper-iframe,
metascraper-telegram and metascraper-media-provider were the only
consumers of p-reflect 3 and serialize-error 13, so a consumer installed
both majors of each.

p-reflect 2 and 3 resolve to the same shape. media-provider only prints
the serialized error in a debug line, so serialize-error 13's NonError
and cause handling are not needed there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kikobeats Kikobeats changed the title chore: drop unused deps and align tldts with consumers chore: drop unused deps and align shared ones with consumers Nov 15, 2026
@Kikobeats
Kikobeats merged commit 0947b6a into master Nov 15, 2026
67 checks passed
@Kikobeats
Kikobeats deleted the Kikobeats/dedupe-deps branch November 15, 2026 18:51
Kikobeats added a commit that referenced this pull request Nov 15, 2026
youtube-dl-exec's postinstall asks the GitHub API for the yt-dlp release.
pull_request.yml passes GITHUB_TOKEN to pnpm install, main.yml did not,
so master runs hit the anonymous runner-IP rate limit and the release job
for #891 failed at Install twice.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants