How to use the @expo/xdl.UserManager.getCurrentUsernameAsync function in @expo/xdl

To help you get started, we’ve selected a few @expo/xdl 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 expo / expo-cli / packages / expo-cli / src / commands / build / BaseBuilder.js View on Github external
}
    const { id: buildId, priority, canPurchasePriorityBuilds } = result;

    log('Build started, it may take a few minutes to complete.');
    log(
      `You can check the queue length at ${chalk.underline(UrlUtils.constructTurtleStatusUrl())}\n`
    );
    if (priority === 'normal' && canPurchasePriorityBuilds) {
      log(
        'You can make this faster. 🐢\nGet priority builds at: https://expo.io/settings/billing\n'
      );
    }

    const username = this.manifest.owner
      ? this.manifest.owner
      : await UserManager.getCurrentUsernameAsync();

    if (buildId) {
      log(
        `You can monitor the build at\n\n ${chalk.underline(
          UrlUtils.constructBuildLogsUrl(buildId, username)
        )}\n`
      );
    }

    if (this.options.wait) {
      const waitOpts = publicUrl ? { publicUrl } : {};
      const completedJob = await this.wait(buildId, waitOpts);
      const artifactUrl = completedJob.artifactId
        ? UrlUtils.constructArtifactUrl(completedJob.artifactId)
        : completedJob.artifacts.url;
      log(`${chalk.green('Successfully built standalone app:')} ${chalk.underline(artifactUrl)}`);
github expo / expo-cli / packages / expo-cli / src / commands / build / BaseBuilder.js View on Github external
async logBuildStatuses(buildStatus: { jobs: Array, canPurchasePriorityBuilds: boolean }) {
    log.raw();
    log('=================');
    log(' Builds Statuses ');
    log('=================\n');

    const username = this.manifest.owner
      ? this.manifest.owner
      : await UserManager.getCurrentUsernameAsync();

    buildStatus.jobs.forEach((job, i) => {
      let platform, packageExtension;
      if (job.platform === 'ios') {
        platform = 'iOS';
        packageExtension = 'IPA';
      } else {
        platform = 'Android';
        packageExtension = 'APK';
      }

      log(`### ${i} | ${platform} | ${UrlUtils.constructBuildLogsUrl(job.id, username)} ###`);

      const hasPriorityBuilds =
        buildStatus.numberOfRemainingPriorityBuilds > 0 || buildStatus.hasUnlimitedPriorityBuilds;
      const shouldShowUpgradeInfo =
github expo / expo-cli / packages / expo-cli / src / commands / start / TerminalUI.js View on Github external
const printUsage = async (projectDir, options = {}) => {
  const { dev } = await ProjectSettings.readAsync(projectDir);
  const { exp } = await readConfigJsonAsync(projectDir);
  const openDevToolsAtStartup = await UserSettings.getAsync('openDevToolsAtStartup', true);
  const username = await UserManager.getCurrentUsernameAsync();
  const devMode = dev ? 'development' : 'production';
  const androidInfo = `${b`a`} to run on ${u`A`}ndroid device/emulator`;
  const iosInfo = process.platform === 'darwin' ? `${b`i`} to run on ${u`i`}OS simulator` : '';
  const webInfo = exp.platforms.includes('web') ? `${b`w`} to run on ${u`w`}eb` : '';
  const platformInfo = [androidInfo, iosInfo, webInfo].filter(Boolean).join(', or ');
  log.nested(`
 \u203A Press ${platformInfo}.
 \u203A Press ${b`c`} to show info on ${u`c`}onnecting new devices.
 \u203A Press ${b`d`} to open DevTools in the default web browser.
 \u203A Press ${b`shift-d`} to ${
    openDevToolsAtStartup ? 'disable' : 'enable'
  } automatically opening ${u`D`}evTools at startup.${
    options.webOnly ? '' : `\n \u203A Press ${b`e`} to send an app link with ${u`e`}mail.`
  }
 \u203A Press ${b`p`} to toggle ${u`p`}roduction mode. (current mode: ${i(devMode)})
 \u203A Press ${b`r`} to ${u`r`}estart bundler, or ${b`shift-r`} to restart and clear cache.
github expo / expo-cli / packages / expo-cli / src / commands / start / TerminalUI.js View on Github external
const printUsage = async (projectDir, options = {}) => {
  const { dev } = await ProjectSettings.readAsync(projectDir);
  const { exp } = await readConfigJsonAsync(projectDir);
  const openDevToolsAtStartup = await UserSettings.getAsync('openDevToolsAtStartup', true);
  const username = await UserManager.getCurrentUsernameAsync();
  const devMode = dev ? 'development' : 'production';
  const androidInfo = `${b`a`} to run on ${u`A`}ndroid device/emulator`;
  const iosInfo = process.platform === 'darwin' ? `${b`i`} to run on ${u`i`}OS simulator` : '';
  const webInfo = exp.platforms.includes('web') ? `${b`w`} to run on ${u`w`}eb` : '';
  const platformInfo = [androidInfo, iosInfo, webInfo].filter(Boolean).join(', or ');
  log.nested(`
 \u203A Press ${platformInfo}.
 \u203A Press ${b`c`} to show info on ${u`c`}onnecting new devices.
 \u203A Press ${b`d`} to open DevTools in the default web browser.
 \u203A Press ${b`shift-d`} to ${
    openDevToolsAtStartup ? 'disable' : 'enable'
  } automatically opening ${u`D`}evTools at startup.${
    options.webOnly ? '' : `\n \u203A Press ${b`e`} to send an app link with ${u`e`}mail.`
  }
 \u203A Press ${b`p`} to toggle ${u`p`}roduction mode. (current mode: ${i(devMode)})
 \u203A Press ${b`r`} to ${u`r`}estart bundler, or ${b`shift-r`} to restart and clear cache.
github expo / expo-cli / packages / dev-tools / server / graphql / GraphQLSchema.js View on Github external
async user() {
      const username = await UserManager.getCurrentUsernameAsync();
      return { username };
    },
  },