code: function getTransformCacheKey(opts: {|
    +cacheVersion: string,
    +projectRoot: string,
    +transformerConfig: TransformerConfig,
  |}): string {
    const {transformerPath, transformerConfig} = opts.transformerConfig;
  
    // eslint-disable-next-line lint/flow-no-fixme
    /* $FlowFixMe: dynamic requires prevent static typing :'(  */
    const Transformer = require(transformerPath);
    const transformerInstance = new Transformer(
      opts.projectRoot,
      transformerConfig,
    );
  
    const transformerKey =
      typeof transformerInstance.getCacheKey !== 'undefined'
        ? transformerInstance.getCacheKey()
        : '';
  
    const cacheKeyParts = [
      'metro-cache',
      VERSION,
      opts.cacheVersion,
      path.relative(path.join(__dirname, '../../../..'), opts.projectRoot),
      getKeyFromFiles([require.resolve(transformerPath)]),
      transformerKey,
    ];
  
    return crypto
      .createHash('sha1')
      .update(cacheKeyParts.join('$'))
      .digest('hex');
  }
docs: Returns a function that will return the transform cache key based on some
  passed transform options.