Files
pnpm/network/web-auth/src/index.ts
Alessio Attilio 2410cf4092 feat: add pnpm docs command and home alias (#11244)
* feat: add pnpm docs command and home alias

* chore: update manifests

* fix: address review comments for pnpm docs command

- Remove 'docs' and 'home' from NOT_IMPLEMENTED_COMMANDS to prevent
  not-implemented handlers from overriding the real implementations
- Change fallback URL from npmjs.com to npmx.dev
- Remove bugs URL as a docs fallback (it's an issue tracker, not docs)
- Fix ESM mock in tests: use jest.unstable_mockModule instead of jest.mock

* refactor: use open package for browser opening in promptBrowserOpen

Replace the hand-rolled platform-specific execFile logic with the open
npm package, which handles WSL, Docker-in-WSL, and Windows edge cases
better. This removes the execFile dependency injection from
promptBrowserOpen, OtpContext, LoginContext, and SharedContext.

* fix: address copilot review comments

- docs: use www.npmjs.com fallback (not npmx.dev) and validate homepage
  URL is http(s) before opening
- promptBrowserOpen: validate authUrl protocol before passing to open(),
  and guard against synchronous throws from open()

* fix: restore npmx.dev fallback for pnpm docs

* chore: expand changeset with web-auth refactor impact

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2026-04-14 16:20:40 +02:00

30 lines
783 B
TypeScript

export { generateQrCode } from './generateQrCode.js'
export {
pollForWebAuthToken,
type PollForWebAuthTokenParams,
type WebAuthContext,
type WebAuthFetchOptions,
type WebAuthFetchResponse,
type WebAuthFetchResponseHeaders,
} from './pollForWebAuthToken.js'
export {
promptBrowserOpen,
type PromptBrowserOpenContext,
type PromptBrowserOpenParams,
type PromptBrowserOpenReadlineInterface,
} from './promptBrowserOpen.js'
export { WebAuthTimeoutError } from './WebAuthTimeoutError.js'
export {
isOtpError,
type OtpContext,
type OtpEnquirer,
type OtpHandlingParams,
OtpNonInteractiveError,
type OtpProcess,
type OtpPromptOptions,
type OtpPromptResponse,
OtpSecondChallengeError,
SyntheticOtpError,
withOtpHandling,
} from './withOtpHandling.js'