mirror of
https://github.com/hanzoai/iam-sdk.git
synced 2026-10-30 14:54:01 +00:00
CI / go (push) Waiting to run
CI / node (22) (push) Waiting to run
CI / node (24) (push) Waiting to run
CI / node (26) (push) Waiting to run
exports["."] sent the browser condition to dist/browser.js, which exports
13 names, while TypeScript types the entry from index.d.ts, which declares
25. So `import { validateToken, IamClient } from "@hanzo/iam"` typechecked,
and then esbuild --platform=browser failed with "No matching export in
dist/browser.js", as it did with Worker conditions. The 12 missing names
(IamClient, IamApiError, validateToken, clearJwksCache, OIDC_PATHS,
IAM_PATHS, BRAND_SERVER_URLS, iamUrl, serverUrlForBrand, trimServerUrl,
generatePKCEChallenge, generateState) need only fetch, WebCrypto and jose,
and dist/index.js imports nothing but jose, so the browser branch had no
reason to exist.
"." now names index.js and index.cjs under every condition, like the other
entries, and ./browser stays the browser half on its own. A browser bundle
of `{ IAM }` from "." still leaves out jose and IamClient: 35,327 bytes,
against 35,012 before.
A new dist test loads every file each exports entry names and fails when
one lacks a name another has. On the old map it lists the 12 names missing
from dist/browser.js and dist/browser.cjs.
Co-authored-by: Hanzo Dev <[email protected]>