houdini 1.2.2 → 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.
- package/build/cmd-cjs/index.js +183 -63
- package/build/cmd-esm/index.js +183 -63
- package/build/codegen-cjs/index.js +181 -61
- package/build/codegen-esm/index.js +181 -61
- package/build/lib/fs.d.ts +8 -1
- package/build/lib/index.d.ts +1 -0
- package/build/lib/parse.d.ts +1 -1
- package/build/lib/types.d.ts +11 -0
- package/build/lib-cjs/index.js +181 -69
- package/build/lib-esm/index.js +179 -69
- package/build/runtime/cache/cache.d.ts +5 -1
- package/build/runtime/cache/lists.d.ts +3 -3
- package/build/runtime/cache/storage.d.ts +8 -2
- package/build/runtime/cache/subscription.d.ts +1 -0
- package/build/runtime/client/documentStore.d.ts +9 -2
- package/build/runtime/client/index.d.ts +6 -3
- package/build/runtime/lib/index.d.ts +1 -0
- package/build/runtime/lib/lru.d.ts +52 -0
- package/build/runtime/lib/types.d.ts +1 -0
- package/build/runtime-cjs/cache/cache.d.ts +5 -1
- package/build/runtime-cjs/cache/cache.js +84 -27
- package/build/runtime-cjs/cache/lists.d.ts +3 -3
- package/build/runtime-cjs/cache/lists.js +20 -8
- package/build/runtime-cjs/cache/storage.d.ts +8 -2
- package/build/runtime-cjs/cache/storage.js +22 -5
- package/build/runtime-cjs/cache/subscription.d.ts +1 -0
- package/build/runtime-cjs/cache/subscription.js +3 -0
- package/build/runtime-cjs/client/documentStore.d.ts +9 -2
- package/build/runtime-cjs/client/documentStore.js +13 -9
- package/build/runtime-cjs/client/index.d.ts +6 -3
- package/build/runtime-cjs/client/index.js +6 -8
- package/build/runtime-cjs/client/plugins/cache.js +3 -0
- package/build/runtime-cjs/client/plugins/mutation.js +10 -6
- package/build/runtime-cjs/lib/index.d.ts +1 -0
- package/build/runtime-cjs/lib/index.js +1 -0
- package/build/runtime-cjs/lib/lru.d.ts +52 -0
- package/build/runtime-cjs/lib/lru.js +73 -0
- package/build/runtime-cjs/lib/types.d.ts +1 -0
- package/build/runtime-cjs/lib/types.js +7 -2
- package/build/runtime-esm/cache/cache.d.ts +5 -1
- package/build/runtime-esm/cache/cache.js +84 -27
- package/build/runtime-esm/cache/lists.d.ts +3 -3
- package/build/runtime-esm/cache/lists.js +20 -8
- package/build/runtime-esm/cache/storage.d.ts +8 -2
- package/build/runtime-esm/cache/storage.js +22 -5
- package/build/runtime-esm/cache/subscription.d.ts +1 -0
- package/build/runtime-esm/cache/subscription.js +3 -0
- package/build/runtime-esm/client/documentStore.d.ts +9 -2
- package/build/runtime-esm/client/documentStore.js +13 -9
- package/build/runtime-esm/client/index.d.ts +6 -3
- package/build/runtime-esm/client/index.js +6 -8
- package/build/runtime-esm/client/plugins/cache.js +3 -0
- package/build/runtime-esm/client/plugins/mutation.js +10 -6
- package/build/runtime-esm/lib/index.d.ts +1 -0
- package/build/runtime-esm/lib/index.js +1 -0
- package/build/runtime-esm/lib/lru.d.ts +52 -0
- package/build/runtime-esm/lib/lru.js +48 -0
- package/build/runtime-esm/lib/types.d.ts +1 -0
- package/build/runtime-esm/lib/types.js +5 -1
- package/build/test-cjs/index.js +181 -61
- package/build/test-esm/index.js +181 -61
- package/build/vite-cjs/index.js +200 -62
- package/build/vite-esm/index.js +200 -62
- package/package.json +1 -1
package/build/cmd-cjs/index.js
CHANGED
|
@@ -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
|
}
|
|
@@ -70293,10 +70300,10 @@ var ListManager = class {
|
|
|
70293
70300
|
this.lists.get(list.name).get(parentID).lists.push(handler);
|
|
70294
70301
|
this.listsByField.get(parentID).get(list.key).push(handler);
|
|
70295
70302
|
}
|
|
70296
|
-
removeIDFromAllLists(id) {
|
|
70303
|
+
removeIDFromAllLists(id, layer) {
|
|
70297
70304
|
for (const fieldMap of this.lists.values()) {
|
|
70298
70305
|
for (const list of fieldMap.values()) {
|
|
70299
|
-
list.removeID(id);
|
|
70306
|
+
list.removeID(id, void 0, layer);
|
|
70300
70307
|
}
|
|
70301
70308
|
}
|
|
70302
70309
|
}
|
|
@@ -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: [
|
|
70431
|
+
edges: [
|
|
70432
|
+
{
|
|
70433
|
+
__typename: listType + "Edge",
|
|
70434
|
+
node: {
|
|
70435
|
+
...data,
|
|
70436
|
+
__typename: listType
|
|
70437
|
+
}
|
|
70438
|
+
}
|
|
70439
|
+
]
|
|
70421
70440
|
}
|
|
70422
70441
|
};
|
|
70423
70442
|
} else {
|
|
@@ -70453,7 +70472,7 @@ var List = class {
|
|
|
70453
70472
|
layer: layer?.id
|
|
70454
70473
|
});
|
|
70455
70474
|
}
|
|
70456
|
-
removeID(id, variables = {}) {
|
|
70475
|
+
removeID(id, variables = {}, layer) {
|
|
70457
70476
|
if (!this.validateWhen()) {
|
|
70458
70477
|
return;
|
|
70459
70478
|
}
|
|
@@ -70500,7 +70519,7 @@ var List = class {
|
|
|
70500
70519
|
subscribers.map((sub) => sub[0]),
|
|
70501
70520
|
variables
|
|
70502
70521
|
);
|
|
70503
|
-
this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID);
|
|
70522
|
+
this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID, layer);
|
|
70504
70523
|
for (const [spec] of subscribers) {
|
|
70505
70524
|
spec.set(
|
|
70506
70525
|
this.cache._internal_unstable.getSelection({
|
|
@@ -70513,12 +70532,12 @@ var List = class {
|
|
|
70513
70532
|
}
|
|
70514
70533
|
return true;
|
|
70515
70534
|
}
|
|
70516
|
-
remove(data, variables = {}) {
|
|
70535
|
+
remove(data, variables = {}, layer) {
|
|
70517
70536
|
const targetID = this.cache._internal_unstable.id(this.listType(data), data);
|
|
70518
70537
|
if (!targetID) {
|
|
70519
70538
|
return;
|
|
70520
70539
|
}
|
|
70521
|
-
return this.removeID(targetID, variables);
|
|
70540
|
+
return this.removeID(targetID, variables, layer);
|
|
70522
70541
|
}
|
|
70523
70542
|
listType(data) {
|
|
70524
70543
|
return data.__typename || this.type;
|
|
@@ -70550,7 +70569,7 @@ var List = class {
|
|
|
70550
70569
|
layer,
|
|
70551
70570
|
where
|
|
70552
70571
|
}) {
|
|
70553
|
-
if (!this.remove(data, variables)) {
|
|
70572
|
+
if (!this.remove(data, variables, layer)) {
|
|
70554
70573
|
this.addToList(selection, data, variables, where, layer);
|
|
70555
70574
|
}
|
|
70556
70575
|
}
|
|
@@ -70687,7 +70706,7 @@ var StaleManager = class {
|
|
|
70687
70706
|
// src/runtime/cache/storage.ts
|
|
70688
70707
|
var InMemoryStorage = class {
|
|
70689
70708
|
data;
|
|
70690
|
-
idCount =
|
|
70709
|
+
idCount = 1;
|
|
70691
70710
|
rank = 0;
|
|
70692
70711
|
constructor() {
|
|
70693
70712
|
this.data = [];
|
|
@@ -70707,11 +70726,11 @@ var InMemoryStorage = class {
|
|
|
70707
70726
|
insert(id, field, location, target) {
|
|
70708
70727
|
return this.topLayer.insert(id, field, location, target);
|
|
70709
70728
|
}
|
|
70710
|
-
remove(id, field, target) {
|
|
70711
|
-
return
|
|
70729
|
+
remove(id, field, target, layerToUser = this.topLayer) {
|
|
70730
|
+
return layerToUser.remove(id, field, target);
|
|
70712
70731
|
}
|
|
70713
|
-
delete(id) {
|
|
70714
|
-
return
|
|
70732
|
+
delete(id, layerToUser = this.topLayer) {
|
|
70733
|
+
return layerToUser.delete(id);
|
|
70715
70734
|
}
|
|
70716
70735
|
deleteField(id, field) {
|
|
70717
70736
|
return this.topLayer.deleteField(id, field);
|
|
@@ -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;
|
|
@@ -71083,6 +71119,9 @@ var InMemorySubscriptions = class {
|
|
|
71083
71119
|
subscribers = {};
|
|
71084
71120
|
referenceCounts = {};
|
|
71085
71121
|
keyVersions = {};
|
|
71122
|
+
activeFields(parent2) {
|
|
71123
|
+
return Object.keys(this.subscribers[parent2] || {});
|
|
71124
|
+
}
|
|
71086
71125
|
add({
|
|
71087
71126
|
parent: parent2,
|
|
71088
71127
|
spec,
|
|
@@ -71351,20 +71390,7 @@ var Cache = class {
|
|
|
71351
71390
|
}) {
|
|
71352
71391
|
const layer = layerID ? this._internal_unstable.storage.getLayer(layerID) : this._internal_unstable.storage.topLayer;
|
|
71353
71392
|
const subscribers = this._internal_unstable.writeSelection({ ...args, layer }).map((sub) => sub[0]);
|
|
71354
|
-
|
|
71355
|
-
for (const spec of subscribers.concat(notifySubscribers)) {
|
|
71356
|
-
if (!notified.includes(spec.set)) {
|
|
71357
|
-
notified.push(spec.set);
|
|
71358
|
-
spec.set(
|
|
71359
|
-
this._internal_unstable.getSelection({
|
|
71360
|
-
parent: spec.parentID || rootID,
|
|
71361
|
-
selection: spec.selection,
|
|
71362
|
-
variables: spec.variables?.() || {},
|
|
71363
|
-
ignoreMasking: false
|
|
71364
|
-
}).data
|
|
71365
|
-
);
|
|
71366
|
-
}
|
|
71367
|
-
}
|
|
71393
|
+
this.#notifySubscribers(subscribers.concat(notifySubscribers));
|
|
71368
71394
|
return subscribers;
|
|
71369
71395
|
}
|
|
71370
71396
|
read(...args) {
|
|
@@ -71403,10 +71429,10 @@ var Cache = class {
|
|
|
71403
71429
|
}
|
|
71404
71430
|
return handler;
|
|
71405
71431
|
}
|
|
71406
|
-
delete(id) {
|
|
71432
|
+
delete(id, layer) {
|
|
71407
71433
|
this._internal_unstable.subscriptions.removeAllSubscribers(id);
|
|
71408
|
-
this._internal_unstable.lists.removeIDFromAllLists(id);
|
|
71409
|
-
this._internal_unstable.storage.delete(id);
|
|
71434
|
+
this._internal_unstable.lists.removeIDFromAllLists(id, layer);
|
|
71435
|
+
this._internal_unstable.storage.delete(id, layer);
|
|
71410
71436
|
}
|
|
71411
71437
|
setConfig(config2) {
|
|
71412
71438
|
this._internal_unstable.setConfig(config2);
|
|
@@ -71438,6 +71464,76 @@ var Cache = class {
|
|
|
71438
71464
|
config() {
|
|
71439
71465
|
return this._internal_unstable.config;
|
|
71440
71466
|
}
|
|
71467
|
+
serialize() {
|
|
71468
|
+
return this._internal_unstable.storage.serialize();
|
|
71469
|
+
}
|
|
71470
|
+
hydrate(...args) {
|
|
71471
|
+
return this._internal_unstable.storage.hydrate(...args);
|
|
71472
|
+
}
|
|
71473
|
+
clearLayer(layerID) {
|
|
71474
|
+
const layer = this._internal_unstable.storage.getLayer(layerID);
|
|
71475
|
+
if (!layer) {
|
|
71476
|
+
throw new Error("Cannot find layer with id: " + layerID);
|
|
71477
|
+
}
|
|
71478
|
+
const toNotify = [];
|
|
71479
|
+
const allFields = [];
|
|
71480
|
+
for (const target of [layer.fields, layer.links]) {
|
|
71481
|
+
for (const [id, fields] of Object.entries(target)) {
|
|
71482
|
+
allFields.push(
|
|
71483
|
+
...Object.entries(fields).map(([field, value]) => ({ id, field, value }))
|
|
71484
|
+
);
|
|
71485
|
+
}
|
|
71486
|
+
}
|
|
71487
|
+
const displayFields = [];
|
|
71488
|
+
for (const pair of allFields) {
|
|
71489
|
+
const { displayLayers } = this._internal_unstable.storage.get(pair.id, pair.field);
|
|
71490
|
+
if (!displayLayers.includes(layerID)) {
|
|
71491
|
+
continue;
|
|
71492
|
+
}
|
|
71493
|
+
displayFields.push(pair);
|
|
71494
|
+
}
|
|
71495
|
+
for (const [id, operation] of Object.entries(layer.operations)) {
|
|
71496
|
+
if (operation.deleted) {
|
|
71497
|
+
displayFields.push(
|
|
71498
|
+
...this._internal_unstable.subscriptions.activeFields(id).map((field) => ({ id, field }))
|
|
71499
|
+
);
|
|
71500
|
+
}
|
|
71501
|
+
const fields = Object.keys(operation.fields ?? {});
|
|
71502
|
+
if (fields.length > 0) {
|
|
71503
|
+
displayFields.push(...fields.map((field) => ({ id, field })));
|
|
71504
|
+
}
|
|
71505
|
+
}
|
|
71506
|
+
layer.clear();
|
|
71507
|
+
for (const display of displayFields) {
|
|
71508
|
+
const { field, id } = display;
|
|
71509
|
+
const notify = !("value" in display) || this._internal_unstable.storage.get(id, field).value !== display.value;
|
|
71510
|
+
if (notify) {
|
|
71511
|
+
toNotify.push(
|
|
71512
|
+
...this._internal_unstable.subscriptions.get(id, field).map((sub) => sub[0])
|
|
71513
|
+
);
|
|
71514
|
+
}
|
|
71515
|
+
}
|
|
71516
|
+
this.#notifySubscribers(toNotify);
|
|
71517
|
+
}
|
|
71518
|
+
#notifySubscribers(subs) {
|
|
71519
|
+
if (subs.length === 0) {
|
|
71520
|
+
return;
|
|
71521
|
+
}
|
|
71522
|
+
const notified = [];
|
|
71523
|
+
for (const spec of subs) {
|
|
71524
|
+
if (!notified.includes(spec.set)) {
|
|
71525
|
+
notified.push(spec.set);
|
|
71526
|
+
spec.set(
|
|
71527
|
+
this._internal_unstable.getSelection({
|
|
71528
|
+
parent: spec.parentID || rootID,
|
|
71529
|
+
selection: spec.selection,
|
|
71530
|
+
variables: spec.variables?.() || {},
|
|
71531
|
+
ignoreMasking: false
|
|
71532
|
+
}).data
|
|
71533
|
+
);
|
|
71534
|
+
}
|
|
71535
|
+
}
|
|
71536
|
+
}
|
|
71441
71537
|
};
|
|
71442
71538
|
var CacheInternal = class {
|
|
71443
71539
|
_disabled = false;
|
|
@@ -71725,8 +71821,16 @@ var CacheInternal = class {
|
|
|
71725
71821
|
operation.position || "last",
|
|
71726
71822
|
layer
|
|
71727
71823
|
);
|
|
71824
|
+
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
71825
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
|
|
71826
|
+
selection: fieldSelection,
|
|
71827
|
+
data: target,
|
|
71828
|
+
variables,
|
|
71829
|
+
where: operation.position || "last",
|
|
71830
|
+
layer
|
|
71831
|
+
});
|
|
71728
71832
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
71729
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
71833
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables, layer);
|
|
71730
71834
|
} else if (operation.action === "delete" && operation.type) {
|
|
71731
71835
|
if (typeof target !== "string") {
|
|
71732
71836
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -71735,15 +71839,7 @@ var CacheInternal = class {
|
|
|
71735
71839
|
if (!targetID) {
|
|
71736
71840
|
continue;
|
|
71737
71841
|
}
|
|
71738
|
-
this.cache.delete(targetID);
|
|
71739
|
-
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
71740
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
|
|
71741
|
-
selection: fieldSelection,
|
|
71742
|
-
data: target,
|
|
71743
|
-
variables,
|
|
71744
|
-
where: operation.position || "last",
|
|
71745
|
-
layer
|
|
71746
|
-
});
|
|
71842
|
+
this.cache.delete(targetID, layer);
|
|
71747
71843
|
}
|
|
71748
71844
|
}
|
|
71749
71845
|
}
|
|
@@ -72278,7 +72374,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
|
72278
72374
|
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
72279
72375
|
return {
|
|
72280
72376
|
async start(ctx, { next, marshalVariables }) {
|
|
72281
|
-
const
|
|
72377
|
+
const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
|
|
72282
72378
|
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
72283
72379
|
let toNotify = [];
|
|
72284
72380
|
if (optimisticResponse) {
|
|
@@ -72289,25 +72385,29 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
72289
72385
|
data: optimisticResponse
|
|
72290
72386
|
}),
|
|
72291
72387
|
variables: marshalVariables(ctx),
|
|
72292
|
-
layer:
|
|
72388
|
+
layer: layerOptimistic.id
|
|
72293
72389
|
});
|
|
72294
72390
|
}
|
|
72295
72391
|
ctx.cacheParams = {
|
|
72296
72392
|
...ctx.cacheParams,
|
|
72297
|
-
layer,
|
|
72393
|
+
layer: layerOptimistic,
|
|
72298
72394
|
notifySubscribers: toNotify,
|
|
72299
72395
|
forceNotify: true
|
|
72300
72396
|
};
|
|
72301
72397
|
next(ctx);
|
|
72302
72398
|
},
|
|
72303
72399
|
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
72304
|
-
ctx.cacheParams?.layer
|
|
72400
|
+
if (ctx.cacheParams?.layer) {
|
|
72401
|
+
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
72402
|
+
}
|
|
72305
72403
|
resolve2(ctx);
|
|
72306
72404
|
},
|
|
72307
72405
|
end(ctx, { resolve: resolve2, value }) {
|
|
72308
72406
|
const hasErrors = value.errors && value.errors.length > 0;
|
|
72309
72407
|
if (hasErrors) {
|
|
72310
|
-
ctx.cacheParams?.layer
|
|
72408
|
+
if (ctx.cacheParams?.layer) {
|
|
72409
|
+
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
72410
|
+
}
|
|
72311
72411
|
}
|
|
72312
72412
|
if (ctx.cacheParams?.layer) {
|
|
72313
72413
|
cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
@@ -72317,7 +72417,7 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
72317
72417
|
catch(ctx, { error }) {
|
|
72318
72418
|
if (ctx.cacheParams?.layer) {
|
|
72319
72419
|
const { layer } = ctx.cacheParams;
|
|
72320
|
-
layer.
|
|
72420
|
+
cache_default.clearLayer(layer.id);
|
|
72321
72421
|
cache_default._internal_unstable.storage.resolveLayer(layer.id);
|
|
72322
72422
|
}
|
|
72323
72423
|
throw error;
|
|
@@ -73330,7 +73430,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
73330
73430
|
}
|
|
73331
73431
|
|
|
73332
73432
|
// src/lib/parse.ts
|
|
73333
|
-
|
|
73433
|
+
function parseJS(str, config2) {
|
|
73334
73434
|
const defaultConfig = {
|
|
73335
73435
|
plugins: ["typescript", "importAssertions"],
|
|
73336
73436
|
sourceType: "module"
|
|
@@ -74799,7 +74899,7 @@ function operationObject({
|
|
|
74799
74899
|
if (operationKind === "insert" || operationKind === "toggle") {
|
|
74800
74900
|
operation.position = position;
|
|
74801
74901
|
}
|
|
74802
|
-
if (operationKind
|
|
74902
|
+
if (allLists && operationKind !== "delete") {
|
|
74803
74903
|
operation.target = "all";
|
|
74804
74904
|
}
|
|
74805
74905
|
if (parentID) {
|
|
@@ -76635,12 +76735,28 @@ ${exportStatement("config")}
|
|
|
76635
76735
|
},
|
|
76636
76736
|
[path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
|
|
76637
76737
|
}),
|
|
76638
|
-
...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map(
|
|
76738
|
+
...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map(
|
|
76739
|
+
(plugin2) => generatePluginRuntime({
|
|
76740
|
+
config: config2,
|
|
76741
|
+
docs,
|
|
76742
|
+
plugin: plugin2,
|
|
76743
|
+
importStatement,
|
|
76744
|
+
exportDefaultStatement: exportStatement,
|
|
76745
|
+
exportStarStatement: exportStar
|
|
76746
|
+
})
|
|
76747
|
+
),
|
|
76639
76748
|
generatePluginIndex({ config: config2, exportStatement: exportStar })
|
|
76640
76749
|
]);
|
|
76641
76750
|
await generateGraphqlReturnTypes(config2, docs);
|
|
76642
76751
|
}
|
|
76643
|
-
async function generatePluginRuntime(
|
|
76752
|
+
async function generatePluginRuntime({
|
|
76753
|
+
config: config2,
|
|
76754
|
+
docs,
|
|
76755
|
+
plugin: plugin2,
|
|
76756
|
+
importStatement,
|
|
76757
|
+
exportDefaultStatement,
|
|
76758
|
+
exportStarStatement
|
|
76759
|
+
}) {
|
|
76644
76760
|
if (houdini_mode.is_testing || !plugin2.includeRuntime) {
|
|
76645
76761
|
return;
|
|
76646
76762
|
}
|
|
@@ -76668,7 +76784,13 @@ async function generatePluginRuntime(config2, docs, plugin2) {
|
|
|
76668
76784
|
Object.fromEntries(
|
|
76669
76785
|
Object.entries(transformMap).map(([key, value]) => [
|
|
76670
76786
|
path_exports.join(runtime_path, key),
|
|
76671
|
-
(content) => value({
|
|
76787
|
+
(content) => value({
|
|
76788
|
+
config: config2,
|
|
76789
|
+
content,
|
|
76790
|
+
importStatement,
|
|
76791
|
+
exportDefaultStatement,
|
|
76792
|
+
exportStarStatement
|
|
76793
|
+
})
|
|
76672
76794
|
])
|
|
76673
76795
|
)
|
|
76674
76796
|
);
|
|
@@ -78536,14 +78658,12 @@ async function typeCheck(config2, docs) {
|
|
|
78536
78658
|
for (const targetType of targetTypes) {
|
|
78537
78659
|
const missingIDFields = config2.keyFieldsForType(targetType.name).filter((fieldName) => !targetType.getFields()[fieldName]);
|
|
78538
78660
|
if (missingIDFields.length > 0) {
|
|
78539
|
-
const message = `@${config2.listDirective} on ${logGreen(
|
|
78540
|
-
targetType.name
|
|
78541
|
-
)} as a configuration issue. Object identification missing: ${missingIDFields.map((c) => `"${logYellow(c)}"`).join(", ")}. Check 'Custom IDs' if needed.`;
|
|
78542
78661
|
errors.push(
|
|
78543
78662
|
new HoudiniError({
|
|
78544
78663
|
filepath: filename,
|
|
78545
|
-
message
|
|
78546
|
-
|
|
78664
|
+
message: `@${config2.listDirective} on ${logGreen(
|
|
78665
|
+
targetType.name
|
|
78666
|
+
)} 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`
|
|
78547
78667
|
})
|
|
78548
78668
|
);
|
|
78549
78669
|
return;
|
|
@@ -80054,8 +80174,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
80054
80174
|
}
|
|
80055
80175
|
packageJSON.devDependencies = {
|
|
80056
80176
|
...packageJSON.devDependencies,
|
|
80057
|
-
houdini: "^1.2.
|
|
80058
|
-
"houdini-svelte": "^1.2.
|
|
80177
|
+
houdini: "^1.2.4",
|
|
80178
|
+
"houdini-svelte": "^1.2.4"
|
|
80059
80179
|
};
|
|
80060
80180
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
80061
80181
|
}
|