This repository has been archived by the owner on May 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix gql test regressions Migrate i18n integration tests to fusion-cli * fix lint and flow * ignore fixture for flow in ci * update lock file * add other integration test
- Loading branch information
Showing
11 changed files
with
1,590 additions
and
3,668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`\`fusion build --production\` works with gql 1`] = `"{\\"kind\\":\\"Document\\",\\"definitions\\":[{\\"kind\\":\\"ObjectTypeDefinition\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"Query\\"},\\"interfaces\\":[],\\"directives\\":[],\\"fields\\":[{\\"kind\\":\\"FieldDefinition\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"user\\"},\\"arguments\\":[],\\"type\\":{\\"kind\\":\\"NamedType\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"User\\"}},\\"directives\\":[]}]},{\\"kind\\":\\"ObjectTypeDefinition\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"User\\"},\\"interfaces\\":[],\\"directives\\":[],\\"fields\\":[{\\"kind\\":\\"FieldDefinition\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"firstName\\"},\\"arguments\\":[],\\"type\\":{\\"kind\\":\\"NamedType\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"String\\"}},\\"directives\\":[]}]}],\\"loc\\":{\\"start\\":0,\\"end\\":62,\\"source\\":{\\"body\\":\\"type Query {\\\\n user: User\\\\n}\\\\n\\\\ntype User {\\\\n firstName: String\\\\n}\\",\\"name\\":\\"GraphQL request\\",\\"locationOffset\\":{\\"line\\":1,\\"column\\":1}}}}"`; | ||
|
||
exports[`\`fusion build --production\` works with gql 2`] = ` | ||
Object { | ||
"definitions": Array [ | ||
Object { | ||
"directives": Array [], | ||
"fields": Array [ | ||
Object { | ||
"arguments": Array [], | ||
"directives": Array [], | ||
"kind": "FieldDefinition", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "user", | ||
}, | ||
"type": Object { | ||
"kind": "NamedType", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "User", | ||
}, | ||
}, | ||
}, | ||
], | ||
"interfaces": Array [], | ||
"kind": "ObjectTypeDefinition", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "Query", | ||
}, | ||
}, | ||
Object { | ||
"directives": Array [], | ||
"fields": Array [ | ||
Object { | ||
"arguments": Array [], | ||
"directives": Array [], | ||
"kind": "FieldDefinition", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "firstName", | ||
}, | ||
"type": Object { | ||
"kind": "NamedType", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "String", | ||
}, | ||
}, | ||
}, | ||
], | ||
"interfaces": Array [], | ||
"kind": "ObjectTypeDefinition", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "User", | ||
}, | ||
}, | ||
], | ||
"kind": "Document", | ||
"loc": Object { | ||
"end": 62, | ||
"source": Object { | ||
"body": "type Query { | ||
user: User | ||
} | ||
type User { | ||
firstName: String | ||
}", | ||
"locationOffset": Object { | ||
"column": 1, | ||
"line": 1, | ||
}, | ||
"name": "GraphQL request", | ||
}, | ||
"start": 0, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`\`fusion dev\` works with gql 1`] = `"{\\"kind\\":\\"Document\\",\\"definitions\\":[{\\"kind\\":\\"ObjectTypeDefinition\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"Query\\"},\\"interfaces\\":[],\\"directives\\":[],\\"fields\\":[{\\"kind\\":\\"FieldDefinition\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"user\\"},\\"arguments\\":[],\\"type\\":{\\"kind\\":\\"NamedType\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"User\\"}},\\"directives\\":[]}]},{\\"kind\\":\\"ObjectTypeDefinition\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"User\\"},\\"interfaces\\":[],\\"directives\\":[],\\"fields\\":[{\\"kind\\":\\"FieldDefinition\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"firstName\\"},\\"arguments\\":[],\\"type\\":{\\"kind\\":\\"NamedType\\",\\"name\\":{\\"kind\\":\\"Name\\",\\"value\\":\\"String\\"}},\\"directives\\":[]}]}],\\"loc\\":{\\"start\\":0,\\"end\\":62,\\"source\\":{\\"body\\":\\"type Query {\\\\n user: User\\\\n}\\\\n\\\\ntype User {\\\\n firstName: String\\\\n}\\",\\"name\\":\\"GraphQL request\\",\\"locationOffset\\":{\\"line\\":1,\\"column\\":1}}}}"`; | ||
|
||
exports[`\`fusion dev\` works with gql 2`] = ` | ||
Object { | ||
"definitions": Array [ | ||
Object { | ||
"directives": Array [], | ||
"fields": Array [ | ||
Object { | ||
"arguments": Array [], | ||
"directives": Array [], | ||
"kind": "FieldDefinition", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "user", | ||
}, | ||
"type": Object { | ||
"kind": "NamedType", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "User", | ||
}, | ||
}, | ||
}, | ||
], | ||
"interfaces": Array [], | ||
"kind": "ObjectTypeDefinition", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "Query", | ||
}, | ||
}, | ||
Object { | ||
"directives": Array [], | ||
"fields": Array [ | ||
Object { | ||
"arguments": Array [], | ||
"directives": Array [], | ||
"kind": "FieldDefinition", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "firstName", | ||
}, | ||
"type": Object { | ||
"kind": "NamedType", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "String", | ||
}, | ||
}, | ||
}, | ||
], | ||
"interfaces": Array [], | ||
"kind": "ObjectTypeDefinition", | ||
"name": Object { | ||
"kind": "Name", | ||
"value": "User", | ||
}, | ||
}, | ||
], | ||
"kind": "Document", | ||
"loc": Object { | ||
"end": 62, | ||
"source": Object { | ||
"body": "type Query { | ||
user: User | ||
} | ||
type User { | ||
firstName: String | ||
}", | ||
"locationOffset": Object { | ||
"column": 1, | ||
"line": 1, | ||
}, | ||
"name": "GraphQL request", | ||
}, | ||
"start": 0, | ||
}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** Copyright (c) 2018 Uber Technologies, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
module.exports = { | ||
experimentalCompile: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.fusion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** Copyright (c) 2018 Uber Technologies, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
import App from 'fusion-react'; | ||
import {FetchToken} from 'fusion-tokens'; | ||
import fetch from 'unfetch'; | ||
import {Locale} from 'locale'; | ||
|
||
import Plugin, {I18nToken, I18nLoaderToken} from 'fusion-plugin-i18n-react'; | ||
|
||
import Root from './root.js'; | ||
|
||
// Translation details | ||
const data = {test: 'hello ${value}'}; | ||
const locale = new Locale('en-US'); | ||
|
||
export default () => { | ||
const app = new App(Root); | ||
|
||
app.register(I18nToken, Plugin); | ||
__NODE__ && | ||
app.register(I18nLoaderToken, { | ||
from: () => ({translations: data, locale: locale}), | ||
}); | ||
__BROWSER__ && app.register(FetchToken, fetch); | ||
|
||
return app; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** Copyright (c) 2018 Uber Technologies, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import {Translate} from 'fusion-plugin-i18n-react'; | ||
|
||
export default ( | ||
<div> | ||
<Translate id="test" data={{value: 'world'}} /> | ||
</div> | ||
); |
Oops, something went wrong.