houdini-svelte 0.17.5 → 0.17.6

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 (46) hide show
  1. package/.turbo/turbo-compile.log +2 -2
  2. package/.turbo/turbo-typedefs.log +2 -2
  3. package/CHANGELOG.md +12 -0
  4. package/build/plugin/codegen/stores/custom.d.ts +6 -0
  5. package/build/plugin/codegen/stores/fragment.d.ts +1 -1
  6. package/build/plugin/codegen/stores/mutation.d.ts +1 -1
  7. package/build/plugin/codegen/stores/query.d.ts +1 -1
  8. package/build/plugin/codegen/stores/subscription.d.ts +1 -1
  9. package/build/plugin/index.d.ts +16 -0
  10. package/build/plugin/kit.d.ts +11 -10
  11. package/build/plugin-cjs/index.js +530 -408
  12. package/build/plugin-esm/index.js +530 -408
  13. package/build/preprocess-cjs/index.js +314 -195
  14. package/build/preprocess-esm/index.js +314 -195
  15. package/build/runtime/stores/mutation.d.ts +2 -1
  16. package/build/runtime/stores/query.d.ts +2 -2
  17. package/build/runtime-cjs/stores/mutation.d.ts +2 -1
  18. package/build/runtime-cjs/stores/mutation.js +6 -2
  19. package/build/runtime-cjs/stores/pagination/cursor.js +1 -2
  20. package/build/runtime-cjs/stores/pagination/offset.js +1 -2
  21. package/build/runtime-cjs/stores/query.d.ts +2 -2
  22. package/build/runtime-cjs/stores/query.js +9 -10
  23. package/build/runtime-esm/stores/mutation.d.ts +2 -1
  24. package/build/runtime-esm/stores/mutation.js +6 -2
  25. package/build/runtime-esm/stores/pagination/cursor.js +1 -2
  26. package/build/runtime-esm/stores/pagination/offset.js +1 -2
  27. package/build/runtime-esm/stores/query.d.ts +2 -2
  28. package/build/runtime-esm/stores/query.js +9 -10
  29. package/build/test-cjs/index.js +695 -467
  30. package/build/test-esm/index.js +695 -467
  31. package/package.json +2 -2
  32. package/src/plugin/codegen/routes/index.ts +208 -191
  33. package/src/plugin/codegen/routes/kit.test.ts +351 -93
  34. package/src/plugin/codegen/stores/custom.ts +22 -0
  35. package/src/plugin/codegen/stores/fragment.ts +13 -10
  36. package/src/plugin/codegen/stores/index.ts +8 -8
  37. package/src/plugin/codegen/stores/mutation.ts +7 -5
  38. package/src/plugin/codegen/stores/query.test.ts +9 -9
  39. package/src/plugin/codegen/stores/query.ts +12 -11
  40. package/src/plugin/codegen/stores/subscription.ts +9 -5
  41. package/src/plugin/index.ts +17 -0
  42. package/src/plugin/kit.ts +139 -114
  43. package/src/runtime/stores/mutation.ts +7 -2
  44. package/src/runtime/stores/pagination/cursor.ts +1 -6
  45. package/src/runtime/stores/pagination/offset.ts +1 -6
  46. package/src/runtime/stores/query.ts +12 -15
@@ -1,5 +1,5 @@
1
- houdini-svelte:compile: cache hit, replaying output d2d1bac98cf7116e
1
+ houdini-svelte:compile: cache hit, replaying output 0a2f71d41e809878
2
2
  houdini-svelte:compile:
3
- houdini-svelte:compile: > houdini-svelte@0.17.5 compile /home/runner/work/houdini/houdini/packages/houdini-svelte
3
+ houdini-svelte:compile: > houdini-svelte@0.17.6 compile /home/runner/work/houdini/houdini/packages/houdini-svelte
4
4
  houdini-svelte:compile: > scripts build --plugin
5
5
  houdini-svelte:compile:
@@ -1,5 +1,5 @@
1
- houdini-svelte:typedefs: cache hit, replaying output 284cb81ac353f467
1
+ houdini-svelte:typedefs: cache hit, replaying output a06350fabda49747
2
2
  houdini-svelte:typedefs:
3
- houdini-svelte:typedefs: > houdini-svelte@0.17.5 typedefs /home/runner/work/houdini/houdini/packages/houdini-svelte
3
+ houdini-svelte:typedefs: > houdini-svelte@0.17.6 typedefs /home/runner/work/houdini/houdini/packages/houdini-svelte
4
4
  houdini-svelte:typedefs: > scripts typedefs --plugin
5
5
  houdini-svelte:typedefs:
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # houdini-svelte
2
2
 
3
+ ## 0.17.6
4
+
5
+ ### 🐛 Fixes
6
+
7
+ - [#686](https://github.com/HoudiniGraphql/houdini/pull/686) [`f138bff`](https://github.com/HoudiniGraphql/houdini/commit/f138bff8854181da63b545f54462b198794e2bbc) Thanks [@jycouet](https://github.com/jycouet)! - isFetching will switch only when a network call is happening (and starts at true for queries)
8
+
9
+ ### ✨ Features
10
+
11
+ - [#676](https://github.com/HoudiniGraphql/houdini/pull/676) [`b7a07a3`](https://github.com/HoudiniGraphql/houdini/commit/b7a07a37ec1fd2fe7b9e6ca34e9e2beb53b84bce) Thanks [@AlecAivazis](https://github.com/AlecAivazis)! - Add config for users to specify custom stores
12
+
13
+ - [#673](https://github.com/HoudiniGraphql/houdini/pull/673) [`3986d5e`](https://github.com/HoudiniGraphql/houdini/commit/3986d5e5491565a19fabc440972ef4d95d548e92) Thanks [@sjcobb2022](https://github.com/sjcobb2022)! - Improve generated types for routes
14
+
3
15
  ## 0.17.5
4
16
 
5
17
  ### 🐛 Fixes
@@ -0,0 +1,6 @@
1
+ import { Config } from 'houdini';
2
+ import type { HoudiniVitePluginConfig } from '../../';
3
+ export declare function store_import(cfg: Config, which: keyof Required<HoudiniVitePluginConfig>['customStores']): {
4
+ statement: string;
5
+ store_class: string;
6
+ };
@@ -1,2 +1,2 @@
1
1
  import { CollectedGraphQLDocument, GenerateHookInput } from 'houdini';
2
- export declare function generateFragmentStore({ config, plugin_root }: GenerateHookInput, doc: CollectedGraphQLDocument): Promise<string>;
2
+ export declare function fragmentStore({ config, plugin_root }: GenerateHookInput, doc: CollectedGraphQLDocument): Promise<string>;
@@ -1,2 +1,2 @@
1
1
  import { CollectedGraphQLDocument, GenerateHookInput } from 'houdini';
2
- export declare function generateIndividualStoreMutation({ config, plugin_root }: GenerateHookInput, doc: CollectedGraphQLDocument): Promise<string>;
2
+ export declare function mutationStore({ config, plugin_root }: GenerateHookInput, doc: CollectedGraphQLDocument): Promise<string>;
@@ -1,2 +1,2 @@
1
1
  import { CollectedGraphQLDocument, GenerateHookInput } from 'houdini';
2
- export declare function generateIndividualStoreQuery({ config, plugin_root }: GenerateHookInput, doc: CollectedGraphQLDocument): Promise<string>;
2
+ export declare function queryStore({ config, plugin_root }: GenerateHookInput, doc: CollectedGraphQLDocument): Promise<string>;
@@ -1,2 +1,2 @@
1
1
  import { CollectedGraphQLDocument, GenerateHookInput } from 'houdini';
2
- export declare function generateSubscriptionStore({ config, plugin_root }: GenerateHookInput, doc: CollectedGraphQLDocument): Promise<string>;
2
+ export declare function subscriptionStore({ config, plugin_root }: GenerateHookInput, doc: CollectedGraphQLDocument): Promise<string>;
@@ -37,4 +37,20 @@ export declare type HoudiniVitePluginConfig = {
37
37
  * A flag to treat every component as a non-route. This is useful for projects built with the static-adapter
38
38
  */
39
39
  static?: boolean;
40
+ /**
41
+ * Override the classes used when building stores for documents. Values should take the form package.export
42
+ * For example, if you have a store exported from $lib/stores you should set the value to "$lib/stores.CustomStore".
43
+ */
44
+ customStores?: {
45
+ query?: string;
46
+ mutation?: string;
47
+ subscription?: string;
48
+ fragment?: string;
49
+ queryForwardsCursor?: string;
50
+ queryBackwardsCursor?: string;
51
+ queryOffset?: string;
52
+ fragmentForwardsCursor?: string;
53
+ fragmentBackwardsCursor?: string;
54
+ fragmentOffset?: string;
55
+ };
40
56
  };
@@ -21,20 +21,21 @@ export declare function layout_query_path(config: Config, filename: string): str
21
21
  export declare function resolve_relative(config: Config, filename: string): string;
22
22
  export declare function walk_routes(config: Config, framework: Framework, visitor: RouteVisitor, dirpath?: string): Promise<void>;
23
23
  export declare type RouteVisitor = {
24
- pageScript?: RouteVisitorHandler<string>;
25
- layoutScript?: RouteVisitorHandler<string>;
24
+ inlinePageQueries?: RouteVisitorHandler<graphql.OperationDefinitionNode>;
25
+ inlineLayoutQueries?: RouteVisitorHandler<graphql.OperationDefinitionNode>;
26
26
  routePageQuery?: RouteVisitorHandler<graphql.OperationDefinitionNode>;
27
27
  routeLayoutQuery?: RouteVisitorHandler<graphql.OperationDefinitionNode>;
28
- inlineLayoutQueries?: RouteVisitorHandler<graphql.OperationDefinitionNode>;
29
- inlineQueries?: RouteVisitorHandler<graphql.OperationDefinitionNode>;
28
+ layoutQueries?: RouteVisitorHandler<graphql.OperationDefinitionNode[]>;
29
+ pageQueries?: RouteVisitorHandler<graphql.OperationDefinitionNode[]>;
30
+ layoutExports?: RouteVisitorHandler<string[]>;
31
+ pageExports?: RouteVisitorHandler<string[]>;
30
32
  route?: RouteVisitorHandler<{
31
33
  dirpath: string;
32
- pageScript: string | null;
33
- layoutScript: string | null;
34
- routePageQuery: graphql.OperationDefinitionNode | null;
35
- routeLayoutQuery: graphql.OperationDefinitionNode | null;
36
- inlineLayoutQueries: graphql.OperationDefinitionNode[];
37
- inlineQueries: graphql.OperationDefinitionNode[];
34
+ svelteTypeFilePath: string;
35
+ layoutQueries: graphql.OperationDefinitionNode[];
36
+ pageQueries: graphql.OperationDefinitionNode[];
37
+ layoutExports: string[];
38
+ pageExports: string[];
38
39
  }>;
39
40
  };
40
41
  declare type RouteVisitorHandler<_Payload> = (value: _Payload, filepath: string) => Promise<void> | void;