@graphitation/apollo-react-relay-duct-tape 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +17 -13
  2. package/README.md +0 -4
  3. package/lib/hooks.d.ts +2 -7
  4. package/lib/hooks.d.ts.map +1 -1
  5. package/lib/hooks.js +3 -12
  6. package/lib/hooks.mjs +5 -15
  7. package/lib/index.d.ts +0 -1
  8. package/lib/index.d.ts.map +1 -1
  9. package/lib/index.js +0 -1
  10. package/lib/index.mjs +3 -3
  11. package/package.json +20 -11
  12. package/CHANGELOG.json +0 -280
  13. package/lib/storeObservation/createImportDocumentsTransform.d.ts +0 -9
  14. package/lib/storeObservation/createImportDocumentsTransform.d.ts.map +0 -1
  15. package/lib/storeObservation/createImportDocumentsTransform.js +0 -92
  16. package/lib/storeObservation/createImportDocumentsTransform.mjs +0 -69
  17. package/lib/storeObservation/createImportDocumentsTransform.test.d.ts +0 -2
  18. package/lib/storeObservation/createImportDocumentsTransform.test.d.ts.map +0 -1
  19. package/lib/storeObservation/createImportDocumentsTransform.test.js +0 -62
  20. package/lib/storeObservation/createImportDocumentsTransform.test.mjs +0 -44
  21. package/lib/storeObservation/hooks.d.ts +0 -27
  22. package/lib/storeObservation/hooks.d.ts.map +0 -1
  23. package/lib/storeObservation/hooks.js +0 -81
  24. package/lib/storeObservation/hooks.mjs +0 -63
  25. package/lib/storeObservation/index.d.ts +0 -3
  26. package/lib/storeObservation/index.d.ts.map +0 -1
  27. package/lib/storeObservation/index.js +0 -21
  28. package/lib/storeObservation/index.mjs +0 -2
  29. package/lib/storeObservation/nodeFromCacheFieldPolicy.d.ts +0 -9
  30. package/lib/storeObservation/nodeFromCacheFieldPolicy.d.ts.map +0 -1
  31. package/lib/storeObservation/nodeFromCacheFieldPolicy.js +0 -47
  32. package/lib/storeObservation/nodeFromCacheFieldPolicy.mjs +0 -24
  33. package/lib/storeObservation/nodeFromCacheFieldPolicy.test.d.ts +0 -2
  34. package/lib/storeObservation/nodeFromCacheFieldPolicy.test.d.ts.map +0 -1
  35. package/lib/storeObservation/nodeFromCacheFieldPolicy.test.js +0 -112
  36. package/lib/storeObservation/nodeFromCacheFieldPolicy.test.mjs +0 -94
  37. package/lib/storeObservation/shallowCompareFragmentReferences.d.ts +0 -23
  38. package/lib/storeObservation/shallowCompareFragmentReferences.d.ts.map +0 -1
  39. package/lib/storeObservation/shallowCompareFragmentReferences.js +0 -50
  40. package/lib/storeObservation/shallowCompareFragmentReferences.mjs +0 -27
package/CHANGELOG.md CHANGED
@@ -1,32 +1,36 @@
1
1
  # Change Log - @graphitation/apollo-react-relay-duct-tape
2
2
 
3
- This log was last generated on Fri, 08 Oct 2021 22:54:51 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 14 Dec 2021 10:06:07 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.5.0
7
+ ## 0.6.0
8
8
 
9
- Fri, 08 Oct 2021 22:54:51 GMT
9
+ Tue, 14 Dec 2021 10:06:07 GMT
10
10
 
11
- ### Patches
11
+ ### Minor changes
12
12
 
13
- - Bump relay-compiler-language-graphitation to v0.6.0-store-observation.2 (eloy.de.enige@gmail.com)
13
+ - Support ESM in distro packages (mnovikov@microsoft.com)
14
+ - Bump @graphitation/apollo-mock-client to v0.9.0
15
+ - Bump @graphitation/graphql-js-operation-payload-generator to v0.7.0
16
+ - Bump @graphitation/graphql-js-tag to v0.7.0
17
+ - Bump relay-compiler-language-graphitation to v0.6.0
14
18
 
15
- ## 0.5.0-store-observation.5
19
+ ## 0.4.5
16
20
 
17
- Thu, 07 Oct 2021 13:10:18 GMT
21
+ Tue, 26 Oct 2021 21:09:29 GMT
18
22
 
19
- ### Changes
23
+ ### Patches
20
24
 
21
- - Fix node field-policy with default typename prefixing of ids and add test coverage (eloy.de.enige@gmail.com)
25
+ - Ensure that all packages listing graphql as a peerDependency also has it as a devDependency (modevold@microsoft.com)
22
26
 
23
- ## 0.5.0-store-observation.1
27
+ ## 0.4.4
24
28
 
25
- Tue, 05 Oct 2021 08:17:41 GMT
29
+ Tue, 26 Oct 2021 12:46:12 GMT
26
30
 
27
- ### Changes
31
+ ### Patches
28
32
 
29
- - Introduces ability to narrow down store observation to fragment level (eloy.de.enige@gmail.com)
33
+ - Align graphql dependency to version ^15.0.0 across packages (modevold@microsoft.com)
30
34
 
31
35
  ## 0.4.3
32
36
 
package/README.md CHANGED
@@ -5,7 +5,3 @@ A compatibility wrapper that provides the react-relay API on top of Apollo Clien
5
5
  _The name is a reference to the Apollo 13 mission._
6
6
 
7
7
  Use this together with [relay-compiler-language-graphitation](../relay-compiler-language-graphitation) to have typings generated.
8
-
9
- # Narrow Store Observation
10
-
11
- TODO
package/lib/hooks.d.ts CHANGED
@@ -1,11 +1,6 @@
1
1
  import { DocumentNode } from "graphql";
2
2
  import { KeyType, KeyTypeData, OperationType } from "./types";
3
- export declare type GraphQLTaggedNode = (DocumentNode & {
4
- watchQueryDocument?: never;
5
- }) | {
6
- watchQueryDocument: DocumentNode;
7
- executeQueryDocument?: DocumentNode;
8
- };
3
+ export declare type GraphQLTaggedNode = DocumentNode;
9
4
  /**
10
5
  * Executes a GraphQL query.
11
6
  *
@@ -121,7 +116,7 @@ export declare function useLazyLoadQuery<TQuery extends OperationType>(query: Gr
121
116
  * fragment.
122
117
  * @returns The data corresponding to the field selections.
123
118
  */
124
- export declare function useFragment<TKey extends KeyType>(fragmentInput: GraphQLTaggedNode, fragmentRef: TKey): KeyTypeData<TKey>;
119
+ export declare function useFragment<TKey extends KeyType>(_fragmentInput: GraphQLTaggedNode, fragmentRef: TKey): KeyTypeData<TKey>;
125
120
  interface GraphQLSubscriptionConfig<TSubscriptionPayload extends OperationType> {
126
121
  subscription: GraphQLTaggedNode;
127
122
  variables: TSubscriptionPayload["variables"];
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.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B,SAAS,aAAa,EAChE,QAAQ,EAAE,iBAAiB,GAC1B,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAuB/C"}
package/lib/hooks.js CHANGED
@@ -63,20 +63,11 @@ __export(exports, {
63
63
  });
64
64
  var import_invariant = __toModule(require("invariant"));
65
65
  var import_client = __toModule(require("@apollo/client"));
66
- var import_hooks = __toModule(require("./storeObservation/hooks"));
67
66
  function useLazyLoadQuery(query, variables, options) {
68
- if (query.watchQueryDocument) {
69
- return (0, import_hooks.useCompiledLazyLoadQuery)(query, __objSpread({variables}, options));
70
- } else {
71
- return (0, import_client.useQuery)(query, __objSpread({variables}, options));
72
- }
67
+ return (0, import_client.useQuery)(query, __objSpread({variables}, options));
73
68
  }
74
- function useFragment(fragmentInput, fragmentRef) {
75
- if (fragmentInput.watchQueryDocument) {
76
- return (0, import_hooks.useCompiledFragment)(fragmentInput, fragmentRef);
77
- } else {
78
- return fragmentRef;
79
- }
69
+ function useFragment(_fragmentInput, fragmentRef) {
70
+ return fragmentRef;
80
71
  }
81
72
  function useSubscription(config) {
82
73
  const {error} = (0, import_client.useSubscription)(config.subscription, {
package/lib/hooks.mjs CHANGED
@@ -34,29 +34,19 @@ var __async = (__this, __arguments, generator) => {
34
34
  step((generator = generator.apply(__this, __arguments)).next());
35
35
  });
36
36
  };
37
+
38
+ // src/hooks.ts
37
39
  import invariant from "invariant";
38
40
  import {
39
41
  useSubscription as useApolloSubscription,
40
42
  useQuery as useApolloQuery,
41
43
  useMutation as useApolloMutation
42
44
  } from "@apollo/client";
43
- import {
44
- useCompiledFragment,
45
- useCompiledLazyLoadQuery
46
- } from "./storeObservation/hooks";
47
45
  function useLazyLoadQuery(query, variables, options) {
48
- if (query.watchQueryDocument) {
49
- return useCompiledLazyLoadQuery(query, __objSpread({variables}, options));
50
- } else {
51
- return useApolloQuery(query, __objSpread({variables}, options));
52
- }
46
+ return useApolloQuery(query, __objSpread({variables}, options));
53
47
  }
54
- function useFragment(fragmentInput, fragmentRef) {
55
- if (fragmentInput.watchQueryDocument) {
56
- return useCompiledFragment(fragmentInput, fragmentRef);
57
- } else {
58
- return fragmentRef;
59
- }
48
+ function useFragment(_fragmentInput, fragmentRef) {
49
+ return fragmentRef;
60
50
  }
61
51
  function useSubscription(config) {
62
52
  const {error} = useApolloSubscription(config.subscription, {
package/lib/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from "./hooks";
2
2
  export * from "./types";
3
- export * from "./storeObservation";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
package/lib/index.js CHANGED
@@ -19,4 +19,3 @@ var __toModule = (module2) => {
19
19
  __markAsModule(exports);
20
20
  __reExport(exports, __toModule(require("./hooks")));
21
21
  __reExport(exports, __toModule(require("./types")));
22
- __reExport(exports, __toModule(require("./storeObservation")));
package/lib/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./hooks";
2
- export * from "./types";
3
- export * from "./storeObservation";
1
+ // src/index.ts
2
+ export * from "./hooks.mjs";
3
+ export * from "./types.mjs";
package/package.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "name": "@graphitation/apollo-react-relay-duct-tape",
3
3
  "description": "A compatibility wrapper that provides the react-relay API on top of Apollo Client.",
4
4
  "license": "MIT",
5
- "version": "0.5.0",
6
- "main": "./lib/index",
5
+ "version": "0.6.0",
6
+ "main": "./lib/index.js",
7
7
  "scripts": {
8
8
  "build": "monorepo-scripts build",
9
9
  "lint": "monorepo-scripts lint",
@@ -13,26 +13,35 @@
13
13
  "generate-interfaces": "relay-compiler --language graphitation --schema ./src/__tests__/schema.graphql --src ./src"
14
14
  },
15
15
  "devDependencies": {
16
- "@apollo/client": "^3.4.13",
17
- "@graphitation/apollo-mock-client": "^0.6.9",
18
- "@graphitation/graphql-js-operation-payload-generator": "^0.5.9",
19
- "@graphitation/graphql-js-tag": "^0.5.4",
16
+ "@apollo/client": "^3.3.15",
17
+ "@graphitation/apollo-mock-client": "^0.9.0",
18
+ "@graphitation/graphql-js-operation-payload-generator": "^0.7.0",
19
+ "@graphitation/graphql-js-tag": "^0.7.0",
20
20
  "@types/jest": "^26.0.22",
21
21
  "@types/react": "^17.0.3",
22
+ "graphql": "^15.0.0",
22
23
  "monorepo-scripts": "*",
23
24
  "react": "^17.0.2",
24
25
  "relay-compiler": "^11.0.2",
25
- "relay-compiler-language-graphitation": "^0.6.0-store-observation.2",
26
+ "relay-compiler-language-graphitation": "^0.6.0",
26
27
  "ts-expect": "^1.3.0"
27
28
  },
28
29
  "peerDependencies": {
29
- "@apollo/client": "^3.4.13",
30
- "graphql": "^15.5.0",
30
+ "graphql": "^15.0.0",
31
31
  "react": "^17.0.2"
32
32
  },
33
33
  "dependencies": {
34
34
  "invariant": "^2.2.4"
35
35
  },
36
- "publishConfig": {},
37
- "types": "./lib/index.d.ts"
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "types": "./lib/index.d.ts",
40
+ "module": "./lib/index.mjs",
41
+ "exports": {
42
+ ".": {
43
+ "import": "./lib/index.mjs",
44
+ "require": "./lib/index.js"
45
+ }
46
+ }
38
47
  }
package/CHANGELOG.json DELETED
@@ -1,280 +0,0 @@
1
- {
2
- "name": "@graphitation/apollo-react-relay-duct-tape",
3
- "entries": [
4
- {
5
- "date": "Fri, 08 Oct 2021 22:54:51 GMT",
6
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.5.0",
7
- "version": "0.5.0",
8
- "comments": {
9
- "none": [
10
- {
11
- "comment": "Beachball sync",
12
- "author": "eloy.de.enige@gmail.com",
13
- "commit": "359e9c535021f12511b80c311cb768222f51d6a8",
14
- "package": "@graphitation/apollo-react-relay-duct-tape"
15
- }
16
- ],
17
- "patch": [
18
- {
19
- "comment": "Bump relay-compiler-language-graphitation to v0.6.0-store-observation.2",
20
- "author": "eloy.de.enige@gmail.com",
21
- "commit": "359e9c535021f12511b80c311cb768222f51d6a8",
22
- "package": "@graphitation/apollo-react-relay-duct-tape"
23
- }
24
- ]
25
- }
26
- },
27
- {
28
- "date": "Thu, 07 Oct 2021 13:10:18 GMT",
29
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.5.0-store-observation.5",
30
- "version": "0.5.0-store-observation.5",
31
- "comments": {
32
- "prerelease": [
33
- {
34
- "comment": "Fix node field-policy with default typename prefixing of ids and add test coverage",
35
- "author": "eloy.de.enige@gmail.com",
36
- "commit": "1e57e78cffd349c5d9ee65a5a4a4ad6e22c7422f",
37
- "package": "@graphitation/apollo-react-relay-duct-tape"
38
- }
39
- ]
40
- }
41
- },
42
- {
43
- "date": "Tue, 05 Oct 2021 08:17:41 GMT",
44
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.5.0-store-observation.1",
45
- "version": "0.5.0-store-observation.1",
46
- "comments": {
47
- "prerelease": [
48
- {
49
- "comment": "Introduces ability to narrow down store observation to fragment level",
50
- "author": "eloy.de.enige@gmail.com",
51
- "commit": "9d2a2f88ca216a108f467e8cdea02bb84d35fea9",
52
- "package": "@graphitation/apollo-react-relay-duct-tape"
53
- }
54
- ],
55
- "none": [
56
- {
57
- "comment": "Bump @graphitation/apollo-mock-client to v0.6.9",
58
- "author": "eloy.de.enige@gmail.com",
59
- "commit": "9d2a2f88ca216a108f467e8cdea02bb84d35fea9",
60
- "package": "@graphitation/apollo-react-relay-duct-tape"
61
- }
62
- ]
63
- }
64
- },
65
- {
66
- "date": "Mon, 04 Oct 2021 13:48:04 GMT",
67
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.4.3",
68
- "version": "0.4.3",
69
- "comments": {
70
- "patch": [
71
- {
72
- "comment": "Bump @graphitation/apollo-mock-client to v0.6.9",
73
- "author": "eloy.de.enige@gmail.com",
74
- "commit": "ceb24aa25210090e38251be53d010d75abdad9ba",
75
- "package": "@graphitation/apollo-react-relay-duct-tape"
76
- }
77
- ]
78
- }
79
- },
80
- {
81
- "date": "Fri, 30 Jul 2021 23:21:22 GMT",
82
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.4.2",
83
- "version": "0.4.2",
84
- "comments": {
85
- "patch": [
86
- {
87
- "comment": "Bump @graphitation/apollo-mock-client to v0.6.8",
88
- "author": "eloy.de.enige@gmail.com",
89
- "commit": "f78957783804c777d9e38adc433882058367b6cd",
90
- "package": "@graphitation/apollo-react-relay-duct-tape"
91
- }
92
- ]
93
- }
94
- },
95
- {
96
- "date": "Fri, 30 Jul 2021 21:57:33 GMT",
97
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.4.1",
98
- "version": "0.4.1",
99
- "comments": {
100
- "patch": [
101
- {
102
- "comment": "Bump @graphitation/apollo-mock-client to v0.6.7",
103
- "author": "eloy.de.enige@gmail.com",
104
- "commit": "17478cbf5d33c03408bf2e23949619b00a66bce5",
105
- "package": "@graphitation/apollo-react-relay-duct-tape"
106
- }
107
- ]
108
- }
109
- },
110
- {
111
- "date": "Tue, 13 Jul 2021 19:42:21 GMT",
112
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.4.0",
113
- "version": "0.4.0",
114
- "comments": {
115
- "minor": [
116
- {
117
- "comment": "Add `useMutation` hook",
118
- "author": "eloy.de.enige@gmail.com",
119
- "commit": "9884e0fea963021c764c176297a864f660ebd87f",
120
- "package": "@graphitation/apollo-react-relay-duct-tape"
121
- }
122
- ]
123
- }
124
- },
125
- {
126
- "date": "Wed, 05 May 2021 19:48:35 GMT",
127
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.3.6",
128
- "version": "0.3.6",
129
- "comments": {
130
- "patch": [
131
- {
132
- "comment": "Bump @graphitation/apollo-mock-client to v0.6.6",
133
- "author": "eloy.de.enige@gmail.com",
134
- "commit": "120ae2d106a4622d6b1ea25ac912663a77ce4980",
135
- "package": "@graphitation/apollo-react-relay-duct-tape"
136
- }
137
- ]
138
- }
139
- },
140
- {
141
- "date": "Tue, 04 May 2021 15:15:49 GMT",
142
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.3.5",
143
- "version": "0.3.5",
144
- "comments": {
145
- "patch": [
146
- {
147
- "comment": "Bump @graphitation/apollo-mock-client to v0.6.5",
148
- "author": "eloy.de.enige@gmail.com",
149
- "commit": "0933b2155e24f057379c24917d0872c8b5491fec",
150
- "package": "@graphitation/apollo-react-relay-duct-tape"
151
- }
152
- ]
153
- }
154
- },
155
- {
156
- "date": "Tue, 27 Apr 2021 21:34:50 GMT",
157
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.3.4",
158
- "version": "0.3.4",
159
- "comments": {
160
- "patch": [
161
- {
162
- "comment": "Bump @graphitation/apollo-mock-client to v0.6.4",
163
- "author": "eloy.de.enige@gmail.com",
164
- "commit": "a6b3ad721b0bcb71de889bbdde778fcd87503217",
165
- "package": "@graphitation/apollo-react-relay-duct-tape"
166
- }
167
- ]
168
- }
169
- },
170
- {
171
- "date": "Sat, 24 Apr 2021 23:10:54 GMT",
172
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.3.3",
173
- "version": "0.3.3",
174
- "comments": {
175
- "patch": [
176
- {
177
- "comment": "Include commonjs modules",
178
- "author": "eloy.de.enige@gmail.com",
179
- "commit": "1959ee4fa8b12688916df580b3c4dd0afa93f2ba",
180
- "package": "@graphitation/apollo-react-relay-duct-tape"
181
- }
182
- ]
183
- }
184
- },
185
- {
186
- "date": "Fri, 23 Apr 2021 22:48:59 GMT",
187
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.3.2",
188
- "version": "0.3.2",
189
- "comments": {
190
- "patch": [
191
- {
192
- "comment": "[package] Bump minor versions",
193
- "author": "eloy.de.enige@gmail.com",
194
- "commit": "1b8e8ab11de78ce4d65f972a35504e246a89a22d",
195
- "package": "@graphitation/apollo-react-relay-duct-tape"
196
- }
197
- ]
198
- }
199
- },
200
- {
201
- "date": "Fri, 23 Apr 2021 21:44:28 GMT",
202
- "tag": "@graphitation/apollo-react-relay-duct-tape_v0.3.0",
203
- "version": "0.3.0",
204
- "comments": {
205
- "patch": [
206
- {
207
- "comment": "Include correct files",
208
- "author": "eloy.de.enige@gmail.com",
209
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
210
- "package": "@graphitation/apollo-react-relay-duct-tape"
211
- },
212
- {
213
- "comment": "fixing the publish process, publishing a new patch level",
214
- "author": "kchau@microsoft.com",
215
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
216
- "package": "@graphitation/apollo-react-relay-duct-tape"
217
- },
218
- {
219
- "comment": "fixing the publish process, publishing a new patch level (again)",
220
- "author": "kchau@microsoft.com",
221
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
222
- "package": "@graphitation/apollo-react-relay-duct-tape"
223
- },
224
- {
225
- "comment": "Bump @graphitation/graphql-js-operation-payload-generator to v0.5.0",
226
- "author": "eloy.de.enige@gmail.com",
227
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
228
- "package": "@graphitation/apollo-react-relay-duct-tape"
229
- },
230
- {
231
- "comment": "Bump @graphitation/apollo-mock-client to v0.6.0",
232
- "author": "eloy.de.enige@gmail.com",
233
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
234
- "package": "@graphitation/apollo-react-relay-duct-tape"
235
- },
236
- {
237
- "comment": "Bump @graphitation/graphql-js-tag to v0.5.0",
238
- "author": "eloy.de.enige@gmail.com",
239
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
240
- "package": "@graphitation/apollo-react-relay-duct-tape"
241
- }
242
- ],
243
- "none": [
244
- {
245
- "comment": "fixing publish again - leveraging the previously generated change files to publish",
246
- "author": "kchau@microsoft.com",
247
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
248
- "package": "@graphitation/apollo-react-relay-duct-tape"
249
- },
250
- {
251
- "comment": "Initial import",
252
- "author": "eloy.de.enige@gmail.com",
253
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
254
- "package": "@graphitation/apollo-react-relay-duct-tape"
255
- },
256
- {
257
- "comment": "Use generated typings in tests",
258
- "author": "eloy.de.enige@gmail.com",
259
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
260
- "package": "@graphitation/apollo-react-relay-duct-tape"
261
- },
262
- {
263
- "comment": "Bump relay-compiler-language-graphitation to v0.5.0",
264
- "author": "eloy.de.enige@gmail.com",
265
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
266
- "package": "@graphitation/apollo-react-relay-duct-tape"
267
- }
268
- ],
269
- "minor": [
270
- {
271
- "comment": "First proper release",
272
- "author": "eloy.de.enige@gmail.com",
273
- "commit": "2834a8b6a60213e786c15b923ca3270ed2dcfe4e",
274
- "package": "@graphitation/apollo-react-relay-duct-tape"
275
- }
276
- ]
277
- }
278
- }
279
- ]
280
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * TODO:
3
- * - Don't hardcode identifiers but check if they're aliased from their imports.
4
- * - Support mutations and subscriptions
5
- * - Properly emit errors from transformer, is invariant ok?
6
- */
7
- import * as ts from "typescript";
8
- export declare function createImportDocumentsTransform(): ts.TransformerFactory<ts.SourceFile>;
9
- //# sourceMappingURL=createImportDocumentsTransform.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createImportDocumentsTransform.d.ts","sourceRoot":"","sources":["../../src/storeObservation/createImportDocumentsTransform.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAQjC,wBAAgB,8BAA8B,IAAI,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,UAAU,CAAC,CAiDrF"}
@@ -1,92 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getProtoOf = Object.getPrototypeOf;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, {get: all[name], enumerable: true});
11
- };
12
- var __reExport = (target, module2, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && key !== "default")
16
- __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
17
- }
18
- return target;
19
- };
20
- var __toModule = (module2) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
22
- };
23
- __markAsModule(exports);
24
- __export(exports, {
25
- createImportDocumentsTransform: () => createImportDocumentsTransform
26
- });
27
- var import_invariant = __toModule(require("invariant"));
28
- var ts = __toModule(require("typescript"));
29
- var import_graphql = __toModule(require("graphql"));
30
- var path = __toModule(require("path"));
31
- var fs = __toModule(require("fs"));
32
- const PREFIX = "__graphitation_";
33
- const QUERIES_NAMESPACE = "generatedQueries";
34
- function createImportDocumentsTransform() {
35
- return (context) => {
36
- const imports = [];
37
- const visitor = (node) => {
38
- if (ts.isTaggedTemplateExpression(node) && ts.isIdentifier(node.tag) && node.tag.escapedText === "graphql") {
39
- const documentNodes = createGraphQLDocumentNodes(node);
40
- if (documentNodes) {
41
- const [importDeclaration, replacementNode] = documentNodes;
42
- let emitImport = true;
43
- const sourceFile = node.getSourceFile();
44
- if (sourceFile) {
45
- const artefactFile = path.join(path.dirname(sourceFile.fileName), importDeclaration.moduleSpecifier.text) + ".ts";
46
- emitImport = fs.existsSync(artefactFile);
47
- }
48
- if (emitImport) {
49
- imports.push(importDeclaration);
50
- return replacementNode;
51
- }
52
- }
53
- }
54
- return ts.visitEachChild(node, visitor, context);
55
- };
56
- return (sourceFile) => {
57
- const outputSourceFile = ts.visitNode(sourceFile, visitor);
58
- return ts.factory.updateSourceFile(outputSourceFile, [
59
- ...imports,
60
- ...outputSourceFile.statements
61
- ]);
62
- };
63
- };
64
- }
65
- function createGraphQLDocumentNodes(graphqlTagTemplateNode) {
66
- var _a;
67
- const graphqlDoc = ts.isNoSubstitutionTemplateLiteral(graphqlTagTemplateNode.template) ? graphqlTagTemplateNode.template.rawText : graphqlTagTemplateNode.template.head.rawText;
68
- (0, import_invariant.default)(graphqlDoc, "Expected a GraphQL document");
69
- const graphqlAST = (0, import_graphql.parse)(graphqlDoc);
70
- const definitionNode = graphqlAST.definitions[0];
71
- if (definitionNode.kind === "OperationDefinition") {
72
- if (definitionNode.operation !== "query") {
73
- return void 0;
74
- }
75
- const operationName = (_a = definitionNode.name) == null ? void 0 : _a.value;
76
- (0, import_invariant.default)(operationName, "Operations are required to have a name");
77
- const namespaceName = `${PREFIX}${QUERIES_NAMESPACE}_${operationName}`;
78
- return [
79
- ts.factory.createImportDeclaration(void 0, void 0, ts.factory.createImportClause(false, void 0, ts.factory.createNamespaceImport(ts.factory.createIdentifier(namespaceName))), ts.factory.createStringLiteral(`./__generated__/${operationName}.graphql`)),
80
- ts.factory.createIdentifier(namespaceName)
81
- ];
82
- } else if (definitionNode.kind === "FragmentDefinition") {
83
- const fragmentName = definitionNode.name.value;
84
- const fragmentBaseName = fragmentName.replace(/Fragment$/, "");
85
- const namespaceName = `${PREFIX}${QUERIES_NAMESPACE}_${fragmentName}`;
86
- return [
87
- ts.factory.createImportDeclaration(void 0, void 0, ts.factory.createImportClause(false, void 0, ts.factory.createNamespaceImport(ts.factory.createIdentifier(namespaceName))), ts.factory.createStringLiteral(`./__generated__/${fragmentBaseName}WatchNodeQuery.graphql`)),
88
- ts.factory.createIdentifier(namespaceName)
89
- ];
90
- }
91
- (0, import_invariant.default)(false, `Unhandled GraphQL definition type: ${definitionNode.kind}`);
92
- }