Skip to content

Commit

Permalink
Some dep updates and more flow types
Browse files Browse the repository at this point in the history
  • Loading branch information
danielholmes committed Aug 13, 2019
1 parent aaaee14 commit 154b9eb
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
[options]

[version]
^0.104.0
^0.105.2
5 changes: 3 additions & 2 deletions dist/getWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ var _default = (languagePlugin, config) => ({
sourceControl,
reporter
}) => _RelayFileWriter.default.writeAll({
config: _objectSpread({}, config, {
config: _objectSpread({
customScalars: {}
}, config, {
compilerTransforms: {
commonTransforms,
codegenTransforms,
fragmentTransforms,
printTransforms,
queryTransforms
},
customScalars: {},
formatModule: languagePlugin.formatModule,
optionalInputFieldsForFlow: [],
schemaExtensions,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-standard": "^4.0.0",
"flow-bin": "0.104.0",
"flow-bin": "0.105.2",
"jest": "^24.0.0",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-relay": "^5.0.0",
"relay-compiler": "^5.0.0",
"rimraf": "^2.6.2",
"standard": "^13.0.2",
"standard": "^14.0.0-0",
"webpack": "^4.5.0"
},
"babel": {
Expand Down
7 changes: 6 additions & 1 deletion src/getWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import type { WriteFilesOptions } from 'relay-compiler'
import RelayFileWriter from 'relay-compiler/lib/RelayFileWriter'
import RelayIRTransforms from 'relay-compiler/lib/RelayIRTransforms'

export type WriterConfig = {
outputDir?: string,
baseDir: string
}

const {
commonTransforms,
codegenTransforms,
Expand All @@ -13,7 +18,7 @@ const {
schemaExtensions
} = RelayIRTransforms

export default (languagePlugin: any, config: any) => ({
export default (languagePlugin: any, config: WriterConfig) => ({
onlyValidate,
schema,
documents,
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import getFilepathsFromGlob from './getFilepathsFromGlob'

import type { GraphQLSchema } from 'graphql'
import type { Compiler } from 'webpack'
import type { WriterConfig } from './getWriter'

type RelayCompilerWebpackPluginOptions = {
schema: string | GraphQLSchema,
Expand Down Expand Up @@ -176,7 +177,7 @@ class RelayCompilerWebpackPlugin {
}: {
sourceParserName: string,
languagePlugin: PluginInterface,
config: any
config: WriterConfig
}) {
return {
[languagePlugin.outputExtension]: {
Expand Down
Loading

0 comments on commit 154b9eb

Please sign in to comment.