Skip to content

Commit

Permalink
fix(indy-vdr): export relevant packages from root (openwallet-foundat…
Browse files Browse the repository at this point in the history
…ion#1291)

Signed-off-by: Karim Stekelenburg <karim@animo.id>
  • Loading branch information
karimStekelenburg committed Feb 13, 2023
1 parent c72fd74 commit b570e0f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
11 changes: 11 additions & 0 deletions packages/indy-vdr/src/IndyVdrModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ export class IndyVdrModule implements Module {
}

public register(dependencyManager: DependencyManager) {
try {
// eslint-disable-next-line import/no-extraneous-dependencies
require('@hyperledger/indy-vdr-nodejs')
} catch (error) {
try {
require('@hyperledger/indy-vdr-react-native')
} catch (error) {
throw new Error('Error registering bindings for Indy VDR')
}
}

// Config
dependencyManager.registerInstance(IndyVdrModuleConfig, this.config)

Expand Down
1 change: 1 addition & 0 deletions packages/indy-vdr/src/anoncreds/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './IndyVdrAnonCredsRegistry'
10 changes: 3 additions & 7 deletions packages/indy-vdr/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export { IndyVdrSovDidResolver } from './dids'

try {
// eslint-disable-next-line import/no-extraneous-dependencies
require('@hyperledger/indy-vdr-nodejs')
} catch (error) {
throw new Error('Error registering nodejs bindings for Indy VDR')
}
export * from './IndyVdrModule'
export * from './IndyVdrModuleConfig'
export * from './anoncreds'
2 changes: 2 additions & 0 deletions packages/indy-vdr/tests/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Needed to register indy-vdr node bindings
import '../src/index'

require('@hyperledger/indy-vdr-nodejs')

jest.setTimeout(60000)

0 comments on commit b570e0f

Please sign in to comment.