Skip to content

types: declare pathname on ProxyTargetDetailed - #152

Merged
pi0 merged 1 commit into
unjs:mainfrom
AMNKramer:fix/types-pathname
Jun 30, 2026
Merged

pi0 merged 1 commit into
unjs:mainfrom
AMNKramer:fix/types-pathname

Conversation

@AMNKramer

@AMNKramer AMNKramer commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

setupOutgoing already reads target.pathname for ProxyTargetDetailed targets — it just uses a (target as URL) cast in _utils.ts:156 to silence the type error. Declaring the field on the interface so consumers passing a plain object can set it directly.

Summary by CodeRabbit

  • New Features
    • Expanded proxy target details to optionally include a pathname, allowing more flexible request routing and configuration.

setupOutgoing reads target.pathname for plain-object targets via a
(target as URL) cast (_utils.ts L156). Declaring the field on the
interface lets consumers set it without the type error or mirroring
the cast.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The exported ProxyTargetDetailed interface in src/types.ts now includes an optional pathname property. No other types or runtime behavior changed.

Changes

Proxy target type update

Layer / File(s) Summary
Optional pathname field
src/types.ts
ProxyTargetDetailed gains an optional pathname property.

Estimated review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny hop, a type grows new,

With pathname tucked in, soft and true.

The bunny nods and twitches a nose,

One little field, and off it goes!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly and concisely describes the main change: adding pathname to ProxyTargetDetailed.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@pi0 pi0 changed the title fix(types): declare pathname on ProxyTargetDetailed types: declare pathname on ProxyTargetDetailed Jun 28, 2026

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thnx!

@pi0
pi0 merged commit c24cd6f into unjs:main Jun 30, 2026
2 checks passed
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.94%. Comparing base (ff3c3d3) to head (168d08d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #152   +/-   ##
=======================================
  Coverage   94.94%   94.94%           
=======================================
  Files           8        8           
  Lines         791      791           
  Branches      325      325           
=======================================
  Hits          751      751           
  Misses         35       35           
  Partials        5        5           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AMNKramer
AMNKramer deleted the fix/types-pathname branch July 1, 2026 07:53
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