How to use the ern-core.log.info function in ern-core

To help you get started, we’ve selected a few ern-core 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 / index.ts View on Github external
function showVersion() {
  // get electrode-native local-cli version
  if (config.get('platformVersion')) {
    log.info(`ern-local-cli : ${config.get('platformVersion')}`)
  }
  // get electrode-native global-cli version
  const packageInfo = JSON.parse(
    execSync('npm ls -g electrode-native --json').toString()
  )
  if (packageInfo && packageInfo.dependencies) {
    log.info(
      `electrode-native : ${
        packageInfo.dependencies['electrode-native'].version
      }`
    )
  }
}
github electrode-io / electrode-native / ern-local-cli / src / commands / cauldron / update / miniapps.ts View on Github external
}
    } else {
      updatedMiniApps.push(miniapp)
    }
  }

  const cauldronCommitMessage = [
    `${
      miniapps.length === 1
        ? `Update ${miniapps[0]} MiniApp version in ${descriptor}`
        : `Update multiple MiniApps versions in ${descriptor}`
    }`,
  ]

  if (updatedMiniApps.length === 0) {
    log.info(
      'No changes to MiniApps resolved SHAs (pointing to same commit(s))'
    )
    if (fullRegen) {
      log.info('Performing regen anyway [--fullRegen]')
    } else {
      log.info(
        `Skipping Container regen.
Only updating Cauldron with new MiniApps versions.
To regenerate anyway use the --fullRegen option.`
      )
      await cauldron.beginTransaction()
      await cauldron.syncContainerMiniApps(descriptor!, miniapps)
      await cauldron.commitTransaction(cauldronCommitMessage)
      return
    }
  }
github electrode-io / electrode-native / ern-local-cli / src / commands / create-api-impl.ts View on Github external
hasConfig,
    nativeOnly,
    outputDirectory,
    packageName,
    paths: {
      apiImplHull: path.join(
        Platform.currentPlatformVersionPath,
        'ern-api-impl-gen',
        'hull'
      ),
      outDirectory: '',
    },
    reactNativeVersion,
    scope,
  })
  log.info('Success')
}
github electrode-io / electrode-native / ern-local-cli / src / commands / cauldron / del / file.ts View on Github external
export const commandHandler = async ({
  cauldronFilePath,
}: {
  cauldronFilePath: string
}) => {
  const cauldron = await getActiveCauldron()
  await cauldron.removeFile({ cauldronFilePath })
  log.info(`${cauldronFilePath} file successfully removed from the Cauldron`)
}
github electrode-io / electrode-native / ern-orchestrator / src / gitHub.ts View on Github external
export async function deleteBranchOrTag({
  name,
  packages,
  type,
}: {
  name: string
  packages: PackagePath[]
  type: 'branch' | 'tag'
}) {
  for (const pkg of packages) {
    if (!pkg.isGitPath) {
      log.info(`Skipping ${pkg.basePath} [not git based]`)
      continue
    }
    const opts: any = { name }
    const { owner, repo } = extractGitData(pkg)
    const api = await getGitHubApi({ owner, repo })
    const refExist =
      type === 'branch' ? await api.isBranch(name) : await api.isTag(name)
    if (!refExist) {
      log.warn(
        `Skipping ${pkg.basePath} [${name} ${type} as it does not exist]`
      )
      continue
    }
    if (type === 'branch') {
      await api.deleteBranch(opts)
    } else {
github electrode-io / electrode-native / ern-local-cli / src / commands / cauldron / repo / remove.ts View on Github external
export const commandHandler = async ({ alias }: { alias: string }) => {
  cauldronRepositories.remove({ alias })
  log.info(`Removed Cauldron repository exists with alias ${alias}`)
}
github electrode-io / electrode-native / ern-local-cli / src / commands / bundlestore / use.ts View on Github external
export const commandHandler = async ({ accessKey }: { accessKey: string }) => {
  await logErrorAndExitIfNotSatisfied({
    bundleStoreUrlSetInCauldron: {
      extraErrorMessage: `You should add bundleStore config in your Cauldron`,
    },
  })

  const cauldron = await getActiveCauldron()
  const bundleStoreUrl = (await cauldron.getBundleStoreConfig()).url
  const sdk = new BundleStoreSdk(bundleStoreUrl)

  const store = await sdk.getStoreByAccessKey({ accessKey })
  config.set('bundlestore-id', store)
  config.set('bundlestore-accesskey', accessKey)

  log.info(`Now using store ${store}`)
}
github electrode-io / electrode-native / ern-local-cli / src / commands / cauldron / why.ts View on Github external
extraErrorMessage:
          'This command cannot work on a non existing native application version',
      },
    })
  } else {
    descriptor = await askUserToChooseANapDescriptorFromCauldron()
  }

  const cauldron = await getActiveCauldron()
  const lock = await cauldron.getYarnLock(descriptor, 'container')
  if (lock) {
    const tree = YarnLockParser.fromContent(
      lock.toString()
    ).buildDependencyTree(dependency)
    if (_.isEmpty(tree)) {
      log.info(`${dependency} is not part of the Composite of ${descriptor}`)
    } else {
      log.info(treeify.asTree(tree, true, true))
    }
  } else {
    throw new Error(
      `No yarn lock was found in Cauldron for ${descriptor} Container`
    )
  }
}
github electrode-io / electrode-native / ern-container-gen / src / publishers / MavenPublisher.ts View on Github external
mavenPassword: config.extra && config.extra.mavenPassword,
                mavenUser: config.extra && config.extra.mavenUser,
              })}
          }
      }
  }
  `
    )

    try {
      log.info('[=== Starting build and publication ===]')
      shell.pushd(config.containerPath)
      await this.buildAndUploadArchive()
      log.info('[=== Completed build and publication of the Container ===]')
      log.info(`[Publication url : ${config.url}]`)
      log.info(
        `[Artifact: ${config.extra.groupId}:${config.extra.artifactId}:${
          config.containerVersion
        } ]`
      )
    } finally {
      shell.popd()
    }
  }