houdini 1.2.27 → 1.2.29

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 (71) hide show
  1. package/build/adapter/index.d.ts +1 -1
  2. package/build/cmd-cjs/index.js +4169 -1854
  3. package/build/cmd-esm/index.js +4169 -1854
  4. package/build/codegen/generators/artifacts/selection.d.ts +2 -1
  5. package/build/codegen/generators/typescript/inlineType.d.ts +5 -1
  6. package/build/codegen/generators/typescript/typeReference.d.ts +1 -1
  7. package/build/codegen/generators/typescript/types.d.ts +6 -3
  8. package/build/codegen/transforms/collectDefinitions.d.ts +1 -1
  9. package/build/codegen/transforms/componentFields.d.ts +8 -0
  10. package/build/codegen/transforms/fragmentVariables.d.ts +1 -1
  11. package/build/codegen/transforms/index.d.ts +1 -0
  12. package/build/codegen/validators/componentFields.d.ts +2 -0
  13. package/build/codegen/validators/index.d.ts +1 -0
  14. package/build/codegen-cjs/index.js +3674 -1393
  15. package/build/codegen-esm/index.js +3674 -1393
  16. package/build/lib/config.d.ts +21 -1
  17. package/build/lib/detectTools.d.ts +1 -1
  18. package/build/lib/graphql.d.ts +6 -0
  19. package/build/lib/imports.d.ts +1 -1
  20. package/build/lib/router/conventions.d.ts +1 -0
  21. package/build/lib/types.d.ts +4 -2
  22. package/build/lib/walk.d.ts +1 -0
  23. package/build/lib-cjs/index.js +1120 -747
  24. package/build/lib-esm/index.js +1119 -747
  25. package/build/runtime/cache/cache.d.ts +24 -3
  26. package/build/runtime/cache/storage.d.ts +1 -1
  27. package/build/runtime/client/index.d.ts +1 -0
  28. package/build/runtime/index.d.ts +1 -1
  29. package/build/runtime/lib/config.d.ts +9 -0
  30. package/build/runtime/lib/index.d.ts +1 -0
  31. package/build/runtime/lib/types.d.ts +18 -1
  32. package/build/runtime/router/server.d.ts +3 -1
  33. package/build/runtime/router/types.d.ts +1 -0
  34. package/build/runtime-cjs/cache/cache.d.ts +24 -3
  35. package/build/runtime-cjs/cache/cache.js +78 -8
  36. package/build/runtime-cjs/cache/storage.d.ts +1 -1
  37. package/build/runtime-cjs/cache/storage.js +16 -3
  38. package/build/runtime-cjs/client/index.d.ts +1 -0
  39. package/build/runtime-cjs/client/index.js +1 -0
  40. package/build/runtime-cjs/index.d.ts +1 -1
  41. package/build/runtime-cjs/lib/config.d.ts +9 -0
  42. package/build/runtime-cjs/lib/index.d.ts +1 -0
  43. package/build/runtime-cjs/lib/index.js +1 -0
  44. package/build/runtime-cjs/lib/types.d.ts +18 -1
  45. package/build/runtime-cjs/public/cache.js +3 -2
  46. package/build/runtime-cjs/router/server.d.ts +3 -1
  47. package/build/runtime-cjs/router/server.js +5 -2
  48. package/build/runtime-cjs/router/session.js +9 -6
  49. package/build/runtime-cjs/router/types.d.ts +1 -0
  50. package/build/runtime-esm/cache/cache.d.ts +24 -3
  51. package/build/runtime-esm/cache/cache.js +76 -8
  52. package/build/runtime-esm/cache/storage.d.ts +1 -1
  53. package/build/runtime-esm/cache/storage.js +16 -3
  54. package/build/runtime-esm/client/index.d.ts +1 -0
  55. package/build/runtime-esm/client/index.js +1 -0
  56. package/build/runtime-esm/index.d.ts +1 -1
  57. package/build/runtime-esm/lib/config.d.ts +9 -0
  58. package/build/runtime-esm/lib/index.d.ts +1 -0
  59. package/build/runtime-esm/lib/index.js +1 -0
  60. package/build/runtime-esm/lib/types.d.ts +18 -1
  61. package/build/runtime-esm/public/cache.js +3 -2
  62. package/build/runtime-esm/router/server.d.ts +3 -1
  63. package/build/runtime-esm/router/server.js +5 -2
  64. package/build/runtime-esm/router/session.js +9 -6
  65. package/build/runtime-esm/router/types.d.ts +1 -0
  66. package/build/test-cjs/index.js +3556 -1373
  67. package/build/test-esm/index.js +3556 -1373
  68. package/build/vite/schema.d.ts +4 -1
  69. package/build/vite-cjs/index.js +4543 -2823
  70. package/build/vite-esm/index.js +4540 -2822
  71. package/package.json +4 -3
@@ -36,6 +36,13 @@ export declare class Config {
36
36
  schemaPollHeaders: ((env: any) => Record<string, string>) | Record<string, string | ((env: any) => string)>;
37
37
  pluginMode: boolean;
38
38
  plugins: PluginMeta[];
39
+ componentFields: Record<string, Record<string, {
40
+ fragment: string;
41
+ directive: graphql.DirectiveNode;
42
+ filepath: string;
43
+ prop: string;
44
+ parent: graphql.FragmentDefinitionNode | graphql.FragmentSpreadNode;
45
+ }>>;
39
46
  constructor({ filepath, loadFrameworkConfig, ...configFile }: ConfigFile & {
40
47
  filepath: string;
41
48
  loadFrameworkConfig?: boolean;
@@ -47,6 +54,8 @@ export declare class Config {
47
54
  processEnvValues(env: Record<string, string | undefined>, value: string | ((env: any) => string)): string | undefined;
48
55
  pullHeaders(): Promise<any>;
49
56
  sourceFiles(): Promise<string[]>;
57
+ get componentScalar(): string;
58
+ schemaString: string;
50
59
  set newSchema(value: string);
51
60
  get newSchema(): string;
52
61
  get artifactDirectory(): string;
@@ -127,7 +136,18 @@ export declare class Config {
127
136
  listRemoveFragment(name: string): string;
128
137
  isInternalEnum(node: graphql.EnumTypeDefinitionNode): boolean;
129
138
  isInternalDirective(name: string): boolean;
130
- needsRefetchArtifact(document: graphql.DocumentNode): boolean;
139
+ get componentFieldDirective(): string;
140
+ componentFieldFragmentName(args: {
141
+ type: string;
142
+ entry: graphql.DirectiveNode | string;
143
+ }): string;
144
+ localDocumentData(document: graphql.DocumentNode): {
145
+ paginated: boolean;
146
+ componentFields: {
147
+ type: string;
148
+ field: string;
149
+ }[];
150
+ };
131
151
  registerFragmentVariablesHash({ hash, args, fragment, }: {
132
152
  hash: string;
133
153
  args: ValueMap | null;
@@ -12,5 +12,5 @@ export type DetectedTools = {
12
12
  package_manager: 'npm' | 'yarn' | 'pnpm';
13
13
  } & DetectedFromPackageTools;
14
14
  export declare function detectFromPackageJSON(cwd: string): Promise<DetectedFromPackageTools>;
15
- export declare function detectTools(cwd: string): Promise<DetectedTools>;
15
+ export declare function detectTools(cwd?: string): Promise<DetectedTools>;
16
16
  export {};
@@ -1,6 +1,12 @@
1
1
  import * as graphql from 'graphql';
2
2
  import type { Document, Config } from '.';
3
3
  export declare function getRootType(type: graphql.GraphQLType): graphql.GraphQLType;
4
+ export declare function processComponentFieldDirective(directive: graphql.DirectiveNode): {
5
+ field: string;
6
+ prop: string;
7
+ export?: string;
8
+ raw?: string;
9
+ };
4
10
  export declare function hashOriginal({ document }: {
5
11
  document: Document;
6
12
  }): string;
@@ -13,7 +13,7 @@ export declare function ensureArtifactImport({ config, artifact, body, local, wi
13
13
  export declare function ensureImports<_Count extends string[] | string>({ config, body, import: importID, sourceModule, importKind, }: {
14
14
  config: Config;
15
15
  body: Statement[];
16
- import: _Count;
16
+ import: _Count | null;
17
17
  sourceModule: string;
18
18
  importKind?: 'value' | 'type';
19
19
  }): _Count;
@@ -9,6 +9,7 @@ export declare function vite_render_path(config: Config, base?: string): string;
9
9
  export declare function app_component_path(config: Config, base?: string): string;
10
10
  export declare function page_unit_path(config: Config, id: string, base?: string): string;
11
11
  export declare function layout_unit_path(config: Config, id: string, base?: string): string;
12
+ export declare function componentField_unit_path(config: Config, id: string, base?: string): string;
12
13
  export declare function fallback_unit_path(config: Config, which: 'page' | 'layout', id: string, base?: string): string;
13
14
  /** Load the page query for the given route from disk */
14
15
  export declare function read_pageQuery(base: string): Promise<(string | null)[]>;
@@ -108,7 +108,9 @@ export type PluginHooks = {
108
108
  importStatement: (where: string, as: string) => string;
109
109
  exportDefaultStatement: (val: string) => string;
110
110
  exportStarStatement: (val: string) => string;
111
- }) => string> | ((docs: Document[]) => Record<string, (args: {
111
+ }) => string> | ((docs: Document[], opts: {
112
+ config: Config;
113
+ }) => Record<string, (args: {
112
114
  config: Config;
113
115
  content: string;
114
116
  importStatement: (where: string, as: string) => string;
@@ -251,7 +253,7 @@ export type PluginHooks = {
251
253
  config?: (config: Config, env: ConfigEnv) => UserConfig | Promise<UserConfig>;
252
254
  buildStart?: (this: PluginContext, options: NormalizedInputOptions & {
253
255
  houdiniConfig: Config;
254
- }) => void;
256
+ }) => void | Promise<void>;
255
257
  buildEnd?: (this: PluginContext, error?: Error, houdiniConfig?: Config) => void | Promise<void>;
256
258
  closeBundle?: (this: PluginContext, config: Config) => void | Promise<void>;
257
259
  configResolved?: ObjectHook<(this: void, config: ResolvedConfig) => void | Promise<void>>;
@@ -17,6 +17,7 @@ export type EmbeddedGraphqlDocument = {
17
17
  parent: BaseNode;
18
18
  };
19
19
  type GraphqlTagWalker = {
20
+ skipGraphqlType?: boolean;
20
21
  where?: (tag: graphql.DocumentNode, ast: {
21
22
  node: BaseNode;
22
23
  parent: BaseNode;