houdini 1.2.45 → 1.2.46

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.
@@ -68340,7 +68340,12 @@ function deepMerge2(filepath, ...targets) {
68340
68340
  // src/lib/parse.ts
68341
68341
  function parseJS(str, config) {
68342
68342
  const defaultConfig = {
68343
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
68343
+ plugins: [
68344
+ "typescript",
68345
+ "importAssertions",
68346
+ "decorators-legacy",
68347
+ "explicitResourceManagement"
68348
+ ],
68344
68349
  sourceType: "module"
68345
68350
  };
68346
68351
  return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
@@ -70045,7 +70050,11 @@ function operationsByPath(config, filepath, definition, filterTypes) {
70045
70050
  const pathOperations = {};
70046
70051
  graphql11.visit(definition, {
70047
70052
  FragmentSpread(node, _3, __, ___, ancestors) {
70048
- if (!config.isListFragment(node.name.value)) {
70053
+ let nameWithoutHash = node.name.value;
70054
+ if (node.directives && node.directives.find((directive) => directive.name.value === "with")) {
70055
+ nameWithoutHash = nameWithoutHash.substring(0, nameWithoutHash.lastIndexOf("_"));
70056
+ }
70057
+ if (!config.isListFragment(nameWithoutHash)) {
70049
70058
  return;
70050
70059
  }
70051
70060
  const path3 = ancestorKey(ancestors);
@@ -70056,8 +70065,8 @@ function operationsByPath(config, filepath, definition, filterTypes) {
70056
70065
  operationObject({
70057
70066
  config,
70058
70067
  filepath,
70059
- listName: config.listNameFromFragment(node.name.value),
70060
- operationKind: config.listOperationFromFragment(node.name.value),
70068
+ listName: config.listNameFromFragment(nameWithoutHash),
70069
+ operationKind: config.listOperationFromFragment(nameWithoutHash),
70061
70070
  type: parentTypeFromAncestors(config.schema, filepath, ancestors).name,
70062
70071
  selection: node
70063
70072
  })
@@ -78023,12 +78032,12 @@ async function packageJSON(targetPath, frameworkInfo) {
78023
78032
  }
78024
78033
  packageJSON2.devDependencies = {
78025
78034
  ...packageJSON2.devDependencies,
78026
- houdini: "^1.2.45"
78035
+ houdini: "^1.2.46"
78027
78036
  };
78028
78037
  if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
78029
78038
  packageJSON2.devDependencies = {
78030
78039
  ...packageJSON2.devDependencies,
78031
- "houdini-svelte": "^1.2.45"
78040
+ "houdini-svelte": "^1.2.46"
78032
78041
  };
78033
78042
  } else {
78034
78043
  throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
@@ -68345,7 +68345,12 @@ function deepMerge2(filepath, ...targets) {
68345
68345
  // src/lib/parse.ts
68346
68346
  function parseJS(str, config) {
68347
68347
  const defaultConfig = {
68348
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
68348
+ plugins: [
68349
+ "typescript",
68350
+ "importAssertions",
68351
+ "decorators-legacy",
68352
+ "explicitResourceManagement"
68353
+ ],
68349
68354
  sourceType: "module"
68350
68355
  };
68351
68356
  return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
@@ -70050,7 +70055,11 @@ function operationsByPath(config, filepath, definition, filterTypes) {
70050
70055
  const pathOperations = {};
70051
70056
  graphql11.visit(definition, {
70052
70057
  FragmentSpread(node, _3, __, ___, ancestors) {
70053
- if (!config.isListFragment(node.name.value)) {
70058
+ let nameWithoutHash = node.name.value;
70059
+ if (node.directives && node.directives.find((directive) => directive.name.value === "with")) {
70060
+ nameWithoutHash = nameWithoutHash.substring(0, nameWithoutHash.lastIndexOf("_"));
70061
+ }
70062
+ if (!config.isListFragment(nameWithoutHash)) {
70054
70063
  return;
70055
70064
  }
70056
70065
  const path3 = ancestorKey(ancestors);
@@ -70061,8 +70070,8 @@ function operationsByPath(config, filepath, definition, filterTypes) {
70061
70070
  operationObject({
70062
70071
  config,
70063
70072
  filepath,
70064
- listName: config.listNameFromFragment(node.name.value),
70065
- operationKind: config.listOperationFromFragment(node.name.value),
70073
+ listName: config.listNameFromFragment(nameWithoutHash),
70074
+ operationKind: config.listOperationFromFragment(nameWithoutHash),
70066
70075
  type: parentTypeFromAncestors(config.schema, filepath, ancestors).name,
70067
70076
  selection: node
70068
70077
  })
@@ -78028,12 +78037,12 @@ async function packageJSON(targetPath, frameworkInfo) {
78028
78037
  }
78029
78038
  packageJSON2.devDependencies = {
78030
78039
  ...packageJSON2.devDependencies,
78031
- houdini: "^1.2.45"
78040
+ houdini: "^1.2.46"
78032
78041
  };
78033
78042
  if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
78034
78043
  packageJSON2.devDependencies = {
78035
78044
  ...packageJSON2.devDependencies,
78036
- "houdini-svelte": "^1.2.45"
78045
+ "houdini-svelte": "^1.2.46"
78037
78046
  };
78038
78047
  } else {
78039
78048
  throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
@@ -56819,7 +56819,12 @@ function deepMerge2(filepath, ...targets) {
56819
56819
  // src/lib/parse.ts
56820
56820
  function parseJS(str, config) {
56821
56821
  const defaultConfig = {
56822
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
56822
+ plugins: [
56823
+ "typescript",
56824
+ "importAssertions",
56825
+ "decorators-legacy",
56826
+ "explicitResourceManagement"
56827
+ ],
56823
56828
  sourceType: "module"
56824
56829
  };
56825
56830
  return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
@@ -58431,7 +58436,11 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58431
58436
  const pathOperations = {};
58432
58437
  graphql11.visit(definition, {
58433
58438
  FragmentSpread(node, _, __, ___, ancestors) {
58434
- if (!config.isListFragment(node.name.value)) {
58439
+ let nameWithoutHash = node.name.value;
58440
+ if (node.directives && node.directives.find((directive) => directive.name.value === "with")) {
58441
+ nameWithoutHash = nameWithoutHash.substring(0, nameWithoutHash.lastIndexOf("_"));
58442
+ }
58443
+ if (!config.isListFragment(nameWithoutHash)) {
58435
58444
  return;
58436
58445
  }
58437
58446
  const path2 = ancestorKey(ancestors);
@@ -58442,8 +58451,8 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58442
58451
  operationObject({
58443
58452
  config,
58444
58453
  filepath,
58445
- listName: config.listNameFromFragment(node.name.value),
58446
- operationKind: config.listOperationFromFragment(node.name.value),
58454
+ listName: config.listNameFromFragment(nameWithoutHash),
58455
+ operationKind: config.listOperationFromFragment(nameWithoutHash),
58447
58456
  type: parentTypeFromAncestors(config.schema, filepath, ancestors).name,
58448
58457
  selection: node
58449
58458
  })
@@ -56818,7 +56818,12 @@ function deepMerge2(filepath, ...targets) {
56818
56818
  // src/lib/parse.ts
56819
56819
  function parseJS(str, config) {
56820
56820
  const defaultConfig = {
56821
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
56821
+ plugins: [
56822
+ "typescript",
56823
+ "importAssertions",
56824
+ "decorators-legacy",
56825
+ "explicitResourceManagement"
56826
+ ],
56822
56827
  sourceType: "module"
56823
56828
  };
56824
56829
  return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
@@ -58430,7 +58435,11 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58430
58435
  const pathOperations = {};
58431
58436
  graphql11.visit(definition, {
58432
58437
  FragmentSpread(node, _, __, ___, ancestors) {
58433
- if (!config.isListFragment(node.name.value)) {
58438
+ let nameWithoutHash = node.name.value;
58439
+ if (node.directives && node.directives.find((directive) => directive.name.value === "with")) {
58440
+ nameWithoutHash = nameWithoutHash.substring(0, nameWithoutHash.lastIndexOf("_"));
58441
+ }
58442
+ if (!config.isListFragment(nameWithoutHash)) {
58434
58443
  return;
58435
58444
  }
58436
58445
  const path2 = ancestorKey(ancestors);
@@ -58441,8 +58450,8 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58441
58450
  operationObject({
58442
58451
  config,
58443
58452
  filepath,
58444
- listName: config.listNameFromFragment(node.name.value),
58445
- operationKind: config.listOperationFromFragment(node.name.value),
58453
+ listName: config.listNameFromFragment(nameWithoutHash),
58454
+ operationKind: config.listOperationFromFragment(nameWithoutHash),
58446
58455
  type: parentTypeFromAncestors(config.schema, filepath, ancestors).name,
58447
58456
  selection: node
58448
58457
  })
@@ -61644,6 +61644,38 @@ function marshalInputs({
61644
61644
  function isScalar(config, type) {
61645
61645
  return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(config.scalars || {})).includes(type);
61646
61646
  }
61647
+ function parseScalar(config, type, value) {
61648
+ if (typeof value === "undefined") {
61649
+ return void 0;
61650
+ }
61651
+ if (type === "Boolean") {
61652
+ return value === "true";
61653
+ }
61654
+ if (type === "ID") {
61655
+ return value;
61656
+ }
61657
+ if (type === "String") {
61658
+ return value;
61659
+ }
61660
+ if (type === "Int") {
61661
+ const result = parseInt(value, 10);
61662
+ if (Number.isNaN(result)) {
61663
+ return void 0;
61664
+ }
61665
+ return result;
61666
+ }
61667
+ if (type === "Float") {
61668
+ const result = parseFloat(value);
61669
+ if (Number.isNaN(result)) {
61670
+ return void 0;
61671
+ }
61672
+ return result;
61673
+ }
61674
+ if (config.scalars?.[type]?.marshal) {
61675
+ return config.scalars[type]?.marshal(value);
61676
+ }
61677
+ return value;
61678
+ }
61647
61679
 
61648
61680
  // src/runtime/lib/store.ts
61649
61681
  var subscriber_queue = [];
@@ -67802,7 +67834,12 @@ function deepMerge2(filepath, ...targets) {
67802
67834
  // src/lib/parse.ts
67803
67835
  function parseJS(str, config) {
67804
67836
  const defaultConfig = {
67805
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
67837
+ plugins: [
67838
+ "typescript",
67839
+ "importAssertions",
67840
+ "decorators-legacy",
67841
+ "explicitResourceManagement"
67842
+ ],
67806
67843
  sourceType: "module"
67807
67844
  };
67808
67845
  return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
@@ -67945,7 +67982,7 @@ async function detectTools(cwd = process.cwd()) {
67945
67982
 
67946
67983
  // src/runtime/router/match.ts
67947
67984
  var param_pattern = /^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;
67948
- function find_match(manifest, current, allowNull = true) {
67985
+ function find_match(config, manifest, current, allowNull = true) {
67949
67986
  let match = null;
67950
67987
  let matchVariables = null;
67951
67988
  for (const page of Object.values(manifest.pages)) {
@@ -67960,7 +67997,15 @@ function find_match(manifest, current, allowNull = true) {
67960
67997
  if (!match && !allowNull) {
67961
67998
  throw new Error("404");
67962
67999
  }
67963
- return [match, matchVariables];
68000
+ let variables = {};
68001
+ for (const document of Object.values(match?.documents ?? {})) {
68002
+ for (const [variable, { type }] of Object.entries(document.variables)) {
68003
+ if (matchVariables?.[variable]) {
68004
+ variables[variable] = parseScalar(config, type, matchVariables[variable]);
68005
+ }
68006
+ }
68007
+ }
68008
+ return [match, variables];
67964
68009
  }
67965
68010
  function parse_page_pattern(id) {
67966
68011
  const params = [];
@@ -68893,7 +68938,18 @@ async function extractQueries(source) {
68893
68938
  } else {
68894
68939
  return [];
68895
68940
  }
68896
- return props.filter((p) => p !== "children");
68941
+ return props.reduce((queries, query2) => {
68942
+ if (query2 === "children") {
68943
+ return queries;
68944
+ }
68945
+ if (query2.endsWith("$handle")) {
68946
+ query2 = query2.substring(0, query2.length - "$handle".length);
68947
+ }
68948
+ if (queries.includes(query2)) {
68949
+ return queries;
68950
+ }
68951
+ return queries.concat([query2]);
68952
+ }, []);
68897
68953
  }
68898
68954
 
68899
68955
  // src/lib/router/server.ts
@@ -61560,6 +61560,38 @@ function marshalInputs({
61560
61560
  function isScalar(config, type) {
61561
61561
  return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(config.scalars || {})).includes(type);
61562
61562
  }
61563
+ function parseScalar(config, type, value) {
61564
+ if (typeof value === "undefined") {
61565
+ return void 0;
61566
+ }
61567
+ if (type === "Boolean") {
61568
+ return value === "true";
61569
+ }
61570
+ if (type === "ID") {
61571
+ return value;
61572
+ }
61573
+ if (type === "String") {
61574
+ return value;
61575
+ }
61576
+ if (type === "Int") {
61577
+ const result = parseInt(value, 10);
61578
+ if (Number.isNaN(result)) {
61579
+ return void 0;
61580
+ }
61581
+ return result;
61582
+ }
61583
+ if (type === "Float") {
61584
+ const result = parseFloat(value);
61585
+ if (Number.isNaN(result)) {
61586
+ return void 0;
61587
+ }
61588
+ return result;
61589
+ }
61590
+ if (config.scalars?.[type]?.marshal) {
61591
+ return config.scalars[type]?.marshal(value);
61592
+ }
61593
+ return value;
61594
+ }
61563
61595
 
61564
61596
  // src/runtime/lib/store.ts
61565
61597
  var subscriber_queue = [];
@@ -67717,7 +67749,12 @@ function deepMerge2(filepath, ...targets) {
67717
67749
  // src/lib/parse.ts
67718
67750
  function parseJS(str, config) {
67719
67751
  const defaultConfig = {
67720
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
67752
+ plugins: [
67753
+ "typescript",
67754
+ "importAssertions",
67755
+ "decorators-legacy",
67756
+ "explicitResourceManagement"
67757
+ ],
67721
67758
  sourceType: "module"
67722
67759
  };
67723
67760
  return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
@@ -67860,7 +67897,7 @@ async function detectTools(cwd = process.cwd()) {
67860
67897
 
67861
67898
  // src/runtime/router/match.ts
67862
67899
  var param_pattern = /^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;
67863
- function find_match(manifest, current, allowNull = true) {
67900
+ function find_match(config, manifest, current, allowNull = true) {
67864
67901
  let match = null;
67865
67902
  let matchVariables = null;
67866
67903
  for (const page of Object.values(manifest.pages)) {
@@ -67875,7 +67912,15 @@ function find_match(manifest, current, allowNull = true) {
67875
67912
  if (!match && !allowNull) {
67876
67913
  throw new Error("404");
67877
67914
  }
67878
- return [match, matchVariables];
67915
+ let variables = {};
67916
+ for (const document of Object.values(match?.documents ?? {})) {
67917
+ for (const [variable, { type }] of Object.entries(document.variables)) {
67918
+ if (matchVariables?.[variable]) {
67919
+ variables[variable] = parseScalar(config, type, matchVariables[variable]);
67920
+ }
67921
+ }
67922
+ }
67923
+ return [match, variables];
67879
67924
  }
67880
67925
  function parse_page_pattern(id) {
67881
67926
  const params = [];
@@ -68808,7 +68853,18 @@ async function extractQueries(source) {
68808
68853
  } else {
68809
68854
  return [];
68810
68855
  }
68811
- return props.filter((p) => p !== "children");
68856
+ return props.reduce((queries, query2) => {
68857
+ if (query2 === "children") {
68858
+ return queries;
68859
+ }
68860
+ if (query2.endsWith("$handle")) {
68861
+ query2 = query2.substring(0, query2.length - "$handle".length);
68862
+ }
68863
+ if (queries.includes(query2)) {
68864
+ return queries;
68865
+ }
68866
+ return queries.concat([query2]);
68867
+ }, []);
68812
68868
  }
68813
68869
 
68814
68870
  // src/lib/router/server.ts
@@ -1,4 +1,5 @@
1
1
  import type { GraphQLVariables } from '$houdini/runtime/lib/types';
2
+ import { type ConfigFile } from '../lib';
2
3
  import type { RouterManifest, RouterPageManifest } from './types';
3
4
  export type RouteParam = {
4
5
  name: string;
@@ -10,8 +11,8 @@ export type RouteParam = {
10
11
  export interface ParamMatcher {
11
12
  (param: string): boolean;
12
13
  }
13
- export declare function find_match<_ComponentType>(manifest: RouterManifest<_ComponentType>, current: string, allowNull: true): [RouterPageManifest<_ComponentType> | null, GraphQLVariables];
14
- export declare function find_match<_ComponentType>(manifest: RouterManifest<_ComponentType>, current: string, allowNull?: false): [RouterPageManifest<_ComponentType>, GraphQLVariables];
14
+ export declare function find_match<_ComponentType>(config: ConfigFile, manifest: RouterManifest<_ComponentType>, current: string, allowNull: true): [RouterPageManifest<_ComponentType> | null, GraphQLVariables];
15
+ export declare function find_match<_ComponentType>(config: ConfigFile, manifest: RouterManifest<_ComponentType>, current: string, allowNull?: false): [RouterPageManifest<_ComponentType>, GraphQLVariables];
15
16
  /**
16
17
  * Creates the regex pattern, extracts parameter names, and generates types for a route
17
18
  */
@@ -1,4 +1,5 @@
1
1
  import type { GraphQLVariables } from '$houdini/runtime/lib/types';
2
+ import { type ConfigFile } from '../lib';
2
3
  import type { RouterManifest, RouterPageManifest } from './types';
3
4
  export type RouteParam = {
4
5
  name: string;
@@ -10,8 +11,8 @@ export type RouteParam = {
10
11
  export interface ParamMatcher {
11
12
  (param: string): boolean;
12
13
  }
13
- export declare function find_match<_ComponentType>(manifest: RouterManifest<_ComponentType>, current: string, allowNull: true): [RouterPageManifest<_ComponentType> | null, GraphQLVariables];
14
- export declare function find_match<_ComponentType>(manifest: RouterManifest<_ComponentType>, current: string, allowNull?: false): [RouterPageManifest<_ComponentType>, GraphQLVariables];
14
+ export declare function find_match<_ComponentType>(config: ConfigFile, manifest: RouterManifest<_ComponentType>, current: string, allowNull: true): [RouterPageManifest<_ComponentType> | null, GraphQLVariables];
15
+ export declare function find_match<_ComponentType>(config: ConfigFile, manifest: RouterManifest<_ComponentType>, current: string, allowNull?: false): [RouterPageManifest<_ComponentType>, GraphQLVariables];
15
16
  /**
16
17
  * Creates the regex pattern, extracts parameter names, and generates types for a route
17
18
  */
@@ -24,8 +24,9 @@ __export(match_exports, {
24
24
  parse_page_pattern: () => parse_page_pattern
25
25
  });
26
26
  module.exports = __toCommonJS(match_exports);
27
+ var import_lib = require("../lib");
27
28
  const param_pattern = /^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;
28
- function find_match(manifest, current, allowNull = true) {
29
+ function find_match(config, manifest, current, allowNull = true) {
29
30
  let match = null;
30
31
  let matchVariables = null;
31
32
  for (const page of Object.values(manifest.pages)) {
@@ -40,7 +41,15 @@ function find_match(manifest, current, allowNull = true) {
40
41
  if (!match && !allowNull) {
41
42
  throw new Error("404");
42
43
  }
43
- return [match, matchVariables];
44
+ let variables = {};
45
+ for (const document of Object.values(match?.documents ?? {})) {
46
+ for (const [variable, { type }] of Object.entries(document.variables)) {
47
+ if (matchVariables?.[variable]) {
48
+ variables[variable] = (0, import_lib.parseScalar)(config, type, matchVariables[variable]);
49
+ }
50
+ }
51
+ }
52
+ return [match, variables];
44
53
  }
45
54
  function parse_page_pattern(id) {
46
55
  const params = [];
@@ -73,7 +73,7 @@ function _serverHandler({
73
73
  if (authResponse) {
74
74
  return authResponse;
75
75
  }
76
- const [match] = (0, import_match.find_match)(manifest, url);
76
+ const [match] = (0, import_match.find_match)(config_file, manifest, url);
77
77
  const rendered = await on_render({
78
78
  url,
79
79
  match,
@@ -1,4 +1,5 @@
1
1
  import type { GraphQLVariables } from '$houdini/runtime/lib/types';
2
+ import { type ConfigFile } from '../lib';
2
3
  import type { RouterManifest, RouterPageManifest } from './types';
3
4
  export type RouteParam = {
4
5
  name: string;
@@ -10,8 +11,8 @@ export type RouteParam = {
10
11
  export interface ParamMatcher {
11
12
  (param: string): boolean;
12
13
  }
13
- export declare function find_match<_ComponentType>(manifest: RouterManifest<_ComponentType>, current: string, allowNull: true): [RouterPageManifest<_ComponentType> | null, GraphQLVariables];
14
- export declare function find_match<_ComponentType>(manifest: RouterManifest<_ComponentType>, current: string, allowNull?: false): [RouterPageManifest<_ComponentType>, GraphQLVariables];
14
+ export declare function find_match<_ComponentType>(config: ConfigFile, manifest: RouterManifest<_ComponentType>, current: string, allowNull: true): [RouterPageManifest<_ComponentType> | null, GraphQLVariables];
15
+ export declare function find_match<_ComponentType>(config: ConfigFile, manifest: RouterManifest<_ComponentType>, current: string, allowNull?: false): [RouterPageManifest<_ComponentType>, GraphQLVariables];
15
16
  /**
16
17
  * Creates the regex pattern, extracts parameter names, and generates types for a route
17
18
  */
@@ -1,5 +1,6 @@
1
+ import { parseScalar } from "../lib";
1
2
  const param_pattern = /^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;
2
- function find_match(manifest, current, allowNull = true) {
3
+ function find_match(config, manifest, current, allowNull = true) {
3
4
  let match = null;
4
5
  let matchVariables = null;
5
6
  for (const page of Object.values(manifest.pages)) {
@@ -14,7 +15,15 @@ function find_match(manifest, current, allowNull = true) {
14
15
  if (!match && !allowNull) {
15
16
  throw new Error("404");
16
17
  }
17
- return [match, matchVariables];
18
+ let variables = {};
19
+ for (const document of Object.values(match?.documents ?? {})) {
20
+ for (const [variable, { type }] of Object.entries(document.variables)) {
21
+ if (matchVariables?.[variable]) {
22
+ variables[variable] = parseScalar(config, type, matchVariables[variable]);
23
+ }
24
+ }
25
+ }
26
+ return [match, variables];
18
27
  }
19
28
  function parse_page_pattern(id) {
20
29
  const params = [];
@@ -49,7 +49,7 @@ function _serverHandler({
49
49
  if (authResponse) {
50
50
  return authResponse;
51
51
  }
52
- const [match] = find_match(manifest, url);
52
+ const [match] = find_match(config_file, manifest, url);
53
53
  const rendered = await on_render({
54
54
  url,
55
55
  match,
@@ -57486,7 +57486,12 @@ function deepMerge2(filepath, ...targets) {
57486
57486
  // src/lib/parse.ts
57487
57487
  function parseJS(str, config) {
57488
57488
  const defaultConfig = {
57489
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
57489
+ plugins: [
57490
+ "typescript",
57491
+ "importAssertions",
57492
+ "decorators-legacy",
57493
+ "explicitResourceManagement"
57494
+ ],
57490
57495
  sourceType: "module"
57491
57496
  };
57492
57497
  return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
@@ -58788,7 +58793,11 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58788
58793
  const pathOperations = {};
58789
58794
  graphql11.visit(definition, {
58790
58795
  FragmentSpread(node, _, __, ___, ancestors) {
58791
- if (!config.isListFragment(node.name.value)) {
58796
+ let nameWithoutHash = node.name.value;
58797
+ if (node.directives && node.directives.find((directive) => directive.name.value === "with")) {
58798
+ nameWithoutHash = nameWithoutHash.substring(0, nameWithoutHash.lastIndexOf("_"));
58799
+ }
58800
+ if (!config.isListFragment(nameWithoutHash)) {
58792
58801
  return;
58793
58802
  }
58794
58803
  const path2 = ancestorKey(ancestors);
@@ -58799,8 +58808,8 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58799
58808
  operationObject({
58800
58809
  config,
58801
58810
  filepath,
58802
- listName: config.listNameFromFragment(node.name.value),
58803
- operationKind: config.listOperationFromFragment(node.name.value),
58811
+ listName: config.listNameFromFragment(nameWithoutHash),
58812
+ operationKind: config.listOperationFromFragment(nameWithoutHash),
58804
58813
  type: parentTypeFromAncestors(config.schema, filepath, ancestors).name,
58805
58814
  selection: node
58806
58815
  })
@@ -57482,7 +57482,12 @@ function deepMerge2(filepath, ...targets) {
57482
57482
  // src/lib/parse.ts
57483
57483
  function parseJS(str, config) {
57484
57484
  const defaultConfig = {
57485
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
57485
+ plugins: [
57486
+ "typescript",
57487
+ "importAssertions",
57488
+ "decorators-legacy",
57489
+ "explicitResourceManagement"
57490
+ ],
57486
57491
  sourceType: "module"
57487
57492
  };
57488
57493
  return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
@@ -58784,7 +58789,11 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58784
58789
  const pathOperations = {};
58785
58790
  graphql11.visit(definition, {
58786
58791
  FragmentSpread(node, _, __, ___, ancestors) {
58787
- if (!config.isListFragment(node.name.value)) {
58792
+ let nameWithoutHash = node.name.value;
58793
+ if (node.directives && node.directives.find((directive) => directive.name.value === "with")) {
58794
+ nameWithoutHash = nameWithoutHash.substring(0, nameWithoutHash.lastIndexOf("_"));
58795
+ }
58796
+ if (!config.isListFragment(nameWithoutHash)) {
58788
58797
  return;
58789
58798
  }
58790
58799
  const path2 = ancestorKey(ancestors);
@@ -58795,8 +58804,8 @@ function operationsByPath(config, filepath, definition, filterTypes) {
58795
58804
  operationObject({
58796
58805
  config,
58797
58806
  filepath,
58798
- listName: config.listNameFromFragment(node.name.value),
58799
- operationKind: config.listOperationFromFragment(node.name.value),
58807
+ listName: config.listNameFromFragment(nameWithoutHash),
58808
+ operationKind: config.listOperationFromFragment(nameWithoutHash),
58800
58809
  type: parentTypeFromAncestors(config.schema, filepath, ancestors).name,
58801
58810
  selection: node
58802
58811
  })
@@ -69480,7 +69480,12 @@ function deepMerge2(filepath, ...targets) {
69480
69480
  // src/lib/parse.ts
69481
69481
  function parseJS(str, config2) {
69482
69482
  const defaultConfig = {
69483
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
69483
+ plugins: [
69484
+ "typescript",
69485
+ "importAssertions",
69486
+ "decorators-legacy",
69487
+ "explicitResourceManagement"
69488
+ ],
69484
69489
  sourceType: "module"
69485
69490
  };
69486
69491
  return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
@@ -70463,7 +70468,18 @@ async function extractQueries(source) {
70463
70468
  } else {
70464
70469
  return [];
70465
70470
  }
70466
- return props.filter((p) => p !== "children");
70471
+ return props.reduce((queries, query2) => {
70472
+ if (query2 === "children") {
70473
+ return queries;
70474
+ }
70475
+ if (query2.endsWith("$handle")) {
70476
+ query2 = query2.substring(0, query2.length - "$handle".length);
70477
+ }
70478
+ if (queries.includes(query2)) {
70479
+ return queries;
70480
+ }
70481
+ return queries.concat([query2]);
70482
+ }, []);
70467
70483
  }
70468
70484
 
70469
70485
  // src/lib/router/server.ts
@@ -71581,7 +71597,11 @@ function operationsByPath(config2, filepath, definition, filterTypes) {
71581
71597
  const pathOperations = {};
71582
71598
  graphql11.visit(definition, {
71583
71599
  FragmentSpread(node, _, __, ___, ancestors) {
71584
- if (!config2.isListFragment(node.name.value)) {
71600
+ let nameWithoutHash = node.name.value;
71601
+ if (node.directives && node.directives.find((directive) => directive.name.value === "with")) {
71602
+ nameWithoutHash = nameWithoutHash.substring(0, nameWithoutHash.lastIndexOf("_"));
71603
+ }
71604
+ if (!config2.isListFragment(nameWithoutHash)) {
71585
71605
  return;
71586
71606
  }
71587
71607
  const path3 = ancestorKey(ancestors);
@@ -71592,8 +71612,8 @@ function operationsByPath(config2, filepath, definition, filterTypes) {
71592
71612
  operationObject({
71593
71613
  config: config2,
71594
71614
  filepath,
71595
- listName: config2.listNameFromFragment(node.name.value),
71596
- operationKind: config2.listOperationFromFragment(node.name.value),
71615
+ listName: config2.listNameFromFragment(nameWithoutHash),
71616
+ operationKind: config2.listOperationFromFragment(nameWithoutHash),
71597
71617
  type: parentTypeFromAncestors(config2.schema, filepath, ancestors).name,
71598
71618
  selection: node
71599
71619
  })
@@ -69473,7 +69473,12 @@ function deepMerge2(filepath, ...targets) {
69473
69473
  // src/lib/parse.ts
69474
69474
  function parseJS(str, config2) {
69475
69475
  const defaultConfig = {
69476
- plugins: ["typescript", "importAssertions", "decorators-legacy"],
69476
+ plugins: [
69477
+ "typescript",
69478
+ "importAssertions",
69479
+ "decorators-legacy",
69480
+ "explicitResourceManagement"
69481
+ ],
69477
69482
  sourceType: "module"
69478
69483
  };
69479
69484
  return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
@@ -70456,7 +70461,18 @@ async function extractQueries(source) {
70456
70461
  } else {
70457
70462
  return [];
70458
70463
  }
70459
- return props.filter((p) => p !== "children");
70464
+ return props.reduce((queries, query2) => {
70465
+ if (query2 === "children") {
70466
+ return queries;
70467
+ }
70468
+ if (query2.endsWith("$handle")) {
70469
+ query2 = query2.substring(0, query2.length - "$handle".length);
70470
+ }
70471
+ if (queries.includes(query2)) {
70472
+ return queries;
70473
+ }
70474
+ return queries.concat([query2]);
70475
+ }, []);
70460
70476
  }
70461
70477
 
70462
70478
  // src/lib/router/server.ts
@@ -71574,7 +71590,11 @@ function operationsByPath(config2, filepath, definition, filterTypes) {
71574
71590
  const pathOperations = {};
71575
71591
  graphql11.visit(definition, {
71576
71592
  FragmentSpread(node, _, __, ___, ancestors) {
71577
- if (!config2.isListFragment(node.name.value)) {
71593
+ let nameWithoutHash = node.name.value;
71594
+ if (node.directives && node.directives.find((directive) => directive.name.value === "with")) {
71595
+ nameWithoutHash = nameWithoutHash.substring(0, nameWithoutHash.lastIndexOf("_"));
71596
+ }
71597
+ if (!config2.isListFragment(nameWithoutHash)) {
71578
71598
  return;
71579
71599
  }
71580
71600
  const path3 = ancestorKey(ancestors);
@@ -71585,8 +71605,8 @@ function operationsByPath(config2, filepath, definition, filterTypes) {
71585
71605
  operationObject({
71586
71606
  config: config2,
71587
71607
  filepath,
71588
- listName: config2.listNameFromFragment(node.name.value),
71589
- operationKind: config2.listOperationFromFragment(node.name.value),
71608
+ listName: config2.listNameFromFragment(nameWithoutHash),
71609
+ operationKind: config2.listOperationFromFragment(nameWithoutHash),
71590
71610
  type: parentTypeFromAncestors(config2.schema, filepath, ancestors).name,
71591
71611
  selection: node
71592
71612
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini",
3
- "version": "1.2.45",
3
+ "version": "1.2.46",
4
4
  "description": "The disappearing GraphQL clients",
5
5
  "keywords": [
6
6
  "typescript",