How to use ern-runner-gen - 4 common examples

To help you get started, we’ve selected a few ern-runner-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 / create-runner.js View on Github external
dependenciesObjs = _.map(dependencies, d => Dependency.fromString(d))
      miniAppsPaths = _.map(miniapps, m => DependencyPath.fromString(m))
    }

    // ==============================================
    // COMMAND LOGIC
    // ==============================================
    for (const platform of platforms) {
      switch (platform) {
        case 'android': {
          await generateContainer(platform, { napDescriptor, dependenciesObjs, miniAppsPaths })
          const pathToAndroidRunner = path.join(commandCwd, platform)
          if (!fs.existsSync(pathToAndroidRunner)) {
            shell.mkdir('-p', pathToAndroidRunner)
            await spin('Generating Android Runner project',
              generateAndroidRunnerProject(
                Platform.currentPlatformVersionPath,
                pathToAndroidRunner,
                mainMiniAppName,
                false))
          }
          break
        }
        case 'ios': {
          await generateContainer(platform, { napDescriptor, dependenciesObjs, miniAppsPaths })
          const pathToIosRunner = path.join(commandCwd, platform)
          if (!fs.existsSync(pathToIosRunner)) {
            shell.mkdir('-p', pathToIosRunner)
            await spin('Generating iOS Runner project',
            generateIosRunnerProject(
              Platform.currentPlatformVersionPath,
              pathToIosRunner,
github electrode-io / electrode-native / ern-local-cli / src / commands / create-runner.js View on Github external
await spin('Generating Android Runner project',
              generateAndroidRunnerProject(
                Platform.currentPlatformVersionPath,
                pathToAndroidRunner,
                mainMiniAppName,
                false))
          }
          break
        }
        case 'ios': {
          await generateContainer(platform, { napDescriptor, dependenciesObjs, miniAppsPaths })
          const pathToIosRunner = path.join(commandCwd, platform)
          if (!fs.existsSync(pathToIosRunner)) {
            shell.mkdir('-p', pathToIosRunner)
            await spin('Generating iOS Runner project',
            generateIosRunnerProject(
              Platform.currentPlatformVersionPath,
              pathToIosRunner,
              path.join(Platform.rootDirectory, 'containergen'),
              mainMiniAppName,
              false))
          }
          break
        }
        default: {
          log.warn(`Skipping unsupported platform type : ${platform}`)
        }
      }
      log.info(`Generation complete`)
    }
  } catch (e) {
    log.error(`${e.message}`)
github electrode-io / electrode-native / ern-local-cli / src / lib / utils.js View on Github external
await reactnative.startPackagerInNewWindow(cwd)
    }
  }

  await generateContainerForRunner(platform, {
    napDescriptor: napDescriptor || undefined,
    dependenciesObjs,
    miniAppsPaths
  })

  const pathToRunner = path.join(cwd, platform)

  if (!fs.existsSync(pathToRunner)) {
    shell.mkdir('-p', pathToRunner)
    await spin(`Generating ${platform} Runner project`,
      generateRunnerProject(
        platform,
        pathToRunner,
        path.join(Platform.rootDirectory, 'containergen'),
        entryMiniAppName,
        { reactNativeDevSupportEnabled: dev }))
  } else {
    await spin(`Regenerating ${platform} Runner Configuration`,
      regenerateRunnerConfig(
        platform,
        pathToRunner,
        path.join(Platform.rootDirectory, 'containergen'),
        entryMiniAppName,
        { reactNativeDevSupportEnabled: dev }))
  }

  await launchRunner(platform, pathToRunner)
github electrode-io / electrode-native / ern-local-cli / src / lib / utils.js View on Github external
})

  const pathToRunner = path.join(cwd, platform)

  if (!fs.existsSync(pathToRunner)) {
    shell.mkdir('-p', pathToRunner)
    await spin(`Generating ${platform} Runner project`,
      generateRunnerProject(
        platform,
        pathToRunner,
        path.join(Platform.rootDirectory, 'containergen'),
        entryMiniAppName,
        { reactNativeDevSupportEnabled: dev }))
  } else {
    await spin(`Regenerating ${platform} Runner Configuration`,
      regenerateRunnerConfig(
        platform,
        pathToRunner,
        path.join(Platform.rootDirectory, 'containergen'),
        entryMiniAppName,
        { reactNativeDevSupportEnabled: dev }))
  }

  await launchRunner(platform, pathToRunner)
}