houdini 1.5.5 → 2.0.0-next.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 (85) hide show
  1. package/build/cmd-cjs/index.js +29267 -22336
  2. package/build/cmd-esm/index.js +27820 -20890
  3. package/build/codegen/generators/artifacts/index.d.ts +8 -0
  4. package/build/codegen/generators/runtime/pluginRuntime.d.ts +3 -0
  5. package/build/codegen/index.d.ts +3 -2
  6. package/build/codegen/transforms/fragmentVariables.d.ts +1 -1
  7. package/build/codegen/transforms/list.d.ts +2 -2
  8. package/build/codegen/transforms/paginate.d.ts +2 -34
  9. package/build/codegen/utils/flattenSelections.d.ts +1 -1
  10. package/build/codegen-cjs/index.js +24414 -19277
  11. package/build/codegen-esm/index.js +22975 -17838
  12. package/build/lib/config.d.ts +3 -0
  13. package/build/lib/fs.d.ts +3 -2
  14. package/build/lib/index.d.ts +1 -0
  15. package/build/lib/introspection.d.ts +1 -1
  16. package/build/lib/watchAndRun.d.ts +61 -0
  17. package/build/lib-cjs/index.js +26708 -20759
  18. package/build/lib-esm/index.js +25041 -19095
  19. package/build/runtime/lib/config.d.ts +7 -0
  20. package/build/runtime-cjs/cache/cache.js +22 -1
  21. package/build/runtime-cjs/cache/gc.js +1 -0
  22. package/build/runtime-cjs/cache/index.js +0 -2
  23. package/build/runtime-cjs/cache/lists.js +9 -0
  24. package/build/runtime-cjs/cache/staleManager.js +26 -1
  25. package/build/runtime-cjs/cache/storage.js +4 -0
  26. package/build/runtime-cjs/cache/subscription.js +1 -0
  27. package/build/runtime-cjs/client/documentStore.js +28 -2
  28. package/build/runtime-cjs/client/index.js +17 -1
  29. package/build/runtime-cjs/client/plugins/cache.js +8 -2
  30. package/build/runtime-cjs/client/plugins/fetch.js +14 -6
  31. package/build/runtime-cjs/client/plugins/fetchParams.js +2 -0
  32. package/build/runtime-cjs/client/plugins/fragment.js +1 -0
  33. package/build/runtime-cjs/client/plugins/index.js +9 -1
  34. package/build/runtime-cjs/client/plugins/injectedPlugins.js +0 -2
  35. package/build/runtime-cjs/client/plugins/mutation.js +6 -0
  36. package/build/runtime-cjs/client/plugins/optimisticKeys.js +10 -3
  37. package/build/runtime-cjs/client/plugins/query.js +4 -0
  38. package/build/runtime-cjs/client/utils/index.js +4 -0
  39. package/build/runtime-cjs/imports/config.js +0 -2
  40. package/build/runtime-cjs/imports/pluginConfig.js +0 -2
  41. package/build/runtime-cjs/index.js +12 -6
  42. package/build/runtime-cjs/lib/config.d.ts +7 -0
  43. package/build/runtime-cjs/lib/config.js +4 -0
  44. package/build/runtime-cjs/lib/deepEquals.js +2 -4
  45. package/build/runtime-cjs/lib/index.js +13 -0
  46. package/build/runtime-cjs/lib/pagination.js +2 -1
  47. package/build/runtime-cjs/lib/types.js +11 -1
  48. package/build/runtime-cjs/public/cache.js +11 -0
  49. package/build/runtime-cjs/public/record.js +5 -0
  50. package/build/runtime-cjs/router/jwt.js +15 -28
  51. package/build/runtime-cjs/router/match.js +2 -4
  52. package/build/runtime-cjs/router/server.js +6 -1
  53. package/build/runtime-cjs/router/session.js +1 -1
  54. package/build/runtime-esm/cache/cache.js +22 -1
  55. package/build/runtime-esm/cache/gc.js +1 -0
  56. package/build/runtime-esm/cache/lists.js +9 -0
  57. package/build/runtime-esm/cache/staleManager.js +26 -1
  58. package/build/runtime-esm/cache/storage.js +4 -0
  59. package/build/runtime-esm/cache/subscription.js +1 -0
  60. package/build/runtime-esm/client/documentStore.js +28 -2
  61. package/build/runtime-esm/client/index.js +13 -1
  62. package/build/runtime-esm/client/plugins/cache.js +4 -2
  63. package/build/runtime-esm/client/plugins/fetch.js +14 -6
  64. package/build/runtime-esm/client/plugins/fetchParams.js +2 -0
  65. package/build/runtime-esm/client/plugins/fragment.js +1 -0
  66. package/build/runtime-esm/client/plugins/mutation.js +6 -0
  67. package/build/runtime-esm/client/plugins/optimisticKeys.js +6 -3
  68. package/build/runtime-esm/client/plugins/query.js +4 -0
  69. package/build/runtime-esm/lib/config.d.ts +7 -0
  70. package/build/runtime-esm/lib/deepEquals.js +2 -4
  71. package/build/runtime-esm/lib/pagination.js +2 -1
  72. package/build/runtime-esm/lib/types.js +9 -0
  73. package/build/runtime-esm/public/cache.js +11 -0
  74. package/build/runtime-esm/public/record.js +5 -0
  75. package/build/runtime-esm/router/jwt.js +15 -28
  76. package/build/runtime-esm/router/match.js +2 -4
  77. package/build/runtime-esm/router/server.js +6 -1
  78. package/build/runtime-esm/router/session.js +1 -1
  79. package/build/test-cjs/index.js +26140 -21029
  80. package/build/test-esm/index.js +24475 -19364
  81. package/build/vite/hmr.d.ts +5 -0
  82. package/build/vite/schema.d.ts +0 -3
  83. package/build/vite-cjs/index.js +34920 -32093
  84. package/build/vite-esm/index.js +31443 -28617
  85. package/package.json +13 -14
@@ -36,6 +36,7 @@ export declare class Config {
36
36
  routesDir: string;
37
37
  schemaPollInterval: number | null;
38
38
  schemaPollTimeout: number;
39
+ schemaPollWriteToDisk: boolean;
39
40
  schemaPollHeaders: ((env: any) => Record<string, string>) | Record<string, string | ((env: any) => string)>;
40
41
  pluginMode: boolean;
41
42
  plugins: PluginMeta[];
@@ -58,6 +59,7 @@ export declare class Config {
58
59
  processEnvValues(env: Record<string, string | undefined>, value: string | ((env: any) => string)): string | undefined;
59
60
  pullHeaders(): Promise<any>;
60
61
  pluginRuntimeSource(plugin: PluginMeta): string | null;
62
+ pluginStaticRuntimeSource(plugin: PluginMeta): string | null;
61
63
  sourceFiles(): Promise<string[]>;
62
64
  get componentScalar(): string;
63
65
  schemaString: string;
@@ -99,6 +101,7 @@ export declare class Config {
99
101
  ignore_plugins?: boolean;
100
102
  }): boolean;
101
103
  pluginRuntimeDirectory(name: string): string;
104
+ pluginStaticRuntimeDirectory(name: string): string;
102
105
  get pluginRootDirectory(): string;
103
106
  pluginDirectory(name: string): string;
104
107
  get loadDirective(): string;
package/build/lib/fs.d.ts CHANGED
@@ -8,8 +8,8 @@ export declare function readFile(filepath: string, encoding?: BufferEncoding): P
8
8
  export declare function readFileSync(filepath: string): string | null;
9
9
  export declare function writeFile(filepath: string, data: string): Promise<void>;
10
10
  export declare function access(filepath: string): Promise<void | import("memfs/lib/Stats").Stats<number>>;
11
- export declare function mkdirp(filepath: string): Promise<string | void>;
12
- export declare function mkdirpSync(filepath: string): Promise<string | void>;
11
+ export declare function mkdirp(filepath: string): Promise<void>;
12
+ export declare function mkdirpSync(filepath: string): Promise<void>;
13
13
  export declare function mkdir(filepath: string): Promise<void>;
14
14
  export declare function rmdir(filepath: string): Promise<unknown>;
15
15
  export declare function stat(filepath: string): Promise<import("memfs/lib/Stats").Stats<number> | fsExtra.Stats>;
@@ -31,4 +31,5 @@ export declare function glob(pattern: string): Promise<string[]>;
31
31
  export declare namespace glob {
32
32
  var hasMagic: (pattern: string | string[], options?: import("glob").GlobOptions | undefined) => boolean;
33
33
  }
34
+ export declare function walk(dir: string): AsyncGenerator<string>;
34
35
  export {};
@@ -14,6 +14,7 @@ export * from './plugin';
14
14
  export * from './detectTools';
15
15
  export * from '../runtime/router/match';
16
16
  export * from './typescript';
17
+ export * from './watchAndRun';
17
18
  export * from './walk';
18
19
  export type { EmbeddedGraphqlDocument } from './walk';
19
20
  export * as fs from './fs';
@@ -1,3 +1,3 @@
1
- export declare function pullSchema(url: string, fetchTimeout: number, schemaPath: string, headers?: Record<string, string>, skipWriting?: boolean): Promise<string | null>;
1
+ export declare function pullSchema(url: string, fetchTimeout: number, schemaPath: string, headers?: Record<string, string>, writeToDisk?: boolean): Promise<string | null>;
2
2
  export declare function extractHeadersStr(str: string | undefined): Record<string, string>;
3
3
  export declare function extractHeaders(headers?: string[] | undefined): {};
@@ -0,0 +1,61 @@
1
+ import type { PluginOption, ViteDevServer } from 'vite';
2
+ export type Options = {
3
+ /**
4
+ * watch files to trigger the run action (glob format)
5
+ */
6
+ watch?: string | string[];
7
+ /**
8
+ * watch files to trigger the run action (function format)
9
+ */
10
+ watchFile?: (filepath: string) => Promise<boolean>;
11
+ /**
12
+ * Kind of watch that will trigger the run action
13
+ */
14
+ watchKind?: WatchKind[];
15
+ /**
16
+ * Tune what you want to print to the console. By default, everything.
17
+ */
18
+ logs?: LogType[];
19
+ /**
20
+ * run command (npm run gen for example!)
21
+ */
22
+ run: string | ((server: ViteDevServer, absolutePath: string | null) => void | Promise<void>);
23
+ /**
24
+ * Delay before running the run command (in ms)
25
+ * @default 300 ms
26
+ */
27
+ delay?: number | null;
28
+ /**
29
+ * Name to display in the logs as prefix
30
+ */
31
+ name?: string | null;
32
+ /**
33
+ * Add shell option to spawn, set "powershell.exe" for example to use it there.
34
+ */
35
+ shell?: string | null;
36
+ /**
37
+ * formatErrors instead of throwing an error
38
+ */
39
+ formatErrors?: (e: unknown, afterError?: (e: Error) => void) => void;
40
+ };
41
+ export declare const kindWithPath: readonly ["add", "addDir", "change", "unlink", "unlinkDir"];
42
+ export type KindWithPath = (typeof kindWithPath)[number];
43
+ export type LogType = 'trigger' | 'streamData' | 'streamError' | 'end';
44
+ export declare const kindWithoutPath: readonly ["all", "error", "raw", "ready"];
45
+ export type KindWithoutPath = (typeof kindWithoutPath)[number];
46
+ export type WatchKind = KindWithPath | KindWithoutPath;
47
+ export type StateDetail = {
48
+ kind: WatchKind[];
49
+ logs: LogType[];
50
+ run: string | ((server: ViteDevServer, absolutePath: string | null) => void | Promise<void>);
51
+ delay: number;
52
+ isRunning: boolean;
53
+ watchFile?: (filepath: string) => boolean | Promise<boolean>;
54
+ watch?: string | string[];
55
+ name?: string | null;
56
+ shell: string | boolean;
57
+ formatErrors?: (e: unknown, afterError?: (e: Error) => void) => void;
58
+ };
59
+ export declare const watchAndRun: (params: Options[]) => PluginOption & {
60
+ getCheckedConf: () => StateDetail[];
61
+ };