Skip to content

Commit

Permalink
Force 'default' transform variant to be present
Browse files Browse the repository at this point in the history
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
  • Loading branch information
davidaurelio authored and facebook-github-bot committed May 4, 2017
1 parent 7876ffe commit 11eef69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion local-cli/util/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -89,7 +90,7 @@ export type ConfigT = {
*/
hasteImpl?: HasteImpl,

transformVariants: () => {[name: string]: Object},
transformVariants: () => TransformVariants,
};

const defaultConfig: ConfigT = {
Expand Down
2 changes: 1 addition & 1 deletion packager/src/ModuleGraph/types.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 11eef69

Please sign in to comment.