houdini-react 1.2.0-react.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 (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/build/next/index.d.ts +2 -0
  4. package/build/next-cjs/index.js +50 -0
  5. package/build/next-cjs/package.json +1 -0
  6. package/build/next-esm/index.js +26 -0
  7. package/build/next-esm/package.json +1 -0
  8. package/build/plugin/config.d.ts +3 -0
  9. package/build/plugin/extract.d.ts +6 -0
  10. package/build/plugin/index.d.ts +3 -0
  11. package/build/plugin/transform.d.ts +6 -0
  12. package/build/plugin-cjs/index.js +78313 -0
  13. package/build/plugin-cjs/package.json +1 -0
  14. package/build/plugin-esm/index.js +78307 -0
  15. package/build/plugin-esm/package.json +1 -0
  16. package/build/runtime/context.d.ts +7 -0
  17. package/build/runtime/hooks/index.d.ts +8 -0
  18. package/build/runtime/hooks/useDeepCompareEffect.d.ts +35 -0
  19. package/build/runtime/hooks/useDocumentHandle.d.ts +34 -0
  20. package/build/runtime/hooks/useDocumentStore.d.ts +11 -0
  21. package/build/runtime/hooks/useDocumentSubscription.d.ts +14 -0
  22. package/build/runtime/hooks/useFragment.d.ts +15 -0
  23. package/build/runtime/hooks/useFragmentHandle.d.ts +9 -0
  24. package/build/runtime/hooks/useHoudiniClient.d.ts +2 -0
  25. package/build/runtime/hooks/useIsMounted.d.ts +3 -0
  26. package/build/runtime/hooks/useMutation.d.ts +10 -0
  27. package/build/runtime/hooks/useQuery.d.ts +5 -0
  28. package/build/runtime/hooks/useQueryHandle.d.ts +10 -0
  29. package/build/runtime/hooks/useSubscription.d.ts +4 -0
  30. package/build/runtime/hooks/useSubscriptionHandle.d.ts +25 -0
  31. package/build/runtime/index.d.ts +2 -0
  32. package/build/runtime/lib/cache.d.ts +62 -0
  33. package/build/runtime-cjs/context.d.ts +7 -0
  34. package/build/runtime-cjs/context.js +41 -0
  35. package/build/runtime-cjs/hooks/index.d.ts +8 -0
  36. package/build/runtime-cjs/hooks/index.js +45 -0
  37. package/build/runtime-cjs/hooks/useDeepCompareEffect.d.ts +35 -0
  38. package/build/runtime-cjs/hooks/useDeepCompareEffect.js +72 -0
  39. package/build/runtime-cjs/hooks/useDocumentHandle.d.ts +34 -0
  40. package/build/runtime-cjs/hooks/useDocumentHandle.js +127 -0
  41. package/build/runtime-cjs/hooks/useDocumentStore.d.ts +11 -0
  42. package/build/runtime-cjs/hooks/useDocumentStore.js +63 -0
  43. package/build/runtime-cjs/hooks/useDocumentSubscription.d.ts +14 -0
  44. package/build/runtime-cjs/hooks/useDocumentSubscription.js +65 -0
  45. package/build/runtime-cjs/hooks/useFragment.d.ts +15 -0
  46. package/build/runtime-cjs/hooks/useFragment.js +93 -0
  47. package/build/runtime-cjs/hooks/useFragmentHandle.d.ts +9 -0
  48. package/build/runtime-cjs/hooks/useFragmentHandle.js +47 -0
  49. package/build/runtime-cjs/hooks/useHoudiniClient.d.ts +2 -0
  50. package/build/runtime-cjs/hooks/useHoudiniClient.js +42 -0
  51. package/build/runtime-cjs/hooks/useIsMounted.d.ts +3 -0
  52. package/build/runtime-cjs/hooks/useIsMounted.js +38 -0
  53. package/build/runtime-cjs/hooks/useMutation.d.ts +10 -0
  54. package/build/runtime-cjs/hooks/useMutation.js +48 -0
  55. package/build/runtime-cjs/hooks/useQuery.d.ts +5 -0
  56. package/build/runtime-cjs/hooks/useQuery.js +32 -0
  57. package/build/runtime-cjs/hooks/useQueryHandle.d.ts +10 -0
  58. package/build/runtime-cjs/hooks/useQueryHandle.js +125 -0
  59. package/build/runtime-cjs/hooks/useSubscription.d.ts +4 -0
  60. package/build/runtime-cjs/hooks/useSubscription.js +32 -0
  61. package/build/runtime-cjs/hooks/useSubscriptionHandle.d.ts +25 -0
  62. package/build/runtime-cjs/hooks/useSubscriptionHandle.js +42 -0
  63. package/build/runtime-cjs/index.d.ts +2 -0
  64. package/build/runtime-cjs/index.js +30 -0
  65. package/build/runtime-cjs/lib/cache.d.ts +62 -0
  66. package/build/runtime-cjs/lib/cache.js +71 -0
  67. package/build/runtime-cjs/package.json +1 -0
  68. package/build/runtime-esm/context.d.ts +7 -0
  69. package/build/runtime-esm/context.js +10 -0
  70. package/build/runtime-esm/hooks/index.d.ts +8 -0
  71. package/build/runtime-esm/hooks/index.js +16 -0
  72. package/build/runtime-esm/hooks/useDeepCompareEffect.d.ts +35 -0
  73. package/build/runtime-esm/hooks/useDeepCompareEffect.js +41 -0
  74. package/build/runtime-esm/hooks/useDocumentHandle.d.ts +34 -0
  75. package/build/runtime-esm/hooks/useDocumentHandle.js +99 -0
  76. package/build/runtime-esm/hooks/useDocumentStore.d.ts +11 -0
  77. package/build/runtime-esm/hooks/useDocumentStore.js +33 -0
  78. package/build/runtime-esm/hooks/useDocumentSubscription.d.ts +14 -0
  79. package/build/runtime-esm/hooks/useDocumentSubscription.js +35 -0
  80. package/build/runtime-esm/hooks/useFragment.d.ts +15 -0
  81. package/build/runtime-esm/hooks/useFragment.js +62 -0
  82. package/build/runtime-esm/hooks/useFragmentHandle.d.ts +9 -0
  83. package/build/runtime-esm/hooks/useFragmentHandle.js +23 -0
  84. package/build/runtime-esm/hooks/useHoudiniClient.d.ts +2 -0
  85. package/build/runtime-esm/hooks/useHoudiniClient.js +12 -0
  86. package/build/runtime-esm/hooks/useIsMounted.d.ts +3 -0
  87. package/build/runtime-esm/hooks/useIsMounted.js +14 -0
  88. package/build/runtime-esm/hooks/useMutation.d.ts +10 -0
  89. package/build/runtime-esm/hooks/useMutation.js +24 -0
  90. package/build/runtime-esm/hooks/useQuery.d.ts +5 -0
  91. package/build/runtime-esm/hooks/useQuery.js +8 -0
  92. package/build/runtime-esm/hooks/useQueryHandle.d.ts +10 -0
  93. package/build/runtime-esm/hooks/useQueryHandle.js +95 -0
  94. package/build/runtime-esm/hooks/useSubscription.d.ts +4 -0
  95. package/build/runtime-esm/hooks/useSubscription.js +8 -0
  96. package/build/runtime-esm/hooks/useSubscriptionHandle.d.ts +25 -0
  97. package/build/runtime-esm/hooks/useSubscriptionHandle.js +18 -0
  98. package/build/runtime-esm/index.d.ts +2 -0
  99. package/build/runtime-esm/index.js +5 -0
  100. package/build/runtime-esm/lib/cache.d.ts +62 -0
  101. package/build/runtime-esm/lib/cache.js +47 -0
  102. package/build/runtime-esm/package.json +1 -0
  103. package/package.json +63 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Alec Aivazis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ <div align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assetss/logo_l.svg">
4
+ <img height="140" alt="Houdini's logo (dark or light)" src="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assets/logo_d.svg">
5
+ </picture>
6
+ <br />
7
+ <br />
8
+ <strong>
9
+ The disappearing GraphQL clients.
10
+ </strong>
11
+ <br />
12
+ <br />
13
+ <a href="https://npmjs.org/package/houdini">
14
+ <img src="https://img.shields.io/npm/v/houdini.svg" alt="version" />
15
+ </a>
16
+ <a href="https://github.com/HoudiniGraphql/houdini/actions">
17
+ <img src="https://github.com/HoudiniGraphql/houdini/actions/workflows/tests.yml/badge.svg" alt="CI Tests" />
18
+ </a>
19
+ <a href="https://github.com/HoudiniGraphql/houdini">
20
+ <img src="https://img.shields.io/github/stars/HoudiniGraphql/houdini.svg?label=stars" alt="github stars" />
21
+ </a>
22
+ <a href="https://npmjs.org/package/houdini">
23
+ <img src="https://img.shields.io/npm/dm/houdini.svg" alt="downloads" />
24
+ </a>
25
+ <a href="https://github.com/HoudiniGraphql/houdini/blob/main/LICENSE">
26
+ <img src="https://img.shields.io/github/license/HoudiniGraphql/houdini.svg?maxAge=2592000" alt="license" />
27
+ </a>
28
+ </div>
29
+
30
+ ----
31
+
32
+ At its core, houdini seeks to enable a high quality developer experience
33
+ without compromising bundle size. Like Svelte, houdini shifts what is
34
+ traditionally handled by a bloated runtime into a compile step that allows
35
+ for the generation of an incredibly lean GraphQL abstraction for your application.
36
+ See more at <a href="https://www.houdinigraphql.com">HoudiniGraphQL.com</a> 🚀
@@ -0,0 +1,2 @@
1
+ import type { NextConfig } from 'next';
2
+ export declare function withHoudini(nextConfig?: NextConfig): NextConfig;
@@ -0,0 +1,50 @@
1
+ const require = conflict_free(import.meta.url);
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/next/index.ts
22
+ var next_exports = {};
23
+ __export(next_exports, {
24
+ withHoudini: () => withHoudini
25
+ });
26
+ module.exports = __toCommonJS(next_exports);
27
+ function withHoudini(nextConfig) {
28
+ return {
29
+ ...nextConfig,
30
+ webpack(config, options) {
31
+ config.module.rules.push({
32
+ test: /\.(jsx|tsx)$/,
33
+ use: [
34
+ options.defaultLoaders.babel,
35
+ {
36
+ loader: "houdini/webpack"
37
+ }
38
+ ]
39
+ });
40
+ if (nextConfig && typeof nextConfig.webpack === "function") {
41
+ return nextConfig.webpack(config, options);
42
+ }
43
+ return config;
44
+ }
45
+ };
46
+ }
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ withHoudini
50
+ });
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,26 @@
1
+ const require = conflict_free(import.meta.url);
2
+
3
+ // src/next/index.ts
4
+ function withHoudini(nextConfig) {
5
+ return {
6
+ ...nextConfig,
7
+ webpack(config, options) {
8
+ config.module.rules.push({
9
+ test: /\.(jsx|tsx)$/,
10
+ use: [
11
+ options.defaultLoaders.babel,
12
+ {
13
+ loader: "houdini/webpack"
14
+ }
15
+ ]
16
+ });
17
+ if (nextConfig && typeof nextConfig.webpack === "function") {
18
+ return nextConfig.webpack(config, options);
19
+ }
20
+ return config;
21
+ }
22
+ };
23
+ }
24
+ export {
25
+ withHoudini
26
+ };
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,3 @@
1
+ import type { Config } from 'houdini';
2
+ import type { HoudiniReactPluginConfig } from '.';
3
+ export declare function plugin_config(config: Config): Required<HoudiniReactPluginConfig>;
@@ -0,0 +1,6 @@
1
+ import { Config } from 'houdini';
2
+ export declare function extractDocuments({ content, config, filepath, }: {
3
+ config: Config;
4
+ content: string;
5
+ filepath: string;
6
+ }): Promise<string[]>;
@@ -0,0 +1,3 @@
1
+ declare const HoudiniReactPlugin: import("houdini").PluginInit;
2
+ export default HoudiniReactPlugin;
3
+ export type HoudiniReactPluginConfig = {};
@@ -0,0 +1,6 @@
1
+ import type { TransformPage } from 'houdini/vite';
2
+ import type { SourceMapInput } from 'rollup';
3
+ export declare function transformFile(page: TransformPage): Promise<{
4
+ code: string;
5
+ map?: SourceMapInput;
6
+ }>;