houdini-svelte 1.2.3 → 1.2.4

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.
@@ -92288,6 +92288,7 @@ __export(fs_exports, {
92288
92288
  recursiveCopy: () => recursiveCopy,
92289
92289
  remove: () => remove,
92290
92290
  rmdir: () => rmdir,
92291
+ snapshot: () => snapshot,
92291
92292
  stat: () => stat,
92292
92293
  writeFile: () => writeFile
92293
92294
  });
@@ -92474,16 +92475,17 @@ function existsSync(dirPath) {
92474
92475
  }
92475
92476
  return import_memfs.fs.existsSync(dirPath);
92476
92477
  }
92477
- async function readdir(filepath) {
92478
+ async function readdir(filepath, opts) {
92478
92479
  if (!houdini_mode.is_testing) {
92479
- return await fs.readdir(filepath);
92480
+ return await fs.readdir(filepath, opts);
92480
92481
  }
92481
92482
  if (filepath.includes("build/runtime")) {
92482
- return await fs.readdir(filepath);
92483
+ return await fs.readdir(filepath, opts);
92483
92484
  }
92484
92485
  try {
92485
- return import_memfs.fs.readdirSync(filepath);
92486
- } catch {
92486
+ return import_memfs.fs.readdirSync(filepath, opts);
92487
+ } catch (e22) {
92488
+ console.log(e22);
92487
92489
  return [];
92488
92490
  }
92489
92491
  }
@@ -92534,6 +92536,11 @@ async function recursiveCopy(source, target, transforms, notRoot) {
92534
92536
  );
92535
92537
  }
92536
92538
  }
92539
+ function snapshot(base) {
92540
+ return Object.fromEntries(
92541
+ Object.entries(import_memfs.vol.toJSON()).filter(([key]) => !base || key.startsWith(base)).map(([key, value2]) => [!base ? key : key.substring(base.length), value2])
92542
+ );
92543
+ }
92537
92544
  async function glob(pattern) {
92538
92545
  return await promisify(import_glob.glob)(posixify(pattern));
92539
92546
  }
@@ -93964,6 +93971,10 @@ var List = class {
93964
93971
  updates: ["append", "prepend"],
93965
93972
  selection: {
93966
93973
  fields: {
93974
+ __typename: {
93975
+ keyRaw: "__typename",
93976
+ type: "String"
93977
+ },
93967
93978
  node: {
93968
93979
  type: listType,
93969
93980
  keyRaw: "node",
@@ -93988,7 +93999,15 @@ var List = class {
93988
93999
  };
93989
94000
  insertData = {
93990
94001
  newEntry: {
93991
- edges: [{ node: { ...data2, __typename: listType } }]
94002
+ edges: [
94003
+ {
94004
+ __typename: listType + "Edge",
94005
+ node: {
94006
+ ...data2,
94007
+ __typename: listType
94008
+ }
94009
+ }
94010
+ ]
93992
94011
  }
93993
94012
  };
93994
94013
  } else {
@@ -94412,6 +94431,23 @@ var InMemoryStorage = class {
94412
94431
  }
94413
94432
  return this.data[this.data.length - 1];
94414
94433
  }
94434
+ serialize() {
94435
+ return JSON.stringify({
94436
+ rank: this.rank,
94437
+ fields: this.topLayer.fields,
94438
+ links: this.topLayer.links
94439
+ });
94440
+ }
94441
+ hydrate(args, layer) {
94442
+ if (!args) {
94443
+ return;
94444
+ }
94445
+ const { rank, fields, links } = args;
94446
+ this.rank = rank;
94447
+ layer ??= this.createLayer(true);
94448
+ layer.fields = fields;
94449
+ layer.links = links;
94450
+ }
94415
94451
  };
94416
94452
  var Layer = class {
94417
94453
  id;
@@ -94989,6 +95025,12 @@ var Cache = class {
94989
95025
  config() {
94990
95026
  return this._internal_unstable.config;
94991
95027
  }
95028
+ serialize() {
95029
+ return this._internal_unstable.storage.serialize();
95030
+ }
95031
+ hydrate(...args) {
95032
+ return this._internal_unstable.storage.hydrate(...args);
95033
+ }
94992
95034
  clearLayer(layerID) {
94993
95035
  const layer = this._internal_unstable.storage.getLayer(layerID);
94994
95036
  if (!layer) {
@@ -96800,7 +96842,7 @@ function deepMerge2(filepath, ...targets) {
96800
96842
  });
96801
96843
  }
96802
96844
  }
96803
- async function parseJS(str, config4) {
96845
+ function parseJS(str, config4) {
96804
96846
  const defaultConfig = {
96805
96847
  plugins: ["typescript", "importAssertions"],
96806
96848
  sourceType: "module"
@@ -186603,6 +186645,7 @@ __export2(fs_exports2, {
186603
186645
  recursiveCopy: () => recursiveCopy2,
186604
186646
  remove: () => remove2,
186605
186647
  rmdir: () => rmdir2,
186648
+ snapshot: () => snapshot2,
186606
186649
  stat: () => stat3,
186607
186650
  writeFile: () => writeFile2
186608
186651
  });
@@ -186789,16 +186832,17 @@ function existsSync2(dirPath) {
186789
186832
  }
186790
186833
  return import_memfs2.fs.existsSync(dirPath);
186791
186834
  }
186792
- async function readdir2(filepath) {
186835
+ async function readdir2(filepath, opts) {
186793
186836
  if (!houdini_mode2.is_testing) {
186794
- return await fs3.readdir(filepath);
186837
+ return await fs3.readdir(filepath, opts);
186795
186838
  }
186796
186839
  if (filepath.includes("build/runtime")) {
186797
- return await fs3.readdir(filepath);
186840
+ return await fs3.readdir(filepath, opts);
186798
186841
  }
186799
186842
  try {
186800
- return import_memfs2.fs.readdirSync(filepath);
186801
- } catch {
186843
+ return import_memfs2.fs.readdirSync(filepath, opts);
186844
+ } catch (e22) {
186845
+ console.log(e22);
186802
186846
  return [];
186803
186847
  }
186804
186848
  }
@@ -186849,6 +186893,11 @@ async function recursiveCopy2(source, target, transforms, notRoot) {
186849
186893
  );
186850
186894
  }
186851
186895
  }
186896
+ function snapshot2(base) {
186897
+ return Object.fromEntries(
186898
+ Object.entries(import_memfs2.vol.toJSON()).filter(([key]) => !base || key.startsWith(base)).map(([key, value2]) => [!base ? key : key.substring(base.length), value2])
186899
+ );
186900
+ }
186852
186901
  async function glob2(pattern) {
186853
186902
  return await promisify3(import_glob2.glob)(posixify2(pattern));
186854
186903
  }
@@ -187702,6 +187751,10 @@ var List3 = class {
187702
187751
  updates: ["append", "prepend"],
187703
187752
  selection: {
187704
187753
  fields: {
187754
+ __typename: {
187755
+ keyRaw: "__typename",
187756
+ type: "String"
187757
+ },
187705
187758
  node: {
187706
187759
  type: listType,
187707
187760
  keyRaw: "node",
@@ -187726,7 +187779,15 @@ var List3 = class {
187726
187779
  };
187727
187780
  insertData = {
187728
187781
  newEntry: {
187729
- edges: [{ node: { ...data2, __typename: listType } }]
187782
+ edges: [
187783
+ {
187784
+ __typename: listType + "Edge",
187785
+ node: {
187786
+ ...data2,
187787
+ __typename: listType
187788
+ }
187789
+ }
187790
+ ]
187730
187791
  }
187731
187792
  };
187732
187793
  } else {
@@ -188150,6 +188211,23 @@ var InMemoryStorage2 = class {
188150
188211
  }
188151
188212
  return this.data[this.data.length - 1];
188152
188213
  }
188214
+ serialize() {
188215
+ return JSON.stringify({
188216
+ rank: this.rank,
188217
+ fields: this.topLayer.fields,
188218
+ links: this.topLayer.links
188219
+ });
188220
+ }
188221
+ hydrate(args, layer) {
188222
+ if (!args) {
188223
+ return;
188224
+ }
188225
+ const { rank, fields, links } = args;
188226
+ this.rank = rank;
188227
+ layer ??= this.createLayer(true);
188228
+ layer.fields = fields;
188229
+ layer.links = links;
188230
+ }
188153
188231
  };
188154
188232
  var Layer2 = class {
188155
188233
  id;
@@ -188727,6 +188805,12 @@ var Cache2 = class {
188727
188805
  config() {
188728
188806
  return this._internal_unstable.config;
188729
188807
  }
188808
+ serialize() {
188809
+ return this._internal_unstable.storage.serialize();
188810
+ }
188811
+ hydrate(...args) {
188812
+ return this._internal_unstable.storage.hydrate(...args);
188813
+ }
188730
188814
  clearLayer(layerID) {
188731
188815
  const layer = this._internal_unstable.storage.getLayer(layerID);
188732
188816
  if (!layer) {
@@ -5,7 +5,7 @@ export declare class BaseStore<_Data extends GraphQLObject, _Input extends Graph
5
5
  #private;
6
6
  get artifact(): _Artifact;
7
7
  get name(): string;
8
- constructor(params: ObserveParams<_Data, _Artifact> & {
8
+ constructor(params: ObserveParams<_Data, _Artifact, _Input> & {
9
9
  initialize?: boolean;
10
10
  });
11
11
  get observer(): DocumentStore<_Data, _Input>;
@@ -5,7 +5,7 @@ export declare class BaseStore<_Data extends GraphQLObject, _Input extends Graph
5
5
  #private;
6
6
  get artifact(): _Artifact;
7
7
  get name(): string;
8
- constructor(params: ObserveParams<_Data, _Artifact> & {
8
+ constructor(params: ObserveParams<_Data, _Artifact, _Input> & {
9
9
  initialize?: boolean;
10
10
  });
11
11
  get observer(): DocumentStore<_Data, _Input>;
@@ -5,7 +5,7 @@ export declare class BaseStore<_Data extends GraphQLObject, _Input extends Graph
5
5
  #private;
6
6
  get artifact(): _Artifact;
7
7
  get name(): string;
8
- constructor(params: ObserveParams<_Data, _Artifact> & {
8
+ constructor(params: ObserveParams<_Data, _Artifact, _Input> & {
9
9
  initialize?: boolean;
10
10
  });
11
11
  get observer(): DocumentStore<_Data, _Input>;