Skip to content

Commit c6762bb

Browse files
authored
fix(react-native): move bbs dep to bbs package (openwallet-foundation#1076)
Signed-off-by: Timo Glastra <[email protected]>
1 parent f777b3d commit c6762bb

File tree

5 files changed

+52
-14
lines changed

5 files changed

+52
-14
lines changed

Diff for: DEVREADME.md

-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
This file is intended for developers working on the internals of the framework. If you're just looking how to get started with the framework, see the [docs](./docs)
44

5-
## Installing dependencies
6-
7-
Right now, as a patch that will later be changed, some platforms will have an "error" when installing the dependencies with yarn. This is because the BBS signatures library that we use is built for Linux x86 and MacOS x86 (and not Windows and MacOS arm). This means that it will show that it could not download the binary.
8-
This is not an error for developers, the library that fails is `node-bbs-signaturs` and is an optional dependency for perfomance improvements. It will fallback to a, slower, wasm build.
9-
105
## Running tests
116

127
Test are executed using jest. Some test require either the **mediator agents** or the **ledger** to be running. When running tests that require a connection to the ledger pool, you need to set the `TEST_AGENT_PUBLIC_DID_SEED` and `GENESIS_TXN_PATH` environment variables.

Diff for: packages/bbs-signatures/README.md

+44
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,47 @@
2929
<br />
3030

3131
Aries Framework JavaScript BBS Module provides an optional addon to Aries Framework JavaScript to use BBS signatures in W3C VC exchange.
32+
33+
## Installation
34+
35+
```sh
36+
yarn add @aries-framework/bbs-signatures
37+
```
38+
39+
### React Native
40+
41+
When using AFJ inside the React Native environment, temporarily, a dependency for creating keys, signing and verifying, with bbs keys must be swapped. Inside your `package.json` the following must be added. This is only needed for React Native environments
42+
43+
#### yarn
44+
45+
```diff
46+
+ "resolutions": {
47+
+ "@mattrglobal/bbs-signatures": "@animo-id/react-native-bbs-signatures@^0.1.0",
48+
+ },
49+
"dependencies": {
50+
...
51+
+ "@animo-id/react-native-bbs-signatures": "^0.1.0",
52+
}
53+
```
54+
55+
#### npm
56+
57+
```diff
58+
+ "overrides": {
59+
+ "@mattrglobal/bbs-signatures": "@animo-id/react-native-bbs-signatures@^0.1.0",
60+
+ },
61+
"dependencies": {
62+
...
63+
+ "@animo-id/react-native-bbs-signatures": "^0.1.0",
64+
}
65+
```
66+
67+
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`.
68+
69+
The added dependency is required for autolinking and should be the same as the one used in the resolution.
70+
71+
[React Native Bbs Signature](https://github.com/animo/react-native-bbs-signatures) has some quirks with setting it up correctly. If any errors occur while using this library, please refer to their README for the installation guide.
72+
73+
### Issue with `node-bbs-signatures`
74+
75+
Right now some platforms will see an "error" when installing the `@aries-framework/bbs-signatures` package. This is because the BBS signatures library that we use under the hood is built for Linux x86 and MacOS x86 (and not Windows and MacOS arm). This means that it will show that it could not download the binary. This is not an error for developers, the library that fails is `node-bbs-signatures` and is an optional dependency for performance improvements. It will fallback to a (slower) wasm build.

Diff for: packages/bbs-signatures/package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,18 @@
3030
"@stablelib/random": "^1.0.2"
3131
},
3232
"peerDependencies": {
33-
"@aries-framework/core": "0.2.5"
33+
"@aries-framework/core": "0.2.5",
34+
"@animo-id/react-native-bbs-signatures": "^0.1.0"
3435
},
3536
"devDependencies": {
3637
"@aries-framework/node": "0.2.5",
3738
"reflect-metadata": "^0.1.13",
3839
"rimraf": "~3.0.2",
3940
"typescript": "~4.3.0"
41+
},
42+
"peerDependenciesMeta": {
43+
"@animo-id/react-native-bbs-signatures": {
44+
"optional": true
45+
}
4046
}
4147
}

Diff for: packages/react-native/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"events": "^3.3.0"
3030
},
3131
"devDependencies": {
32-
"@animo-id/react-native-bbs-signatures": "^0.1.0",
3332
"@types/indy-sdk-react-native": "npm:@types/indy-sdk@^1.16.21",
3433
"@types/react-native": "^0.64.10",
3534
"indy-sdk-react-native": "^0.2.2",
@@ -43,7 +42,6 @@
4342
"peerDependencies": {
4443
"indy-sdk-react-native": "^0.2.2",
4544
"react-native-fs": "^2.18.0",
46-
"react-native-get-random-values": "^1.7.0",
47-
"@animo-id/react-native-bbs-signatures": "^0.1.0"
45+
"react-native-get-random-values": "^1.7.0"
4846
}
4947
}

Diff for: yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
"@jridgewell/gen-mapping" "^0.1.0"
1111
"@jridgewell/trace-mapping" "^0.3.9"
1212

13-
"@animo-id/react-native-bbs-signatures@^0.1.0":
14-
version "0.1.0"
15-
resolved "https://registry.yarnpkg.com/@animo-id/react-native-bbs-signatures/-/react-native-bbs-signatures-0.1.0.tgz#f62bc16b867c9f690977982d66f0a03566b21ad2"
16-
integrity sha512-7qvsiWhGfUev8ngE8YzF6ON9PtCID5LiYVYM4EC5eyj80gCdhx3R46CI7K1qbqIlGsoTYQ/Xx5Ubo5Ji9eaUEA==
17-
1813
"@azure/core-asynciterator-polyfill@^1.0.0":
1914
version "1.0.2"
2015
resolved "https://registry.yarnpkg.com/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.2.tgz#0dd3849fb8d97f062a39db0e5cadc9ffaf861fec"

0 commit comments

Comments
 (0)