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/vite-esm/index.js
CHANGED
|
@@ -65512,6 +65512,7 @@ __export(fs_exports, {
|
|
|
65512
65512
|
recursiveCopy: () => recursiveCopy,
|
|
65513
65513
|
remove: () => remove,
|
|
65514
65514
|
rmdir: () => rmdir,
|
|
65515
|
+
snapshot: () => snapshot,
|
|
65515
65516
|
stat: () => stat,
|
|
65516
65517
|
writeFile: () => writeFile
|
|
65517
65518
|
});
|
|
@@ -65706,16 +65707,17 @@ function existsSync(dirPath) {
|
|
|
65706
65707
|
}
|
|
65707
65708
|
return import_memfs.fs.existsSync(dirPath);
|
|
65708
65709
|
}
|
|
65709
|
-
async function readdir(filepath) {
|
|
65710
|
+
async function readdir(filepath, opts) {
|
|
65710
65711
|
if (!houdini_mode.is_testing) {
|
|
65711
|
-
return await fs.readdir(filepath);
|
|
65712
|
+
return await fs.readdir(filepath, opts);
|
|
65712
65713
|
}
|
|
65713
65714
|
if (filepath.includes("build/runtime")) {
|
|
65714
|
-
return await fs.readdir(filepath);
|
|
65715
|
+
return await fs.readdir(filepath, opts);
|
|
65715
65716
|
}
|
|
65716
65717
|
try {
|
|
65717
|
-
return import_memfs.fs.readdirSync(filepath);
|
|
65718
|
-
} catch {
|
|
65718
|
+
return import_memfs.fs.readdirSync(filepath, opts);
|
|
65719
|
+
} catch (e2) {
|
|
65720
|
+
console.log(e2);
|
|
65719
65721
|
return [];
|
|
65720
65722
|
}
|
|
65721
65723
|
}
|
|
@@ -65766,6 +65768,11 @@ async function recursiveCopy(source, target, transforms, notRoot) {
|
|
|
65766
65768
|
);
|
|
65767
65769
|
}
|
|
65768
65770
|
}
|
|
65771
|
+
function snapshot(base) {
|
|
65772
|
+
return Object.fromEntries(
|
|
65773
|
+
Object.entries(import_memfs.vol.toJSON()).filter(([key]) => !base || key.startsWith(base)).map(([key, value]) => [!base ? key : key.substring(base.length), value])
|
|
65774
|
+
);
|
|
65775
|
+
}
|
|
65769
65776
|
async function glob(pattern) {
|
|
65770
65777
|
return await promisify(import_glob.glob)(posixify(pattern));
|
|
65771
65778
|
}
|
|
@@ -67153,10 +67160,10 @@ var ListManager = class {
|
|
|
67153
67160
|
this.lists.get(list.name).get(parentID).lists.push(handler);
|
|
67154
67161
|
this.listsByField.get(parentID).get(list.key).push(handler);
|
|
67155
67162
|
}
|
|
67156
|
-
removeIDFromAllLists(id) {
|
|
67163
|
+
removeIDFromAllLists(id, layer) {
|
|
67157
67164
|
for (const fieldMap of this.lists.values()) {
|
|
67158
67165
|
for (const list of fieldMap.values()) {
|
|
67159
|
-
list.removeID(id);
|
|
67166
|
+
list.removeID(id, void 0, layer);
|
|
67160
67167
|
}
|
|
67161
67168
|
}
|
|
67162
67169
|
}
|
|
@@ -67253,6 +67260,10 @@ var List = class {
|
|
|
67253
67260
|
updates: ["append", "prepend"],
|
|
67254
67261
|
selection: {
|
|
67255
67262
|
fields: {
|
|
67263
|
+
__typename: {
|
|
67264
|
+
keyRaw: "__typename",
|
|
67265
|
+
type: "String"
|
|
67266
|
+
},
|
|
67256
67267
|
node: {
|
|
67257
67268
|
type: listType,
|
|
67258
67269
|
keyRaw: "node",
|
|
@@ -67277,7 +67288,15 @@ var List = class {
|
|
|
67277
67288
|
};
|
|
67278
67289
|
insertData = {
|
|
67279
67290
|
newEntry: {
|
|
67280
|
-
edges: [
|
|
67291
|
+
edges: [
|
|
67292
|
+
{
|
|
67293
|
+
__typename: listType + "Edge",
|
|
67294
|
+
node: {
|
|
67295
|
+
...data,
|
|
67296
|
+
__typename: listType
|
|
67297
|
+
}
|
|
67298
|
+
}
|
|
67299
|
+
]
|
|
67281
67300
|
}
|
|
67282
67301
|
};
|
|
67283
67302
|
} else {
|
|
@@ -67313,7 +67332,7 @@ var List = class {
|
|
|
67313
67332
|
layer: layer?.id
|
|
67314
67333
|
});
|
|
67315
67334
|
}
|
|
67316
|
-
removeID(id, variables = {}) {
|
|
67335
|
+
removeID(id, variables = {}, layer) {
|
|
67317
67336
|
if (!this.validateWhen()) {
|
|
67318
67337
|
return;
|
|
67319
67338
|
}
|
|
@@ -67360,7 +67379,7 @@ var List = class {
|
|
|
67360
67379
|
subscribers.map((sub) => sub[0]),
|
|
67361
67380
|
variables
|
|
67362
67381
|
);
|
|
67363
|
-
this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID);
|
|
67382
|
+
this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID, layer);
|
|
67364
67383
|
for (const [spec] of subscribers) {
|
|
67365
67384
|
spec.set(
|
|
67366
67385
|
this.cache._internal_unstable.getSelection({
|
|
@@ -67373,12 +67392,12 @@ var List = class {
|
|
|
67373
67392
|
}
|
|
67374
67393
|
return true;
|
|
67375
67394
|
}
|
|
67376
|
-
remove(data, variables = {}) {
|
|
67395
|
+
remove(data, variables = {}, layer) {
|
|
67377
67396
|
const targetID = this.cache._internal_unstable.id(this.listType(data), data);
|
|
67378
67397
|
if (!targetID) {
|
|
67379
67398
|
return;
|
|
67380
67399
|
}
|
|
67381
|
-
return this.removeID(targetID, variables);
|
|
67400
|
+
return this.removeID(targetID, variables, layer);
|
|
67382
67401
|
}
|
|
67383
67402
|
listType(data) {
|
|
67384
67403
|
return data.__typename || this.type;
|
|
@@ -67410,7 +67429,7 @@ var List = class {
|
|
|
67410
67429
|
layer,
|
|
67411
67430
|
where
|
|
67412
67431
|
}) {
|
|
67413
|
-
if (!this.remove(data, variables)) {
|
|
67432
|
+
if (!this.remove(data, variables, layer)) {
|
|
67414
67433
|
this.addToList(selection, data, variables, where, layer);
|
|
67415
67434
|
}
|
|
67416
67435
|
}
|
|
@@ -67547,7 +67566,7 @@ var StaleManager = class {
|
|
|
67547
67566
|
// src/runtime/cache/storage.ts
|
|
67548
67567
|
var InMemoryStorage = class {
|
|
67549
67568
|
data;
|
|
67550
|
-
idCount =
|
|
67569
|
+
idCount = 1;
|
|
67551
67570
|
rank = 0;
|
|
67552
67571
|
constructor() {
|
|
67553
67572
|
this.data = [];
|
|
@@ -67567,11 +67586,11 @@ var InMemoryStorage = class {
|
|
|
67567
67586
|
insert(id, field, location, target) {
|
|
67568
67587
|
return this.topLayer.insert(id, field, location, target);
|
|
67569
67588
|
}
|
|
67570
|
-
remove(id, field, target) {
|
|
67571
|
-
return
|
|
67589
|
+
remove(id, field, target, layerToUser = this.topLayer) {
|
|
67590
|
+
return layerToUser.remove(id, field, target);
|
|
67572
67591
|
}
|
|
67573
|
-
delete(id) {
|
|
67574
|
-
return
|
|
67592
|
+
delete(id, layerToUser = this.topLayer) {
|
|
67593
|
+
return layerToUser.delete(id);
|
|
67575
67594
|
}
|
|
67576
67595
|
deleteField(id, field) {
|
|
67577
67596
|
return this.topLayer.deleteField(id, field);
|
|
@@ -67705,6 +67724,23 @@ var InMemoryStorage = class {
|
|
|
67705
67724
|
}
|
|
67706
67725
|
return this.data[this.data.length - 1];
|
|
67707
67726
|
}
|
|
67727
|
+
serialize() {
|
|
67728
|
+
return JSON.stringify({
|
|
67729
|
+
rank: this.rank,
|
|
67730
|
+
fields: this.topLayer.fields,
|
|
67731
|
+
links: this.topLayer.links
|
|
67732
|
+
});
|
|
67733
|
+
}
|
|
67734
|
+
hydrate(args, layer) {
|
|
67735
|
+
if (!args) {
|
|
67736
|
+
return;
|
|
67737
|
+
}
|
|
67738
|
+
const { rank, fields, links } = args;
|
|
67739
|
+
this.rank = rank;
|
|
67740
|
+
layer ??= this.createLayer(true);
|
|
67741
|
+
layer.fields = fields;
|
|
67742
|
+
layer.links = links;
|
|
67743
|
+
}
|
|
67708
67744
|
};
|
|
67709
67745
|
var Layer = class {
|
|
67710
67746
|
id;
|
|
@@ -67943,6 +67979,9 @@ var InMemorySubscriptions = class {
|
|
|
67943
67979
|
subscribers = {};
|
|
67944
67980
|
referenceCounts = {};
|
|
67945
67981
|
keyVersions = {};
|
|
67982
|
+
activeFields(parent2) {
|
|
67983
|
+
return Object.keys(this.subscribers[parent2] || {});
|
|
67984
|
+
}
|
|
67946
67985
|
add({
|
|
67947
67986
|
parent: parent2,
|
|
67948
67987
|
spec,
|
|
@@ -68211,20 +68250,7 @@ var Cache = class {
|
|
|
68211
68250
|
}) {
|
|
68212
68251
|
const layer = layerID ? this._internal_unstable.storage.getLayer(layerID) : this._internal_unstable.storage.topLayer;
|
|
68213
68252
|
const subscribers = this._internal_unstable.writeSelection({ ...args, layer }).map((sub) => sub[0]);
|
|
68214
|
-
|
|
68215
|
-
for (const spec of subscribers.concat(notifySubscribers)) {
|
|
68216
|
-
if (!notified.includes(spec.set)) {
|
|
68217
|
-
notified.push(spec.set);
|
|
68218
|
-
spec.set(
|
|
68219
|
-
this._internal_unstable.getSelection({
|
|
68220
|
-
parent: spec.parentID || rootID,
|
|
68221
|
-
selection: spec.selection,
|
|
68222
|
-
variables: spec.variables?.() || {},
|
|
68223
|
-
ignoreMasking: false
|
|
68224
|
-
}).data
|
|
68225
|
-
);
|
|
68226
|
-
}
|
|
68227
|
-
}
|
|
68253
|
+
this.#notifySubscribers(subscribers.concat(notifySubscribers));
|
|
68228
68254
|
return subscribers;
|
|
68229
68255
|
}
|
|
68230
68256
|
read(...args) {
|
|
@@ -68263,10 +68289,10 @@ var Cache = class {
|
|
|
68263
68289
|
}
|
|
68264
68290
|
return handler;
|
|
68265
68291
|
}
|
|
68266
|
-
delete(id) {
|
|
68292
|
+
delete(id, layer) {
|
|
68267
68293
|
this._internal_unstable.subscriptions.removeAllSubscribers(id);
|
|
68268
|
-
this._internal_unstable.lists.removeIDFromAllLists(id);
|
|
68269
|
-
this._internal_unstable.storage.delete(id);
|
|
68294
|
+
this._internal_unstable.lists.removeIDFromAllLists(id, layer);
|
|
68295
|
+
this._internal_unstable.storage.delete(id, layer);
|
|
68270
68296
|
}
|
|
68271
68297
|
setConfig(config4) {
|
|
68272
68298
|
this._internal_unstable.setConfig(config4);
|
|
@@ -68298,6 +68324,76 @@ var Cache = class {
|
|
|
68298
68324
|
config() {
|
|
68299
68325
|
return this._internal_unstable.config;
|
|
68300
68326
|
}
|
|
68327
|
+
serialize() {
|
|
68328
|
+
return this._internal_unstable.storage.serialize();
|
|
68329
|
+
}
|
|
68330
|
+
hydrate(...args) {
|
|
68331
|
+
return this._internal_unstable.storage.hydrate(...args);
|
|
68332
|
+
}
|
|
68333
|
+
clearLayer(layerID) {
|
|
68334
|
+
const layer = this._internal_unstable.storage.getLayer(layerID);
|
|
68335
|
+
if (!layer) {
|
|
68336
|
+
throw new Error("Cannot find layer with id: " + layerID);
|
|
68337
|
+
}
|
|
68338
|
+
const toNotify = [];
|
|
68339
|
+
const allFields = [];
|
|
68340
|
+
for (const target of [layer.fields, layer.links]) {
|
|
68341
|
+
for (const [id, fields] of Object.entries(target)) {
|
|
68342
|
+
allFields.push(
|
|
68343
|
+
...Object.entries(fields).map(([field, value]) => ({ id, field, value }))
|
|
68344
|
+
);
|
|
68345
|
+
}
|
|
68346
|
+
}
|
|
68347
|
+
const displayFields = [];
|
|
68348
|
+
for (const pair of allFields) {
|
|
68349
|
+
const { displayLayers } = this._internal_unstable.storage.get(pair.id, pair.field);
|
|
68350
|
+
if (!displayLayers.includes(layerID)) {
|
|
68351
|
+
continue;
|
|
68352
|
+
}
|
|
68353
|
+
displayFields.push(pair);
|
|
68354
|
+
}
|
|
68355
|
+
for (const [id, operation] of Object.entries(layer.operations)) {
|
|
68356
|
+
if (operation.deleted) {
|
|
68357
|
+
displayFields.push(
|
|
68358
|
+
...this._internal_unstable.subscriptions.activeFields(id).map((field) => ({ id, field }))
|
|
68359
|
+
);
|
|
68360
|
+
}
|
|
68361
|
+
const fields = Object.keys(operation.fields ?? {});
|
|
68362
|
+
if (fields.length > 0) {
|
|
68363
|
+
displayFields.push(...fields.map((field) => ({ id, field })));
|
|
68364
|
+
}
|
|
68365
|
+
}
|
|
68366
|
+
layer.clear();
|
|
68367
|
+
for (const display of displayFields) {
|
|
68368
|
+
const { field, id } = display;
|
|
68369
|
+
const notify = !("value" in display) || this._internal_unstable.storage.get(id, field).value !== display.value;
|
|
68370
|
+
if (notify) {
|
|
68371
|
+
toNotify.push(
|
|
68372
|
+
...this._internal_unstable.subscriptions.get(id, field).map((sub) => sub[0])
|
|
68373
|
+
);
|
|
68374
|
+
}
|
|
68375
|
+
}
|
|
68376
|
+
this.#notifySubscribers(toNotify);
|
|
68377
|
+
}
|
|
68378
|
+
#notifySubscribers(subs) {
|
|
68379
|
+
if (subs.length === 0) {
|
|
68380
|
+
return;
|
|
68381
|
+
}
|
|
68382
|
+
const notified = [];
|
|
68383
|
+
for (const spec of subs) {
|
|
68384
|
+
if (!notified.includes(spec.set)) {
|
|
68385
|
+
notified.push(spec.set);
|
|
68386
|
+
spec.set(
|
|
68387
|
+
this._internal_unstable.getSelection({
|
|
68388
|
+
parent: spec.parentID || rootID,
|
|
68389
|
+
selection: spec.selection,
|
|
68390
|
+
variables: spec.variables?.() || {},
|
|
68391
|
+
ignoreMasking: false
|
|
68392
|
+
}).data
|
|
68393
|
+
);
|
|
68394
|
+
}
|
|
68395
|
+
}
|
|
68396
|
+
}
|
|
68301
68397
|
};
|
|
68302
68398
|
var CacheInternal = class {
|
|
68303
68399
|
_disabled = false;
|
|
@@ -68585,8 +68681,16 @@ var CacheInternal = class {
|
|
|
68585
68681
|
operation.position || "last",
|
|
68586
68682
|
layer
|
|
68587
68683
|
);
|
|
68684
|
+
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
68685
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
|
|
68686
|
+
selection: fieldSelection,
|
|
68687
|
+
data: target,
|
|
68688
|
+
variables,
|
|
68689
|
+
where: operation.position || "last",
|
|
68690
|
+
layer
|
|
68691
|
+
});
|
|
68588
68692
|
} else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
|
|
68589
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
68693
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables, layer);
|
|
68590
68694
|
} else if (operation.action === "delete" && operation.type) {
|
|
68591
68695
|
if (typeof target !== "string") {
|
|
68592
68696
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -68595,15 +68699,7 @@ var CacheInternal = class {
|
|
|
68595
68699
|
if (!targetID) {
|
|
68596
68700
|
continue;
|
|
68597
68701
|
}
|
|
68598
|
-
this.cache.delete(targetID);
|
|
68599
|
-
} else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
|
|
68600
|
-
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement({
|
|
68601
|
-
selection: fieldSelection,
|
|
68602
|
-
data: target,
|
|
68603
|
-
variables,
|
|
68604
|
-
where: operation.position || "last",
|
|
68605
|
-
layer
|
|
68606
|
-
});
|
|
68702
|
+
this.cache.delete(targetID, layer);
|
|
68607
68703
|
}
|
|
68608
68704
|
}
|
|
68609
68705
|
}
|
|
@@ -69138,7 +69234,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
|
69138
69234
|
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
69139
69235
|
return {
|
|
69140
69236
|
async start(ctx, { next, marshalVariables }) {
|
|
69141
|
-
const
|
|
69237
|
+
const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
|
|
69142
69238
|
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
69143
69239
|
let toNotify = [];
|
|
69144
69240
|
if (optimisticResponse) {
|
|
@@ -69149,25 +69245,29 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
69149
69245
|
data: optimisticResponse
|
|
69150
69246
|
}),
|
|
69151
69247
|
variables: marshalVariables(ctx),
|
|
69152
|
-
layer:
|
|
69248
|
+
layer: layerOptimistic.id
|
|
69153
69249
|
});
|
|
69154
69250
|
}
|
|
69155
69251
|
ctx.cacheParams = {
|
|
69156
69252
|
...ctx.cacheParams,
|
|
69157
|
-
layer,
|
|
69253
|
+
layer: layerOptimistic,
|
|
69158
69254
|
notifySubscribers: toNotify,
|
|
69159
69255
|
forceNotify: true
|
|
69160
69256
|
};
|
|
69161
69257
|
next(ctx);
|
|
69162
69258
|
},
|
|
69163
69259
|
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
69164
|
-
ctx.cacheParams?.layer
|
|
69260
|
+
if (ctx.cacheParams?.layer) {
|
|
69261
|
+
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
69262
|
+
}
|
|
69165
69263
|
resolve2(ctx);
|
|
69166
69264
|
},
|
|
69167
69265
|
end(ctx, { resolve: resolve2, value }) {
|
|
69168
69266
|
const hasErrors = value.errors && value.errors.length > 0;
|
|
69169
69267
|
if (hasErrors) {
|
|
69170
|
-
ctx.cacheParams?.layer
|
|
69268
|
+
if (ctx.cacheParams?.layer) {
|
|
69269
|
+
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
69270
|
+
}
|
|
69171
69271
|
}
|
|
69172
69272
|
if (ctx.cacheParams?.layer) {
|
|
69173
69273
|
cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
@@ -69177,7 +69277,7 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
69177
69277
|
catch(ctx, { error }) {
|
|
69178
69278
|
if (ctx.cacheParams?.layer) {
|
|
69179
69279
|
const { layer } = ctx.cacheParams;
|
|
69180
|
-
layer.
|
|
69280
|
+
cache_default.clearLayer(layer.id);
|
|
69181
69281
|
cache_default._internal_unstable.storage.resolveLayer(layer.id);
|
|
69182
69282
|
}
|
|
69183
69283
|
throw error;
|
|
@@ -70189,7 +70289,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
70189
70289
|
}
|
|
70190
70290
|
|
|
70191
70291
|
// src/lib/parse.ts
|
|
70192
|
-
|
|
70292
|
+
function parseJS(str, config4) {
|
|
70193
70293
|
const defaultConfig = {
|
|
70194
70294
|
plugins: ["typescript", "importAssertions"],
|
|
70195
70295
|
sourceType: "module"
|
|
@@ -71600,7 +71700,7 @@ function operationObject({
|
|
|
71600
71700
|
if (operationKind === "insert" || operationKind === "toggle") {
|
|
71601
71701
|
operation.position = position;
|
|
71602
71702
|
}
|
|
71603
|
-
if (operationKind
|
|
71703
|
+
if (allLists && operationKind !== "delete") {
|
|
71604
71704
|
operation.target = "all";
|
|
71605
71705
|
}
|
|
71606
71706
|
if (parentID) {
|
|
@@ -73442,12 +73542,28 @@ ${exportStatement("config")}
|
|
|
73442
73542
|
},
|
|
73443
73543
|
[path_exports.join(config4.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config4, content, importStatement, exportStatement })
|
|
73444
73544
|
}),
|
|
73445
|
-
...config4.plugins.filter((plugin2) => plugin2.includeRuntime).map(
|
|
73545
|
+
...config4.plugins.filter((plugin2) => plugin2.includeRuntime).map(
|
|
73546
|
+
(plugin2) => generatePluginRuntime({
|
|
73547
|
+
config: config4,
|
|
73548
|
+
docs,
|
|
73549
|
+
plugin: plugin2,
|
|
73550
|
+
importStatement,
|
|
73551
|
+
exportDefaultStatement: exportStatement,
|
|
73552
|
+
exportStarStatement: exportStar
|
|
73553
|
+
})
|
|
73554
|
+
),
|
|
73446
73555
|
generatePluginIndex({ config: config4, exportStatement: exportStar })
|
|
73447
73556
|
]);
|
|
73448
73557
|
await generateGraphqlReturnTypes(config4, docs);
|
|
73449
73558
|
}
|
|
73450
|
-
async function generatePluginRuntime(
|
|
73559
|
+
async function generatePluginRuntime({
|
|
73560
|
+
config: config4,
|
|
73561
|
+
docs,
|
|
73562
|
+
plugin: plugin2,
|
|
73563
|
+
importStatement,
|
|
73564
|
+
exportDefaultStatement,
|
|
73565
|
+
exportStarStatement
|
|
73566
|
+
}) {
|
|
73451
73567
|
if (houdini_mode.is_testing || !plugin2.includeRuntime) {
|
|
73452
73568
|
return;
|
|
73453
73569
|
}
|
|
@@ -73475,7 +73591,13 @@ async function generatePluginRuntime(config4, docs, plugin2) {
|
|
|
73475
73591
|
Object.fromEntries(
|
|
73476
73592
|
Object.entries(transformMap).map(([key, value]) => [
|
|
73477
73593
|
path_exports.join(runtime_path, key),
|
|
73478
|
-
(content) => value({
|
|
73594
|
+
(content) => value({
|
|
73595
|
+
config: config4,
|
|
73596
|
+
content,
|
|
73597
|
+
importStatement,
|
|
73598
|
+
exportDefaultStatement,
|
|
73599
|
+
exportStarStatement
|
|
73600
|
+
})
|
|
73479
73601
|
])
|
|
73480
73602
|
)
|
|
73481
73603
|
);
|
|
@@ -75343,14 +75465,12 @@ async function typeCheck(config4, docs) {
|
|
|
75343
75465
|
for (const targetType of targetTypes) {
|
|
75344
75466
|
const missingIDFields = config4.keyFieldsForType(targetType.name).filter((fieldName) => !targetType.getFields()[fieldName]);
|
|
75345
75467
|
if (missingIDFields.length > 0) {
|
|
75346
|
-
const message = `@${config4.listDirective} on ${logGreen2(
|
|
75347
|
-
targetType.name
|
|
75348
|
-
)} as a configuration issue. Object identification missing: ${missingIDFields.map((c) => `"${logYellow2(c)}"`).join(", ")}. Check 'Custom IDs' if needed.`;
|
|
75349
75468
|
errors.push(
|
|
75350
75469
|
new HoudiniError({
|
|
75351
75470
|
filepath: filename,
|
|
75352
|
-
message
|
|
75353
|
-
|
|
75471
|
+
message: `@${config4.listDirective} on ${logGreen2(
|
|
75472
|
+
targetType.name
|
|
75473
|
+
)} 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`
|
|
75354
75474
|
})
|
|
75355
75475
|
);
|
|
75356
75476
|
return;
|
|
@@ -76437,7 +76557,7 @@ function Plugin(opts = {}) {
|
|
|
76437
76557
|
enforce: "pre",
|
|
76438
76558
|
async config(viteConfig) {
|
|
76439
76559
|
config3 = await getConfig(opts);
|
|
76440
|
-
|
|
76560
|
+
let result = {
|
|
76441
76561
|
server: {
|
|
76442
76562
|
...viteConfig.server,
|
|
76443
76563
|
fs: {
|
|
@@ -76446,6 +76566,13 @@ function Plugin(opts = {}) {
|
|
|
76446
76566
|
}
|
|
76447
76567
|
}
|
|
76448
76568
|
};
|
|
76569
|
+
for (const plugin2 of config3.plugins) {
|
|
76570
|
+
if (typeof plugin2.vite?.config !== "function") {
|
|
76571
|
+
continue;
|
|
76572
|
+
}
|
|
76573
|
+
result = deepMerge2("", result, plugin2.vite.config.call(this, config3));
|
|
76574
|
+
}
|
|
76575
|
+
return result;
|
|
76449
76576
|
},
|
|
76450
76577
|
async buildStart() {
|
|
76451
76578
|
try {
|
|
@@ -76454,6 +76581,17 @@ function Plugin(opts = {}) {
|
|
|
76454
76581
|
formatErrors(e2);
|
|
76455
76582
|
}
|
|
76456
76583
|
},
|
|
76584
|
+
configureServer(server) {
|
|
76585
|
+
for (const plugin2 of config3.plugins) {
|
|
76586
|
+
if (typeof plugin2.vite?.configureServer !== "function") {
|
|
76587
|
+
continue;
|
|
76588
|
+
}
|
|
76589
|
+
const result = plugin2.vite.configureServer.call(this, {
|
|
76590
|
+
...server,
|
|
76591
|
+
houdiniConfig: config3
|
|
76592
|
+
});
|
|
76593
|
+
}
|
|
76594
|
+
},
|
|
76457
76595
|
async transform(code, filepath) {
|
|
76458
76596
|
filepath = path_exports.posixify(filepath);
|
|
76459
76597
|
if (filepath.startsWith("/src/")) {
|