Conversation
chore(explorer): remove empty dependsOn from build target
- Introduced `explorerTheme.ts` with scoped CSS for the login modal. - Created `types.ts` to define TypeScript types for authentication and modal components. - Added TypeScript configuration files (`tsconfig.json` and `tsconfig.lib.json`) for the login modal package. - Updated `pnpm-lock.yaml` to include React and related dependencies for the login modal.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the explorer and SDK packages to support dual ESM+CJS outputs, fixes all lint errors, and introduces a new @lit-protocol/login-modal React component for PKP authentication. The changes modernize the build system by switching from CommonJS to ES2022 modules with CJS compatibility layers.
Key changes:
- New login-modal package providing a React-based authentication UI
- Dual ESM/CJS build system for all packages via separate build targets
- Module format updates from
commonjstoES2022across all packages - Fix for aggressive RPC polling in the networks package
- ESLint rule suppressions and type safety improvements in Explorer
Reviewed changes
Copilot reviewed 123 out of 155 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/write-cjs-packagejson.mjs | New utility to generate CJS package.json markers |
| packages/*/package.json | Updated exports for dual ESM/CJS support |
| packages/*/tsconfig.json | Module format changed from commonjs to ES2022 |
| packages/*/project.json | Split build into build-esm and build-cjs targets |
| packages/login-modal/* | New React authentication modal package |
| packages/networks/.../createStateManager.ts | Fixed aggressive RPC polling issue |
| apps/explorer/* | Integration with new login-modal, ESLint fixes |
| docs/* | Added documentation for login-modal |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| step === 'pkp-select' && | ||
| pendingAuthData && | ||
| pendingMethod && | ||
| servicesState |
There was a problem hiding this comment.
This use of variable 'servicesState' always evaluates to true.
…' of github.com:LIT-Protocol/js-sdk into fix-auth-split-storage-entrypoints-for-browser-and-node
- contracts: export map now routes custom-network-signatures to Node-only builds and keeps browser defaults. - e2e: awaits async nagaLocal.withLocalContext. - networks: naga-local loads custom signatures via Node-only dynamic import to avoid bundling fs in browsers. - schemas: moved AuthConfig/AuthData + Lit resource schemas into schemas.ts and removed duplicate exports to fix circular/ambiguous exports.
- Updated package.json to include new applications (vite-react, svelte, portal) in dev:apps and test:apps scripts. - Modified ensure-app-test-deps.mjs to include paths for vite-react and svelte applications. - Expanded pack-auth-tarball.mjs to pack additional packages: auth-helpers and schemas. - Added serve-app-tests-index.mjs to serve the app tests index over HTTP.
…rypoints-for-browser-and-node
Signed-off-by: Anson <ansonox@gmail.com>
…rypoints-for-browser-and-node Signed-off-by: Anson <ansonox@gmail.com>
…rypoints-for-browser-and-node fix(auth): split storage entrypoints for browser and node
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WHAT
Test it in the Naga Explorer app
Quickstart
Wrap your app with
LitAuthProvider, then callshowAuthModal()when you want to prompt login.Auth services (required for non-EOA methods)
If you enable any auth method other than
eoa, you must provide:services.authServiceUrls(per network)services.loginServerUrl(Google/Discord)services.discordClientId(Discord)EOA wallet provider integration (RainbowKit / Wagmi, etc.)
By default, the EOA flow uses
window.ethereum. If your app uses a wallet framework (Wagmi, WalletConnect, custom EIP-1193 provider), pass an EOA wallet provider so the modal can authenticate with the already connected wallet client.Any EIP-1193 provider (WalletConnect / Web3Modal / Privy / Dynamic, etc.)
If your connection layer gives you an EIP-1193 provider, you can adapt it to the modal using
createEoaWalletProvider.Minting PKPs (EOA vs Auth Service)
enabledAuthMethodsincludeseoa): minting is on-chain by default (no Auth Service). The user’s connected wallet signs the transaction, so it must have gas / test tokens.POST /pkp/mint(useful when the user has no gas). This requiresservices.authServiceUrls(andservices.authServiceApiKeyif your Auth Service gates requests).POST /pkp/mint), so you must provideservices.authServiceUrls(and any required API key configuration).