How to use the @expo/config.ensurePWAConfig function in @expo/config

To help you get started, we’ve selected a few @expo/config 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 / webpack-config / src / Diagnosis.ts View on Github external
async function logAutoConfigValuesAsync(env: Environment) {
  const locations = env.locations || (await getPathsAsync(env.projectRoot));

  const { exp: config } = readConfigJson(env.projectRoot, true, true);

  const standardConfig = ensurePWAConfig({}, locations.absolute, {
    templateIcon: locations.template.get('icon.png'),
  });
  const pwaConfig = ensurePWAConfig(config, locations.absolute, {
    templateIcon: locations.template.get('icon.png'),
  });

  // @ts-ignore
  const nonStandard = diff(standardConfig, pwaConfig);

  let obj = {};

  for (const diff of nonStandard) {
    // console.log(chalk.bold(diff.path.join('/') + ': ') + chalk.bgRed(JSON.stringify(diff.rhs, null, 2)));

    // TODO: Bacon: add support for array updates: https://www.npmjs.com/package/deep-diff#differences
    if (diff.kind !== 'A') {
github expo / expo-cli / packages / webpack-config / src / utils / Diagnosis.ts View on Github external
async function logAutoConfigValuesAsync(env: Environment) {
  const locations = env.locations || (await getPathsAsync(env.projectRoot));

  const { exp: config } = readConfigJson(env.projectRoot);

  const standardConfig = ensurePWAConfig({}, locations.absolute, {
    templateIcon: locations.template.get('icon.png'),
  });
  const pwaConfig = ensurePWAConfig(config, locations.absolute, {
    templateIcon: locations.template.get('icon.png'),
  });

  // @ts-ignore
  const nonStandard = diff(standardConfig, pwaConfig);

  let obj = {};

  for (const diff of nonStandard) {
    // console.log(chalk.bold(diff.path.join('/') + ': ') + chalk.bgRed(JSON.stringify(diff.rhs, null, 2)));

    // TODO: Bacon: add support for array updates: https://www.npmjs.com/package/deep-diff#differences
    if (diff.kind !== 'A') {
      setDeepValue(diff.path, obj, diff);
    }
  }
github expo / expo-cli / packages / webpack-config / src / utils / Diagnosis.ts View on Github external
async function logAutoConfigValuesAsync(env: Environment) {
  const locations = env.locations || (await getPathsAsync(env.projectRoot));

  const { exp: config } = readConfigJson(env.projectRoot);

  const standardConfig = ensurePWAConfig({}, locations.absolute, {
    templateIcon: locations.template.get('icon.png'),
  });
  const pwaConfig = ensurePWAConfig(config, locations.absolute, {
    templateIcon: locations.template.get('icon.png'),
  });

  // @ts-ignore
  const nonStandard = diff(standardConfig, pwaConfig);

  let obj = {};

  for (const diff of nonStandard) {
    // console.log(chalk.bold(diff.path.join('/') + ': ') + chalk.bgRed(JSON.stringify(diff.rhs, null, 2)));

    // TODO: Bacon: add support for array updates: https://www.npmjs.com/package/deep-diff#differences
    if (diff.kind !== 'A') {
github expo / expo-cli / packages / webpack-config / src / Diagnosis.ts View on Github external
async function logAutoConfigValuesAsync(env: Environment) {
  const locations = env.locations || (await getPathsAsync(env.projectRoot));

  const { exp: config } = readConfigJson(env.projectRoot, true, true);

  const standardConfig = ensurePWAConfig({}, locations.absolute, {
    templateIcon: locations.template.get('icon.png'),
  });
  const pwaConfig = ensurePWAConfig(config, locations.absolute, {
    templateIcon: locations.template.get('icon.png'),
  });

  // @ts-ignore
  const nonStandard = diff(standardConfig, pwaConfig);

  let obj = {};

  for (const diff of nonStandard) {
    // console.log(chalk.bold(diff.path.join('/') + ': ') + chalk.bgRed(JSON.stringify(diff.rhs, null, 2)));

    // TODO: Bacon: add support for array updates: https://www.npmjs.com/package/deep-diff#differences
    if (diff.kind !== 'A') {
      setDeepValue(diff.path, obj, diff);
    }
  }