Force `'default'` transform variant to be present

Summary: Enforces a `'default'` property to be present on the transform variant mapping. This will allow us to simplify transforms of assets and json to only provide one variant for the new Buck build system.

Reviewed By: jeanlauliac

Differential Revision: D5002052

fbshipit-source-id: 2a7240c1b2450f62de686c46ab2c2e5a75dea399
This commit is contained in:
David Aurelio 2017-05-04 08:28:50 -07:00 committed by Facebook Github Bot
parent 7876ffec5e
commit 11eef69936
2 changed files with 3 additions and 2 deletions

View File

@ -21,6 +21,7 @@ const RN_CLI_CONFIG = 'rn-cli.config.js';
import type {GetTransformOptions, PostMinifyProcess, PostProcessModules} from '../../packager/src/Bundler';
import type {HasteImpl} from '../../packager/src/node-haste/Module';
import type {TransformVariants} from '../../packager/src/ModuleGraph/types.flow';
/**
* Configuration file of the CLI.
@ -89,7 +90,7 @@ export type ConfigT = {
*/
hasteImpl?: HasteImpl,
transformVariants: () => {[name: string]: Object},
transformVariants: () => TransformVariants,
};
const defaultConfig: ConfigT = {

View File

@ -123,7 +123,7 @@ export type TransformResult = {|
export type TransformResults = {[string]: TransformResult};
export type TransformVariants = {[key: string]: Object};
export type TransformVariants = {+[name: string]: {}, +default: {}};
export type TransformedCodeFile = {
+code: string,