Packages are importing from app-specific code (~/kernel/*, ~/common/*), which breaks package isolation and makes them unusable outside the app context.
-
src/wallet-manager.ts~/kernel/storage/EncryptedStorage(makeWalletEncryptedStorage)
-
src/lifecycle/wallet-lifecycle.ts~/kernel/storage/Keychain(KeychainManager)
-
src/hooks/useLaunchWalletAfterSyncing.tsx~/kernel/navigation/hooks/useWalletNavigation(useWalletNavigation)
-
src/hooks/useIsOnline.ts~/kernel/connection/ConnectionProvider(useConnectionStatus)~/kernel/connection/types(ConnectionStatus)
-
src/hooks/useBestBlock.tsx~/kernel/connection/ConnectionProvider(persistPrefixKeyword)
-
src/hooks/useGenerateWalletLink.tsx~/kernel/storage/EncryptedStorage(makeWalletEncryptedStorage)
-
src/hw/hw/hw.ts~/common/providers/BackgroundTimerContext(useBackgroundTimerControl)
-
src/api/wallet-registration.ts../../../packages/api/cardano/utils/url-mapping(getBackendZeroUrl) - relative path to another package
Pass these dependencies as parameters/factory functions to the package functions/classes instead of importing them directly.
If these utilities are reusable, move them to appropriate packages:
- Storage utilities →
@yoroi/commonor new@yoroi/storagepackage - Connection utilities →
@yoroi/commonor new@yoroi/connectionpackage - Navigation utilities → Keep in app (should be injected)
If these files are only used in the app context and not meant to be part of the package API, exclude them from the package build entirely.
- Review each import to determine if it should be:
- Moved to a package
- Injected as a dependency
- Excluded from package build
- Refactor code to remove direct app imports
- Update package APIs to accept dependencies as parameters