How to use the @react-native-community/cli-tools.inlineString function in @react-native-community/cli-tools

To help you get started, we’ve selected a few @react-native-community/cli-tools 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 react-native-community / cli / packages / cli / src / tools / config / index.ts View on Github external
try {
      root =
        localDependencyRoot ||
        resolveNodeModuleDir(projectRoot, dependencyName);
      const output = readDependencyConfigFromDisk(root);
      config = output.config;

      if (output.legacy && !localDependencyRoot) {
        const pkg = require(path.join(root, 'package.json'));
        const link =
          pkg.homepage || `https://npmjs.com/package/${dependencyName}`;
        depsWithWarnings.push([dependencyName, link]);
      }
    } catch (error) {
      logger.warn(
        inlineString(`
          Package ${chalk.bold(
            dependencyName,
          )} has been ignored because it contains invalid configuration.

          Reason: ${chalk.dim(error.message)}`),
      );
      return acc;
    }

    const isPlatform = Object.keys(config.platforms).length > 0;

    /**
     * Legacy `rnpm` config required `haste` to be defined. With new config,
     * we do it automatically.
     *
     * @todo: Remove this once `rnpm` config is deprecated and all major RN libs are converted.