@cedarjs/web 5.0.7-next.336 → 5.0.7-rc.3

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 (192) hide show
  1. package/dist/apollo/fragmentRegistry.d.ts +0 -25
  2. package/dist/apollo/fragmentRegistry.d.ts.map +1 -1
  3. package/dist/apollo/fragmentRegistry.js +1 -19
  4. package/dist/apollo/index.d.ts +70 -50
  5. package/dist/apollo/index.d.ts.map +1 -1
  6. package/dist/apollo/index.js +184 -2
  7. package/dist/apollo/suspense.d.ts +7 -16
  8. package/dist/apollo/suspense.d.ts.map +1 -1
  9. package/dist/apollo/suspense.js +26 -9
  10. package/dist/apollo/typeOverride.d.ts +21 -0
  11. package/dist/apollo/typeOverride.d.ts.map +1 -0
  12. package/dist/bundled/apollo-upload-client.js +1 -2899
  13. package/dist/cjs/apollo/fragmentRegistry.d.ts +43 -0
  14. package/dist/cjs/apollo/fragmentRegistry.d.ts.map +1 -0
  15. package/dist/cjs/apollo/fragmentRegistry.js +75 -0
  16. package/dist/cjs/apollo/index.d.ts +76 -0
  17. package/dist/cjs/apollo/index.d.ts.map +1 -0
  18. package/dist/cjs/apollo/index.js +218 -0
  19. package/dist/cjs/apollo/links.d.ts +27 -0
  20. package/dist/cjs/apollo/links.d.ts.map +1 -0
  21. package/dist/cjs/apollo/links.js +122 -0
  22. package/dist/cjs/apollo/sseLink.d.ts +29 -0
  23. package/dist/cjs/apollo/sseLink.d.ts.map +1 -0
  24. package/dist/cjs/apollo/sseLink.js +120 -0
  25. package/dist/{apollo/apolloLinkTypes.d.ts → cjs/apollo/suspense.d.ts} +22 -22
  26. package/dist/cjs/apollo/suspense.d.ts.map +1 -0
  27. package/dist/cjs/apollo/suspense.js +127 -0
  28. package/dist/cjs/apollo/typeOverride.d.ts +21 -0
  29. package/dist/cjs/apollo/typeOverride.d.ts.map +1 -0
  30. package/dist/cjs/apollo/typeOverride.js +16 -0
  31. package/dist/cjs/apollo/useCache.d.ts +22 -0
  32. package/dist/cjs/apollo/useCache.d.ts.map +1 -0
  33. package/dist/cjs/apollo/useCache.js +49 -0
  34. package/dist/cjs/bins/cedar.d.ts +9 -0
  35. package/dist/cjs/bins/cedar.d.ts.map +1 -0
  36. package/dist/cjs/bins/cedar.js +36 -0
  37. package/dist/cjs/bins/cfw.d.ts +3 -0
  38. package/dist/cjs/bins/cfw.d.ts.map +1 -0
  39. package/dist/cjs/bins/cfw.js +36 -0
  40. package/dist/cjs/bins/cross-env.d.ts +3 -0
  41. package/dist/cjs/bins/cross-env.d.ts.map +1 -0
  42. package/dist/cjs/bins/cross-env.js +30 -0
  43. package/dist/cjs/bins/msw.d.ts +3 -0
  44. package/dist/cjs/bins/msw.d.ts.map +1 -0
  45. package/dist/cjs/bins/msw.js +28 -0
  46. package/dist/cjs/bins/redwood.d.ts +9 -0
  47. package/dist/cjs/bins/redwood.d.ts.map +1 -0
  48. package/dist/cjs/bins/redwood.js +36 -0
  49. package/dist/cjs/bins/storybook.d.ts +3 -0
  50. package/dist/cjs/bins/storybook.d.ts.map +1 -0
  51. package/dist/cjs/bins/storybook.js +49 -0
  52. package/dist/cjs/bins/tsc.d.ts +3 -0
  53. package/dist/cjs/bins/tsc.d.ts.map +1 -0
  54. package/dist/cjs/bins/tsc.js +30 -0
  55. package/dist/cjs/bundled/apollo-upload-client.d.ts +3 -0
  56. package/dist/cjs/bundled/apollo-upload-client.d.ts.map +1 -0
  57. package/dist/cjs/bundled/apollo-upload-client.js +2925 -0
  58. package/dist/cjs/components/DevFatalErrorPage.d.ts +21 -0
  59. package/dist/cjs/components/DevFatalErrorPage.d.ts.map +1 -0
  60. package/dist/cjs/components/DevFatalErrorPage.js +552 -0
  61. package/dist/cjs/components/FatalErrorBoundary.d.ts +24 -0
  62. package/dist/cjs/components/FatalErrorBoundary.d.ts.map +1 -0
  63. package/dist/cjs/components/FatalErrorBoundary.js +63 -0
  64. package/dist/cjs/components/FetchConfigProvider.d.ts +25 -0
  65. package/dist/cjs/components/FetchConfigProvider.d.ts.map +1 -0
  66. package/dist/cjs/components/FetchConfigProvider.js +80 -0
  67. package/dist/cjs/components/GraphQLHooksProvider.d.ts +45 -0
  68. package/dist/cjs/components/GraphQLHooksProvider.d.ts.map +1 -0
  69. package/dist/cjs/components/GraphQLHooksProvider.js +135 -0
  70. package/dist/cjs/components/MetaTags.d.ts +52 -0
  71. package/dist/cjs/components/MetaTags.d.ts.map +1 -0
  72. package/dist/cjs/components/MetaTags.js +68 -0
  73. package/dist/cjs/components/Metadata.d.ts +9 -0
  74. package/dist/cjs/components/Metadata.d.ts.map +1 -0
  75. package/dist/cjs/components/Metadata.js +94 -0
  76. package/dist/cjs/components/PortalHead.d.ts +4 -0
  77. package/dist/cjs/components/PortalHead.d.ts.map +1 -0
  78. package/dist/cjs/components/PortalHead.js +59 -0
  79. package/dist/{components/CedarProvider.d.ts → cjs/components/RedwoodProvider.d.ts} +1 -3
  80. package/dist/cjs/components/RedwoodProvider.d.ts.map +1 -0
  81. package/dist/cjs/components/RedwoodProvider.js +57 -0
  82. package/dist/cjs/components/ServerInject.d.ts +26 -0
  83. package/dist/cjs/components/ServerInject.d.ts.map +1 -0
  84. package/dist/cjs/components/ServerInject.js +75 -0
  85. package/dist/cjs/components/cell/CellCacheContext.d.ts +20 -0
  86. package/dist/cjs/components/cell/CellCacheContext.d.ts.map +1 -0
  87. package/dist/cjs/components/cell/CellCacheContext.js +53 -0
  88. package/dist/cjs/components/cell/CellErrorBoundary.d.ts +25 -0
  89. package/dist/cjs/components/cell/CellErrorBoundary.d.ts.map +1 -0
  90. package/dist/cjs/components/cell/CellErrorBoundary.js +66 -0
  91. package/dist/cjs/components/cell/cellTypes.d.ts +152 -0
  92. package/dist/cjs/components/cell/cellTypes.d.ts.map +1 -0
  93. package/dist/cjs/components/cell/cellTypes.js +16 -0
  94. package/dist/cjs/components/cell/createCell.d.ts +10 -0
  95. package/dist/cjs/components/cell/createCell.d.ts.map +1 -0
  96. package/dist/cjs/components/cell/createCell.js +165 -0
  97. package/dist/cjs/components/cell/createCell.test.js +351 -0
  98. package/dist/cjs/components/cell/createServerCell.d.ts +15 -0
  99. package/dist/cjs/components/cell/createServerCell.d.ts.map +1 -0
  100. package/dist/cjs/components/cell/createServerCell.js +91 -0
  101. package/dist/cjs/components/cell/createSuspendingCell.d.ts +11 -0
  102. package/dist/cjs/components/cell/createSuspendingCell.d.ts.map +1 -0
  103. package/dist/cjs/components/cell/createSuspendingCell.js +152 -0
  104. package/dist/cjs/components/cell/createSuspendingCell.test.js +115 -0
  105. package/dist/cjs/components/cell/isCellEmpty.d.ts +41 -0
  106. package/dist/cjs/components/cell/isCellEmpty.d.ts.map +1 -0
  107. package/dist/cjs/components/cell/isCellEmpty.js +35 -0
  108. package/dist/cjs/components/htmlTags.d.ts +52 -0
  109. package/dist/cjs/components/htmlTags.d.ts.map +1 -0
  110. package/dist/cjs/components/htmlTags.js +88 -0
  111. package/dist/cjs/config.d.ts +2 -0
  112. package/dist/cjs/config.d.ts.map +1 -0
  113. package/dist/cjs/config.js +6 -0
  114. package/dist/cjs/global.web-auto-imports.d.ts +30 -0
  115. package/dist/cjs/global.web-auto-imports.d.ts.map +1 -0
  116. package/dist/cjs/global.web-auto-imports.js +16 -0
  117. package/dist/cjs/graphql.d.ts +23 -0
  118. package/dist/cjs/graphql.d.ts.map +1 -0
  119. package/dist/cjs/graphql.js +36 -0
  120. package/dist/cjs/index.d.ts +19 -0
  121. package/dist/cjs/index.d.ts.map +1 -0
  122. package/dist/cjs/index.js +69 -0
  123. package/dist/cjs/package.json +1 -0
  124. package/dist/cjs/routeHooks.types.d.ts +12 -0
  125. package/dist/cjs/routeHooks.types.d.ts.map +1 -0
  126. package/dist/cjs/routeHooks.types.js +16 -0
  127. package/dist/cjs/server/MiddlewareRequest.d.ts +28 -0
  128. package/dist/cjs/server/MiddlewareRequest.d.ts.map +1 -0
  129. package/dist/cjs/server/MiddlewareRequest.js +71 -0
  130. package/dist/cjs/server/MiddlewareResponse.d.ts +44 -0
  131. package/dist/cjs/server/MiddlewareResponse.d.ts.map +1 -0
  132. package/dist/cjs/server/MiddlewareResponse.js +130 -0
  133. package/dist/cjs/server/middleware.d.ts +17 -0
  134. package/dist/cjs/server/middleware.d.ts.map +1 -0
  135. package/dist/cjs/server/middleware.js +24 -0
  136. package/dist/cjs/server/request.d.ts +2 -0
  137. package/dist/cjs/server/request.d.ts.map +1 -0
  138. package/dist/cjs/server/request.js +34 -0
  139. package/dist/cjs/streamUtils/useDocumentReady.d.ts +11 -0
  140. package/dist/cjs/streamUtils/useDocumentReady.d.ts.map +1 -0
  141. package/dist/cjs/streamUtils/useDocumentReady.js +41 -0
  142. package/dist/cjs/toast/index.d.ts +3 -0
  143. package/dist/cjs/toast/index.d.ts.map +1 -0
  144. package/dist/cjs/toast/index.js +41 -0
  145. package/dist/components/FetchConfigProvider.d.ts +2 -3
  146. package/dist/components/FetchConfigProvider.d.ts.map +1 -1
  147. package/dist/components/GraphQLHooksProvider.d.ts +45 -0
  148. package/dist/components/GraphQLHooksProvider.d.ts.map +1 -0
  149. package/dist/components/GraphQLHooksProvider.js +94 -0
  150. package/dist/components/RedwoodProvider.d.ts +9 -0
  151. package/dist/components/RedwoodProvider.d.ts.map +1 -0
  152. package/dist/components/{CedarProvider.js → RedwoodProvider.js} +1 -3
  153. package/dist/components/cell/CellErrorBoundary.d.ts +2 -3
  154. package/dist/components/cell/CellErrorBoundary.d.ts.map +1 -1
  155. package/dist/components/cell/cellTypes.d.ts +7 -22
  156. package/dist/components/cell/cellTypes.d.ts.map +1 -1
  157. package/dist/components/cell/createCell.d.ts +7 -1
  158. package/dist/components/cell/createCell.d.ts.map +1 -1
  159. package/dist/components/cell/createCell.js +3 -22
  160. package/dist/components/cell/createCell.test.js +328 -0
  161. package/dist/components/cell/createSuspendingCell.d.ts.map +1 -1
  162. package/dist/components/cell/createSuspendingCell.js +3 -12
  163. package/dist/components/cell/createSuspendingCell.test.js +92 -0
  164. package/dist/global.web-auto-imports.d.ts +16 -0
  165. package/dist/global.web-auto-imports.d.ts.map +1 -1
  166. package/dist/index.d.ts +3 -6
  167. package/dist/index.d.ts.map +1 -1
  168. package/dist/index.js +4 -6
  169. package/dist/package.json +1 -0
  170. package/package.json +106 -48
  171. package/dist/apollo/ApolloProviderWithFetchConfig.d.ts +0 -15
  172. package/dist/apollo/ApolloProviderWithFetchConfig.d.ts.map +0 -1
  173. package/dist/apollo/ApolloProviderWithFetchConfig.js +0 -134
  174. package/dist/apollo/CedarApolloProvider.d.ts +0 -14
  175. package/dist/apollo/CedarApolloProvider.d.ts.map +0 -1
  176. package/dist/apollo/CedarApolloProvider.js +0 -35
  177. package/dist/apollo/ErrorBoundary.d.ts +0 -13
  178. package/dist/apollo/ErrorBoundary.d.ts.map +0 -1
  179. package/dist/apollo/ErrorBoundary.js +0 -13
  180. package/dist/apollo/apolloLinkTypes.d.ts.map +0 -1
  181. package/dist/bins/cedar.js +0 -14
  182. package/dist/bins/cfw.js +0 -14
  183. package/dist/bins/cross-env.js +0 -8
  184. package/dist/bins/msw.js +0 -6
  185. package/dist/bins/redwood.js +0 -14
  186. package/dist/bins/storybook.js +0 -27
  187. package/dist/bins/tsc.js +0 -8
  188. package/dist/components/CedarProvider.d.ts.map +0 -1
  189. package/dist/components/cell/createFragmentCell.d.ts +0 -19
  190. package/dist/components/cell/createFragmentCell.d.ts.map +0 -1
  191. package/dist/components/cell/createFragmentCell.js +0 -73
  192. /package/dist/apollo/{apolloLinkTypes.js → typeOverride.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/web",
3
- "version": "5.0.7-next.336",
3
+ "version": "5.0.7-rc.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
@@ -10,57 +10,116 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
- "types": "./dist/index.d.ts",
14
- "default": "./dist/index.js"
13
+ "import": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "require": {
18
+ "types": "./dist/cjs/index.d.ts",
19
+ "default": "./dist/cjs/index.js"
20
+ }
15
21
  },
16
22
  "./serverInject": {
17
- "types": "./dist/components/ServerInject.d.ts",
18
- "default": "./dist/components/ServerInject.js"
23
+ "import": {
24
+ "types": "./dist/components/ServerInject.d.ts",
25
+ "default": "./dist/components/ServerInject.js"
26
+ },
27
+ "require": {
28
+ "types": "./dist/cjs/components/ServerInject.d.ts",
29
+ "default": "./dist/cjs/components/ServerInject.js"
30
+ }
19
31
  },
20
32
  "./request": {
21
- "types": "./dist/server/request.d.ts",
22
- "default": "./dist/server/request.js"
33
+ "import": {
34
+ "types": "./dist/server/request.d.ts",
35
+ "default": "./dist/server/request.js"
36
+ },
37
+ "require": {
38
+ "types": "./dist/cjs/server/request.d.ts",
39
+ "default": "./dist/cjs/server/request.js"
40
+ }
23
41
  },
24
42
  "./middleware": {
25
- "types": "./dist/server/middleware.d.ts",
26
- "default": "./dist/server/middleware.js"
43
+ "import": {
44
+ "types": "./dist/server/middleware.d.ts",
45
+ "default": "./dist/server/middleware.js"
46
+ },
47
+ "require": {
48
+ "types": "./dist/cjs/server/middleware.d.ts",
49
+ "default": "./dist/cjs/server/middleware.js"
50
+ }
27
51
  },
28
52
  "./dist/server/middleware": {
29
- "types": "./dist/server/middleware.d.ts",
30
- "default": "./dist/server/middleware.js"
53
+ "import": {
54
+ "types": "./dist/server/middleware.d.ts",
55
+ "default": "./dist/server/middleware.js"
56
+ },
57
+ "require": {
58
+ "types": "./dist/cjs/server/middleware.d.ts",
59
+ "default": "./dist/cjs/server/middleware.js"
60
+ }
61
+ },
62
+ "./dist/components/*": {
63
+ "require": "./dist/cjs/components/*.js",
64
+ "import": "./dist/components/*.js"
65
+ },
66
+ "./htmlTags": {
67
+ "require": "./dist/cjs/components/htmlTags.js",
68
+ "import": "./dist/components/htmlTags.js"
69
+ },
70
+ "./Metadata": {
71
+ "require": "./dist/cjs/components/Metadata.js",
72
+ "import": "./dist/components/Metadata.js"
73
+ },
74
+ "./dist/apollo/suspense": {
75
+ "require": "./dist/cjs/apollo/suspense.js",
76
+ "import": "./dist/apollo/suspense.js"
77
+ },
78
+ "./dist/apollo/sseLink": {
79
+ "require": "./dist/cjs/apollo/sseLink.js",
80
+ "import": "./dist/apollo/sseLink.js"
81
+ },
82
+ "./dist/graphql.js": {
83
+ "require": "./dist/cjs/graphql.js",
84
+ "import": "./dist/graphql.js"
31
85
  },
32
- "./dist/components/*": "./dist/components/*.js",
33
- "./htmlTags": "./dist/components/htmlTags.js",
34
- "./Metadata": "./dist/components/Metadata.js",
35
- "./dist/apollo/suspense": "./dist/apollo/suspense.js",
36
- "./dist/apollo/sseLink": "./dist/apollo/sseLink.js",
37
- "./dist/graphql.js": "./dist/graphql.js",
38
86
  "./toast": {
39
- "types": "./dist/toast/index.d.ts",
40
- "default": "./dist/toast/index.js"
87
+ "import": {
88
+ "types": "./dist/toast/index.d.ts",
89
+ "default": "./dist/toast/index.js"
90
+ },
91
+ "require": {
92
+ "types": "./dist/cjs/toast/index.d.ts",
93
+ "default": "./dist/cjs/toast/index.js"
94
+ }
41
95
  },
42
96
  "./apollo": {
43
- "types": "./dist/apollo/index.d.ts",
44
- "default": "./dist/apollo/index.js"
45
- },
46
- "./apollo/CedarApolloProvider": {
47
- "types": "./dist/apollo/CedarApolloProvider.d.ts",
48
- "default": "./dist/apollo/CedarApolloProvider.js"
97
+ "import": {
98
+ "types": "./dist/apollo/index.d.ts",
99
+ "default": "./dist/apollo/index.js"
100
+ },
101
+ "require": {
102
+ "types": "./dist/cjs/apollo/index.d.ts",
103
+ "default": "./dist/cjs/apollo/index.js"
104
+ }
49
105
  },
50
- "./forceEsmApollo": "./dist/apollo/index.js"
106
+ "./forceEsmApollo": {
107
+ "require": "./dist/apollo/index.js",
108
+ "import": "./dist/apollo/index.js"
109
+ }
51
110
  },
52
111
  "main": "./dist/index.js",
53
112
  "types": "dist/index.d.ts",
54
113
  "bin": {
55
- "cedar": "./dist/bins/cedar.js",
56
- "cedarjs": "./dist/bins/cedar.js",
57
- "cfw": "./dist/bins/cfw.js",
58
- "cross-env": "./dist/bins/cross-env.js",
59
- "msw": "./dist/bins/msw.js",
60
- "redwood": "./dist/bins/redwood.js",
61
- "rw": "./dist/bins/redwood.js",
62
- "storybook": "./dist/bins/storybook.js",
63
- "tsc": "./dist/bins/tsc.js"
114
+ "cedar": "./dist/cjs/bins/cedar.js",
115
+ "cedarjs": "./dist/cjs/bins/cedar.js",
116
+ "cfw": "./dist/cjs/bins/cfw.js",
117
+ "cross-env": "./dist/cjs/bins/cross-env.js",
118
+ "msw": "./dist/cjs/bins/msw.js",
119
+ "redwood": "./dist/cjs/bins/redwood.js",
120
+ "rw": "./dist/cjs/bins/redwood.js",
121
+ "storybook": "./dist/cjs/bins/storybook.js",
122
+ "tsc": "./dist/cjs/bins/tsc.js"
64
123
  },
65
124
  "files": [
66
125
  "dist",
@@ -68,11 +127,11 @@
68
127
  "toast"
69
128
  ],
70
129
  "scripts": {
71
- "build": "node ./build.ts",
130
+ "build": "node ./build.ts && yarn build:types",
72
131
  "build:pack": "yarn pack -o cedarjs-web.tgz",
73
- "build:types": "tsc --build --verbose ./tsconfig.build.json",
132
+ "build:types": "tsc --build --verbose ./tsconfig.build.json ./tsconfig.cjs.json",
74
133
  "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"",
75
- "check:attw": "yarn cedar-fwtools-attw",
134
+ "check:attw": "node ./attw.ts",
76
135
  "check:package": "concurrently npm:check:attw yarn:publint",
77
136
  "prepublishOnly": "NODE_ENV=production yarn build",
78
137
  "test": "vitest run",
@@ -81,7 +140,7 @@
81
140
  },
82
141
  "dependencies": {
83
142
  "@apollo/client": "3.14.1",
84
- "@cedarjs/server-store": "5.0.7-next.336",
143
+ "@cedarjs/server-store": "5.0.7-rc.3",
85
144
  "@dr.pogodin/react-helmet": "2.0.4",
86
145
  "@whatwg-node/fetch": "0.10.13",
87
146
  "apollo-upload-client": "18.0.1",
@@ -95,32 +154,31 @@
95
154
  },
96
155
  "devDependencies": {
97
156
  "@apollo/client-react-streaming": "0.12.3",
98
- "@arethetypeswrong/cli": "0.18.5",
157
+ "@arethetypeswrong/cli": "0.18.4",
99
158
  "@babel/cli": "7.29.7",
100
159
  "@babel/core": "^7.26.10",
101
160
  "@babel/plugin-transform-runtime": "7.29.7",
102
161
  "@babel/runtime": "7.29.7",
103
- "@cedarjs/auth": "5.0.7-next.336",
104
- "@cedarjs/framework-tools": "5.0.7-next.336",
105
- "@cedarjs/internal": "5.0.7-next.336",
162
+ "@cedarjs/auth": "5.0.7-rc.3",
163
+ "@cedarjs/framework-tools": "5.0.7-rc.3",
164
+ "@cedarjs/internal": "5.0.7-rc.3",
106
165
  "@rollup/plugin-babel": "6.1.0",
107
- "@testing-library/dom": "10.4.1",
108
166
  "@testing-library/jest-dom": "6.9.1",
109
- "@testing-library/react": "16.3.2",
167
+ "@testing-library/react": "14.3.1",
110
168
  "@types/apollo-upload-client": "^18",
111
169
  "@types/react": "^18.2.55",
112
170
  "@types/react-dom": "^18.2.19",
113
171
  "concurrently": "9.2.4",
114
172
  "nodemon": "3.1.14",
115
- "publint": "0.3.23",
173
+ "publint": "0.3.21",
116
174
  "react": "18.3.1",
117
175
  "react-dom": "18.3.1",
118
176
  "tstyche": "5.0.2",
119
177
  "typescript": "5.9.3",
120
- "vitest": "4.1.10"
178
+ "vitest": "3.2.6"
121
179
  },
122
180
  "peerDependencies": {
123
- "@cedarjs/auth": "5.0.7-next.336",
181
+ "@cedarjs/auth": "5.0.7-rc.3",
124
182
  "react": "18.3.1",
125
183
  "react-dom": "18.3.1"
126
184
  },
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import type { ApolloCache, setLogVerbosity } from '@apollo/client';
3
- import type { UseAuth } from '@cedarjs/auth';
4
- import type { GraphQLClientConfigProp } from './apolloLinkTypes.js';
5
- interface Props {
6
- config: Omit<GraphQLClientConfigProp, 'cacheConfig' | 'cache'> & {
7
- cache: ApolloCache<unknown>;
8
- };
9
- useAuth?: UseAuth;
10
- logLevel: ReturnType<typeof setLogVerbosity>;
11
- children: React.ReactNode;
12
- }
13
- export declare function ApolloProviderWithFetchConfig({ config, children, useAuth, logLevel, }: Props): React.JSX.Element;
14
- export {};
15
- //# sourceMappingURL=ApolloProviderWithFetchConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ApolloProviderWithFetchConfig.d.ts","sourceRoot":"","sources":["../../src/apollo/ApolloProviderWithFetchConfig.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,WAAW,EAAgB,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAYhF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,sBAAsB,CAAA;AAoC7B,UAAU,KAAK;IACb,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG;QAC/D,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;KAC5B,CAAA;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;IAC5C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,MAAM,EACN,QAAQ,EACR,OAAmB,EACnB,QAAQ,GACT,EAAE,KAAK,qBAgKP"}
@@ -1,134 +0,0 @@
1
- import React from "react";
2
- import {
3
- ApolloClient,
4
- setLogVerbosity as apolloSetLogVerbosity
5
- } from "@apollo/client/core/core.cjs";
6
- import { setContext } from "@apollo/client/link/context/context.cjs";
7
- import { ApolloLink, split } from "@apollo/client/link/core/core.cjs";
8
- import { createPersistedQueryLink } from "@apollo/client/link/persisted-queries/persisted-queries.cjs";
9
- import { ApolloProvider } from "@apollo/client/react/react.cjs";
10
- import { getMainDefinition } from "@apollo/client/utilities/utilities.cjs";
11
- import { print } from "graphql/language/printer.js";
12
- import { useNoAuth } from "@cedarjs/auth";
13
- import { createUploadLink } from "../bundled/apollo-upload-client.js";
14
- import { useFetchConfig } from "../components/FetchConfigProvider.js";
15
- import { ErrorBoundary } from "./ErrorBoundary.js";
16
- import * as SSELinkExports from "./sseLink.js";
17
- const { SSELink, isSubscription, isLiveQuery } = SSELinkExports;
18
- function ApolloProviderWithFetchConfig({
19
- config,
20
- children,
21
- useAuth = useNoAuth,
22
- logLevel
23
- }) {
24
- apolloSetLogVerbosity(logLevel);
25
- const { getToken, type: authProviderType } = useAuth();
26
- const data = {
27
- mostRecentRequest: void 0,
28
- mostRecentResponse: void 0
29
- };
30
- const updateDataApolloLink = new ApolloLink((operation, forward) => {
31
- const { operationName, query, variables } = operation;
32
- data.mostRecentRequest = {};
33
- data.mostRecentRequest.operationName = operationName;
34
- data.mostRecentRequest.operationKind = query?.kind.toString();
35
- data.mostRecentRequest.variables = variables;
36
- data.mostRecentRequest.query = query && print(operation.query);
37
- return forward(operation).map((result) => {
38
- data.mostRecentResponse = result;
39
- return result;
40
- });
41
- });
42
- const withToken = setContext(async () => {
43
- const token = await getToken();
44
- return { token };
45
- });
46
- const { headers, uri } = useFetchConfig();
47
- const authMiddleware = new ApolloLink((operation, forward) => {
48
- const { token } = operation.getContext();
49
- const authHeaders = token ? {
50
- "auth-provider": authProviderType,
51
- authorization: `Bearer ${token}`
52
- } : {};
53
- operation.setContext(() => ({
54
- headers: {
55
- ...operation.getContext().headers,
56
- ...headers,
57
- // Duped auth headers, because we may remove the `FetchConfigProvider` at a later date.
58
- ...authHeaders
59
- }
60
- }));
61
- return forward(operation);
62
- });
63
- const { httpLinkConfig, link: cedarApolloLink, ...rest } = config ?? {};
64
- const uploadLink = createUploadLink({
65
- uri,
66
- ...httpLinkConfig
67
- });
68
- const uploadOrSSELink = typeof SSELink !== "undefined" ? split(
69
- ({ query }) => {
70
- const definition = getMainDefinition(query);
71
- return isSubscription(definition) || isLiveQuery(definition);
72
- },
73
- new SSELink({
74
- url: uri,
75
- auth: { authProviderType, tokenFn: getToken },
76
- httpLinkConfig,
77
- headers
78
- }),
79
- uploadLink
80
- ) : uploadLink;
81
- const terminatingLink = split(
82
- ({ query }) => {
83
- const documentQuery = query;
84
- return documentQuery?.["__meta__"]?.["hash"] !== void 0;
85
- },
86
- createPersistedQueryLink({
87
- generateHash: (document) => document["__meta__"]["hash"]
88
- }).concat(uploadOrSSELink),
89
- uploadOrSSELink
90
- );
91
- const cedarApolloLinks = [
92
- { name: "withToken", link: withToken },
93
- { name: "authMiddleware", link: authMiddleware },
94
- { name: "updateDataApolloLink", link: updateDataApolloLink },
95
- { name: "httpLink", link: terminatingLink }
96
- ];
97
- let link = cedarApolloLink;
98
- link ??= ApolloLink.from(cedarApolloLinks.map((l) => l.link));
99
- if (typeof link === "function") {
100
- link = link(cedarApolloLinks);
101
- }
102
- const client = new ApolloClient({
103
- // Default options for every Cell. Better to specify them here than in
104
- // `beforeQuery` where it's too easy to overwrite them.
105
- // See https://www.apollographql.com/docs/react/api/core/ApolloClient/#example-defaultoptions-object.
106
- defaultOptions: {
107
- watchQuery: {
108
- // The `fetchPolicy` we expect:
109
- //
110
- // > Apollo Client executes the full query against both the cache and
111
- // > your GraphQL server.
112
- // > The query automatically updates if the result of the server-side
113
- // > query modifies cached fields.
114
- //
115
- // See https://www.apollographql.com/docs/react/data/queries/#cache-and-network.
116
- fetchPolicy: "cache-and-network",
117
- // So that Cells rerender when refetching.
118
- // See https://www.apollographql.com/docs/react/data/queries/#inspecting-loading-states.
119
- notifyOnNetworkStatusChange: true
120
- }
121
- },
122
- link,
123
- ...rest
124
- });
125
- const extendErrorAndRethrow = (error, _errorInfo) => {
126
- error["mostRecentRequest"] = data.mostRecentRequest;
127
- error["mostRecentResponse"] = data.mostRecentResponse;
128
- throw error;
129
- };
130
- return /* @__PURE__ */ React.createElement(ApolloProvider, { client }, /* @__PURE__ */ React.createElement(ErrorBoundary, { onError: extendErrorAndRethrow }, children));
131
- }
132
- export {
133
- ApolloProviderWithFetchConfig
134
- };
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { DocumentNode, setLogVerbosity } from '@apollo/client';
3
- import type { UseAuth } from '@cedarjs/auth';
4
- import type { GraphQLClientConfigProp } from './apolloLinkTypes.js';
5
- export type { ApolloClientCacheConfig, CedarApolloLink, CedarApolloLinkFactory, CedarApolloLinkName, CedarApolloLinks, GraphQLClientConfigProp, } from './apolloLinkTypes.js';
6
- interface Props {
7
- graphQLClientConfig?: GraphQLClientConfigProp;
8
- fragments?: DocumentNode[];
9
- useAuth?: UseAuth;
10
- logLevel?: ReturnType<typeof setLogVerbosity>;
11
- children: React.ReactNode;
12
- }
13
- export declare function CedarApolloProvider({ graphQLClientConfig, fragments, useAuth, logLevel, children, }: Props): React.JSX.Element;
14
- //# sourceMappingURL=CedarApolloProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CedarApolloProvider.d.ts","sourceRoot":"","sources":["../../src/apollo/CedarApolloProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAK5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAInE,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,sBAAsB,CAAA;AAE7B,UAAU,KAAK;IACb,mBAAmB,CAAC,EAAE,uBAAuB,CAAA;IAC7C,SAAS,CAAC,EAAE,YAAY,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,mBAAmB,EACnB,SAAS,EACT,OAAmB,EACnB,QAAkB,EAClB,QAAQ,GACT,EAAE,KAAK,qBA4BP"}
@@ -1,35 +0,0 @@
1
- import React from "react";
2
- import { InMemoryCache } from "@apollo/client/cache/cache.cjs";
3
- import { useNoAuth } from "@cedarjs/auth";
4
- import { FetchConfigProvider } from "../components/FetchConfigProvider.js";
5
- import { ApolloProviderWithFetchConfig } from "./ApolloProviderWithFetchConfig.js";
6
- import { fragmentRegistry } from "./fragmentRegistry.js";
7
- function CedarApolloProvider({
8
- graphQLClientConfig,
9
- fragments,
10
- useAuth = useNoAuth,
11
- logLevel = "debug",
12
- children
13
- }) {
14
- const { cacheConfig, ...config } = graphQLClientConfig ?? {};
15
- if (fragments) {
16
- fragmentRegistry.register(...fragments);
17
- }
18
- const cache = new InMemoryCache({
19
- fragments: fragmentRegistry,
20
- possibleTypes: cacheConfig?.possibleTypes,
21
- ...cacheConfig
22
- }).restore(globalThis?.__CEDAR__APOLLO_STATE ?? {});
23
- return /* @__PURE__ */ React.createElement(FetchConfigProvider, { useAuth }, /* @__PURE__ */ React.createElement(
24
- ApolloProviderWithFetchConfig,
25
- {
26
- config: { cache, ...config },
27
- useAuth,
28
- logLevel
29
- },
30
- children
31
- ));
32
- }
33
- export {
34
- CedarApolloProvider
35
- };
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- type ComponentDidCatch = React.ComponentLifecycle<any, any>['componentDidCatch'];
3
- interface ErrorBoundaryProps {
4
- error?: unknown;
5
- onError: NonNullable<ComponentDidCatch>;
6
- children: React.ReactNode;
7
- }
8
- export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
9
- componentDidCatch(...args: Parameters<NonNullable<ComponentDidCatch>>): void;
10
- render(): React.ReactNode;
11
- }
12
- export {};
13
- //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/apollo/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,KAAK,iBAAiB,GAAG,KAAK,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,mBAAmB,CAAC,CAAA;AAEhF,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAA;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC;IACpE,iBAAiB,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAKrE,MAAM;CAGP"}
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- class ErrorBoundary extends React.Component {
3
- componentDidCatch(...args) {
4
- this.setState({});
5
- this.props.onError(...args);
6
- }
7
- render() {
8
- return this.props.children;
9
- }
10
- }
11
- export {
12
- ErrorBoundary
13
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"apolloLinkTypes.d.ts","sourceRoot":"","sources":["../../src/apollo/apolloLinkTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,mBAAmB,EACpB,MAAM,gBAAgB,CAAA;AAEvB,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAA;AAEzD,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,gBAAgB,GAChB,sBAAsB,GACtB,UAAU,CAAA;AAEd,MAAM,MAAM,eAAe,CACzB,IAAI,SAAS,mBAAmB,EAChC,IAAI,SAAS,UAAU,GAAG,UAAU,IAClC;IACF,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,eAAe,CAAC,WAAW,CAAC;IAC5B,eAAe,CAAC,gBAAgB,CAAC;IACjC,eAAe,CAAC,sBAAsB,CAAC;IACvC,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,CAAC;CACnD,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,UAAU,CAAA;AAE5E,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,mBAAmB,CAAC,OAAO,CAAC,EAC5B,OAAO,GAAG,MAAM,CACjB,GAAG;IACF,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,uBAAuB,CAAA;IACrC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,sBAAsB,CAAA;CAC3C,CAAA"}
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from "node:module";
3
- import { pathToFileURL } from "node:url";
4
- const require2 = createRequire(import.meta.url);
5
- const cliPackageJsonFileUrl = pathToFileURL(
6
- require2.resolve("@cedarjs/cli/package.json")
7
- );
8
- const requireFromCli = createRequire(cliPackageJsonFileUrl);
9
- const bins = requireFromCli("./package.json")["bin"];
10
- const cliEntryPointUrl = new URL(bins["cedar"], cliPackageJsonFileUrl);
11
- if (process.env.PROJECT_CWD) {
12
- process.chdir(process.env.PROJECT_CWD);
13
- }
14
- import(cliEntryPointUrl.toString());
package/dist/bins/cfw.js DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from "node:module";
3
- import { pathToFileURL } from "node:url";
4
- const require2 = createRequire(import.meta.url);
5
- const cliPackageJsonFileUrl = pathToFileURL(
6
- require2.resolve("@cedarjs/cli/package.json")
7
- );
8
- const requireFromCli = createRequire(cliPackageJsonFileUrl);
9
- const bins = requireFromCli("./package.json")["bin"];
10
- const cliEntryPointUrl = new URL(bins["cfw"], cliPackageJsonFileUrl);
11
- if (process.env.PROJECT_CWD) {
12
- process.chdir(process.env.PROJECT_CWD);
13
- }
14
- import(cliEntryPointUrl.toString());
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from "module";
3
- const require2 = createRequire(import.meta.url);
4
- const requireFromCrossEnv = createRequire(
5
- require2.resolve("cross-env/package.json")
6
- );
7
- const bins = requireFromCrossEnv("./package.json")["bin"];
8
- requireFromCrossEnv(`./${bins["cross-env"]}`);
package/dist/bins/msw.js DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from "module";
3
- const require2 = createRequire(import.meta.url);
4
- const requireFromMSW = createRequire(require2.resolve("msw/package.json"));
5
- const bins = requireFromMSW("./package.json")["bin"];
6
- requireFromMSW(`./${bins["msw"]}`);
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from "node:module";
3
- import { pathToFileURL } from "node:url";
4
- const require2 = createRequire(import.meta.url);
5
- const cliPackageJsonFileUrl = pathToFileURL(
6
- require2.resolve("@cedarjs/cli/package.json")
7
- );
8
- const requireFromCli = createRequire(cliPackageJsonFileUrl);
9
- const bins = requireFromCli("./package.json")["bin"];
10
- const cliEntryPointUrl = new URL(bins["redwood"], cliPackageJsonFileUrl);
11
- if (process.env.PROJECT_CWD) {
12
- process.chdir(process.env.PROJECT_CWD);
13
- }
14
- import(cliEntryPointUrl.toString());
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from "node:module";
3
- import { pathToFileURL } from "node:url";
4
- const require2 = createRequire(import.meta.url);
5
- function isErrorWithCode(error) {
6
- return !!error && typeof error === "object" && "code" in error && typeof error.code === "string";
7
- }
8
- const pkgJsonPath = require2.resolve("storybook/package.json");
9
- const storybookPackageJsonFileUrl = pathToFileURL(pkgJsonPath);
10
- try {
11
- const requireFromStorybook = createRequire(storybookPackageJsonFileUrl);
12
- const bins = requireFromStorybook("./package.json")["bin"];
13
- const sbEntryPointUrl = new URL(
14
- bins["storybook"],
15
- storybookPackageJsonFileUrl
16
- );
17
- if (process.env.PROJECT_CWD) {
18
- process.chdir(process.env.PROJECT_CWD);
19
- }
20
- import(sbEntryPointUrl.toString());
21
- } catch (error) {
22
- if (isErrorWithCode(error) && error.code === "MODULE_NOT_FOUND") {
23
- console.error("Storybook is not currently installed.");
24
- process.exit(1);
25
- }
26
- throw error;
27
- }
package/dist/bins/tsc.js DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from "module";
3
- const require2 = createRequire(import.meta.url);
4
- const requireFromTypeScript = createRequire(
5
- require2.resolve("typescript/package.json")
6
- );
7
- const bins = requireFromTypeScript("./package.json")["bin"];
8
- requireFromTypeScript(bins["tsc"]);
@@ -1 +0,0 @@
1
- {"version":3,"file":"CedarProvider.d.ts","sourceRoot":"","sources":["../../src/components/CedarProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,GAAI,8BAG3B,oBAAoB,sBAuBtB,CAAA;AAED,mDAAmD;AACnD,eAAO,MAAM,eAAe,iCA1BzB,oBAAoB,sBA0BqB,CAAA;AAE5C,OAAO,CAAC,MAAM,CAAC,GAAE"}
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import type { CreateCellProps } from './cellTypes.js';
3
- /**
4
- * Creates a Cell out of a GraphQL fragment and components that render its
5
- * data.
6
- *
7
- * Fragment Cells don't fire queries of their own. A parent Cell spreads the
8
- * fragment in its QUERY and passes the matching slice of the query result
9
- * down via a prop named after the fragment (`AuthorCell_author` -> `author`).
10
- * `Success` receives the data as that same prop. The data is read
11
- * synchronously, so fragment Cells never render `Loading`.
12
- *
13
- * When the GraphQL client supports it (Apollo does), the fragment data is
14
- * read from the client's cache, so the Cell re-renders when other queries or
15
- * mutations update the underlying entity. If the cache read is incomplete,
16
- * the passed-in object itself is used as the data snapshot.
17
- */
18
- export declare function createFragmentCell<CellProps extends Record<string, unknown>, CellVariables extends Record<string, unknown>>({ FRAGMENT, afterQuery, isEmpty, Empty, Success, displayName, }: CreateCellProps<CellProps, CellVariables>): React.FC<CellProps>;
19
- //# sourceMappingURL=createFragmentCell.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createFragmentCell.d.ts","sourceRoot":"","sources":["../../../src/components/cell/createFragmentCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAqDrD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzC,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7C,EACA,QAAQ,EACR,UAA2B,EAC3B,OAAqB,EACrB,KAAK,EACL,OAAO,EACP,WAAoB,GACrB,EAAE,eAAe,CAAC,SAAS,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAkEjE"}