How to use the @expo/xdl.Project.stopAsync 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 / apps / test-suite / runner / Run.js View on Github external
// Wait for and parse results
  const allDone = new Promise(resolve => {
    ProjectUtils.attachLoggerStream(testSuitePath, {
      type: 'raw',
      stream: {
        write: chunk => {
          if (chunk.msg.indexOf('[TEST-SUITE-END]') >= 0) {
            resolve(JSON.parse(chunk.msg));
          }
        },
      },
    });
  });
  const results = await allDone;
  await Project.stopAsync(testSuitePath);
  process.exit(results.failed);
}
github expo / expo-cli / packages / expo-cli / src / commands / upgrade.ts View on Github external
if (!exp.sdkVersion) {
    if (workflow === 'bare') {
      log.error(
        'This command only works for bare workflow projects that also have the expo package installed and sdkVersion configured in app.json.'
      );
      throw new CommandError('SDK_VERSION_REQUIRED_FOR_UPGRADE_COMMAND_IN_BARE');
    } else {
      log.error('No sdkVersion field is present in app.json, cannot upgrade project.');
      throw new CommandError('SDK_VERSION_REQUIRED_FOR_UPGRADE_COMMAND_IN_MANAGED');
    }
  }

  // Can't upgrade if Expo is running
  let status = await Project.currentStatus(projectRoot);
  if (status === 'running') {
    await Project.stopAsync(projectRoot);
    log(
      chalk.bold.underline(
        'We found an existing expo-cli instance running for this project and closed it to continue.'
      )
    );
    log.addNewLineIfNone();
  }

  let currentSdkVersionString = exp.sdkVersion;
  let sdkVersions = await Versions.releasedSdkVersionsAsync();
  let latestSdkVersion = await Versions.newestReleasedSdkVersionAsync();
  let latestSdkVersionString = latestSdkVersion.version;
  let targetSdkVersionString =
    maybeFormatSdkVersion(requestedSdkVersion) || latestSdkVersion.version;
  let targetSdkVersion = sdkVersions[targetSdkVersionString];
github expo / expo-cli / packages / expo-cli / src / commands / export.js View on Github external
dumpAssetmap: options.dumpAssetmap,
    dumpSourcemap: options.dumpSourcemap,
    isDev: options.dev,
  };
  const absoluteOutputDir = path.resolve(process.cwd(), options.outputDir);
  await Project.exportForAppHosting(
    projectDir,
    options.publicUrl,
    options.assetUrl,
    absoluteOutputDir,
    exportOptions
  );

  if (startedOurOwn) {
    log('Terminating server processes.');
    await Project.stopAsync(projectDir);
  }

  // Merge src dirs/urls into a multimanifest if specified
  const mergeSrcDirs = [];

  // src urls were specified to merge in, so download and decompress them
  if (options.mergeSrcUrl.length > 0) {
    // delete .tmp if it exists and recreate it anew
    const tmpFolder = path.resolve(projectDir, path.join('.tmp'));
    await fs.remove(tmpFolder);
    await fs.ensureDir(tmpFolder);

    // Download the urls into a tmp dir
    const downloadDecompressPromises = options.mergeSrcUrl.map(async url => {
      // Add the absolute paths to srcDir
      const uniqFilename = `${path.basename(url, '.tar.gz')}_${crypto
github expo / expo-cli / packages / expo-cli / src / exit.ts View on Github external
process.on('SIGINT', () => {
    console.log(chalk.blue('\nStopping packager...'));
    Project.stopAsync(projectDir).then(() => {
      console.log(chalk.green('Packager stopped.'));
      process.exit();
    });
  });
}
github expo / expo / tools / expotools / src / commands / RecordDevModeTestAppFixturesCommand.ts View on Github external
if (currentState === STATE_INITIAL) {
            console.log('Triggering a live reload...');
            Fixtures.recordFindTextOnScreenEvent('INITIAL_STATE');
            currentState = STATE_FINISHED_FIRST_LOAD;
            await _rewriteAppJsFileAsync(projectDir, 'AFTER_LIVE_RELOAD');
            console.log(
              `Sometimes triggering a live reload doesn't work. If it's not happening please run 'touch ${path.join(
                projectDir,
                'App.js'
              )}'`
            );
          } else {
            console.log('Shutting down...');
            Fixtures.recordFindTextOnScreenEvent('AFTER_LIVE_RELOAD');
            await Project.stopAsync(projectDir);
            await _rewriteAppJsFileAsync(projectDir, 'INITIAL_STATE');

            process.exit(0);
          }
        }
      },
    },
github expo / expo-cli / packages / expo-cli / src / commands / publish.js View on Github external
let url = result.url;

    if (options.quiet) {
      simpleSpinner.stop();
    }

    log('Published');
    log('Your URL is\n\n' + chalk.underline(url) + '\n');
    log.raw(url);

    if (recipient) {
      await sendTo.sendUrlAsync(url, recipient);
    }
  } finally {
    if (startedOurOwn) {
      await Project.stopAsync(projectDir);
    }
  }
  return result;
}
github expo / expo-cli / packages / expo-cli / src / commands / publish.js View on Github external
let url = result.url;

    if (options.quiet) {
      simpleSpinner.stop();
    }

    log('Published');
    log('Your URL is\n\n' + chalk.underline(url) + '\n');
    log.raw(url);

    if (recipient) {
      await sendTo.sendUrlAsync(url, recipient);
    }
  } finally {
    if (startedOurOwn) {
      await Project.stopAsync(projectDir);
    }
  }
  return result;
}