-
Notifications
You must be signed in to change notification settings - Fork 89
Feat/cleanup explorer #1023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: naga
Are you sure you want to change the base?
Feat/cleanup explorer #1023
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This use of variable 'servicesState' always evaluates to true.
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).