relay-compiler 0.0.0-main-e0f88a3b → 0.0.0-main-2087b512

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. package/bin/RelayCompilerBin.js.flow +2 -3
  2. package/bin/RelayCompilerMain.js.flow +12 -14
  3. package/bin/relay-compiler +5613 -5548
  4. package/codegen/CodegenDirectory.js.flow +4 -5
  5. package/codegen/CodegenRunner.js.flow +11 -13
  6. package/codegen/CodegenWatcher.js.flow +3 -4
  7. package/codegen/NormalizationCodeGenerator.js.flow +13 -14
  8. package/codegen/ReaderCodeGenerator.js.flow +14 -16
  9. package/codegen/RelayCodeGenerator.js.flow +7 -7
  10. package/codegen/RelayFileWriter.js.flow +20 -22
  11. package/codegen/compileRelayArtifacts.js.flow +5 -6
  12. package/codegen/writeRelayGeneratedFile.js.flow +7 -9
  13. package/core/ASTCache.js.flow +3 -4
  14. package/core/ASTConvert.js.flow +7 -8
  15. package/core/CompilerContext.js.flow +5 -7
  16. package/core/CompilerError.js.flow +2 -2
  17. package/core/DotGraphQLParser.js.flow +4 -6
  18. package/core/IR.js.flow +2 -2
  19. package/core/IRPrinter.js.flow +3 -4
  20. package/core/IRTransformer.js.flow +4 -5
  21. package/core/IRValidator.js.flow +3 -4
  22. package/core/IRVisitor.js.flow +2 -2
  23. package/core/JSModuleParser.js.flow +2 -2
  24. package/core/RelayCompilerScope.js.flow +2 -2
  25. package/core/RelayFindGraphQLTags.js.flow +6 -7
  26. package/core/RelayGraphQLEnumsGenerator.js.flow +2 -2
  27. package/core/RelayIRTransforms.js.flow +3 -3
  28. package/core/RelayParser.js.flow +16 -18
  29. package/core/RelaySourceModuleParser.js.flow +7 -9
  30. package/core/Schema.js.flow +24 -24
  31. package/core/SchemaUtils.js.flow +3 -3
  32. package/core/filterContextForNode.js.flow +2 -3
  33. package/core/getFieldDefinition.js.flow +3 -3
  34. package/core/getIdentifierForArgumentValue.js.flow +2 -2
  35. package/core/getIdentifierForSelection.js.flow +3 -4
  36. package/core/inferRootArgumentDefinitions.js.flow +5 -6
  37. package/index.js +1 -1
  38. package/index.js.flow +33 -35
  39. package/language/RelayLanguagePluginInterface.js.flow +3 -3
  40. package/language/javascript/FindGraphQLTags.js.flow +2 -3
  41. package/language/javascript/RelayFlowBabelFactories.js.flow +1 -1
  42. package/language/javascript/RelayFlowGenerator.js.flow +16 -19
  43. package/language/javascript/RelayFlowTypeTransformers.js.flow +3 -5
  44. package/language/javascript/RelayLanguagePluginJavaScript.js.flow +2 -3
  45. package/lib/bin/RelayCompilerBin.js +2 -2
  46. package/lib/bin/RelayCompilerMain.js +10 -10
  47. package/lib/codegen/CodegenDirectory.js +2 -3
  48. package/lib/codegen/CodegenRunner.js +9 -9
  49. package/lib/codegen/CodegenWatcher.js +2 -2
  50. package/lib/codegen/NormalizationCodeGenerator.js +11 -4
  51. package/lib/codegen/ReaderCodeGenerator.js +7 -6
  52. package/lib/codegen/RelayCodeGenerator.js +11 -4
  53. package/lib/codegen/RelayFileWriter.js +14 -14
  54. package/lib/codegen/compileRelayArtifacts.js +3 -3
  55. package/lib/codegen/writeRelayGeneratedFile.js +4 -4
  56. package/lib/core/CompilerContext.js +5 -5
  57. package/lib/core/CompilerError.js +2 -1
  58. package/lib/core/DotGraphQLParser.js +4 -4
  59. package/lib/core/IRPrinter.js +2 -2
  60. package/lib/core/IRTransformer.js +2 -2
  61. package/lib/core/IRValidator.js +2 -2
  62. package/lib/core/RelayCompilerScope.js +34 -0
  63. package/lib/core/RelayFindGraphQLTags.js +2 -2
  64. package/lib/core/RelayIRTransforms.js +4 -4
  65. package/lib/core/RelayParser.js +10 -10
  66. package/lib/core/RelaySourceModuleParser.js +5 -5
  67. package/lib/core/Schema.js +2 -2
  68. package/lib/core/filterContextForNode.js +2 -1
  69. package/lib/core/getIdentifierForArgumentValue.js +2 -1
  70. package/lib/core/getIdentifierForSelection.js +3 -2
  71. package/lib/core/inferRootArgumentDefinitions.js +3 -3
  72. package/lib/index.js +46 -46
  73. package/lib/language/RelayLanguagePluginInterface.js +13 -1
  74. package/lib/language/javascript/FindGraphQLTags.js +2 -2
  75. package/lib/language/javascript/RelayFlowBabelFactories.js +2 -2
  76. package/lib/language/javascript/RelayFlowGenerator.js +3 -3
  77. package/lib/language/javascript/RelayFlowTypeTransformers.js +2 -2
  78. package/lib/language/javascript/RelayLanguagePluginJavaScript.js +2 -2
  79. package/lib/runner/Artifacts.js +3 -3
  80. package/lib/runner/BufferedFilesystem.js +2 -1
  81. package/lib/runner/GraphQLASTNodeGroup.js +2 -2
  82. package/lib/runner/GraphQLNodeMap.js +2 -2
  83. package/lib/runner/Sources.js +2 -2
  84. package/lib/runner/compileArtifacts.js +2 -2
  85. package/lib/runner/extractAST.js +2 -2
  86. package/lib/transforms/ApplyFragmentArgumentTransform.js +6 -6
  87. package/lib/transforms/ClientExtensionsTransform.js +2 -2
  88. package/lib/transforms/ConnectionTransform.js +6 -6
  89. package/lib/transforms/DeclarativeConnectionMutationTransform.js +2 -2
  90. package/lib/transforms/DeferStreamTransform.js +4 -4
  91. package/lib/transforms/DisallowIdAsAlias.js +2 -2
  92. package/lib/transforms/DisallowTypenameOnRoot.js +2 -2
  93. package/lib/transforms/FilterDirectivesTransform.js +2 -1
  94. package/lib/transforms/FlattenTransform.js +6 -6
  95. package/lib/transforms/InlineDataFragmentTransform.js +2 -2
  96. package/lib/transforms/MaskTransform.js +4 -4
  97. package/lib/transforms/MatchTransform.js +4 -4
  98. package/lib/transforms/ReactFlightComponentTransform.js +4 -4
  99. package/lib/transforms/RefetchableFragmentTransform.js +4 -4
  100. package/lib/transforms/RelayDirectiveTransform.js +2 -2
  101. package/lib/transforms/RequiredFieldTransform.js +4 -4
  102. package/lib/transforms/SkipHandleFieldTransform.js +2 -1
  103. package/lib/transforms/SkipRedundantNodesTransform.js +11 -3
  104. package/lib/transforms/SkipUnusedVariablesTransform.js +2 -1
  105. package/lib/transforms/SplitModuleImportTransform.js +2 -2
  106. package/lib/transforms/TestOperationTransform.js +3 -3
  107. package/lib/transforms/ValidateGlobalVariablesTransform.js +3 -2
  108. package/lib/transforms/ValidateRequiredArgumentsTransform.js +2 -2
  109. package/lib/transforms/ValidateServerOnlyDirectivesTransform.js +2 -2
  110. package/lib/transforms/ValidateUnusedVariablesTransform.js +2 -2
  111. package/lib/transforms/query-generators/FetchableQueryGenerator.js +2 -2
  112. package/lib/transforms/query-generators/NodeQueryGenerator.js +4 -4
  113. package/lib/transforms/query-generators/index.js +3 -3
  114. package/lib/util/joinArgumentDefinitions.js +2 -1
  115. package/package.json +2 -2
  116. package/relay-compiler.js +4 -4
  117. package/relay-compiler.min.js +4 -4
  118. package/reporters/ConsoleReporter.js.flow +2 -2
  119. package/runner/Artifacts.js.flow +4 -5
  120. package/runner/BufferedFilesystem.js.flow +3 -3
  121. package/runner/GraphQLASTNodeGroup.js.flow +2 -3
  122. package/runner/GraphQLNodeMap.js.flow +3 -3
  123. package/runner/Sources.js.flow +5 -6
  124. package/runner/compileArtifacts.js.flow +5 -6
  125. package/runner/extractAST.js.flow +4 -6
  126. package/runner/getChangedNodeNames.js.flow +2 -2
  127. package/runner/getSchemaInstance.js.flow +3 -3
  128. package/transforms/ApplyFragmentArgumentTransform.js.flow +9 -11
  129. package/transforms/ClientExtensionsTransform.js.flow +3 -4
  130. package/transforms/ConnectionTransform.js.flow +11 -13
  131. package/transforms/DeclarativeConnectionMutationTransform.js.flow +3 -5
  132. package/transforms/DeferStreamTransform.js.flow +5 -7
  133. package/transforms/DisallowIdAsAlias.js.flow +3 -4
  134. package/transforms/DisallowTypenameOnRoot.js.flow +3 -4
  135. package/transforms/FieldHandleTransform.js.flow +3 -5
  136. package/transforms/FilterCompilerDirectivesTransform.js.flow +2 -2
  137. package/transforms/FilterDirectivesTransform.js.flow +2 -2
  138. package/transforms/FlattenTransform.js.flow +5 -7
  139. package/transforms/GenerateIDFieldTransform.js.flow +4 -5
  140. package/transforms/GenerateTypeNameTransform.js.flow +4 -6
  141. package/transforms/InlineDataFragmentTransform.js.flow +3 -4
  142. package/transforms/InlineFragmentsTransform.js.flow +3 -4
  143. package/transforms/MaskTransform.js.flow +6 -8
  144. package/transforms/MatchTransform.js.flow +7 -9
  145. package/transforms/ReactFlightComponentTransform.js.flow +5 -6
  146. package/transforms/RefetchableFragmentTransform.js.flow +7 -9
  147. package/transforms/RelayDirectiveTransform.js.flow +3 -4
  148. package/transforms/RequiredFieldTransform.js.flow +10 -12
  149. package/transforms/SkipClientExtensionsTransform.js.flow +2 -2
  150. package/transforms/SkipHandleFieldTransform.js.flow +2 -2
  151. package/transforms/SkipRedundantNodesTransform.js.flow +6 -8
  152. package/transforms/SkipSplitOperationTransform.js.flow +2 -2
  153. package/transforms/SkipUnreachableNodeTransform.js.flow +3 -4
  154. package/transforms/SkipUnusedVariablesTransform.js.flow +2 -2
  155. package/transforms/SplitModuleImportTransform.js.flow +4 -5
  156. package/transforms/TestOperationTransform.js.flow +2 -2
  157. package/transforms/ValidateGlobalVariablesTransform.js.flow +3 -4
  158. package/transforms/ValidateRequiredArgumentsTransform.js.flow +5 -6
  159. package/transforms/ValidateServerOnlyDirectivesTransform.js.flow +3 -4
  160. package/transforms/ValidateUnusedVariablesTransform.js.flow +3 -4
  161. package/transforms/query-generators/FetchableQueryGenerator.js.flow +4 -5
  162. package/transforms/query-generators/NodeQueryGenerator.js.flow +5 -7
  163. package/transforms/query-generators/QueryQueryGenerator.js.flow +4 -4
  164. package/transforms/query-generators/ViewerQueryGenerator.js.flow +4 -4
  165. package/transforms/query-generators/index.js.flow +4 -5
  166. package/util/RelayCompilerCache.js.flow +0 -1
  167. package/util/TimeReporter.js.flow +2 -2
  168. package/util/argumentContainsVariables.js.flow +1 -1
  169. package/util/generateAbstractTypeRefinementKey.js.flow +2 -2
  170. package/util/getDefinitionNodeHash.js.flow +2 -3
  171. package/util/joinArgumentDefinitions.js.flow +2 -2
@@ -12,21 +12,7 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const Profiler = require('./GraphQLCompilerProfiler');
16
-
17
- const orList = require('../util/orList');
18
- const partitionArray = require('../util/partitionArray');
19
-
20
- const {DEFAULT_HANDLE_KEY} = require('../util/DefaultHandleKey');
21
- const {
22
- createCompilerError,
23
- createUserError,
24
- eachWithCombinedError,
25
- } = require('./CompilerError');
26
- const {isExecutableDefinitionAST} = require('./SchemaUtils');
27
- const {getFieldDefinitionLegacy} = require('./getFieldDefinition');
28
- const {parse: parseGraphQL, parseType, print, Source} = require('graphql');
29
-
15
+ import type {GetFieldDefinitionFn} from './getFieldDefinition';
30
16
  import type {
31
17
  Argument,
32
18
  ArgumentValue,
@@ -44,17 +30,16 @@ import type {
44
30
  Variable,
45
31
  } from './IR';
46
32
  import type {
47
- CompositeTypeID,
48
33
  Argument as FieldArgument,
34
+ CompositeTypeID,
49
35
  FieldID,
50
36
  InputTypeID,
51
37
  Schema,
52
38
  TypeID,
53
39
  } from './Schema';
54
- import type {GetFieldDefinitionFn} from './getFieldDefinition';
55
40
  import type {
56
- ASTNode,
57
41
  ArgumentNode,
42
+ ASTNode,
58
43
  BooleanValueNode,
59
44
  DefinitionNode,
60
45
  DirectiveLocationEnum,
@@ -77,6 +62,19 @@ import type {
77
62
  VariableNode,
78
63
  } from 'graphql';
79
64
 
65
+ const {DEFAULT_HANDLE_KEY} = require('../util/DefaultHandleKey');
66
+ const orList = require('../util/orList');
67
+ const partitionArray = require('../util/partitionArray');
68
+ const {
69
+ createCompilerError,
70
+ createUserError,
71
+ eachWithCombinedError,
72
+ } = require('./CompilerError');
73
+ const {getFieldDefinitionLegacy} = require('./getFieldDefinition');
74
+ const Profiler = require('./GraphQLCompilerProfiler');
75
+ const {isExecutableDefinitionAST} = require('./SchemaUtils');
76
+ const {Source, parse: parseGraphQL, parseType, print} = require('graphql');
77
+
80
78
  type ASTDefinitionNode = FragmentDefinitionNode | OperationDefinitionNode;
81
79
  type NonNullLiteralValueNode =
82
80
  | IntValueNode
@@ -12,21 +12,19 @@
12
12
 
13
13
  'use strict';
14
14
 
15
+ import type {File} from '../codegen/CodegenTypes';
16
+ import type {FileFilter} from '../codegen/CodegenWatcher';
17
+ import type {GraphQLTagFinder} from '../language/RelayLanguagePluginInterface';
18
+ import type {DocumentNode} from 'graphql';
19
+
15
20
  const ASTCache = require('./ASTCache');
16
- const GraphQL = require('graphql');
17
21
  const Profiler = require('./GraphQLCompilerProfiler');
18
-
22
+ const {memoizedFind} = require('./RelayFindGraphQLTags');
19
23
  const fs = require('fs');
24
+ const GraphQL = require('graphql');
20
25
  const invariant = require('invariant');
21
26
  const path = require('path');
22
27
 
23
- const {memoizedFind} = require('./RelayFindGraphQLTags');
24
-
25
- import type {File} from '../codegen/CodegenTypes';
26
- import type {FileFilter} from '../codegen/CodegenWatcher';
27
- import type {GraphQLTagFinder} from '../language/RelayLanguagePluginInterface';
28
- import type {DocumentNode} from 'graphql';
29
-
30
28
  export type GetFileFilter = (baseDir: string) => FileFilter;
31
29
 
32
30
  export type SourceModuleParser = {|
@@ -13,42 +13,42 @@
13
13
 
14
14
  'use strict';
15
15
 
16
+ import type {Field as IRField} from './IR';
17
+ import type {
18
+ DirectiveDefinitionNode,
19
+ DirectiveLocationEnum,
20
+ DocumentNode,
21
+ EnumTypeDefinitionNode,
22
+ FieldDefinitionNode,
23
+ InputObjectTypeDefinitionNode,
24
+ InterfaceTypeDefinitionNode,
25
+ InterfaceTypeExtensionNode,
26
+ ObjectTypeDefinitionNode,
27
+ ObjectTypeExtensionNode,
28
+ ScalarTypeDefinitionNode,
29
+ SchemaDefinitionNode,
30
+ Source,
31
+ TypeNode,
32
+ TypeSystemDefinitionNode,
33
+ TypeSystemExtensionNode,
34
+ UnionTypeDefinitionNode,
35
+ ValueNode,
36
+ } from 'graphql';
37
+
16
38
  const {createCompilerError} = require('./CompilerError');
17
39
  const {isSchemaDefinitionAST} = require('./SchemaUtils');
18
40
  const {
41
+ GraphQLBoolean,
19
42
  GraphQLFloat,
43
+ GraphQLID,
20
44
  GraphQLInt,
21
- GraphQLBoolean,
22
45
  GraphQLString,
23
- GraphQLID,
24
46
  parse,
25
47
  parseType,
26
48
  print,
27
49
  valueFromASTUntyped,
28
50
  } = require('graphql');
29
51
 
30
- import type {Field as IRField} from './IR';
31
- import type {
32
- DirectiveLocationEnum,
33
- DocumentNode,
34
- Source,
35
- TypeNode,
36
- ValueNode,
37
- ObjectTypeDefinitionNode,
38
- InterfaceTypeDefinitionNode,
39
- InputObjectTypeDefinitionNode,
40
- SchemaDefinitionNode,
41
- ScalarTypeDefinitionNode,
42
- EnumTypeDefinitionNode,
43
- UnionTypeDefinitionNode,
44
- DirectiveDefinitionNode,
45
- TypeSystemDefinitionNode,
46
- TypeSystemExtensionNode,
47
- ObjectTypeExtensionNode,
48
- InterfaceTypeExtensionNode,
49
- FieldDefinitionNode,
50
- } from 'graphql';
51
-
52
52
  type ExtensionNode =
53
53
  | TypeSystemDefinitionNode
54
54
  | TypeSystemExtensionNode
@@ -12,12 +12,12 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const {createCompilerError} = require('./CompilerError');
16
-
17
15
  import type {ScalarField} from '../core/IR';
18
- import type {CompositeTypeID, Schema, InputTypeID} from './Schema';
16
+ import type {CompositeTypeID, InputTypeID, Schema} from './Schema';
19
17
  import type {ASTNode} from 'graphql';
20
18
 
19
+ const {createCompilerError} = require('./CompilerError');
20
+
21
21
  const ID = 'id';
22
22
 
23
23
  /**
@@ -12,12 +12,11 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const CompilerContext = require('./CompilerContext');
15
+ import type {Fragment, FragmentSpread, Root} from './IR';
16
16
 
17
+ const CompilerContext = require('./CompilerContext');
17
18
  const {visit} = require('./IRVisitor');
18
19
 
19
- import type {Fragment, FragmentSpread, Root} from './IR';
20
-
21
20
  /**
22
21
  * Returns a CompilerContext containing only the documents referenced
23
22
  * by and including the provided node.
@@ -12,12 +12,12 @@
12
12
 
13
13
  'use strict';
14
14
 
15
+ import type {FieldID, Schema, TypeID} from './Schema';
16
+ import type {FieldNode} from 'graphql';
17
+
15
18
  const {createCompilerError} = require('./CompilerError');
16
19
  const {SchemaMetaFieldDef, TypeMetaFieldDef} = require('graphql');
17
20
 
18
- import type {Schema, TypeID, FieldID} from './Schema';
19
- import type {FieldNode} from 'graphql';
20
-
21
21
  export type GetFieldDefinitionFn = (
22
22
  schema: Schema,
23
23
  parentType: TypeID,
@@ -12,10 +12,10 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const invariant = require('invariant');
16
-
17
15
  import type {ArgumentValue} from './IR';
18
16
 
17
+ const invariant = require('invariant');
18
+
19
19
  /**
20
20
  * Generates an identifier for an argument value. The identifier is based on the
21
21
  * structure/order of items and keys in the value.
@@ -12,13 +12,12 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const invariant = require('invariant');
16
-
17
- const {printArguments, printDirectives} = require('./IRPrinter');
18
-
19
15
  import type {Selection} from './IR';
20
16
  import type {Schema} from './Schema';
21
17
 
18
+ const {printArguments, printDirectives} = require('./IRPrinter');
19
+ const invariant = require('invariant');
20
+
22
21
  /**
23
22
  * Generates an identifier that is unique to a given selection: the alias for
24
23
  * fields, the type for inline fragments, and a summary of the condition
@@ -12,12 +12,6 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const CompilerContext = require('./CompilerContext');
16
- const IRVisitor = require('./IRVisitor');
17
- const SchemaUtils = require('./SchemaUtils');
18
-
19
- const {createCompilerError} = require('./CompilerError');
20
-
21
15
  import type {
22
16
  Argument,
23
17
  ArgumentDefinition,
@@ -31,6 +25,11 @@ import type {
31
25
  Stream,
32
26
  } from './IR';
33
27
 
28
+ const CompilerContext = require('./CompilerContext');
29
+ const {createCompilerError} = require('./CompilerError');
30
+ const IRVisitor = require('./IRVisitor');
31
+ const SchemaUtils = require('./SchemaUtils');
32
+
34
33
  type ArgumentMap = Map<string, ArgumentDefinition>;
35
34
 
36
35
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-e0f88a3b
2
+ * Relay v0.0.0-main-2087b512
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
package/index.js.flow CHANGED
@@ -12,63 +12,61 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const ASTCache = require('./core/ASTCache');
16
- const ASTConvert = require('./core/ASTConvert');
17
- const Artifacts = require('./runner/Artifacts');
18
- const BufferedFilesystem = require('./runner/BufferedFilesystem');
19
- const CodeMarker = require('./util/CodeMarker');
15
+ const {main} = require('./bin/RelayCompilerMain');
20
16
  const CodegenDirectory = require('./codegen/CodegenDirectory');
21
17
  const CodegenRunner = require('./codegen/CodegenRunner');
22
18
  const CodegenWatcher = require('./codegen/CodegenWatcher');
19
+ const compileRelayArtifacts = require('./codegen/compileRelayArtifacts');
20
+ const RelayCodeGenerator = require('./codegen/RelayCodeGenerator');
21
+ const RelayFileWriter = require('./codegen/RelayFileWriter');
22
+ const {SourceControlMercurial} = require('./codegen/SourceControl');
23
+ const writeRelayGeneratedFile = require('./codegen/writeRelayGeneratedFile');
24
+ const ASTCache = require('./core/ASTCache');
25
+ const ASTConvert = require('./core/ASTConvert');
23
26
  const CompilerContext = require('./core/CompilerContext');
24
27
  const CompilerError = require('./core/CompilerError');
25
- const ConsoleReporter = require('./reporters/ConsoleReporter');
26
28
  const DotGraphQLParser = require('./core/DotGraphQLParser');
27
- const FindGraphQLTags = require('./language/javascript/FindGraphQLTags');
28
- const GraphQLASTNodeGroup = require('./runner/GraphQLASTNodeGroup');
29
- const GraphQLASTUtils = require('./runner/GraphQLASTUtils');
29
+ const filterContextForNode = require('./core/filterContextForNode');
30
+ const getIdentifierForArgumentValue = require('./core/getIdentifierForArgumentValue');
31
+ const getLiteralArgumentValues = require('./core/getLiteralArgumentValues');
32
+ const getNormalizationOperationName = require('./core/getNormalizationOperationName');
30
33
  const GraphQLCompilerProfiler = require('./core/GraphQLCompilerProfiler');
31
- const GraphQLNodeMap = require('./runner/GraphQLNodeMap');
34
+ const {
35
+ getReaderSourceDefinitionName,
36
+ } = require('./core/GraphQLDerivedFromMetadata');
32
37
  const GraphQLWatchmanClient = require('./core/GraphQLWatchmanClient');
33
38
  const IRPrinter = require('./core/IRPrinter');
34
39
  const IRTransformer = require('./core/IRTransformer');
35
40
  const IRVisitor = require('./core/IRVisitor');
36
41
  const JSModuleParser = require('./core/JSModuleParser');
37
- const MultiReporter = require('./reporters/MultiReporter');
38
- const RelayCodeGenerator = require('./codegen/RelayCodeGenerator');
39
- const RelayFileWriter = require('./codegen/RelayFileWriter');
40
42
  const RelayFindGraphQLTags = require('./core/RelayFindGraphQLTags');
41
- const RelayFlowGenerator = require('./language/javascript/RelayFlowGenerator');
42
43
  const RelayIRTransforms = require('./core/RelayIRTransforms');
43
44
  const RelayParser = require('./core/RelayParser');
44
45
  const RelaySchema = require('./core/Schema');
45
- const Rollout = require('./util/Rollout');
46
46
  const SchemaUtils = require('./core/SchemaUtils');
47
- const Sources = require('./runner/Sources');
48
- const StrictMap = require('./runner/StrictMap');
49
- const TimeReporter = require('./util/TimeReporter');
50
-
47
+ const FindGraphQLTags = require('./language/javascript/FindGraphQLTags');
48
+ const {
49
+ formatGeneratedCommonjsModule: formatGeneratedModule,
50
+ } = require('./language/javascript/formatGeneratedModule');
51
+ const RelayFlowGenerator = require('./language/javascript/RelayFlowGenerator');
52
+ const ConsoleReporter = require('./reporters/ConsoleReporter');
53
+ const MultiReporter = require('./reporters/MultiReporter');
54
+ const Artifacts = require('./runner/Artifacts');
55
+ const BufferedFilesystem = require('./runner/BufferedFilesystem');
51
56
  const compileArtifacts = require('./runner/compileArtifacts');
52
- const compileRelayArtifacts = require('./codegen/compileRelayArtifacts');
53
57
  const extractAST = require('./runner/extractAST');
54
- const filterContextForNode = require('./core/filterContextForNode');
55
58
  const getChangedNodeNames = require('./runner/getChangedNodeNames');
56
- const getDefinitionNodeHash = require('./util/getDefinitionNodeHash');
57
- const getIdentifierForArgumentValue = require('./core/getIdentifierForArgumentValue');
58
- const getLiteralArgumentValues = require('./core/getLiteralArgumentValues');
59
- const getNormalizationOperationName = require('./core/getNormalizationOperationName');
60
59
  const getSchemaInstance = require('./runner/getSchemaInstance');
60
+ const GraphQLASTNodeGroup = require('./runner/GraphQLASTNodeGroup');
61
+ const GraphQLASTUtils = require('./runner/GraphQLASTUtils');
62
+ const GraphQLNodeMap = require('./runner/GraphQLNodeMap');
63
+ const Sources = require('./runner/Sources');
64
+ const StrictMap = require('./runner/StrictMap');
65
+ const CodeMarker = require('./util/CodeMarker');
66
+ const getDefinitionNodeHash = require('./util/getDefinitionNodeHash');
61
67
  const md5 = require('./util/md5');
62
- const writeRelayGeneratedFile = require('./codegen/writeRelayGeneratedFile');
63
-
64
- const {main} = require('./bin/RelayCompilerMain');
65
- const {SourceControlMercurial} = require('./codegen/SourceControl');
66
- const {
67
- getReaderSourceDefinitionName,
68
- } = require('./core/GraphQLDerivedFromMetadata');
69
- const {
70
- formatGeneratedCommonjsModule: formatGeneratedModule,
71
- } = require('./language/javascript/formatGeneratedModule');
68
+ const Rollout = require('./util/Rollout');
69
+ const TimeReporter = require('./util/TimeReporter');
72
70
 
73
71
  export type {Filesystem} from './codegen/CodegenDirectory';
74
72
  export type {
@@ -12,19 +12,19 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const {RelayConcreteNode} = require('relay-runtime');
16
-
17
15
  import type {
18
16
  IsGeneratedFileFn,
19
17
  KeepExtraFileFn,
20
18
  } from '../codegen/CodegenRunner';
21
19
  import type {IRTransform} from '../core/CompilerContext';
22
- import type {GeneratedDefinition, Root, Fragment} from '../core/IR';
20
+ import type {Fragment, GeneratedDefinition, Root} from '../core/IR';
23
21
  import type {GetFileFilter} from '../core/RelaySourceModuleParser';
24
22
  import type {Schema} from '../core/Schema';
25
23
  import type {ScalarTypeMapping} from './javascript/RelayFlowTypeTransformers';
26
24
  import type {GeneratedNode} from 'relay-runtime';
27
25
 
26
+ const {RelayConcreteNode} = require('relay-runtime');
27
+
28
28
  /**
29
29
  * A language plugin allows relay-compiler to both read and write files for any
30
30
  * language.
@@ -12,13 +12,12 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const Profiler = require('../../core/GraphQLCompilerProfiler');
15
+ import type {GraphQLTag} from '../RelayLanguagePluginInterface';
16
16
 
17
+ const Profiler = require('../../core/GraphQLCompilerProfiler');
17
18
  const babylon = require('@babel/parser');
18
19
  const util = require('util');
19
20
 
20
- import type {GraphQLTag} from '../RelayLanguagePluginInterface';
21
-
22
21
  // Attempt to be as inclusive as possible of source text.
23
22
  const BABYLON_OPTIONS = {
24
23
  allowImportExportEverywhere: true,
@@ -12,8 +12,8 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const invariant = require('invariant');
16
15
  const t = require('@babel/types');
16
+ const invariant = require('invariant');
17
17
 
18
18
  type BabelAST = BabelNode_DEPRECATED;
19
19
 
@@ -12,18 +12,30 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const FlattenTransform = require('../../transforms/FlattenTransform');
15
+ import type {IRTransform} from '../../core/CompilerContext';
16
+ import type {
17
+ Directive,
18
+ Fragment,
19
+ Metadata,
20
+ ModuleImport,
21
+ Root,
22
+ Selection as IRSelection,
23
+ } from '../../core/IR';
24
+ import type {NodeVisitor} from '../../core/IRVisitor';
25
+ import type {EnumTypeID, Schema, TypeID} from '../../core/Schema';
26
+ import type {RequiredDirectiveMetadata} from '../../transforms/RequiredFieldTransform';
27
+ import type {TypeGeneratorOptions} from '../RelayLanguagePluginInterface';
28
+
29
+ const Profiler = require('../../core/GraphQLCompilerProfiler');
16
30
  const IRVisitor = require('../../core/IRVisitor');
31
+ const FlattenTransform = require('../../transforms/FlattenTransform');
17
32
  const MaskTransform = require('../../transforms/MaskTransform');
18
33
  const MatchTransform = require('../../transforms/MatchTransform');
19
- const Profiler = require('../../core/GraphQLCompilerProfiler');
20
34
  const RefetchableFragmentTransform = require('../../transforms/RefetchableFragmentTransform');
21
35
  const RelayDirectiveTransform = require('../../transforms/RelayDirectiveTransform');
22
36
  const RequiredFieldTransform = require('../../transforms/RequiredFieldTransform');
23
-
24
37
  const generateAbstractTypeRefinementKey = require('../../util/generateAbstractTypeRefinementKey');
25
38
  const partitionArray = require('../../util/partitionArray');
26
-
27
39
  const {
28
40
  anyTypeAlias,
29
41
  declareExportOpaqueType,
@@ -42,21 +54,6 @@ const {
42
54
  transformInputType,
43
55
  transformScalarType,
44
56
  } = require('./RelayFlowTypeTransformers');
45
-
46
- import type {IRTransform} from '../../core/CompilerContext';
47
- import type {
48
- Fragment,
49
- Root,
50
- Directive,
51
- Metadata,
52
- ModuleImport,
53
- Selection as IRSelection,
54
- } from '../../core/IR';
55
- import type {NodeVisitor} from '../../core/IRVisitor';
56
- import type {Schema, TypeID, EnumTypeID} from '../../core/Schema';
57
- import type {RequiredDirectiveMetadata} from '../../transforms/RequiredFieldTransform';
58
- import type {TypeGeneratorOptions} from '../RelayLanguagePluginInterface';
59
-
60
57
  const babelGenerator = require('@babel/generator').default;
61
58
  const t = require('@babel/types');
62
59
  const invariant = require('invariant');
@@ -12,14 +12,14 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const t = require('@babel/types');
15
+ import type {EnumTypeID, Schema, TypeID} from '../../core/Schema';
16
+ import type {State} from './RelayFlowGenerator';
16
17
 
17
18
  const {
18
19
  exactObjectTypeAnnotation,
19
20
  readOnlyArrayOfType,
20
21
  } = require('./RelayFlowBabelFactories');
21
-
22
- import type {Schema, TypeID, EnumTypeID} from '../../core/Schema';
22
+ const t = require('@babel/types');
23
23
 
24
24
  export type BabelTypes = typeof t;
25
25
  export type ScalarTypeMapping = {
@@ -27,8 +27,6 @@ export type ScalarTypeMapping = {
27
27
  ...,
28
28
  };
29
29
 
30
- import type {State} from './RelayFlowGenerator';
31
-
32
30
  function getInputObjectTypeIdentifier(schema: Schema, typeID: TypeID): string {
33
31
  return schema.getTypeString(typeID);
34
32
  }
@@ -12,15 +12,14 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const RelayFlowGenerator = require('./RelayFlowGenerator');
15
+ import type {PluginInterface} from '../RelayLanguagePluginInterface';
16
16
 
17
17
  const {find} = require('./FindGraphQLTags');
18
18
  const {
19
19
  formatGeneratedCommonjsModule,
20
20
  formatGeneratedESModule,
21
21
  } = require('./formatGeneratedModule');
22
-
23
- import type {PluginInterface} from '../RelayLanguagePluginInterface';
22
+ const RelayFlowGenerator = require('./RelayFlowGenerator');
24
23
 
25
24
  module.exports = (options?: {|eagerESModules: boolean|}): PluginInterface => ({
26
25
  inputExtensions: ['js', 'jsx'],
@@ -10,11 +10,11 @@
10
10
  // flowlint ambiguous-object-type:error
11
11
  'use strict';
12
12
 
13
- var _yargs = require('yargs');
14
-
15
13
  var _require = require('./RelayCompilerMain'),
16
14
  main = _require.main;
17
15
 
16
+ var _yargs = require('yargs');
17
+
18
18
  var RelayConfig;
19
19
 
20
20
  try {
@@ -24,19 +24,19 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
24
24
 
25
25
  var CodegenRunner = require('../codegen/CodegenRunner');
26
26
 
27
- var ConsoleReporter = require('../reporters/ConsoleReporter');
27
+ var RelayFileWriter = require('../codegen/RelayFileWriter');
28
28
 
29
29
  var DotGraphQLParser = require('../core/DotGraphQLParser');
30
30
 
31
- var RelayFileWriter = require('../codegen/RelayFileWriter');
31
+ var WatchmanClient = require('../core/GraphQLWatchmanClient');
32
32
 
33
33
  var RelayIRTransforms = require('../core/RelayIRTransforms');
34
34
 
35
- var RelayLanguagePluginJavaScript = require('../language/javascript/RelayLanguagePluginJavaScript');
36
-
37
35
  var RelaySourceModuleParser = require('../core/RelaySourceModuleParser');
38
36
 
39
- var WatchmanClient = require('../core/GraphQLWatchmanClient');
37
+ var RelayLanguagePluginJavaScript = require('../language/javascript/RelayLanguagePluginJavaScript');
38
+
39
+ var ConsoleReporter = require('../reporters/ConsoleReporter');
40
40
 
41
41
  var crypto = require('crypto');
42
42
 
@@ -44,15 +44,15 @@ var fs = require('fs');
44
44
 
45
45
  var glob = require('glob');
46
46
 
47
- var invariant = require('invariant');
48
-
49
- var path = require('path');
50
-
51
47
  var _require = require('graphql'),
52
- buildClientSchema = _require.buildClientSchema,
53
48
  Source = _require.Source,
49
+ buildClientSchema = _require.buildClientSchema,
54
50
  printSchema = _require.printSchema;
55
51
 
52
+ var invariant = require('invariant');
53
+
54
+ var path = require('path');
55
+
56
56
  var commonTransforms = RelayIRTransforms.commonTransforms,
57
57
  codegenTransforms = RelayIRTransforms.codegenTransforms,
58
58
  fragmentTransforms = RelayIRTransforms.fragmentTransforms,
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
  // flowlint ambiguous-object-type:error
11
- 'use strict';
11
+ 'use strict'; // flowlint nonstrict-import:warn
12
12
 
13
13
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
14
14
 
@@ -22,8 +22,7 @@ var crypto = require('crypto');
22
22
 
23
23
  var invariant = require('invariant');
24
24
 
25
- var path = require('path'); // flowlint nonstrict-import:warn
26
-
25
+ var path = require('path');
27
26
 
28
27
  var CodegenDirectory = /*#__PURE__*/function () {
29
28
  function CodegenDirectory(dir, options) {
@@ -18,20 +18,16 @@ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime
18
18
 
19
19
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
20
20
 
21
- var CodegenDirectory = require('./CodegenDirectory');
22
-
23
- var CodegenWatcher = require('./CodegenWatcher');
24
-
25
- var GraphQLWatchmanClient = require('../core/GraphQLWatchmanClient');
26
-
27
21
  var Profiler = require('../core/GraphQLCompilerProfiler');
28
22
 
29
- var invariant = require('invariant');
30
-
31
- var path = require('path');
23
+ var GraphQLWatchmanClient = require('../core/GraphQLWatchmanClient');
32
24
 
33
25
  var _require = require('../core/Schema'),
34
26
  createSchema = _require.create;
27
+
28
+ var CodegenDirectory = require('./CodegenDirectory');
29
+
30
+ var CodegenWatcher = require('./CodegenWatcher');
35
31
  /* $FlowFixMe[untyped-import] - importing immutable, which is untyped (and flow
36
32
  * is sad about it) */
37
33
 
@@ -39,6 +35,10 @@ var _require = require('../core/Schema'),
39
35
  var _require2 = require('immutable'),
40
36
  ImmutableMap = _require2.Map;
41
37
 
38
+ var invariant = require('invariant');
39
+
40
+ var path = require('path');
41
+
42
42
  var CodegenRunner = /*#__PURE__*/function () {
43
43
  // parser => writers that are affected by it
44
44
  function CodegenRunner(options) {
@@ -12,10 +12,10 @@
12
12
 
13
13
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
14
14
 
15
- var GraphQLWatchmanClient = require('../core/GraphQLWatchmanClient');
16
-
17
15
  var Profiler = require('../core/GraphQLCompilerProfiler');
18
16
 
17
+ var GraphQLWatchmanClient = require('../core/GraphQLWatchmanClient');
18
+
19
19
  var crypto = require('crypto');
20
20
 
21
21
  var fs = require('fs');