Skip to content
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

Add react-native-bbs-signatures as optional peer dependency #139

Open
TimoGlastra opened this issue Jul 15, 2022 · 0 comments
Open

Add react-native-bbs-signatures as optional peer dependency #139

TimoGlastra opened this issue Jul 15, 2022 · 0 comments

Comments

@TimoGlastra
Copy link

We've been working on a react native wrapper around the FFI interface that matches the interface of this library. We use it to expose the same functionlity in react native and leverage the jsonld-signatures-bbs library.

https://github.com/animo/react-native-bbs-signatures

Currently, however, we need to add overrides for all dependencies of @mattrglobal/bbs-signatures and map it to @animo-id/react-native-bbs-signatures. If we were to make @animo-id/react-native-bbs-signatures an optional peer dependency of this library and import it conditionally like is already done with node vs wasm, we wouldn't need any overrides anymore.

The package won't be installed by default and the user is still responsible for adding the dependency. It just adds support for the import in this library, meaning all packages that depend on this package (e.g. the bls12381-key-pair package) would automatically import the correct version.

We would still need to add the dependency to a react native project because autolinking only supports top-level packages declared in package.json, but it would make the setup easier.

Currently we have to add the following mapping to the package.json (depending whether you're using yarn/npm)

yarn

+   "resolutions": {
+     "@mattrglobal/bbs-signatures": "@animo-id/[email protected]",
+   }

npm

+   "overrides": {
+     "@mattrglobal/bbs-signatures": "@animo-id/[email protected]",
+   }

The resolution field says that any instance of @mattrglobal/bbs-signatures in any child dependency must be swapped
with @animo-id/react-native-bbs-signatures.

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

No branches or pull requests

1 participant