How to use the babel-runtime/helpers/async-to-generator function in babel-runtime

To help you get started, we’ve selected a few babel-runtime 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 / exp / build / commands / version.js View on Github external
'use strict';

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var jsonFile = require('@exponent/json-file');
var path = require('path');

module.exports = {
  name: 'value',
  description: "Displays the version of exp that you are using",
  help: "Displays the version of exp you are using. `exp` is versioned using semver (http://semver.org/) and the version is always described in the `package.json` file and matches the version number in `npm`.",
  runAsync: _asyncToGenerator(function* (env) {
    var argv = env.argv;
    var args = argv._;

    var version = yield jsonFile.getAsync(path.join(__dirname, '..', '..', 'package.json'), 'version');
    console.log(version);
  })
};
github expo / xde / build / application / metadata.js View on Github external
'use strict';

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var reactNativeVersionInfoAsync = _asyncToGenerator(function* () {

  var reactNativePkgJson = jsonFile(path.resolve(__dirname, '../../node_modules/react-native/package.json'));

  return yield promiseProps({
    versionDescription: packageJsonFile().getAsync('dependencies.react-native'),
    versionSpecific: reactNativePkgJson.getAsync('version')
  });
});

var jsonFile = require('@exponent/json-file');
var path = require('path');
var promiseProps = require('promise-props');

function packageJsonFile() {
github expo / xde / build / application / packager.js View on Github external
'use strict';

var _get = require('babel-runtime/helpers/get')['default'];

var _inherits = require('babel-runtime/helpers/inherits')['default'];

var _createClass = require('babel-runtime/helpers/create-class')['default'];

var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var _slicedToArray = require('babel-runtime/helpers/sliced-to-array')['default'];

var _Object$assign = require('babel-runtime/core-js/object/assign')['default'];

var _Promise = require('babel-runtime/core-js/promise')['default'];

var child_process = require('child_process');
var crayon = require('@ccheever/crayon');
var freeportAsync = require('freeport-async');
var instapromise = require('instapromise');
var ngrok = require('ngrok');
var path = require('path');
var events = require('events');

var urlUtils = require('./urlUtils');
github expo / xde / build / web / Simulator.js View on Github external
'use strict';

var _get = require('babel-runtime/helpers/get')['default'];

var _inherits = require('babel-runtime/helpers/inherits')['default'];

var _createDecoratedClass = require('babel-runtime/helpers/create-decorated-class')['default'];

var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var _extends = require('babel-runtime/helpers/extends')['default'];

var React = require('react');

var autobind = require('autobind-decorator');
var escapeHtml = require('escape-html');
var execAsync = require('exec-async');
var gitInfoAsync = require('git-info-async');
var jsonFile = require('@exponent/json-file');
var path = require('path');

var Api = require('../application/Api');
var config = require('../config');
var Commands = require('./Commands');
var Exp = require('../application/Exp');
github expo / exp / build / commands / web.js View on Github external
'use strict';

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var child_process = require('child_process');
var crayon = require('@ccheever/crayon');
var instapromise = require('instapromise');
var qrcodeTerminal = require('qrcode-terminal');
var simpleSpinner = require('@exponent/simple-spinner');

var CommandError = require('./CommandError');
var log = require('../log');
var sendTo = require('./sendTo');
var urlOpts = require('./urlOpts');
var urlUtil = require('../urlUtil');

module.exports = {
  name: 'web',
  options: [['--test', 'Will test to make sure the URL is valid']],
github expo / exp / build / commands / logs.js View on Github external
'use strict';

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var crayon = require('@ccheever/crayon');
var pm2 = require('pm2');

var CommandError = require('./CommandError');
var config = require('../config');
var log = require('../log');
var pm2serve = require('./pm2serve');

module.exports = {
  name: 'logs',
  description: "Streams the exp-serve logs to a terminal window",
  args: ['[path-to-project]'],
  options: [['--lines', "Number of lines of history to go back", 200], ['--raw', "View raw logs (with no prefixing)"]],
  runAsync: _asyncToGenerator(function* (env) {
    var argv = env.argv;
github expo / exp / build / commands / init.js View on Github external
'use strict';

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var crayon = require('@ccheever/crayon');
var fs = require('fs');
var instapromise = require('instapromise');
var jsonFile = require('@exponent/json-file');
var mkdirp = require('mkdirp');
var path = require('path');

var spawnAsync = require('@exponent/spawn-async');

var CommandError = require('./CommandError');
var log = require('../log');

module.exports = {
  name: 'init',
  description: 'Initializes a directory so it can be used with exp',
github expo / xde / build / commands / runPackager.js View on Github external
'use strict';

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var path = require('path');

var Exp = require('../application/Exp');
var PackagerController = require('../application/PackagerController');
var userSettings = require('../application/userSettings');

module.exports = {
  runAsync: _asyncToGenerator(function* (env, args) {

    if (!env.root) {
      throw new Error("Can't run packager without `env.root` defined");
    }

    if (!env.entryPoint) {
      env.entryPoint = yield Exp.determineEntryPoint(env.root);
github expo / exp / build / commands / whoami.js View on Github external
'use strict';

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var _Object$keys = require('babel-runtime/core-js/object/keys')['default'];

var crayon = require('@ccheever/crayon');

var api = require('../api');
var CommandError = require('./CommandError');
var log = require('../log');
var userSettings = require('../userSettings');

function NotLoggedIn(message) {
  var err = new Error(message);
  err._isNotLoggedIn = true;
  return err;
}
github expo / xde / build / web / SimulatorControls.js View on Github external
'use strict';

var _get = require('babel-runtime/helpers/get')['default'];

var _inherits = require('babel-runtime/helpers/inherits')['default'];

var _createDecoratedClass = require('babel-runtime/helpers/create-decorated-class')['default'];

var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];

var _asyncToGenerator = require('babel-runtime/helpers/async-to-generator')['default'];

var _extends = require('babel-runtime/helpers/extends')['default'];

var React = require('react');

var autobind = require('autobind-decorator');
var escapeHtml = require('escape-html');
var execAsync = require('exec-async');
var gitInfoAsync = require('git-info-async');
var jsonFile = require('@exponent/json-file');
var path = require('path');

var Api = require('../application/Api');
var config = require('../config');
var Commands = require('./Commands');
var Exp = require('../application/Exp');