@quilted/quilt 0.5.158 → 0.6.1

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 (180) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/build/esm/graphql/testing/matchers/operations.mjs +1 -1
  3. package/build/esm/graphql/testing/matchers/utilities.mjs +1 -1
  4. package/build/esm/graphql/testing/matchers.mjs +4 -3
  5. package/build/esm/graphql/testing.mjs +5 -1
  6. package/build/esm/react/testing.mjs +5 -2
  7. package/build/esnext/globals.esnext +1 -1
  8. package/build/esnext/graphql/testing/matchers/operations.esnext +49 -19
  9. package/build/esnext/graphql/testing/matchers/utilities.esnext +18 -15
  10. package/build/esnext/graphql/testing/matchers.esnext +4 -3
  11. package/build/esnext/graphql/testing.esnext +4 -1
  12. package/build/esnext/html/HTML.esnext +6 -9
  13. package/build/esnext/react/testing.esnext +4 -2
  14. package/build/esnext/server/ServerContext.esnext +14 -2
  15. package/build/esnext/server/preload.esnext +9 -10
  16. package/build/esnext/server/request-router.esnext +138 -141
  17. package/build/esnext/utilities/react.esnext +1 -4
  18. package/build/tsconfig.tsbuildinfo +1 -1
  19. package/build/typescript/assets/files.d.ts +97 -0
  20. package/build/typescript/assets/files.d.ts.map +1 -0
  21. package/build/typescript/assets/styles.d.ts +11 -0
  22. package/build/typescript/assets/styles.d.ts.map +1 -0
  23. package/build/typescript/assets.d.ts +2 -0
  24. package/build/typescript/assets.d.ts.map +1 -1
  25. package/build/typescript/globals.d.ts +3 -0
  26. package/build/typescript/globals.d.ts.map +1 -1
  27. package/build/typescript/graphql/testing/matchers/utilities.d.ts +1 -1
  28. package/build/typescript/graphql/testing/matchers/utilities.d.ts.map +1 -1
  29. package/build/typescript/graphql/testing/matchers.d.ts +10 -8
  30. package/build/typescript/graphql/testing/matchers.d.ts.map +1 -1
  31. package/build/typescript/graphql/testing.d.ts +7 -1
  32. package/build/typescript/graphql/testing.d.ts.map +1 -1
  33. package/build/typescript/modules.d.ts +23 -0
  34. package/build/typescript/modules.d.ts.map +1 -0
  35. package/build/typescript/react/testing.d.ts +7 -2
  36. package/build/typescript/react/testing.d.ts.map +1 -1
  37. package/configuration/rollup.config.js +3 -0
  38. package/package.json +66 -197
  39. package/source/assets/files.ts +129 -0
  40. package/source/assets/styles.ts +9 -0
  41. package/source/assets.ts +3 -0
  42. package/source/globals.ts +4 -0
  43. package/source/graphql/testing/matchers/operations.ts +1 -1
  44. package/source/graphql/testing/matchers/utilities.ts +1 -1
  45. package/source/graphql/testing/matchers.ts +15 -22
  46. package/source/graphql/testing.ts +11 -1
  47. package/source/modules.ts +31 -0
  48. package/source/react/testing.ts +10 -3
  49. package/tsconfig.json +2 -4
  50. package/build/cjs/assets.cjs +0 -39
  51. package/build/cjs/async.cjs +0 -32
  52. package/build/cjs/env.cjs +0 -7
  53. package/build/cjs/events.cjs +0 -46
  54. package/build/cjs/globals.cjs +0 -21
  55. package/build/cjs/graphql/server.cjs +0 -14
  56. package/build/cjs/graphql/testing/matchers/operations.cjs +0 -42
  57. package/build/cjs/graphql/testing/matchers/utilities.cjs +0 -43
  58. package/build/cjs/graphql/testing/matchers.cjs +0 -10
  59. package/build/cjs/graphql/testing.cjs +0 -18
  60. package/build/cjs/graphql.cjs +0 -21
  61. package/build/cjs/html/HTML.cjs +0 -21
  62. package/build/cjs/html.cjs +0 -133
  63. package/build/cjs/http.cjs +0 -146
  64. package/build/cjs/index.cjs +0 -2
  65. package/build/cjs/localize.cjs +0 -46
  66. package/build/cjs/magic/app.cjs +0 -2
  67. package/build/cjs/magic/assets.cjs +0 -2
  68. package/build/cjs/magic/request-router.cjs +0 -2
  69. package/build/cjs/navigate/testing.cjs +0 -12
  70. package/build/cjs/navigate.cjs +0 -70
  71. package/build/cjs/performance.cjs +0 -26
  72. package/build/cjs/polyfills/abort-controller.cjs +0 -4
  73. package/build/cjs/polyfills/base.cjs +0 -4
  74. package/build/cjs/polyfills/crypto.cjs +0 -4
  75. package/build/cjs/polyfills/fetch-get-set-cookie.cjs +0 -4
  76. package/build/cjs/polyfills/fetch.cjs +0 -4
  77. package/build/cjs/polyfills/noop.cjs +0 -4
  78. package/build/cjs/react/testing.cjs +0 -30
  79. package/build/cjs/react/tools.cjs +0 -19
  80. package/build/cjs/react.cjs +0 -15
  81. package/build/cjs/request-router/index.cjs +0 -12
  82. package/build/cjs/request-router/node.cjs +0 -12
  83. package/build/cjs/server/ServerContext.cjs +0 -20
  84. package/build/cjs/server/preload.cjs +0 -37
  85. package/build/cjs/server/request-router.cjs +0 -266
  86. package/build/cjs/server.cjs +0 -114
  87. package/build/cjs/signals.cjs +0 -51
  88. package/build/cjs/static/StaticContext.cjs +0 -20
  89. package/build/cjs/static/index.cjs +0 -261
  90. package/build/cjs/static/render.cjs +0 -44
  91. package/build/cjs/testing.cjs +0 -12
  92. package/build/cjs/threads.cjs +0 -117
  93. package/build/cjs/utilities/react.cjs +0 -12
  94. package/build/esm/magic/request-router.mjs +0 -1
  95. package/build/esm/polyfills/abort-controller.mjs +0 -1
  96. package/build/esm/polyfills/base.mjs +0 -1
  97. package/build/esm/polyfills/crypto.mjs +0 -1
  98. package/build/esm/polyfills/fetch-get-set-cookie.mjs +0 -1
  99. package/build/esm/polyfills/fetch.mjs +0 -1
  100. package/build/esm/polyfills/noop.mjs +0 -1
  101. package/build/esm/static/StaticContext.mjs +0 -18
  102. package/build/esm/static/index.mjs +0 -259
  103. package/build/esm/static/render.mjs +0 -42
  104. package/build/esm/testing.mjs +0 -1
  105. package/build/esnext/magic/app.esnext +0 -1
  106. package/build/esnext/magic/assets.esnext +0 -1
  107. package/build/esnext/magic/request-router.esnext +0 -1
  108. package/build/esnext/polyfills/abort-controller.esnext +0 -1
  109. package/build/esnext/polyfills/base.esnext +0 -1
  110. package/build/esnext/polyfills/crypto.esnext +0 -1
  111. package/build/esnext/polyfills/fetch-get-set-cookie.esnext +0 -1
  112. package/build/esnext/polyfills/fetch.esnext +0 -1
  113. package/build/esnext/polyfills/noop.esnext +0 -1
  114. package/build/esnext/static/StaticContext.esnext +0 -18
  115. package/build/esnext/static/index.esnext +0 -259
  116. package/build/esnext/static/render.esnext +0 -42
  117. package/build/esnext/testing.esnext +0 -1
  118. package/build/typescript/App.d.ts +0 -48
  119. package/build/typescript/App.d.ts.map +0 -1
  120. package/build/typescript/TestApp.d.ts +0 -17
  121. package/build/typescript/TestApp.d.ts.map +0 -1
  122. package/build/typescript/global.d.ts +0 -8
  123. package/build/typescript/global.d.ts.map +0 -1
  124. package/build/typescript/magic/app.d.ts +0 -4
  125. package/build/typescript/magic/app.d.ts.map +0 -1
  126. package/build/typescript/magic/assets.d.ts +0 -5
  127. package/build/typescript/magic/assets.d.ts.map +0 -1
  128. package/build/typescript/magic/request-router.d.ts +0 -4
  129. package/build/typescript/magic/request-router.d.ts.map +0 -1
  130. package/build/typescript/matchers/graphql/operations.d.ts +0 -7
  131. package/build/typescript/matchers/graphql/operations.d.ts.map +0 -1
  132. package/build/typescript/matchers/graphql/utilities.d.ts +0 -8
  133. package/build/typescript/matchers/graphql/utilities.d.ts.map +0 -1
  134. package/build/typescript/matchers/graphql.d.ts +0 -9
  135. package/build/typescript/matchers/graphql.d.ts.map +0 -1
  136. package/build/typescript/matchers.d.ts +0 -3
  137. package/build/typescript/matchers.d.ts.map +0 -1
  138. package/build/typescript/polyfills/abort-controller.d.ts +0 -2
  139. package/build/typescript/polyfills/abort-controller.d.ts.map +0 -1
  140. package/build/typescript/polyfills/base.d.ts +0 -2
  141. package/build/typescript/polyfills/base.d.ts.map +0 -1
  142. package/build/typescript/polyfills/crypto.d.ts +0 -2
  143. package/build/typescript/polyfills/crypto.d.ts.map +0 -1
  144. package/build/typescript/polyfills/fetch-get-set-cookie.d.ts +0 -2
  145. package/build/typescript/polyfills/fetch-get-set-cookie.d.ts.map +0 -1
  146. package/build/typescript/polyfills/fetch.d.ts +0 -2
  147. package/build/typescript/polyfills/fetch.d.ts.map +0 -1
  148. package/build/typescript/polyfills/noop.d.ts +0 -2
  149. package/build/typescript/polyfills/noop.d.ts.map +0 -1
  150. package/build/typescript/react/index.d.ts +0 -3
  151. package/build/typescript/react/index.d.ts.map +0 -1
  152. package/build/typescript/react-dom/index.d.ts +0 -3
  153. package/build/typescript/react-dom/index.d.ts.map +0 -1
  154. package/build/typescript/server/index.d.ts +0 -16
  155. package/build/typescript/server/index.d.ts.map +0 -1
  156. package/build/typescript/static/StaticContext.d.ts +0 -13
  157. package/build/typescript/static/StaticContext.d.ts.map +0 -1
  158. package/build/typescript/static/index.d.ts +0 -20
  159. package/build/typescript/static/index.d.ts.map +0 -1
  160. package/build/typescript/static/render.d.ts +0 -19
  161. package/build/typescript/static/render.d.ts.map +0 -1
  162. package/build/typescript/testing.d.ts +0 -2
  163. package/build/typescript/testing.d.ts.map +0 -1
  164. package/quilt.project.ts +0 -5
  165. package/source/magic/app.ts +0 -5
  166. package/source/magic/assets.ts +0 -8
  167. package/source/magic/request-router.ts +0 -5
  168. package/source/polyfills/README.md +0 -3
  169. package/source/polyfills/abort-controller.ts +0 -1
  170. package/source/polyfills/base.ts +0 -1
  171. package/source/polyfills/crypto.ts +0 -1
  172. package/source/polyfills/fetch-get-set-cookie.ts +0 -1
  173. package/source/polyfills/fetch.ts +0 -1
  174. package/source/polyfills/noop.ts +0 -1
  175. package/source/static/StaticContext.tsx +0 -39
  176. package/source/static/index.tsx +0 -315
  177. package/source/static/render.tsx +0 -40
  178. package/source/testing.ts +0 -1
  179. /package/build/esm/{magic/app.mjs → modules.mjs} +0 -0
  180. /package/build/{esm/magic/assets.mjs → esnext/modules.esnext} +0 -0
@@ -1,4 +1,14 @@
1
- import './testing/matchers.ts';
1
+ import {expect} from 'vitest';
2
+
3
+ import {matchers, type CustomMatchers} from './testing/matchers.ts';
2
4
 
3
5
  export * from '@quilted/graphql/testing';
4
6
  export {GraphQLTesting} from '@quilted/react-graphql/testing';
7
+
8
+ declare module 'vitest' {
9
+ interface Assertion<T = any> extends CustomMatchers<T> {}
10
+ interface AsymmetricMatchersContaining extends CustomMatchers {}
11
+ }
12
+
13
+ // @ts-expect-error Incompatibilities between `expect()` and vitest
14
+ expect.extend(matchers);
@@ -0,0 +1,31 @@
1
+ declare module 'quilt:module/env' {
2
+ import type {EnvironmentVariables} from '@quilted/quilt/env';
3
+
4
+ const Env: EnvironmentVariables;
5
+ export default Env;
6
+ }
7
+
8
+ declare module 'quilt:module/app' {
9
+ import type {ComponentType} from 'react';
10
+
11
+ const App: ComponentType<Record<string, unknown>>;
12
+ export default App;
13
+ }
14
+
15
+ declare module 'quilt:module/request-router' {
16
+ import type {RequestRouter} from '@quilted/request-router';
17
+
18
+ const router: RequestRouter;
19
+ export default router;
20
+ }
21
+
22
+ declare module 'quilt:module/assets' {
23
+ import type {
24
+ AssetsCacheKey,
25
+ BrowserAssets as BrowserAssetsType,
26
+ } from '@quilted/assets';
27
+
28
+ export const BrowserAssets: {
29
+ new <CacheKey = AssetsCacheKey>(): BrowserAssetsType<CacheKey>;
30
+ };
31
+ }
@@ -1,6 +1,5 @@
1
- import '@quilted/react-testing/matchers';
2
-
3
- export * from '@quilted/testing';
1
+ import {expect} from 'vitest';
2
+ import {matchers, CustomMatchers} from '@quilted/react-testing/matchers';
4
3
 
5
4
  export {
6
5
  render,
@@ -28,3 +27,11 @@ export type {
28
27
  PlainObject,
29
28
  Predicate,
30
29
  } from '@quilted/react-testing';
30
+
31
+ declare module 'vitest' {
32
+ interface Assertion<T = any> extends CustomMatchers<T> {}
33
+ interface AsymmetricMatchersContaining extends CustomMatchers {}
34
+ }
35
+
36
+ // @ts-expect-error Incompatibilities between `expect()` and vitest
37
+ expect.extend(matchers);
package/tsconfig.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
- "extends": "@quilted/typescript/project.json",
2
+ "extends": "@quilted/craft/typescript/project.json",
3
3
  "compilerOptions": {
4
4
  "rootDir": "source",
5
5
  "outDir": "build/typescript"
6
6
  },
7
7
  "include": ["source"],
8
- "exclude": ["quilt.project.ts", "**/*.test.ts", "**/*.test.tsx"],
8
+ "exclude": ["**/*.test.ts", "**/*.test.tsx"],
9
9
  "references": [
10
10
  {"path": "../assets"},
11
11
  {"path": "../async"},
12
12
  {"path": "../events"},
13
13
  {"path": "../graphql"},
14
- {"path": "../polyfills"},
15
14
  {"path": "../react"},
16
15
  {"path": "../react-assets"},
17
16
  {"path": "../react-async"},
@@ -30,7 +29,6 @@
30
29
  {"path": "../react-workers"},
31
30
  {"path": "../request-router"},
32
31
  {"path": "../signals"},
33
- {"path": "../testing"},
34
32
  {"path": "../threads"},
35
33
  {"path": "../useful-react-types"},
36
34
  {"path": "../workers"}
@@ -1,39 +0,0 @@
1
- 'use strict';
2
-
3
- var assets = require('@quilted/assets');
4
- var reactAssets = require('@quilted/react-assets');
5
-
6
-
7
-
8
- Object.defineProperty(exports, 'BrowserAssetsFromManifests', {
9
- enumerable: true,
10
- get: function () { return assets.BrowserAssetsFromManifests; }
11
- });
12
- Object.defineProperty(exports, 'createBrowserAssetsEntryFromManifest', {
13
- enumerable: true,
14
- get: function () { return assets.createBrowserAssetsEntryFromManifest; }
15
- });
16
- Object.defineProperty(exports, 'scriptAssetAttributes', {
17
- enumerable: true,
18
- get: function () { return assets.scriptAssetAttributes; }
19
- });
20
- Object.defineProperty(exports, 'scriptAssetPreloadAttributes', {
21
- enumerable: true,
22
- get: function () { return assets.scriptAssetPreloadAttributes; }
23
- });
24
- Object.defineProperty(exports, 'styleAssetAttributes', {
25
- enumerable: true,
26
- get: function () { return assets.styleAssetAttributes; }
27
- });
28
- Object.defineProperty(exports, 'styleAssetPreloadAttributes', {
29
- enumerable: true,
30
- get: function () { return assets.styleAssetPreloadAttributes; }
31
- });
32
- Object.defineProperty(exports, 'useAssetsCacheKey', {
33
- enumerable: true,
34
- get: function () { return reactAssets.useAssetsCacheKey; }
35
- });
36
- Object.defineProperty(exports, 'useModuleAssets', {
37
- enumerable: true,
38
- get: function () { return reactAssets.useModuleAssets; }
39
- });
@@ -1,32 +0,0 @@
1
- 'use strict';
2
-
3
- var async = require('@quilted/async');
4
- var reactAsync = require('@quilted/react-async');
5
- var reactIdle = require('@quilted/react-idle');
6
-
7
-
8
-
9
- Object.defineProperty(exports, 'createAsyncModule', {
10
- enumerable: true,
11
- get: function () { return async.createAsyncModule; }
12
- });
13
- Object.defineProperty(exports, 'createAsyncComponent', {
14
- enumerable: true,
15
- get: function () { return reactAsync.createAsyncComponent; }
16
- });
17
- Object.defineProperty(exports, 'useAsyncModule', {
18
- enumerable: true,
19
- get: function () { return reactAsync.useAsyncModule; }
20
- });
21
- Object.defineProperty(exports, 'useAsyncModulePreload', {
22
- enumerable: true,
23
- get: function () { return reactAsync.useAsyncModulePreload; }
24
- });
25
- Object.defineProperty(exports, 'usePreload', {
26
- enumerable: true,
27
- get: function () { return reactAsync.usePreload; }
28
- });
29
- Object.defineProperty(exports, 'useIdleCallback', {
30
- enumerable: true,
31
- get: function () { return reactIdle.useIdleCallback; }
32
- });
package/build/cjs/env.cjs DELETED
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const Env = {};
6
-
7
- exports["default"] = Env;
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- var events = require('@quilted/events');
4
-
5
-
6
-
7
- Object.defineProperty(exports, 'AbortError', {
8
- enumerable: true,
9
- get: function () { return events.AbortError; }
10
- });
11
- Object.defineProperty(exports, 'EventEmitter', {
12
- enumerable: true,
13
- get: function () { return events.EventEmitter; }
14
- });
15
- Object.defineProperty(exports, 'NestedAbortController', {
16
- enumerable: true,
17
- get: function () { return events.NestedAbortController; }
18
- });
19
- Object.defineProperty(exports, 'TimedAbortController', {
20
- enumerable: true,
21
- get: function () { return events.TimedAbortController; }
22
- });
23
- Object.defineProperty(exports, 'addEventHandler', {
24
- enumerable: true,
25
- get: function () { return events.addEventHandler; }
26
- });
27
- Object.defineProperty(exports, 'createEventEmitter', {
28
- enumerable: true,
29
- get: function () { return events.createEventEmitter; }
30
- });
31
- Object.defineProperty(exports, 'on', {
32
- enumerable: true,
33
- get: function () { return events.on; }
34
- });
35
- Object.defineProperty(exports, 'once', {
36
- enumerable: true,
37
- get: function () { return events.once; }
38
- });
39
- Object.defineProperty(exports, 'raceAgainstAbortSignal', {
40
- enumerable: true,
41
- get: function () { return events.raceAgainstAbortSignal; }
42
- });
43
- Object.defineProperty(exports, 'sleep', {
44
- enumerable: true,
45
- get: function () { return events.sleep; }
46
- });
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var async = require('@quilted/async');
6
-
7
- const property = Symbol.for('quilt');
8
- const quilt = globalThis[property] ?? {};
9
- quilt.AsyncModules = async.createAsyncModulesGlobal({
10
- cache: quilt.AsyncModules
11
- });
12
- Object.defineProperty(globalThis, property, {
13
- value: quilt,
14
- enumerable: false,
15
- configurable: true,
16
- writable: true
17
- });
18
-
19
- exports["default"] = quilt;
20
- exports.global = quilt;
21
- exports.quilt = quilt;
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- var server = require('@quilted/graphql/server');
4
-
5
-
6
-
7
- Object.defineProperty(exports, 'createGraphQLResolverBuilder', {
8
- enumerable: true,
9
- get: function () { return server.createGraphQLResolverBuilder; }
10
- });
11
- Object.defineProperty(exports, 'createGraphQLSchema', {
12
- enumerable: true,
13
- get: function () { return server.createGraphQLSchema; }
14
- });
@@ -1,42 +0,0 @@
1
- 'use strict';
2
-
3
- var jestMatcherUtils = require('jest-matcher-utils');
4
- var ast = require('@quilted/graphql/ast');
5
- var utilities = require('./utilities.cjs');
6
-
7
- function toHavePerformedGraphQLOperation(graphql, operation, variables) {
8
- utilities.assertIsGraphQLController(graphql, {
9
- expectation: 'toHavePerformedGraphQLOperation',
10
- isNot: this.isNot
11
- });
12
- const foundByOperation = graphql.completed.all({
13
- operation
14
- });
15
- const foundByVariables = variables == null ? foundByOperation : foundByOperation.filter(operation => Object.keys(variables).every(key => this.equals(variables[key], (operation.variables ?? {})[key])));
16
- const pass = foundByVariables.length > 0;
17
- const {
18
- name
19
- } = ast.normalizeOperation(operation);
20
- const message = pass ? () => `${jestMatcherUtils.matcherHint('.not.toHavePerformedGraphQLOperation')}\n\n` + `Expected not to have performed GraphQL operation:\n ${jestMatcherUtils.EXPECTED_COLOR(name)}\n${variables ? `With variables matching:\n ${jestMatcherUtils.printExpected(variables)}\n` : ''}` + `But ${foundByVariables.length} matching ${foundByVariables.length === 1 ? 'operation was' : 'operations were'} found.\n` : () => `${`${jestMatcherUtils.matcherHint('.toHavePerformedGraphQLOperation')}\n\n` + `Expected to have performed GraphQL operation:\n ${jestMatcherUtils.EXPECTED_COLOR(name)}\n${variables ? `With variables matching:\n ${jestMatcherUtils.printExpected(variables)}\n` : ''}`}${foundByOperation.length === 0 ? `But no matching operations were found.\n` : `But the ${foundByVariables.length === 1 ? 'found operation has' : 'found operations have'} the following variable differences:\n\n${diffs(foundByVariables, variables, this.expand)}`}`;
21
- return {
22
- pass,
23
- message
24
- };
25
- }
26
- function diffs(requests, variables, expand) {
27
- return requests.reduce((diffs, request, index) => `${diffs}${index === 0 ? '' : '\n\n'}${normalizedDiff(request, variables, {
28
- expand,
29
- showLegend: index === 0
30
- })}`, '');
31
- }
32
- function normalizedDiff(request, variables, {
33
- expand = false,
34
- showLegend = false
35
- }) {
36
- const result = utilities.diffVariables(request.variables ?? {}, variables, {
37
- expand
38
- }) || '';
39
- return showLegend ? result : result.split('\n\n')[1];
40
- }
41
-
42
- exports.toHavePerformedGraphQLOperation = toHavePerformedGraphQLOperation;
@@ -1,43 +0,0 @@
1
- 'use strict';
2
-
3
- var jestMatcherUtils = require('jest-matcher-utils');
4
- var testing = require('@quilted/graphql/testing');
5
-
6
- function assertIsGraphQLController(graphql, {
7
- expectation,
8
- isNot
9
- }) {
10
- if (!(graphql instanceof testing.GraphQLController)) {
11
- throw new Error(jestMatcherUtils.matcherErrorMessage(jestMatcherUtils.matcherHint(`.${expectation}`, undefined, undefined, {
12
- isNot
13
- }), `${jestMatcherUtils.RECEIVED_COLOR('received')} value must be a @quilted/graphql/fixtures GraphQLController object`, jestMatcherUtils.printWithType('Received', graphql, jestMatcherUtils.printReceived)));
14
- }
15
- }
16
- function diffVariables(actual, expected, {
17
- expand = false
18
- }) {
19
- return jestMatcherUtils.diff(expected, getObjectSubset(actual, expected), {
20
- expand
21
- });
22
- }
23
-
24
- // Original from https://github.com/facebook/jest/blob/master/packages/expect/source/utils.ts#L107
25
- function getObjectSubset(object, subset) {
26
- if (Array.isArray(object)) {
27
- if (Array.isArray(subset) && subset.length === object.length) {
28
- return subset.map((sub, i) => getObjectSubset(object[i], sub));
29
- }
30
- } else if (object instanceof Date) {
31
- return object;
32
- } else if (typeof object === 'object' && object !== null && typeof subset === 'object' && subset !== null) {
33
- const trimmed = {};
34
- Object.keys(subset).filter(key => Reflect.has(object, key)).forEach(key => trimmed[key] = getObjectSubset(object[key], subset[key]));
35
- if (Object.keys(trimmed).length > 0) {
36
- return trimmed;
37
- }
38
- }
39
- return object;
40
- }
41
-
42
- exports.assertIsGraphQLController = assertIsGraphQLController;
43
- exports.diffVariables = diffVariables;
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- var testing = require('@quilted/testing');
4
- var operations = require('./matchers/operations.cjs');
5
-
6
- testing.expect.extend({
7
- toHavePerformedGraphQLOperation: operations.toHavePerformedGraphQLOperation,
8
- toHavePerformedGraphQLQuery: operations.toHavePerformedGraphQLOperation,
9
- toHavePerformedGraphQLMutation: operations.toHavePerformedGraphQLOperation
10
- });
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- require('./testing/matchers.cjs');
4
- var testing$1 = require('@quilted/graphql/testing');
5
- var testing = require('@quilted/react-graphql/testing');
6
-
7
-
8
-
9
- Object.defineProperty(exports, 'GraphQLTesting', {
10
- enumerable: true,
11
- get: function () { return testing.GraphQLTesting; }
12
- });
13
- Object.keys(testing$1).forEach(function (k) {
14
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
15
- enumerable: true,
16
- get: function () { return testing$1[k]; }
17
- });
18
- });
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- var graphql = require('@quilted/graphql');
4
- var reactGraphql = require('@quilted/react-graphql');
5
-
6
-
7
-
8
- Object.defineProperty(exports, 'GraphQLContext', {
9
- enumerable: true,
10
- get: function () { return reactGraphql.GraphQLContext; }
11
- });
12
- Object.defineProperty(exports, 'useGraphQLFetch', {
13
- enumerable: true,
14
- get: function () { return reactGraphql.useGraphQLFetch; }
15
- });
16
- Object.keys(graphql).forEach(function (k) {
17
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
18
- enumerable: true,
19
- get: function () { return graphql[k]; }
20
- });
21
- });
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- var reactHttp = require('@quilted/react-http');
4
- var reactHtml = require('@quilted/react-html');
5
- var jsxRuntime = require('react/jsx-runtime');
6
-
7
- function HTML({
8
- children
9
- }) {
10
- return /*#__PURE__*/jsxRuntime.jsx(reactHttp.HttpContext, {
11
- children: /*#__PURE__*/jsxRuntime.jsxs(reactHttp.CookieContext, {
12
- children: [/*#__PURE__*/jsxRuntime.jsx(HTMLUpdater, {}), children]
13
- })
14
- });
15
- }
16
- function HTMLUpdater() {
17
- reactHtml.useHTMLUpdater();
18
- return null;
19
- }
20
-
21
- exports.HTML = HTML;
@@ -1,133 +0,0 @@
1
- 'use strict';
2
-
3
- var reactHtml = require('@quilted/react-html');
4
- var reactHttp = require('@quilted/react-http');
5
- var HTML = require('./html/HTML.cjs');
6
-
7
-
8
-
9
- Object.defineProperty(exports, 'Alternate', {
10
- enumerable: true,
11
- get: function () { return reactHtml.Alternate; }
12
- });
13
- Object.defineProperty(exports, 'BodyAttributes', {
14
- enumerable: true,
15
- get: function () { return reactHtml.BodyAttributes; }
16
- });
17
- Object.defineProperty(exports, 'Favicon', {
18
- enumerable: true,
19
- get: function () { return reactHtml.Favicon; }
20
- });
21
- Object.defineProperty(exports, 'HTMLAttributes', {
22
- enumerable: true,
23
- get: function () { return reactHtml.HTMLAttributes; }
24
- });
25
- Object.defineProperty(exports, 'HeadScript', {
26
- enumerable: true,
27
- get: function () { return reactHtml.HeadScript; }
28
- });
29
- Object.defineProperty(exports, 'HeadStyle', {
30
- enumerable: true,
31
- get: function () { return reactHtml.HeadStyle; }
32
- });
33
- Object.defineProperty(exports, 'Link', {
34
- enumerable: true,
35
- get: function () { return reactHtml.Link; }
36
- });
37
- Object.defineProperty(exports, 'Meta', {
38
- enumerable: true,
39
- get: function () { return reactHtml.Meta; }
40
- });
41
- Object.defineProperty(exports, 'SearchRobots', {
42
- enumerable: true,
43
- get: function () { return reactHtml.SearchRobots; }
44
- });
45
- Object.defineProperty(exports, 'Serialize', {
46
- enumerable: true,
47
- get: function () { return reactHtml.Serialize; }
48
- });
49
- Object.defineProperty(exports, 'ThemeColor', {
50
- enumerable: true,
51
- get: function () { return reactHtml.ThemeColor; }
52
- });
53
- Object.defineProperty(exports, 'Title', {
54
- enumerable: true,
55
- get: function () { return reactHtml.Title; }
56
- });
57
- Object.defineProperty(exports, 'Viewport', {
58
- enumerable: true,
59
- get: function () { return reactHtml.Viewport; }
60
- });
61
- Object.defineProperty(exports, 'getSerialized', {
62
- enumerable: true,
63
- get: function () { return reactHtml.getSerialized; }
64
- });
65
- Object.defineProperty(exports, 'useAlternateUrl', {
66
- enumerable: true,
67
- get: function () { return reactHtml.useAlternateUrl; }
68
- });
69
- Object.defineProperty(exports, 'useBodyAttributes', {
70
- enumerable: true,
71
- get: function () { return reactHtml.useBodyAttributes; }
72
- });
73
- Object.defineProperty(exports, 'useFavicon', {
74
- enumerable: true,
75
- get: function () { return reactHtml.useFavicon; }
76
- });
77
- Object.defineProperty(exports, 'useHTMLAttributes', {
78
- enumerable: true,
79
- get: function () { return reactHtml.useHTMLAttributes; }
80
- });
81
- Object.defineProperty(exports, 'useHTMLUpdater', {
82
- enumerable: true,
83
- get: function () { return reactHtml.useHTMLUpdater; }
84
- });
85
- Object.defineProperty(exports, 'useHeadScript', {
86
- enumerable: true,
87
- get: function () { return reactHtml.useHeadScript; }
88
- });
89
- Object.defineProperty(exports, 'useHeadStyle', {
90
- enumerable: true,
91
- get: function () { return reactHtml.useHeadStyle; }
92
- });
93
- Object.defineProperty(exports, 'useLink', {
94
- enumerable: true,
95
- get: function () { return reactHtml.useLink; }
96
- });
97
- Object.defineProperty(exports, 'useLocale', {
98
- enumerable: true,
99
- get: function () { return reactHtml.useLocale; }
100
- });
101
- Object.defineProperty(exports, 'useMeta', {
102
- enumerable: true,
103
- get: function () { return reactHtml.useMeta; }
104
- });
105
- Object.defineProperty(exports, 'useSearchRobots', {
106
- enumerable: true,
107
- get: function () { return reactHtml.useSearchRobots; }
108
- });
109
- Object.defineProperty(exports, 'useSerialized', {
110
- enumerable: true,
111
- get: function () { return reactHtml.useSerialized; }
112
- });
113
- Object.defineProperty(exports, 'useThemeColor', {
114
- enumerable: true,
115
- get: function () { return reactHtml.useThemeColor; }
116
- });
117
- Object.defineProperty(exports, 'useTitle', {
118
- enumerable: true,
119
- get: function () { return reactHtml.useTitle; }
120
- });
121
- Object.defineProperty(exports, 'useViewport', {
122
- enumerable: true,
123
- get: function () { return reactHtml.useViewport; }
124
- });
125
- Object.defineProperty(exports, 'useCookie', {
126
- enumerable: true,
127
- get: function () { return reactHttp.useCookie; }
128
- });
129
- Object.defineProperty(exports, 'useCookies', {
130
- enumerable: true,
131
- get: function () { return reactHttp.useCookies; }
132
- });
133
- exports.HTML = HTML.HTML;