How to use the xdl.ProjectSettings.setAsync function in xdl

To help you get started, we’ve selected a few 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 NervJS / taro / packages / taro-rn-runner / src / index.js View on Github external
return
    case 'r':
    case 'R': {
      clearConsole()
      const reset = key === 'R'
      if (reset) {
        log.withTimestamp('Asking packager to reset its cache...')
      }
      log.withTimestamp('Restarting packager...')
      Project.startAsync(projectDir, { reset })
      return
    }
    case 'd':
      clearConsole()
      dev = !dev
      await ProjectSettings.setAsync(projectDir, { dev })
      log(
        `Packager now running in ${chalk.bold(dev ? 'development' : 'production')}${chalk.reset(` mode.`)}
Please close and reopen the project in the Expo app for the
change to take effect.`
      )
      printUsage()
  }
}
github expo / xde / src / ui / MainScreen.js View on Github external
_setProjectSettingAsync = async options => {
    let projectSettings = await ProjectSettings.setAsync(this.state.projectRoot, options);
    let computedUrl = await this._computeUrlAsync(this.state.projectRoot);
    this.setState({
      projectSettings,
      computedUrl,
    });
  };
github react-community / create-react-native-app / react-native-scripts / src / scripts / start.js View on Github external
return;
    case 'r':
    case 'R': {
      clearConsole();
      const reset = key === 'R';
      if (reset) {
        log.withTimestamp('Asking packager to reset its cache...');
      }
      log.withTimestamp('Restarting packager...');
      Project.startAsync(process.cwd(), { reset });
      return;
    }
    case 'd':
      clearConsole();
      dev = !dev;
      await ProjectSettings.setAsync(process.cwd(), { dev });
      log(
        `Packager now running in ${chalk.bold(dev ? 'development' : 'production')}${chalk.reset(` mode.`)}

Please close and reopen the project in the Expo app for the
change to take effect.`
      );
      printUsage();
      return;
  }
}
github expo / exp / src / exp_commands / start.js View on Github external
let { url, isUrlFallback } = await Project.getManifestUrlWithFallbackAsync(projectDir);

  let { exp } = await ProjectUtils.readConfigJsonAsync(projectDir);

  if (!exp.isDetached) {
    urlOpts.printQRCode(url);
  }

  log('Your URL is: ' + chalk.underline(url));

  if (!exp.isDetached) {
    await printRunInstructionsAsync();
  }

  if (isUrlFallback) {
    await ProjectSettings.setAsync(projectDir, { hostType: 'lan' });

    log.warn(
      'Switched to a LAN URL because the tunnel appears to be down. ' +
        'Only devices in the same network can access the app. ' +
        'Restart with `exp start --tunnel` to try reconnecting.'
    );
  }

  const recipient = await sendTo.getRecipient(options.sendTo);
  if (recipient) {
    await sendTo.sendUrlAsync(url, recipient);
  }

  await urlOpts.handleMobileOptsAsync(projectDir, options);

  log(chalk.green('Logs for your project will appear below. Press Ctrl+C to exit.'));
github expo / exp / src / urlOpts.js View on Github external
opts.hostType = 'lan';
  } else if (options.localhost) {
    opts.hostType = 'localhost';
  } else {
    opts.hostType = 'lan';
  }

  let rawArgs = options.parent.rawArgs;
  if (hasBooleanArg(rawArgs, 'dev')) {
    opts.dev = getBooleanArg(rawArgs, 'dev');
  }
  if (hasBooleanArg(rawArgs, 'minify')) {
    opts.minify = getBooleanArg(rawArgs, 'minify');
  }

  await ProjectSettings.setAsync(projectDir, opts);

  return opts;
}
github expo / xde / src / ui / App.js View on Github external
_setProjectSettingAsync = async (options) => {
    let projectSettings = await ProjectSettings.setAsync(this.state.projectRoot, options);
    let computedUrl = await this._computeUrlAsync(this.state.projectRoot);
    this.setState({
      projectSettings,
      computedUrl,
    });
  };