Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.62k stars 600 forks source link

Peer dependency warnings #109

Closed hamstercat closed 6 years ago

hamstercat commented 6 years ago

I'm using this library in a react-native project, so I have not added lokijs as a dependency. This is causing yarn to throw the following warning every time I run it:

warning " > @nozbe/watermelondb@0.6.2" has unmet peer dependency "lokijs@^1.5.5".

I'm guessing the same issue is happening to web projects with the react-native dependency.

My suggestion would be to move them to optionalDependencies (both yarn and npm seem to support it).

radex commented 6 years ago

hmm, is optionalDependencies right? I'm confused about the difference between the two. If you're on the web, the dependency is not optional, after all. Same with react-native. It's not a dependency for Watermelon itself, but if you do use SQLiteAdapter, it does need to be a certain version to work

hamstercat commented 6 years ago

Yeah that's the one. It should normally work with expected version in the same way as yarn does for peer dependencies (it will check for minimum and maximum version, and warn if the version used is not within the required range).

After playing a bit in the project, I think my suggestion of using it instead of peer dependencies may not be the appropriate solution though, optional dependencies are installed automatically which isn't the end goal.

I will continue to think about it over the week-end to see if I can find something else to fix this warning.

radex commented 6 years ago

closing this for now, I'll reopen if anyone wants to get back to this