How to use the ern-api-gen.ApiGen.regenerateCode function in ern-api-gen

To help you get started, we’ve selected a few ern-api-gen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electrode-io / electrode-native / ern-local-cli / src / commands / regen-api.js View on Github external
skipVersion: boolean,
  bridgeVersion: string
} = {}) {
  try {
    if (!bridgeVersion) {
      const bridgeDep = await manifest.getNativeDependency(PackagePath.fromString('react-native-electrode-bridge'))
      if (!bridgeDep) {
        throw new Error('react-native-electrode-bridge not found in manifest. please provide explicit version')
      }
      if (!bridgeDep.version) {
        throw new Error('react-native-electrode-bridge version not defined. This should not happen')
      }
      bridgeVersion = bridgeDep.version
    }

    await ApiGen.regenerateCode({bridgeVersion, skipVersion})
  } catch (e) {
    coreUtils.logErrorAndExitProcess(e)
  }
}
github electrode-io / electrode-native / ern-local-cli / src / commands / regen-api.ts View on Github external
const bridgeDep = await manifest.getNativeDependency(electrodeBridgePkg, {
      manifestId,
    })
    if (!bridgeDep) {
      throw new Error(
        `react-native-electrode-bridge is not found in manifest. Specify explicit --bridgeVersion in the command.\n ${errorMessage}`
      )
    }
    if (!bridgeDep.version) {
      throw new Error(
        `react-native-electrode-bridge version not defined. Specify explicit --bridgeVersion in the command. \n ${errorMessage}`
      )
    }
    bridgeVersion = bridgeDep.version
  }
  await ApiGen.regenerateCode({ bridgeVersion, skipVersion })
}

ern-api-gen

Electrode Native API Generator

Apache-2.0
Latest version published 4 months ago

Package Health Score

66 / 100
Full package analysis