-
Notifications
You must be signed in to change notification settings - Fork 89
fix(auth): split storage entrypoints for browser and node #1049
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: chore/cleanup-explorer
Are you sure you want to change the base?
fix(auth): split storage entrypoints for browser and node #1049
Conversation
…rypoints-for-browser-and-node
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 splits storage entrypoints into separate browser and node paths to prevent client bundlers from pulling in the node-localstorage dependency. The root storagePlugins export is narrowed to browser-only (localStorage), while Node.js consumers are updated to import from a dedicated @lit-protocol/auth/storage-node entrypoint.
- Created separate storage subpath exports:
@lit-protocol/auth/storage(browser) and@lit-protocol/auth/storage-node(Node.js) - Updated all Node.js consumers (e2e tests, artillery, auth-services) to use the new storage-node import path
- Updated documentation and examples to reflect the new import patterns
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.base.json | Adds TypeScript path mappings for the new storage and storage-node entrypoints |
| packages/auth/storage.ts | New entrypoint file that re-exports browser storage from src/storage.ts |
| packages/auth/storage-node.ts | New entrypoint file that re-exports node storage from src/storage-node.ts |
| packages/auth/src/storage.ts | New source file exporting browser-only localStorage and storagePlugins |
| packages/auth/src/storage-node.ts | New source file exporting Node.js localStorageNode and storagePlugins |
| packages/auth/src/lib/storage/localStorageNode.ts | Updated usage documentation comment to reference the new import path |
| packages/auth/src/index.ts | Removed localStorageNode from exports, keeping only browser-compatible localStorage |
| packages/auth/package.json | Added package exports and typesVersions configuration for the new subpath entrypoints |
| packages/e2e/src/**/*.ts (7 files) | Updated imports to use storagePlugins from @lit-protocol/auth/storage-node |
| packages/auth-services/src/_setup/initSystemContext.ts | Updated imports to use storagePlugins from @lit-protocol/auth/storage-node |
| packages/artillery/src/**/*.ts (2 files) | Updated imports to use storagePlugins from @lit-protocol/auth/storage-node |
| docs/**/*.mdx (3 files) | Updated documentation examples to show correct import paths for both browser and node environments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…' 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.
WHAT
Examples
Tests
Then, go to localhost:5554