react-native/local-cli
Rafael Oleza e4621f4ce1 Expose the actual transformer in the config
Summary:
This diff exposes the new more generic way to configure transformers in `Metro` via the config parameter `transformerPath`.

The new generic transformers can be used to transform any kind of file, since they don't call any JS-specific method and their API is generic. They only need to implement a single `transform` method:

```
async function transform(
  absolutePath: string,
  relativePath: string,
  fileContents: Buffer,
  options: TransformOptions, // very soon these will be configurable
): Promise<{
  output: Array<mixed>,
  dependencies: Array<{
    name: string,
    data: mixed, // very soon
  }>,
}> {
  // ...
}
```

Metro already had a `transformModulePath` config param, which was used to configure how babel was called in order to generate the AST. In order to avoid confusion, but keep the current open source transformer worker, I've renamed this param to `babelTransformerPath`. We can add a layer of compatibility and detect old config params in order to show a deprecation warning.

Reviewed By: pvdz

Differential Revision: D9070810

fbshipit-source-id: aebde879736026c09537f5d236eae24c06640abf
2018-08-23 15:48:04 -07:00
..
__mocks__ metro-memory-fs: enforce explicit cwd() 2018-05-25 08:04:34 -07:00
bundle Expose the actual transformer in the config 2018-08-23 15:48:04 -07:00
core Do not override `metro.config.js` settings (#20705) 2018-08-18 05:31:41 -07:00
dependencies Expose the actual transformer in the config 2018-08-23 15:48:04 -07:00
eject Prettier RN local-cli 2018-05-11 13:00:50 -07:00
generator Ignore DevDependencies when generating template. (#20542) 2018-08-06 12:32:24 -07:00
info cli: upgrade envinfo for new features in `react-native info` 2018-05-29 17:30:16 -07:00
init Switch babel preset to metro-react-native-babel-preset (#20653) 2018-08-13 10:32:11 -07:00
install Prettier RN local-cli 2018-05-11 13:00:50 -07:00
library Prettier RN local-cli 2018-05-11 13:00:50 -07:00
link Bump Android Support Library to 27.1.1 (#20586) 2018-08-20 18:08:52 -07:00
logAndroid Prettier RN local-cli 2018-05-11 13:00:50 -07:00
logIOS Prettier RN local-cli 2018-05-11 13:00:50 -07:00
runAndroid Add missing "--terminal" argument to run-android (#20584) 2018-08-20 15:02:42 -07:00
runIOS Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
server Bugfix: Check NodeJS version successfully even for old runtimes (Fixes #20769) (#20779) 2018-08-22 20:34:41 -07:00
templates refine android config (#20731) 2018-08-23 12:17:57 -07:00
upgrade Prettier RN local-cli 2018-05-11 13:00:50 -07:00
util Expose the actual transformer in the config 2018-08-23 15:48:04 -07:00
.npmignore npmignore: ignore tests and fixtures 2018-02-27 08:42:14 -08:00
cli.js Prettier RN local-cli 2018-05-11 13:00:50 -07:00
cliEntry.js Use new configuration in react-native public cli 2018-07-25 05:47:58 -07:00
commands.js BREAKING: metro: rename 'unbundle' to 'ram bundle' 2018-07-20 09:33:57 -07:00
setup_env.bat Update license headers for MIT license 2018-02-16 18:31:53 -08:00
setup_env.sh Update license headers for MIT license 2018-02-16 18:31:53 -08:00
wrong-react-native.js Prettier files with shebang 2018-05-11 13:52:30 -07:00