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,11 +12,10 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- const _yargs = require('yargs');
15
+ import type {Config} from './RelayCompilerMain';
16
16
 
17
17
  const {main} = require('./RelayCompilerMain');
18
-
19
- import type {Config} from './RelayCompilerMain';
18
+ const _yargs = require('yargs');
20
19
 
21
20
  let RelayConfig;
22
21
  try {
@@ -12,23 +12,28 @@
12
12
 
13
13
  'use strict';
14
14
 
15
+ import type {WriteFilesOptions} from '../codegen/CodegenRunner';
16
+ import type {ScalarTypeMapping} from '../language/javascript/RelayFlowTypeTransformers';
17
+ import type {
18
+ PluginInitializer,
19
+ PluginInterface,
20
+ } from '../language/RelayLanguagePluginInterface';
21
+
15
22
  const CodegenRunner = require('../codegen/CodegenRunner');
16
- const ConsoleReporter = require('../reporters/ConsoleReporter');
17
- const DotGraphQLParser = require('../core/DotGraphQLParser');
18
23
  const RelayFileWriter = require('../codegen/RelayFileWriter');
24
+ const DotGraphQLParser = require('../core/DotGraphQLParser');
25
+ const WatchmanClient = require('../core/GraphQLWatchmanClient');
19
26
  const RelayIRTransforms = require('../core/RelayIRTransforms');
20
- const RelayLanguagePluginJavaScript = require('../language/javascript/RelayLanguagePluginJavaScript');
21
27
  const RelaySourceModuleParser = require('../core/RelaySourceModuleParser');
22
- const WatchmanClient = require('../core/GraphQLWatchmanClient');
23
-
28
+ const RelayLanguagePluginJavaScript = require('../language/javascript/RelayLanguagePluginJavaScript');
29
+ const ConsoleReporter = require('../reporters/ConsoleReporter');
24
30
  const crypto = require('crypto');
25
31
  const fs = require('fs');
26
32
  const glob = require('glob');
33
+ const {Source, buildClientSchema, printSchema} = require('graphql');
27
34
  const invariant = require('invariant');
28
35
  const path = require('path');
29
36
 
30
- const {buildClientSchema, Source, printSchema} = require('graphql');
31
-
32
37
  const {
33
38
  commonTransforms,
34
39
  codegenTransforms,
@@ -38,13 +43,6 @@ const {
38
43
  schemaExtensions: relaySchemaExtensions,
39
44
  } = RelayIRTransforms;
40
45
 
41
- import type {ScalarTypeMapping} from '../language/javascript/RelayFlowTypeTransformers';
42
- import type {WriteFilesOptions} from '../codegen/CodegenRunner';
43
- import type {
44
- PluginInitializer,
45
- PluginInterface,
46
- } from '../language/RelayLanguagePluginInterface';
47
-
48
46
  export type Config = {|
49
47
  schema: string,
50
48
  src: string,