[pull] main from shadcn-ui:main - #498
Merged
Merged
Conversation
* fix(shadcn): replace node-fetch with undici
Removes the transitive node-domexception deprecation warning triggered
on install by node-fetch -> fetch-blob. Uses Node's global fetch with
undici.ProxyAgent as the dispatcher when https_proxy is set, preserving
existing proxy support.
Also declares the implicit Node version requirement (>=20.18.1, matching
undici@7's engines field) now that Node 20 is entering maintenance EOL.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: changeset
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(shadcn): expand proxy env-var support via EnvHttpProxyAgent
Switch the registry fetcher from undici.ProxyAgent (single-URI) to
undici.EnvHttpProxyAgent, which honors HTTPS_PROXY, HTTP_PROXY,
NO_PROXY (and lowercase variants). Previously only https_proxy
lowercase was respected.
Extracts the dispatcher selection into createProxyDispatcher in
packages/shadcn/src/registry/proxy.ts, with unit tests covering
all env-var permutations and an integration test that spins up a
local CONNECT-tunneling proxy to verify end-to-end routing and
NO_PROXY bypass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: update changeset
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(shadcn): add SOCKS and PAC proxy support
Extends the registry's proxy capabilities beyond HTTP/HTTPS to cover
the standard proxy mechanisms users encounter:
- SOCKS4/SOCKS5 via ALL_PROXY=socks5://... (curl convention).
Implementation uses the `socks` package wired into a custom undici
Agent's `connect` factory, so SOCKS routing flows through the same
fetch dispatcher pipeline as HTTP/HTTPS.
- PAC files via PAC_URL, with full PROXY/SOCKS/DIRECT directive
support. PacDispatcher lazily fetches and compiles the PAC script
using `pac-resolver` (running PAC JavaScript in a QuickJS WASM
sandbox via `quickjs-wasi`), then resolves and routes per request.
Detection and routing priority is PAC > SOCKS > HTTP, matching the
specificity of each mechanism (PAC can return mixed directives
per request; SOCKS and HTTP are per-process configurations).
Coverage:
- 14 new unit tests (env-var detection, priority, edge cases)
- 7 new integration tests using a hand-rolled SOCKS5 server, a
CONNECT-tunneling HTTP proxy, and a PAC file server — verifying
end-to-end routing for each mechanism plus per-host PAC directives.
A local pac-resolver.d.ts stub mirrors the v9 surface we use,
because pac-resolver@9 ships its types only via the `exports` map
which the repo's classic `moduleResolution: node` doesn't read.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: update changeset for SOCKS and PAC support
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(shadcn): tighten proxy integration tests per review
- Replace the dead "proxy-direct" response body in the test proxy's
request handler with a 502 reply. The request callback path was
never exercised (undici only sends CONNECT to the proxy), so the
unreachable JSON body was confusing dead code. Lock the new
CONNECT-only contract in with an explicit test.
- Tighten the NO_PROXY-non-match assertion from `.toHaveLength(1)` +
`.toBe("CONNECT")` to `.toEqual([{ url: originHost, method: "CONNECT" }])`,
matching the parallel HTTP_PROXY test. The looser version would
miss bugs where the dispatcher CONNECTed to the wrong host (e.g.,
the proxy's own address instead of the origin's) — the strict
version catches that bug class.
Both changes per @pomeh's review feedback.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(shadcn): rescope proxy support to SOCKS only
Per review feedback, split the proxy work: this branch now lands SOCKS
support alone and PAC moves to a follow-up PR.
Removes the PacDispatcher, the PAC directive parser, the PAC_URL env
handling and the pac-resolver type stub, along with the pac-resolver and
quickjs-wasi dependencies (the latter being ~3 MB of WASM). The socks
dependency and the entire SOCKS code path are unchanged, as is
fetchWithProxy's cross-origin redirect hardening.
ALL_PROXY remains SOCKS-only: a non-socks scheme falls through to the
explicit HTTP_PROXY / HTTPS_PROXY variables rather than being absorbed.
Changeset bumped from patch to minor.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YT4UiAoMUVeF9xaVm9ufi
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: shadcn <m@shadcn.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )