Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw new Error('react-native-electrode-bridge version needs to be defined')
}
const reactNative = await manifest.getNativeDependency(
PackagePath.fromString('react-native'),
{ manifestId }
)
if (!reactNative) {
throw new Error(
'react-native-electrode-bridge not found in manifest. cannot infer version to use'
)
}
log.info(`Generating ${apiName} API`)
await ApiGen.generateApi({
apiAuthor,
apiSchemaPath: schemaPath,
apiVersion,
bridgeVersion: `${bridgeDep.version || ''}`,
name: apiName,
npmScope: scope,
packageName,
reactNativeVersion: reactNative.version,
})
log.info('Success')
}
const bridgeDep = await manifest.getNativeDependency(PackagePath.fromString('react-native-electrode-bridge'))
if (!bridgeDep) {
throw new Error('react-native-electrode-bridge not found in manifest. cannot infer version to use')
}
if (!bridgeDep.version) {
throw new Error('react-native-electrode-bridge version needs to be defined')
}
const reactNative = await manifest.getNativeDependency(PackagePath.fromString('react-native'))
if (!reactNative) {
throw new Error('react-native-electrode-bridge not found in manifest. cannot infer version to use')
}
log.info(`Generating ${apiName} API`)
await ApiGen.generateApi({
bridgeVersion: `${bridgeDep.version || ''}`,
reactNativeVersion: reactNative.version,
name: apiName,
npmScope: scope,
apiSchemaPath: schemaPath,
apiVersion: apiVersion,
apiAuthor: apiAuthor,
packageName: packageName
})
log.info('Success!')
} catch (e) {
coreUtils.logErrorAndExitProcess(e)
}
}