houdini-svelte 0.17.4 → 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 (50) hide show
  1. package/.turbo/turbo-compile.log +2 -2
  2. package/.turbo/turbo-typedefs.log +2 -2
  3. package/CHANGELOG.md +18 -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 +27447 -30752
  12. package/build/plugin-esm/index.js +27447 -30752
  13. package/build/preprocess-cjs/index.js +27250 -30558
  14. package/build/preprocess-esm/index.js +27250 -30558
  15. package/build/runtime/index.d.ts +8 -1
  16. package/build/runtime/stores/mutation.d.ts +2 -1
  17. package/build/runtime/stores/query.d.ts +2 -2
  18. package/build/runtime-cjs/index.d.ts +8 -1
  19. package/build/runtime-cjs/stores/mutation.d.ts +2 -1
  20. package/build/runtime-cjs/stores/mutation.js +6 -2
  21. package/build/runtime-cjs/stores/pagination/cursor.js +1 -2
  22. package/build/runtime-cjs/stores/pagination/offset.js +1 -2
  23. package/build/runtime-cjs/stores/query.d.ts +2 -2
  24. package/build/runtime-cjs/stores/query.js +9 -10
  25. package/build/runtime-esm/index.d.ts +8 -1
  26. package/build/runtime-esm/stores/mutation.d.ts +2 -1
  27. package/build/runtime-esm/stores/mutation.js +6 -2
  28. package/build/runtime-esm/stores/pagination/cursor.js +1 -2
  29. package/build/runtime-esm/stores/pagination/offset.js +1 -2
  30. package/build/runtime-esm/stores/query.d.ts +2 -2
  31. package/build/runtime-esm/stores/query.js +9 -10
  32. package/build/test-cjs/index.js +45652 -51141
  33. package/build/test-esm/index.js +45652 -51141
  34. package/package.json +4 -4
  35. package/src/plugin/codegen/routes/index.ts +208 -191
  36. package/src/plugin/codegen/routes/kit.test.ts +351 -93
  37. package/src/plugin/codegen/stores/custom.ts +22 -0
  38. package/src/plugin/codegen/stores/fragment.ts +13 -10
  39. package/src/plugin/codegen/stores/index.ts +8 -8
  40. package/src/plugin/codegen/stores/mutation.ts +7 -5
  41. package/src/plugin/codegen/stores/query.test.ts +9 -9
  42. package/src/plugin/codegen/stores/query.ts +12 -11
  43. package/src/plugin/codegen/stores/subscription.ts +9 -5
  44. package/src/plugin/index.ts +17 -0
  45. package/src/plugin/kit.ts +139 -114
  46. package/src/runtime/index.ts +23 -0
  47. package/src/runtime/stores/mutation.ts +7 -2
  48. package/src/runtime/stores/pagination/cursor.ts +1 -6
  49. package/src/runtime/stores/pagination/offset.ts +1 -6
  50. package/src/runtime/stores/query.ts +12 -15
@@ -1,5 +1,5 @@
1
- houdini-svelte:compile: cache hit, replaying output 63a8657f1d957c94
1
+ houdini-svelte:compile: cache hit, replaying output 0a2f71d41e809878
2
2
  houdini-svelte:compile:
3
- houdini-svelte:compile: > houdini-svelte@0.17.4 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 c4e270bb2bacdf50
1
+ houdini-svelte:typedefs: cache hit, replaying output a06350fabda49747
2
2
  houdini-svelte:typedefs:
3
- houdini-svelte:typedefs: > houdini-svelte@0.17.4 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,23 @@
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
+
15
+ ## 0.17.5
16
+
17
+ ### 🐛 Fixes
18
+
19
+ - [#659](https://github.com/HoudiniGraphql/houdini/pull/659) [`579fb0b`](https://github.com/HoudiniGraphql/houdini/commit/579fb0bd4ccc5ee6e9aad0cc6278b0a9bfa972d1) Thanks [@AlecAivazis](https://github.com/AlecAivazis)! - Improve typing for loadAll
20
+
3
21
  ## 0.17.3
4
22
 
5
23
  ### 🐛 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;