houdini 1.2.3 → 1.2.5

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 (54) hide show
  1. package/build/cmd-cjs/index.js +82 -18
  2. package/build/cmd-esm/index.js +82 -18
  3. package/build/codegen-cjs/index.js +78 -16
  4. package/build/codegen-esm/index.js +78 -16
  5. package/build/lib/fs.d.ts +8 -1
  6. package/build/lib/index.d.ts +1 -0
  7. package/build/lib/parse.d.ts +1 -1
  8. package/build/lib/types.d.ts +11 -0
  9. package/build/lib-cjs/index.js +81 -25
  10. package/build/lib-esm/index.js +79 -25
  11. package/build/runtime/cache/cache.d.ts +2 -0
  12. package/build/runtime/cache/storage.d.ts +6 -0
  13. package/build/runtime/client/documentStore.d.ts +9 -2
  14. package/build/runtime/client/index.d.ts +6 -3
  15. package/build/runtime/lib/index.d.ts +1 -0
  16. package/build/runtime/lib/lru.d.ts +52 -0
  17. package/build/runtime/lib/types.d.ts +1 -0
  18. package/build/runtime-cjs/cache/cache.d.ts +2 -0
  19. package/build/runtime-cjs/cache/cache.js +6 -0
  20. package/build/runtime-cjs/cache/lists.js +13 -1
  21. package/build/runtime-cjs/cache/storage.d.ts +6 -0
  22. package/build/runtime-cjs/cache/storage.js +17 -0
  23. package/build/runtime-cjs/client/documentStore.d.ts +9 -2
  24. package/build/runtime-cjs/client/documentStore.js +13 -9
  25. package/build/runtime-cjs/client/index.d.ts +6 -3
  26. package/build/runtime-cjs/client/index.js +6 -8
  27. package/build/runtime-cjs/client/plugins/cache.js +3 -0
  28. package/build/runtime-cjs/lib/index.d.ts +1 -0
  29. package/build/runtime-cjs/lib/index.js +1 -0
  30. package/build/runtime-cjs/lib/lru.d.ts +52 -0
  31. package/build/runtime-cjs/lib/lru.js +73 -0
  32. package/build/runtime-cjs/lib/types.d.ts +1 -0
  33. package/build/runtime-cjs/lib/types.js +7 -2
  34. package/build/runtime-esm/cache/cache.d.ts +2 -0
  35. package/build/runtime-esm/cache/cache.js +6 -0
  36. package/build/runtime-esm/cache/lists.js +13 -1
  37. package/build/runtime-esm/cache/storage.d.ts +6 -0
  38. package/build/runtime-esm/cache/storage.js +17 -0
  39. package/build/runtime-esm/client/documentStore.d.ts +9 -2
  40. package/build/runtime-esm/client/documentStore.js +13 -9
  41. package/build/runtime-esm/client/index.d.ts +6 -3
  42. package/build/runtime-esm/client/index.js +6 -8
  43. package/build/runtime-esm/client/plugins/cache.js +3 -0
  44. package/build/runtime-esm/lib/index.d.ts +1 -0
  45. package/build/runtime-esm/lib/index.js +1 -0
  46. package/build/runtime-esm/lib/lru.d.ts +52 -0
  47. package/build/runtime-esm/lib/lru.js +48 -0
  48. package/build/runtime-esm/lib/types.d.ts +1 -0
  49. package/build/runtime-esm/lib/types.js +5 -1
  50. package/build/test-cjs/index.js +80 -16
  51. package/build/test-esm/index.js +80 -16
  52. package/build/vite-cjs/index.js +99 -17
  53. package/build/vite-esm/index.js +99 -17
  54. package/package.json +1 -1
@@ -68652,6 +68652,7 @@ __export(fs_exports, {
68652
68652
  recursiveCopy: () => recursiveCopy,
68653
68653
  remove: () => remove,
68654
68654
  rmdir: () => rmdir,
68655
+ snapshot: () => snapshot,
68655
68656
  stat: () => stat,
68656
68657
  writeFile: () => writeFile
68657
68658
  });
@@ -68846,16 +68847,17 @@ function existsSync(dirPath) {
68846
68847
  }
68847
68848
  return import_memfs.fs.existsSync(dirPath);
68848
68849
  }
68849
- async function readdir(filepath) {
68850
+ async function readdir(filepath, opts) {
68850
68851
  if (!houdini_mode.is_testing) {
68851
- return await import_promises.default.readdir(filepath);
68852
+ return await import_promises.default.readdir(filepath, opts);
68852
68853
  }
68853
68854
  if (filepath.includes("build/runtime")) {
68854
- return await import_promises.default.readdir(filepath);
68855
+ return await import_promises.default.readdir(filepath, opts);
68855
68856
  }
68856
68857
  try {
68857
- return import_memfs.fs.readdirSync(filepath);
68858
- } catch {
68858
+ return import_memfs.fs.readdirSync(filepath, opts);
68859
+ } catch (e2) {
68860
+ console.log(e2);
68859
68861
  return [];
68860
68862
  }
68861
68863
  }
@@ -68906,6 +68908,11 @@ async function recursiveCopy(source, target, transforms, notRoot) {
68906
68908
  );
68907
68909
  }
68908
68910
  }
68911
+ function snapshot(base) {
68912
+ return Object.fromEntries(
68913
+ Object.entries(import_memfs.vol.toJSON()).filter(([key]) => !base || key.startsWith(base)).map(([key, value]) => [!base ? key : key.substring(base.length), value])
68914
+ );
68915
+ }
68909
68916
  async function glob(pattern) {
68910
68917
  return await (0, import_node_util.promisify)(import_glob.glob)(posixify(pattern));
68911
68918
  }
@@ -70393,6 +70400,10 @@ var List = class {
70393
70400
  updates: ["append", "prepend"],
70394
70401
  selection: {
70395
70402
  fields: {
70403
+ __typename: {
70404
+ keyRaw: "__typename",
70405
+ type: "String"
70406
+ },
70396
70407
  node: {
70397
70408
  type: listType,
70398
70409
  keyRaw: "node",
@@ -70417,7 +70428,15 @@ var List = class {
70417
70428
  };
70418
70429
  insertData = {
70419
70430
  newEntry: {
70420
- edges: [{ node: { ...data, __typename: listType } }]
70431
+ edges: [
70432
+ {
70433
+ __typename: listType + "Edge",
70434
+ node: {
70435
+ ...data,
70436
+ __typename: listType
70437
+ }
70438
+ }
70439
+ ]
70421
70440
  }
70422
70441
  };
70423
70442
  } else {
@@ -70845,6 +70864,23 @@ var InMemoryStorage = class {
70845
70864
  }
70846
70865
  return this.data[this.data.length - 1];
70847
70866
  }
70867
+ serialize() {
70868
+ return JSON.stringify({
70869
+ rank: this.rank,
70870
+ fields: this.topLayer.fields,
70871
+ links: this.topLayer.links
70872
+ });
70873
+ }
70874
+ hydrate(args, layer) {
70875
+ if (!args) {
70876
+ return;
70877
+ }
70878
+ const { rank, fields, links } = args;
70879
+ this.rank = rank;
70880
+ layer ??= this.createLayer(true);
70881
+ layer.fields = fields;
70882
+ layer.links = links;
70883
+ }
70848
70884
  };
70849
70885
  var Layer = class {
70850
70886
  id;
@@ -71428,6 +71464,12 @@ var Cache = class {
71428
71464
  config() {
71429
71465
  return this._internal_unstable.config;
71430
71466
  }
71467
+ serialize() {
71468
+ return this._internal_unstable.storage.serialize();
71469
+ }
71470
+ hydrate(...args) {
71471
+ return this._internal_unstable.storage.hydrate(...args);
71472
+ }
71431
71473
  clearLayer(layerID) {
71432
71474
  const layer = this._internal_unstable.storage.getLayer(layerID);
71433
71475
  if (!layer) {
@@ -72703,6 +72745,8 @@ var Config = class {
72703
72745
  root = this.projectRoot,
72704
72746
  ignore_plugins = false
72705
72747
  } = {}) {
72748
+ const parsed = parse2(filepath);
72749
+ filepath = `${parsed.dir}/${parsed.name}${parsed.ext.split("?")[0]}`;
72706
72750
  let included = false;
72707
72751
  for (const plugin2 of ignore_plugins ? [] : this.plugins) {
72708
72752
  if (!plugin2.include) {
@@ -73388,9 +73432,9 @@ function deepMerge2(filepath, ...targets) {
73388
73432
  }
73389
73433
 
73390
73434
  // src/lib/parse.ts
73391
- async function parseJS(str, config2) {
73435
+ function parseJS(str, config2) {
73392
73436
  const defaultConfig = {
73393
- plugins: ["typescript", "importAssertions"],
73437
+ plugins: ["typescript", "importAssertions", "decorators"],
73394
73438
  sourceType: "module"
73395
73439
  };
73396
73440
  return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
@@ -76693,12 +76737,28 @@ ${exportStatement("config")}
76693
76737
  },
76694
76738
  [path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
76695
76739
  }),
76696
- ...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map((plugin2) => generatePluginRuntime(config2, docs, plugin2)),
76740
+ ...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map(
76741
+ (plugin2) => generatePluginRuntime({
76742
+ config: config2,
76743
+ docs,
76744
+ plugin: plugin2,
76745
+ importStatement,
76746
+ exportDefaultStatement: exportStatement,
76747
+ exportStarStatement: exportStar
76748
+ })
76749
+ ),
76697
76750
  generatePluginIndex({ config: config2, exportStatement: exportStar })
76698
76751
  ]);
76699
76752
  await generateGraphqlReturnTypes(config2, docs);
76700
76753
  }
76701
- async function generatePluginRuntime(config2, docs, plugin2) {
76754
+ async function generatePluginRuntime({
76755
+ config: config2,
76756
+ docs,
76757
+ plugin: plugin2,
76758
+ importStatement,
76759
+ exportDefaultStatement,
76760
+ exportStarStatement
76761
+ }) {
76702
76762
  if (houdini_mode.is_testing || !plugin2.includeRuntime) {
76703
76763
  return;
76704
76764
  }
@@ -76726,7 +76786,13 @@ async function generatePluginRuntime(config2, docs, plugin2) {
76726
76786
  Object.fromEntries(
76727
76787
  Object.entries(transformMap).map(([key, value]) => [
76728
76788
  path_exports.join(runtime_path, key),
76729
- (content) => value({ config: config2, content })
76789
+ (content) => value({
76790
+ config: config2,
76791
+ content,
76792
+ importStatement,
76793
+ exportDefaultStatement,
76794
+ exportStarStatement
76795
+ })
76730
76796
  ])
76731
76797
  )
76732
76798
  );
@@ -78594,14 +78660,12 @@ async function typeCheck(config2, docs) {
78594
78660
  for (const targetType of targetTypes) {
78595
78661
  const missingIDFields = config2.keyFieldsForType(targetType.name).filter((fieldName) => !targetType.getFields()[fieldName]);
78596
78662
  if (missingIDFields.length > 0) {
78597
- const message = `@${config2.listDirective} on ${logGreen(
78598
- targetType.name
78599
- )} as a configuration issue. Object identification missing: ${missingIDFields.map((c) => `"${logYellow(c)}"`).join(", ")}. Check 'Custom IDs' if needed.`;
78600
78663
  errors.push(
78601
78664
  new HoudiniError({
78602
78665
  filepath: filename,
78603
- message,
78604
- description: message
78666
+ message: `@${config2.listDirective} on ${logGreen(
78667
+ targetType.name
78668
+ )} has a configuration issue: ${targetType} dos not have a valid key. Please check this link for more information: https://houdinigraphql.com/guides/caching-data#custom-ids`
78605
78669
  })
78606
78670
  );
78607
78671
  return;
@@ -80112,8 +80176,8 @@ async function updatePackageJSON(targetPath) {
80112
80176
  }
80113
80177
  packageJSON.devDependencies = {
80114
80178
  ...packageJSON.devDependencies,
80115
- houdini: "^1.2.3",
80116
- "houdini-svelte": "^1.2.3"
80179
+ houdini: "^1.2.5",
80180
+ "houdini-svelte": "^1.2.5"
80117
80181
  };
80118
80182
  await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
80119
80183
  }
@@ -68658,6 +68658,7 @@ __export(fs_exports, {
68658
68658
  recursiveCopy: () => recursiveCopy,
68659
68659
  remove: () => remove,
68660
68660
  rmdir: () => rmdir,
68661
+ snapshot: () => snapshot,
68661
68662
  stat: () => stat,
68662
68663
  writeFile: () => writeFile
68663
68664
  });
@@ -68852,16 +68853,17 @@ function existsSync(dirPath) {
68852
68853
  }
68853
68854
  return import_memfs.fs.existsSync(dirPath);
68854
68855
  }
68855
- async function readdir(filepath) {
68856
+ async function readdir(filepath, opts) {
68856
68857
  if (!houdini_mode.is_testing) {
68857
- return await fs.readdir(filepath);
68858
+ return await fs.readdir(filepath, opts);
68858
68859
  }
68859
68860
  if (filepath.includes("build/runtime")) {
68860
- return await fs.readdir(filepath);
68861
+ return await fs.readdir(filepath, opts);
68861
68862
  }
68862
68863
  try {
68863
- return import_memfs.fs.readdirSync(filepath);
68864
- } catch {
68864
+ return import_memfs.fs.readdirSync(filepath, opts);
68865
+ } catch (e2) {
68866
+ console.log(e2);
68865
68867
  return [];
68866
68868
  }
68867
68869
  }
@@ -68912,6 +68914,11 @@ async function recursiveCopy(source, target, transforms, notRoot) {
68912
68914
  );
68913
68915
  }
68914
68916
  }
68917
+ function snapshot(base) {
68918
+ return Object.fromEntries(
68919
+ Object.entries(import_memfs.vol.toJSON()).filter(([key]) => !base || key.startsWith(base)).map(([key, value]) => [!base ? key : key.substring(base.length), value])
68920
+ );
68921
+ }
68915
68922
  async function glob(pattern) {
68916
68923
  return await promisify(import_glob.glob)(posixify(pattern));
68917
68924
  }
@@ -70399,6 +70406,10 @@ var List = class {
70399
70406
  updates: ["append", "prepend"],
70400
70407
  selection: {
70401
70408
  fields: {
70409
+ __typename: {
70410
+ keyRaw: "__typename",
70411
+ type: "String"
70412
+ },
70402
70413
  node: {
70403
70414
  type: listType,
70404
70415
  keyRaw: "node",
@@ -70423,7 +70434,15 @@ var List = class {
70423
70434
  };
70424
70435
  insertData = {
70425
70436
  newEntry: {
70426
- edges: [{ node: { ...data, __typename: listType } }]
70437
+ edges: [
70438
+ {
70439
+ __typename: listType + "Edge",
70440
+ node: {
70441
+ ...data,
70442
+ __typename: listType
70443
+ }
70444
+ }
70445
+ ]
70427
70446
  }
70428
70447
  };
70429
70448
  } else {
@@ -70851,6 +70870,23 @@ var InMemoryStorage = class {
70851
70870
  }
70852
70871
  return this.data[this.data.length - 1];
70853
70872
  }
70873
+ serialize() {
70874
+ return JSON.stringify({
70875
+ rank: this.rank,
70876
+ fields: this.topLayer.fields,
70877
+ links: this.topLayer.links
70878
+ });
70879
+ }
70880
+ hydrate(args, layer) {
70881
+ if (!args) {
70882
+ return;
70883
+ }
70884
+ const { rank, fields, links } = args;
70885
+ this.rank = rank;
70886
+ layer ??= this.createLayer(true);
70887
+ layer.fields = fields;
70888
+ layer.links = links;
70889
+ }
70854
70890
  };
70855
70891
  var Layer = class {
70856
70892
  id;
@@ -71434,6 +71470,12 @@ var Cache = class {
71434
71470
  config() {
71435
71471
  return this._internal_unstable.config;
71436
71472
  }
71473
+ serialize() {
71474
+ return this._internal_unstable.storage.serialize();
71475
+ }
71476
+ hydrate(...args) {
71477
+ return this._internal_unstable.storage.hydrate(...args);
71478
+ }
71437
71479
  clearLayer(layerID) {
71438
71480
  const layer = this._internal_unstable.storage.getLayer(layerID);
71439
71481
  if (!layer) {
@@ -72708,6 +72750,8 @@ var Config = class {
72708
72750
  root = this.projectRoot,
72709
72751
  ignore_plugins = false
72710
72752
  } = {}) {
72753
+ const parsed = parse2(filepath);
72754
+ filepath = `${parsed.dir}/${parsed.name}${parsed.ext.split("?")[0]}`;
72711
72755
  let included = false;
72712
72756
  for (const plugin2 of ignore_plugins ? [] : this.plugins) {
72713
72757
  if (!plugin2.include) {
@@ -73393,9 +73437,9 @@ function deepMerge2(filepath, ...targets) {
73393
73437
  }
73394
73438
 
73395
73439
  // src/lib/parse.ts
73396
- async function parseJS(str, config2) {
73440
+ function parseJS(str, config2) {
73397
73441
  const defaultConfig = {
73398
- plugins: ["typescript", "importAssertions"],
73442
+ plugins: ["typescript", "importAssertions", "decorators"],
73399
73443
  sourceType: "module"
73400
73444
  };
73401
73445
  return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
@@ -76698,12 +76742,28 @@ ${exportStatement("config")}
76698
76742
  },
76699
76743
  [path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
76700
76744
  }),
76701
- ...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map((plugin2) => generatePluginRuntime(config2, docs, plugin2)),
76745
+ ...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map(
76746
+ (plugin2) => generatePluginRuntime({
76747
+ config: config2,
76748
+ docs,
76749
+ plugin: plugin2,
76750
+ importStatement,
76751
+ exportDefaultStatement: exportStatement,
76752
+ exportStarStatement: exportStar
76753
+ })
76754
+ ),
76702
76755
  generatePluginIndex({ config: config2, exportStatement: exportStar })
76703
76756
  ]);
76704
76757
  await generateGraphqlReturnTypes(config2, docs);
76705
76758
  }
76706
- async function generatePluginRuntime(config2, docs, plugin2) {
76759
+ async function generatePluginRuntime({
76760
+ config: config2,
76761
+ docs,
76762
+ plugin: plugin2,
76763
+ importStatement,
76764
+ exportDefaultStatement,
76765
+ exportStarStatement
76766
+ }) {
76707
76767
  if (houdini_mode.is_testing || !plugin2.includeRuntime) {
76708
76768
  return;
76709
76769
  }
@@ -76731,7 +76791,13 @@ async function generatePluginRuntime(config2, docs, plugin2) {
76731
76791
  Object.fromEntries(
76732
76792
  Object.entries(transformMap).map(([key, value]) => [
76733
76793
  path_exports.join(runtime_path, key),
76734
- (content) => value({ config: config2, content })
76794
+ (content) => value({
76795
+ config: config2,
76796
+ content,
76797
+ importStatement,
76798
+ exportDefaultStatement,
76799
+ exportStarStatement
76800
+ })
76735
76801
  ])
76736
76802
  )
76737
76803
  );
@@ -78599,14 +78665,12 @@ async function typeCheck(config2, docs) {
78599
78665
  for (const targetType of targetTypes) {
78600
78666
  const missingIDFields = config2.keyFieldsForType(targetType.name).filter((fieldName) => !targetType.getFields()[fieldName]);
78601
78667
  if (missingIDFields.length > 0) {
78602
- const message = `@${config2.listDirective} on ${logGreen(
78603
- targetType.name
78604
- )} as a configuration issue. Object identification missing: ${missingIDFields.map((c) => `"${logYellow(c)}"`).join(", ")}. Check 'Custom IDs' if needed.`;
78605
78668
  errors.push(
78606
78669
  new HoudiniError({
78607
78670
  filepath: filename,
78608
- message,
78609
- description: message
78671
+ message: `@${config2.listDirective} on ${logGreen(
78672
+ targetType.name
78673
+ )} has a configuration issue: ${targetType} dos not have a valid key. Please check this link for more information: https://houdinigraphql.com/guides/caching-data#custom-ids`
78610
78674
  })
78611
78675
  );
78612
78676
  return;
@@ -80117,8 +80181,8 @@ async function updatePackageJSON(targetPath) {
80117
80181
  }
80118
80182
  packageJSON.devDependencies = {
80119
80183
  ...packageJSON.devDependencies,
80120
- houdini: "^1.2.3",
80121
- "houdini-svelte": "^1.2.3"
80184
+ houdini: "^1.2.5",
80185
+ "houdini-svelte": "^1.2.5"
80122
80186
  };
80123
80187
  await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
80124
80188
  }
@@ -54386,6 +54386,7 @@ __export(fs_exports, {
54386
54386
  recursiveCopy: () => recursiveCopy,
54387
54387
  remove: () => remove,
54388
54388
  rmdir: () => rmdir,
54389
+ snapshot: () => snapshot,
54389
54390
  stat: () => stat,
54390
54391
  writeFile: () => writeFile
54391
54392
  });
@@ -54580,16 +54581,17 @@ function existsSync(dirPath) {
54580
54581
  }
54581
54582
  return import_memfs.fs.existsSync(dirPath);
54582
54583
  }
54583
- async function readdir(filepath) {
54584
+ async function readdir(filepath, opts) {
54584
54585
  if (!houdini_mode.is_testing) {
54585
- return await import_promises.default.readdir(filepath);
54586
+ return await import_promises.default.readdir(filepath, opts);
54586
54587
  }
54587
54588
  if (filepath.includes("build/runtime")) {
54588
- return await import_promises.default.readdir(filepath);
54589
+ return await import_promises.default.readdir(filepath, opts);
54589
54590
  }
54590
54591
  try {
54591
- return import_memfs.fs.readdirSync(filepath);
54592
- } catch {
54592
+ return import_memfs.fs.readdirSync(filepath, opts);
54593
+ } catch (e) {
54594
+ console.log(e);
54593
54595
  return [];
54594
54596
  }
54595
54597
  }
@@ -54640,6 +54642,11 @@ async function recursiveCopy(source, target, transforms, notRoot) {
54640
54642
  );
54641
54643
  }
54642
54644
  }
54645
+ function snapshot(base) {
54646
+ return Object.fromEntries(
54647
+ Object.entries(import_memfs.vol.toJSON()).filter(([key]) => !base || key.startsWith(base)).map(([key, value]) => [!base ? key : key.substring(base.length), value])
54648
+ );
54649
+ }
54643
54650
  async function glob(pattern) {
54644
54651
  return await (0, import_node_util.promisify)(import_glob.glob)(posixify(pattern));
54645
54652
  }
@@ -54871,6 +54878,10 @@ var List = class {
54871
54878
  updates: ["append", "prepend"],
54872
54879
  selection: {
54873
54880
  fields: {
54881
+ __typename: {
54882
+ keyRaw: "__typename",
54883
+ type: "String"
54884
+ },
54874
54885
  node: {
54875
54886
  type: listType,
54876
54887
  keyRaw: "node",
@@ -54895,7 +54906,15 @@ var List = class {
54895
54906
  };
54896
54907
  insertData = {
54897
54908
  newEntry: {
54898
- edges: [{ node: { ...data, __typename: listType } }]
54909
+ edges: [
54910
+ {
54911
+ __typename: listType + "Edge",
54912
+ node: {
54913
+ ...data,
54914
+ __typename: listType
54915
+ }
54916
+ }
54917
+ ]
54899
54918
  }
54900
54919
  };
54901
54920
  } else {
@@ -55323,6 +55342,23 @@ var InMemoryStorage = class {
55323
55342
  }
55324
55343
  return this.data[this.data.length - 1];
55325
55344
  }
55345
+ serialize() {
55346
+ return JSON.stringify({
55347
+ rank: this.rank,
55348
+ fields: this.topLayer.fields,
55349
+ links: this.topLayer.links
55350
+ });
55351
+ }
55352
+ hydrate(args, layer) {
55353
+ if (!args) {
55354
+ return;
55355
+ }
55356
+ const { rank, fields, links } = args;
55357
+ this.rank = rank;
55358
+ layer ??= this.createLayer(true);
55359
+ layer.fields = fields;
55360
+ layer.links = links;
55361
+ }
55326
55362
  };
55327
55363
  var Layer = class {
55328
55364
  id;
@@ -55906,6 +55942,12 @@ var Cache = class {
55906
55942
  config() {
55907
55943
  return this._internal_unstable.config;
55908
55944
  }
55945
+ serialize() {
55946
+ return this._internal_unstable.storage.serialize();
55947
+ }
55948
+ hydrate(...args) {
55949
+ return this._internal_unstable.storage.hydrate(...args);
55950
+ }
55909
55951
  clearLayer(layerID) {
55910
55952
  const layer = this._internal_unstable.storage.getLayer(layerID);
55911
55953
  if (!layer) {
@@ -57057,9 +57099,9 @@ function deepMerge2(filepath, ...targets) {
57057
57099
  }
57058
57100
 
57059
57101
  // src/lib/parse.ts
57060
- async function parseJS(str, config2) {
57102
+ function parseJS(str, config2) {
57061
57103
  const defaultConfig = {
57062
- plugins: ["typescript", "importAssertions"],
57104
+ plugins: ["typescript", "importAssertions", "decorators"],
57063
57105
  sourceType: "module"
57064
57106
  };
57065
57107
  return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
@@ -60304,12 +60346,28 @@ ${exportStatement("config")}
60304
60346
  },
60305
60347
  [path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
60306
60348
  }),
60307
- ...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map((plugin2) => generatePluginRuntime(config2, docs, plugin2)),
60349
+ ...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map(
60350
+ (plugin2) => generatePluginRuntime({
60351
+ config: config2,
60352
+ docs,
60353
+ plugin: plugin2,
60354
+ importStatement,
60355
+ exportDefaultStatement: exportStatement,
60356
+ exportStarStatement: exportStar
60357
+ })
60358
+ ),
60308
60359
  generatePluginIndex({ config: config2, exportStatement: exportStar })
60309
60360
  ]);
60310
60361
  await generateGraphqlReturnTypes(config2, docs);
60311
60362
  }
60312
- async function generatePluginRuntime(config2, docs, plugin2) {
60363
+ async function generatePluginRuntime({
60364
+ config: config2,
60365
+ docs,
60366
+ plugin: plugin2,
60367
+ importStatement,
60368
+ exportDefaultStatement,
60369
+ exportStarStatement
60370
+ }) {
60313
60371
  if (houdini_mode.is_testing || !plugin2.includeRuntime) {
60314
60372
  return;
60315
60373
  }
@@ -60337,7 +60395,13 @@ async function generatePluginRuntime(config2, docs, plugin2) {
60337
60395
  Object.fromEntries(
60338
60396
  Object.entries(transformMap).map(([key, value]) => [
60339
60397
  path_exports.join(runtime_path, key),
60340
- (content) => value({ config: config2, content })
60398
+ (content) => value({
60399
+ config: config2,
60400
+ content,
60401
+ importStatement,
60402
+ exportDefaultStatement,
60403
+ exportStarStatement
60404
+ })
60341
60405
  ])
60342
60406
  )
60343
60407
  );
@@ -62205,14 +62269,12 @@ async function typeCheck(config2, docs) {
62205
62269
  for (const targetType of targetTypes) {
62206
62270
  const missingIDFields = config2.keyFieldsForType(targetType.name).filter((fieldName) => !targetType.getFields()[fieldName]);
62207
62271
  if (missingIDFields.length > 0) {
62208
- const message = `@${config2.listDirective} on ${logGreen(
62209
- targetType.name
62210
- )} as a configuration issue. Object identification missing: ${missingIDFields.map((c) => `"${logYellow(c)}"`).join(", ")}. Check 'Custom IDs' if needed.`;
62211
62272
  errors.push(
62212
62273
  new HoudiniError({
62213
62274
  filepath: filename,
62214
- message,
62215
- description: message
62275
+ message: `@${config2.listDirective} on ${logGreen(
62276
+ targetType.name
62277
+ )} has a configuration issue: ${targetType} dos not have a valid key. Please check this link for more information: https://houdinigraphql.com/guides/caching-data#custom-ids`
62216
62278
  })
62217
62279
  );
62218
62280
  return;