Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit 135a209

Browse files
committed
chore: merge with master
2 parents 5463302 + e60bd56 commit 135a209

36 files changed

+2156
-3359
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,7 @@ typings/
6363
/bin
6464

6565
.npmrc
66+
67+
# Build artifacts
68+
.yalc
69+
yalc.lock

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
__snapshots__/
2-
fixtures/
2+
fixtures/
3+
example/ts/__relay_artifacts

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
- secure: RQjCgMg2NHtjP7qZDNSXjcX0wKm9A9NVcnszamDNp79ljUK9s8JmBUEF/nmraoV38a5WrrfQvvBJGY3kTm/UFdItblcsmNm2fWixuRhc1QPtOhB765SKYVus4v87cN/CI4teUmDC118gQHVfg/elkqUjbFg5nmhcSK1V+wQi3DIdRDtmmob4VcBKimQHGHYQgXx0Am16BnVcVeLV28U77hp9f4Cle4vEn0n3Waaum2upaoF/WQGzFHap9yRKghARSZ8Rxd2CgGFbFQuXlll7evV21RHmOTmef4ENZ27KuWiBBnxosALnOqc+J/ah00HoNHcswgjuQdWWXhM8pUAr3oP9dciJcaf77jkpB6ICxsj/k0Ykl7crJuKQYO2MmYi4Hx9FX+wfaxIPxmApErxGDqFb8ornY277iW7REaBykml5BqPENS607KWYmpSFNduMC7HK15ntaeOCWV0isLc0TMkcENdepA5s7llViOhO2dfn0flrZtAZ5NdGbIcspF8rg+vnA42VJJ2VEh2VWyGveYkcUcJiYVRh1srycAc8uJYzj65fuUOLzzGkJh/q7gh2HrofBk5fD50tbKFHCf+3+nG8D7Tt6vWzpJ4I1gadyjtMeiIK3tmwUDfAl7sHkmC4pOlqZA1pMiPqgxLrER672QLYmD2AjvdS3hqGExCZVi0=
88
- GIT_NAME="Eloy Durán"
99
- GIT_EMAIL="[email protected]"
10+
- GH_USER="alloy"
1011

1112
script:
1213
- yarn lint
@@ -16,7 +17,13 @@ script:
1617
before_deploy:
1718
- echo "NPM_TOKEN=${NPM_TOKEN}" >> .env
1819
- echo "GH_TOKEN=${GH_TOKEN}" >> .env
19-
- git checkout master && git pull origin
20+
- git config --local user.name "${GIT_NAME}"
21+
- git config --local user.email "${GIT_EMAIL}"
22+
- git remote rm origin
23+
- git remote add origin https://${GH_USER}:${GH_TOKEN}@github.com/relay-tools/relay-compiler-language-typescript.git
24+
- git fetch origin --tags
25+
- git checkout master && git pull origin master
26+
- git branch --set-upstream-to origin/master master
2027
- yarn build
2128
deploy:
2229
skip_cleanup: true

CHANGELOG.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
# v9.0.0 (Mon Oct 21 2019)
2+
3+
#### 💥 Breaking Change
4+
5+
- Fix opaque types [#139](https://github.com/relay-tools/relay-compiler-language-typescript/pull/139) ([@ds300](https://github.com/ds300))
6+
7+
#### 🏠 Internal
8+
9+
- Correct version number [skip-ci] [#147](https://github.com/relay-tools/relay-compiler-language-typescript/pull/147) ([@zephraph](https://github.com/zephraph))
10+
11+
#### Authors: 2
12+
13+
- David Sheldrick ([@ds300](https://github.com/ds300))
14+
- Justin Bennett ([@zephraph](https://github.com/zephraph))
15+
16+
---
17+
18+
# v8.0.3 (Mon Oct 21 2019)
19+
20+
#### 🐛 Bug Fix
21+
22+
- Ensure on master, and that upstream is pointed at master [#146](https://github.com/relay-tools/relay-compiler-language-typescript/pull/146) ([@zephraph](https://github.com/zephraph))
23+
- Fix deployment issue by pulling before setting upstream [#145](https://github.com/relay-tools/relay-compiler-language-typescript/pull/145) ([@zephraph](https://github.com/zephraph))
24+
- Fix failing deployments by adding the proper git upstream [#144](https://github.com/relay-tools/relay-compiler-language-typescript/pull/144) ([@zephraph](https://github.com/zephraph))
25+
- Ensure CI can push to GitHub [#143](https://github.com/relay-tools/relay-compiler-language-typescript/pull/143) ([@zephraph](https://github.com/zephraph))
26+
- Verify the release process doesn't throw errors [#142](https://github.com/relay-tools/relay-compiler-language-typescript/pull/142) ([@zephraph](https://github.com/zephraph))
27+
28+
#### 🏠 Internal
29+
30+
- Add the ability to configure auto deploys [#141](https://github.com/relay-tools/relay-compiler-language-typescript/pull/141) ([@zephraph](https://github.com/zephraph))
31+
32+
#### Authors: 1
33+
34+
- Justin Bennett ([@zephraph](https://github.com/zephraph))
35+
36+
---
37+
138
# v4.1.0 (Fri May 10 2019)
239

340
#### 🚀 Enhancement
@@ -95,4 +132,4 @@
95132
- [@nodkz](https://github.com/nodkz)
96133
- [@sibelius](https://github.com/sibelius)
97134
- [@kastermester](https://github.com/kastermester)
98-
- [@khs@secoya.dk](https://github.com/[email protected])
135+
- [@khs@secoya.dk](https://github.com/[email protected])

example/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Relay TodoMVC
22

3+
## Prerequisites
4+
5+
```
6+
yarn global add yalc
7+
```
8+
9+
And in the project root folder
10+
11+
```
12+
yarn watch
13+
```
14+
315
## Installation
416

517
```

example/data/schema.graphql

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,33 @@ type Mutation {
4141
renameTodo(input: RenameTodoInput!): RenameTodoPayload
4242
}
4343

44-
# An object with an ID
44+
"""An object with an ID"""
4545
interface Node {
46-
# The id of the object.
46+
"""The id of the object."""
4747
id: ID!
4848
}
4949

50-
# Information about pagination in a connection.
50+
"""Information about pagination in a connection."""
5151
type PageInfo {
52-
# When paginating forwards, are there more items?
52+
"""When paginating forwards, are there more items?"""
5353
hasNextPage: Boolean!
5454

55-
# When paginating backwards, are there more items?
55+
"""When paginating backwards, are there more items?"""
5656
hasPreviousPage: Boolean!
5757

58-
# When paginating backwards, the cursor to continue.
58+
"""When paginating backwards, the cursor to continue."""
5959
startCursor: String
6060

61-
# When paginating forwards, the cursor to continue.
61+
"""When paginating forwards, the cursor to continue."""
6262
endCursor: String
6363
}
6464

6565
type Query {
6666
viewer: User
6767

68-
# Fetches an object given its ID
68+
"""Fetches an object given its ID"""
6969
node(
70-
# The ID of an object
70+
"""The ID of an object"""
7171
id: ID!
7272
): Node
7373
}
@@ -105,32 +105,32 @@ type RenameTodoPayload {
105105
}
106106

107107
type Todo implements Node {
108-
# The ID of an object
108+
"""The ID of an object"""
109109
id: ID!
110110
text: String
111111
complete: Boolean
112112
}
113113

114-
# A connection to a list of items.
114+
"""A connection to a list of items."""
115115
type TodoConnection {
116-
# Information to aid in pagination.
116+
"""Information to aid in pagination."""
117117
pageInfo: PageInfo!
118118

119-
# A list of edges.
119+
"""A list of edges."""
120120
edges: [TodoEdge]
121121
}
122122

123-
# An edge in a connection.
123+
"""An edge in a connection."""
124124
type TodoEdge {
125-
# The item at the end of the edge
125+
"""The item at the end of the edge"""
126126
node: Todo
127127

128-
# A cursor for use in pagination
128+
"""A cursor for use in pagination"""
129129
cursor: String!
130130
}
131131

132132
type User implements Node {
133-
# The ID of an object
133+
"""The ID of an object"""
134134
id: ID!
135135
todos(status: String = "any", after: String, first: Int, before: String, last: Int): TodoConnection
136136
totalCount: Int

example/package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"private": true,
33
"scripts": {
44
"start": "babel-node ./server.js",
5-
"build":
6-
"relay-compiler --src ./ts/ --schema ./data/schema.graphql --language typescript --artifactDirectory ./ts/__relay_artifacts__",
5+
"build": "relay-compiler --src ./ts/ --schema ./data/schema.graphql --language typescript --artifactDirectory ./ts/__relay_artifacts__",
76
"update-schema": "babel-node ./scripts/updateSchema.js",
87
"lint": "tslint --project tsconfig.json",
8+
"postinstall": "patch-package",
99
"type-check": "tsc --noEmit --pretty"
1010
},
11-
"resolutions": {
12-
"relay-compiler-language-typescript":
13-
"file:../relay-compiler-language-typescript-v1.1.1-alpha.2.tgz"
11+
"prettier": {
12+
"semi": false,
13+
"trailingComma": "all"
1414
},
1515
"dependencies": {
1616
"@babel/core": "^7.0.0-0",
@@ -25,15 +25,14 @@
2525
"classnames": "2.2.5",
2626
"express": "^4.15.2",
2727
"express-graphql": "^0.7.1",
28-
"graphql": "^14.0.2",
29-
"graphql-compiler": "^2.0.0-rc.1",
30-
"graphql-relay": "^0.5.5",
28+
"graphql": "^14.5.8",
29+
"graphql-compiler": "^1.7.0",
30+
"graphql-relay": "^0.6.0",
3131
"prop-types": "^15.6.2",
32-
"react": "^16.4.1",
33-
"react-dom": "^16.4.1",
34-
"react-relay": "^2.0.0-rc.1",
35-
"relay-devtools": "^1.4.0",
36-
"relay-runtime": "^2.0.0-rc.1",
32+
"react": "^16.10.2",
33+
"react-dom": "^16.10.2",
34+
"react-relay": "^6.0.0",
35+
"relay-runtime": "^6.0.0",
3736
"todomvc-app-css": "^2.1.0",
3837
"todomvc-common": "^1.0.3",
3938
"webpack": "^3.5.5",
@@ -44,18 +43,19 @@
4443
"@types/prop-types": "^15.5.5",
4544
"@types/react": "^16.4.12",
4645
"@types/react-dom": "^16.0.7",
47-
"@types/react-relay": "^1.3.9",
48-
"@types/relay-runtime": "^1.3.5",
46+
"@types/react-relay": "^6.0.1",
47+
"@types/relay-runtime": "^6.0.6",
4948
"babel-cli": "^6.26.0",
5049
"babel-eslint": "6.1.2",
5150
"csstype": "^2.5.6",
5251
"fork-ts-checker-webpack-plugin": "^0.3.0",
53-
"relay-compiler": "^2.0.0-rc.1",
54-
"relay-compiler-language-typescript":
55-
"file:../relay-compiler-language-typescript-v1.1.1-alpha.2.tgz",
56-
"ts-loader": "^3.2.0",
57-
"tslint": "^5.12.0",
52+
"patch-package": "^6.2.0",
53+
"postinstall-postinstall": "^2.0.0",
54+
"relay-compiler": "^6.0.0",
55+
"relay-compiler-language-typescript": "file:.yalc/relay-compiler-language-typescript",
56+
"ts-loader": "^6.2.0",
57+
"tslint": "^5.20.0",
5858
"tslint-plugin-relay": "^0.0.3",
59-
"typescript": "2.9.1"
59+
"typescript": "^3.6.3"
6060
}
6161
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/node_modules/@types/relay-runtime/index.d.ts b/node_modules/@types/relay-runtime/index.d.ts
2+
index 18ff05e..1ab09b6 100644
3+
--- a/node_modules/@types/relay-runtime/index.d.ts
4+
+++ b/node_modules/@types/relay-runtime/index.d.ts
5+
@@ -193,12 +193,20 @@ export { createRelayNetworkLogger } from './lib/network/createRelayNetworkLogger
6+
export { deepFreeze } from './lib/util/deepFreeze';
7+
8+
// These match the output of relay-compiler-language-typescript.
9+
-export interface _RefType<T> {
10+
- ' $refType': T;
11+
+export interface _RefType<T extends string> {
12+
+ " $refType": T;
13+
}
14+
-export interface _FragmentRefs<T> {
15+
- ' $fragmentRefs': T;
16+
+
17+
+export type FragmentRefs<Refs extends string> = {
18+
+ [ref in Refs]: true
19+
+}
20+
+
21+
+export interface _FragmentRefs<Refs extends string> {
22+
+ " $fragmentRefs": FragmentRefs<Refs>
23+
}
24+
25+
// This is a utility type for converting from a data type to a fragment reference that will resolve to that data type.
26+
-export type FragmentRef<T> = T extends _RefType<infer U> ? _FragmentRefs<U> : never;
27+
+export type FragmentRef<T> = T extends _RefType<infer U>
28+
+ ? _FragmentRefs<U>
29+
+ : never;
30+
+

example/ts/__relay_artifacts__/AddTodoMutation.graphql.ts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ export type AddTodoMutationVariables = {
99
readonly input: AddTodoInput;
1010
};
1111
export type AddTodoMutationResponse = {
12-
readonly addTodo: ({
13-
readonly todoEdge: ({
12+
readonly addTodo: {
13+
readonly todoEdge: {
1414
readonly __typename: string;
1515
readonly cursor: string;
16-
readonly node: ({
16+
readonly node: {
1717
readonly complete: boolean | null;
1818
readonly id: string;
1919
readonly text: string | null;
20-
}) | null;
21-
}) | null;
22-
readonly viewer: ({
20+
} | null;
21+
} | null;
22+
readonly viewer: {
2323
readonly id: string;
2424
readonly totalCount: number | null;
25-
}) | null;
26-
}) | null;
25+
} | null;
26+
} | null;
2727
};
2828
export type AddTodoMutation = {
2929
readonly response: AddTodoMutationResponse;
@@ -80,8 +80,7 @@ v2 = [
8080
{
8181
"kind": "Variable",
8282
"name": "input",
83-
"variableName": "input",
84-
"type": "AddTodoInput!"
83+
"variableName": "input"
8584
}
8685
],
8786
"concreteType": "AddTodoPayload",
@@ -126,7 +125,7 @@ v2 = [
126125
"args": null,
127126
"storageKey": null
128127
},
129-
v1,
128+
(v1/*: any*/),
130129
{
131130
"kind": "ScalarField",
132131
"alias": null,
@@ -147,7 +146,7 @@ v2 = [
147146
"concreteType": "User",
148147
"plural": false,
149148
"selections": [
150-
v1,
149+
(v1/*: any*/),
151150
{
152151
"kind": "ScalarField",
153152
"alias": null,
@@ -162,24 +161,26 @@ v2 = [
162161
];
163162
return {
164163
"kind": "Request",
165-
"operationKind": "mutation",
166-
"name": "AddTodoMutation",
167-
"id": null,
168-
"text": "mutation AddTodoMutation(\n $input: AddTodoInput!\n) {\n addTodo(input: $input) {\n todoEdge {\n __typename\n cursor\n node {\n complete\n id\n text\n }\n }\n viewer {\n id\n totalCount\n }\n }\n}\n",
169-
"metadata": {},
170164
"fragment": {
171165
"kind": "Fragment",
172166
"name": "AddTodoMutation",
173167
"type": "Mutation",
174168
"metadata": null,
175-
"argumentDefinitions": v0,
176-
"selections": v2
169+
"argumentDefinitions": (v0/*: any*/),
170+
"selections": (v2/*: any*/)
177171
},
178172
"operation": {
179173
"kind": "Operation",
180174
"name": "AddTodoMutation",
181-
"argumentDefinitions": v0,
182-
"selections": v2
175+
"argumentDefinitions": (v0/*: any*/),
176+
"selections": (v2/*: any*/)
177+
},
178+
"params": {
179+
"operationKind": "mutation",
180+
"name": "AddTodoMutation",
181+
"id": null,
182+
"text": "mutation AddTodoMutation(\n $input: AddTodoInput!\n) {\n addTodo(input: $input) {\n todoEdge {\n __typename\n cursor\n node {\n complete\n id\n text\n }\n }\n viewer {\n id\n totalCount\n }\n }\n}\n",
183+
"metadata": {}
183184
}
184185
};
185186
})();

0 commit comments

Comments
 (0)