How to use the ern-container-gen.generateMiniAppsComposite function in ern-container-gen

To help you get started, we’ve selected a few ern-container-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 / lib / publication.js View on Github external
// If force or skipFinalConfirmation was not provided as option, we ask user for confirmation before proceeding
    // with code-push publication
    const userConfirmedCodePushPublication = force || skipConfirmation || await askUserToConfirmCodePushPublication(miniAppsToBeCodePushed, jsApiImplsToBeCodePushed)

    if (!userConfirmedCodePushPublication) {
      return log.info('CodePush publication aborted')
    } else {
      log.info('Getting things ready for CodePush publication')
    }

    const pathsToMiniAppsToBeCodePushed = _.map(miniAppsToBeCodePushed, m => PackagePath.fromString(m.toString()))
    const pathToJsApiImplsToBeCodePushed = _.map(jsApiImplsToBeCodePushed, j => PackagePath.fromString(j.toString()))

    await spin('Generating composite module',
       generateMiniAppsComposite(pathsToMiniAppsToBeCodePushed, tmpWorkingDir, {pathToYarnLock}, pathToJsApiImplsToBeCodePushed))

    const bundleOutputDirectory = path.join(tmpWorkingDir, 'bundleOut')
    shell.mkdir('-p', bundleOutputDirectory)
    const platform = napDescriptor.platform || ''
    const bundleOutputPath = platform === 'android'
      ? path.join(bundleOutputDirectory, 'index.android.bundle')
      : path.join(bundleOutputDirectory, 'MiniApp.jsbundle')

    await spin('Generating composite bundle for miniapps', reactnative.bundle({
      entryFile: `index.${platform}.js`,
      dev: false,
      bundleOutput: bundleOutputPath,
      platform,
      assetsDest: bundleOutputDirectory
    }))