Skip to content

chore: refactor client package to use esm#33

Open
stephancill wants to merge 4 commits intoMobileWalletProtocol:masterfrom
stephancill:chore/esm
Open

chore: refactor client package to use esm#33
stephancill wants to merge 4 commits intoMobileWalletProtocol:masterfrom
stephancill:chore/esm

Conversation

@stephancill
Copy link

Summary

Refactored packages/client to use ESM.

Depends on #32

How did you test your changes?

  • Built the package using yarn build
  • Verified types are correct using npx @arethetypeswrong/cli --pack
  • Ensured tests still execute and pass

Comment on lines -1 to +6
import AsyncStorage from '@react-native-async-storage/async-storage';
import AsyncStorage_, { AsyncStorageStatic } from '@react-native-async-storage/async-storage';

import { KeyValueStorage, Scope, ScopedStorage } from './types';
import { KeyValueStorage, Scope, ScopedStorage } from './types.js';

// AsyncStorage type not correctly inferred by compiler so we have to cast it manually
const AsyncStorage = AsyncStorage_ as unknown as AsyncStorageStatic;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the one weird issue I ran into when migrating. Seems like the type isn't being inferred correctly from the default export

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant