houdini-svelte 0.17.8 → 0.17.10
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/README.md +33 -0
- package/build/plugin-cjs/index.js +58 -40
- package/build/plugin-esm/index.js +58 -40
- package/build/preprocess-cjs/index.js +52 -24
- package/build/preprocess-esm/index.js +52 -24
- package/build/runtime/adapter.d.ts +1 -7
- package/build/runtime/session.d.ts +1 -1
- package/build/runtime-cjs/adapter.d.ts +1 -7
- package/build/runtime-cjs/adapter.js +2 -6
- package/build/runtime-cjs/session.d.ts +1 -1
- package/build/runtime-esm/adapter.d.ts +1 -7
- package/build/runtime-esm/adapter.js +2 -5
- package/build/runtime-esm/session.d.ts +1 -1
- package/build/test-cjs/index.js +201 -88
- package/build/test-esm/index.js +201 -88
- package/package.json +20 -3
- package/.turbo/turbo-compile.log +0 -5
- package/.turbo/turbo-typedefs.log +0 -5
- package/CHANGELOG.md +0 -70
- package/src/plugin/codegen/components/index.ts +0 -149
- package/src/plugin/codegen/index.ts +0 -26
- package/src/plugin/codegen/routes/index.ts +0 -324
- package/src/plugin/codegen/routes/kit.test.ts +0 -534
- package/src/plugin/codegen/stores/custom.ts +0 -22
- package/src/plugin/codegen/stores/fragment.test.ts +0 -62
- package/src/plugin/codegen/stores/fragment.ts +0 -86
- package/src/plugin/codegen/stores/index.ts +0 -55
- package/src/plugin/codegen/stores/mutation.test.ts +0 -56
- package/src/plugin/codegen/stores/mutation.ts +0 -58
- package/src/plugin/codegen/stores/query.test.ts +0 -504
- package/src/plugin/codegen/stores/query.ts +0 -98
- package/src/plugin/codegen/stores/subscription.test.ts +0 -60
- package/src/plugin/codegen/stores/subscription.ts +0 -61
- package/src/plugin/extract.test.ts +0 -290
- package/src/plugin/extract.ts +0 -127
- package/src/plugin/extractLoadFunction.test.ts +0 -247
- package/src/plugin/extractLoadFunction.ts +0 -249
- package/src/plugin/fsPatch.ts +0 -246
- package/src/plugin/index.ts +0 -210
- package/src/plugin/kit.ts +0 -408
- package/src/plugin/transforms/index.ts +0 -90
- package/src/plugin/transforms/kit/index.ts +0 -20
- package/src/plugin/transforms/kit/init.test.ts +0 -28
- package/src/plugin/transforms/kit/init.ts +0 -75
- package/src/plugin/transforms/kit/load.test.ts +0 -1279
- package/src/plugin/transforms/kit/load.ts +0 -516
- package/src/plugin/transforms/kit/session.test.ts +0 -268
- package/src/plugin/transforms/kit/session.ts +0 -161
- package/src/plugin/transforms/query.test.ts +0 -99
- package/src/plugin/transforms/query.ts +0 -263
- package/src/plugin/transforms/reactive.ts +0 -126
- package/src/plugin/transforms/tags.ts +0 -20
- package/src/plugin/transforms/types.ts +0 -9
- package/src/plugin/validate.test.ts +0 -95
- package/src/plugin/validate.ts +0 -50
- package/src/preprocess/index.ts +0 -33
- package/src/runtime/adapter.ts +0 -21
- package/src/runtime/fragments.ts +0 -86
- package/src/runtime/index.ts +0 -95
- package/src/runtime/network.ts +0 -6
- package/src/runtime/session.ts +0 -187
- package/src/runtime/stores/fragment.ts +0 -48
- package/src/runtime/stores/index.ts +0 -5
- package/src/runtime/stores/mutation.ts +0 -190
- package/src/runtime/stores/pagination/cursor.ts +0 -260
- package/src/runtime/stores/pagination/fetch.ts +0 -7
- package/src/runtime/stores/pagination/fragment.ts +0 -236
- package/src/runtime/stores/pagination/index.ts +0 -7
- package/src/runtime/stores/pagination/offset.ts +0 -157
- package/src/runtime/stores/pagination/pageInfo.test.ts +0 -39
- package/src/runtime/stores/pagination/pageInfo.ts +0 -67
- package/src/runtime/stores/pagination/query.ts +0 -132
- package/src/runtime/stores/query.ts +0 -521
- package/src/runtime/stores/store.ts +0 -13
- package/src/runtime/stores/subscription.ts +0 -107
- package/src/runtime/types.ts +0 -40
- package/src/test/index.ts +0 -208
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img alt="houdini" height="200" src="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assets/houdini-v5.png" />
|
|
3
|
+
<br />
|
|
4
|
+
<br />
|
|
5
|
+
<strong>
|
|
6
|
+
The disappearing GraphQL clients.
|
|
7
|
+
</strong>
|
|
8
|
+
<br />
|
|
9
|
+
<br />
|
|
10
|
+
<a href="https://npmjs.org/package/houdini">
|
|
11
|
+
<img src="https://img.shields.io/npm/v/houdini.svg" alt="version" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://github.com/HoudiniGraphql/houdini/actions">
|
|
14
|
+
<img src="https://github.com/HoudiniGraphql/houdini/actions/workflows/tests.yml/badge.svg" alt="CI Tests" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://github.com/HoudiniGraphql/houdini">
|
|
17
|
+
<img src="https://img.shields.io/github/stars/HoudiniGraphql/houdini.svg?label=stars" alt="github stars" />
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://npmjs.org/package/houdini">
|
|
20
|
+
<img src="https://img.shields.io/npm/dm/houdini.svg" alt="downloads" />
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://github.com/HoudiniGraphql/houdini/blob/main/LICENSE">
|
|
23
|
+
<img src="https://img.shields.io/github/license/HoudiniGraphql/houdini.svg?maxAge=2592000" alt="license" />
|
|
24
|
+
</a>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
----
|
|
28
|
+
|
|
29
|
+
At its core, houdini seeks to enable a high quality developer experience
|
|
30
|
+
without compromising bundle size. Like Svelte, houdini shifts what is
|
|
31
|
+
traditionally handled by a bloated runtime into a compile step that allows
|
|
32
|
+
for the generation of an incredibly lean GraphQL abstraction for your application.
|
|
33
|
+
See more at <a href="https://www.houdinigraphql.com">HoudiniGraphQL.com</a> 🚀
|
|
@@ -30803,10 +30803,10 @@ var require_main5 = __commonJS({
|
|
|
30803
30803
|
}
|
|
30804
30804
|
});
|
|
30805
30805
|
|
|
30806
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30806
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js
|
|
30807
30807
|
var HttpError, Redirect, ValidationError;
|
|
30808
30808
|
var init_control = __esm({
|
|
30809
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30809
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js"() {
|
|
30810
30810
|
HttpError = class {
|
|
30811
30811
|
constructor(status, body) {
|
|
30812
30812
|
this.status = status;
|
|
@@ -30837,7 +30837,7 @@ var init_control = __esm({
|
|
|
30837
30837
|
}
|
|
30838
30838
|
});
|
|
30839
30839
|
|
|
30840
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30840
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js
|
|
30841
30841
|
var exports_exports = {};
|
|
30842
30842
|
__export(exports_exports, {
|
|
30843
30843
|
error: () => error2,
|
|
@@ -30849,7 +30849,7 @@ function error2(status, message) {
|
|
|
30849
30849
|
return new HttpError(status, message);
|
|
30850
30850
|
}
|
|
30851
30851
|
function redirect(status, location) {
|
|
30852
|
-
if (isNaN(status) || status < 300 || status >
|
|
30852
|
+
if (isNaN(status) || status < 300 || status > 308) {
|
|
30853
30853
|
throw new Error("Invalid status code");
|
|
30854
30854
|
}
|
|
30855
30855
|
return new Redirect(status, location);
|
|
@@ -30868,7 +30868,7 @@ function invalid(status, data2) {
|
|
|
30868
30868
|
return new ValidationError(status, data2);
|
|
30869
30869
|
}
|
|
30870
30870
|
var init_exports = __esm({
|
|
30871
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30871
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js"() {
|
|
30872
30872
|
init_control();
|
|
30873
30873
|
}
|
|
30874
30874
|
});
|
|
@@ -88584,22 +88584,31 @@ var ListManager = class {
|
|
|
88584
88584
|
}
|
|
88585
88585
|
lists = /* @__PURE__ */ new Map();
|
|
88586
88586
|
listsByField = /* @__PURE__ */ new Map();
|
|
88587
|
-
get(listName, id2) {
|
|
88587
|
+
get(listName, id2, allLists) {
|
|
88588
88588
|
const matches2 = this.lists.get(listName);
|
|
88589
88589
|
if (!matches2 || matches2.size === 0) {
|
|
88590
88590
|
return null;
|
|
88591
88591
|
}
|
|
88592
|
+
if (allLists) {
|
|
88593
|
+
return new ListCollection(
|
|
88594
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
88595
|
+
);
|
|
88596
|
+
}
|
|
88592
88597
|
const head = [...matches2.values()][0];
|
|
88598
|
+
const { recordType } = head.lists[0];
|
|
88599
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
88593
88600
|
if (matches2?.size === 1) {
|
|
88594
|
-
|
|
88601
|
+
if (!id2) {
|
|
88602
|
+
return head;
|
|
88603
|
+
}
|
|
88604
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
88595
88605
|
}
|
|
88596
88606
|
if (!id2) {
|
|
88597
|
-
|
|
88598
|
-
`Found multiple instances of "${listName}". Please provide
|
|
88607
|
+
console.error(
|
|
88608
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
88599
88609
|
);
|
|
88610
|
+
return null;
|
|
88600
88611
|
}
|
|
88601
|
-
const { recordType } = head.lists[0];
|
|
88602
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
88603
88612
|
return this.lists.get(listName)?.get(parentID);
|
|
88604
88613
|
}
|
|
88605
88614
|
remove(listName, id2) {
|
|
@@ -89539,8 +89548,8 @@ var Cache2 = class {
|
|
|
89539
89548
|
variables
|
|
89540
89549
|
);
|
|
89541
89550
|
}
|
|
89542
|
-
list(name2, parentID) {
|
|
89543
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
89551
|
+
list(name2, parentID, allLists) {
|
|
89552
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
89544
89553
|
if (!handler) {
|
|
89545
89554
|
throw new Error(
|
|
89546
89555
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -89807,15 +89816,15 @@ var CacheInternal = class {
|
|
|
89807
89816
|
parentID = id2;
|
|
89808
89817
|
}
|
|
89809
89818
|
}
|
|
89810
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
89819
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
89811
89820
|
continue;
|
|
89812
89821
|
}
|
|
89813
89822
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
89814
89823
|
for (const target of targets) {
|
|
89815
89824
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
89816
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
89825
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
89817
89826
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
89818
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
89827
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
89819
89828
|
} else if (operation.action === "delete" && operation.type) {
|
|
89820
89829
|
if (typeof target !== "string") {
|
|
89821
89830
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -89826,7 +89835,7 @@ var CacheInternal = class {
|
|
|
89826
89835
|
}
|
|
89827
89836
|
this.cache.delete(targetID);
|
|
89828
89837
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
89829
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
89838
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
89830
89839
|
}
|
|
89831
89840
|
}
|
|
89832
89841
|
}
|
|
@@ -151647,22 +151656,31 @@ var ListManager2 = class {
|
|
|
151647
151656
|
}
|
|
151648
151657
|
lists = /* @__PURE__ */ new Map();
|
|
151649
151658
|
listsByField = /* @__PURE__ */ new Map();
|
|
151650
|
-
get(listName, id2) {
|
|
151659
|
+
get(listName, id2, allLists) {
|
|
151651
151660
|
const matches2 = this.lists.get(listName);
|
|
151652
151661
|
if (!matches2 || matches2.size === 0) {
|
|
151653
151662
|
return null;
|
|
151654
151663
|
}
|
|
151664
|
+
if (allLists) {
|
|
151665
|
+
return new ListCollection2(
|
|
151666
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
151667
|
+
);
|
|
151668
|
+
}
|
|
151655
151669
|
const head = [...matches2.values()][0];
|
|
151670
|
+
const { recordType } = head.lists[0];
|
|
151671
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
151656
151672
|
if (matches2?.size === 1) {
|
|
151657
|
-
|
|
151673
|
+
if (!id2) {
|
|
151674
|
+
return head;
|
|
151675
|
+
}
|
|
151676
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
151658
151677
|
}
|
|
151659
151678
|
if (!id2) {
|
|
151660
|
-
|
|
151661
|
-
`Found multiple instances of "${listName}". Please provide
|
|
151679
|
+
console.error(
|
|
151680
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
151662
151681
|
);
|
|
151682
|
+
return null;
|
|
151663
151683
|
}
|
|
151664
|
-
const { recordType } = head.lists[0];
|
|
151665
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
151666
151684
|
return this.lists.get(listName)?.get(parentID);
|
|
151667
151685
|
}
|
|
151668
151686
|
remove(listName, id2) {
|
|
@@ -152602,8 +152620,8 @@ var Cache22 = class {
|
|
|
152602
152620
|
variables
|
|
152603
152621
|
);
|
|
152604
152622
|
}
|
|
152605
|
-
list(name2, parentID) {
|
|
152606
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
152623
|
+
list(name2, parentID, allLists) {
|
|
152624
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
152607
152625
|
if (!handler) {
|
|
152608
152626
|
throw new Error(
|
|
152609
152627
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -152870,15 +152888,15 @@ var CacheInternal2 = class {
|
|
|
152870
152888
|
parentID = id2;
|
|
152871
152889
|
}
|
|
152872
152890
|
}
|
|
152873
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
152891
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
152874
152892
|
continue;
|
|
152875
152893
|
}
|
|
152876
152894
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
152877
152895
|
for (const target of targets) {
|
|
152878
152896
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
152879
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
152897
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
152880
152898
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
152881
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
152899
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
152882
152900
|
} else if (operation.action === "delete" && operation.type) {
|
|
152883
152901
|
if (typeof target !== "string") {
|
|
152884
152902
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -152889,7 +152907,7 @@ var CacheInternal2 = class {
|
|
|
152889
152907
|
}
|
|
152890
152908
|
this.cache.delete(targetID);
|
|
152891
152909
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
152892
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
152910
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
152893
152911
|
}
|
|
152894
152912
|
}
|
|
152895
152913
|
}
|
|
@@ -179503,6 +179521,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179503
179521
|
let layoutExports = [];
|
|
179504
179522
|
let pageQueries = [];
|
|
179505
179523
|
let layoutQueries = [];
|
|
179524
|
+
let validRoute = false;
|
|
179506
179525
|
for (const child of await fs_exports.readdir(dirpath)) {
|
|
179507
179526
|
const childPath = path_exports.join(dirpath, child);
|
|
179508
179527
|
if ((await fs_exports.stat(childPath)).isDirectory()) {
|
|
@@ -179510,18 +179529,21 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179510
179529
|
continue;
|
|
179511
179530
|
}
|
|
179512
179531
|
if (is_layout_script(framework2, childPath)) {
|
|
179532
|
+
validRoute = true;
|
|
179513
179533
|
const { houdini_load, exports } = await extract_load_function(config2, childPath);
|
|
179514
179534
|
await visitor.layoutQueries?.(houdini_load ?? [], childPath);
|
|
179515
179535
|
layoutQueries.push(...houdini_load ?? []);
|
|
179516
179536
|
await visitor.layoutExports?.(exports, childPath);
|
|
179517
179537
|
layoutExports.push(...exports);
|
|
179518
179538
|
} else if (is_page_script(framework2, childPath)) {
|
|
179539
|
+
validRoute = true;
|
|
179519
179540
|
const { houdini_load, exports } = await extract_load_function(config2, childPath);
|
|
179520
179541
|
await visitor.pageQueries?.(houdini_load ?? [], childPath);
|
|
179521
179542
|
pageQueries.push(...houdini_load ?? []);
|
|
179522
179543
|
await visitor.pageExports?.(exports, childPath);
|
|
179523
179544
|
pageExports.push(...exports);
|
|
179524
179545
|
} else if (is_layout_component(framework2, childPath)) {
|
|
179546
|
+
validRoute = true;
|
|
179525
179547
|
const contents = await fs_exports.readFile(childPath);
|
|
179526
179548
|
if (!contents) {
|
|
179527
179549
|
continue;
|
|
@@ -179545,6 +179567,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179545
179567
|
}
|
|
179546
179568
|
});
|
|
179547
179569
|
} else if (is_component(config2, framework2, child)) {
|
|
179570
|
+
validRoute = true;
|
|
179548
179571
|
const contents = await fs_exports.readFile(childPath);
|
|
179549
179572
|
if (!contents) {
|
|
179550
179573
|
continue;
|
|
@@ -179568,6 +179591,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179568
179591
|
}
|
|
179569
179592
|
});
|
|
179570
179593
|
} else if (child === plugin_config(config2).layoutQueryFilename) {
|
|
179594
|
+
validRoute = true;
|
|
179571
179595
|
const contents = await fs_exports.readFile(childPath);
|
|
179572
179596
|
if (!contents) {
|
|
179573
179597
|
continue;
|
|
@@ -179580,6 +179604,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179580
179604
|
throw routeQueryError(childPath);
|
|
179581
179605
|
}
|
|
179582
179606
|
} else if (child === plugin_config(config2).pageQueryFilename) {
|
|
179607
|
+
validRoute = true;
|
|
179583
179608
|
const contents = await fs_exports.readFile(childPath);
|
|
179584
179609
|
if (!contents) {
|
|
179585
179610
|
continue;
|
|
@@ -179595,7 +179620,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179595
179620
|
continue;
|
|
179596
179621
|
}
|
|
179597
179622
|
}
|
|
179598
|
-
if (visitor.route &&
|
|
179623
|
+
if (visitor.route && validRoute) {
|
|
179599
179624
|
const relative_path_regex = /src(.*)/;
|
|
179600
179625
|
const svelteTypeFilePath = path_exports.join(
|
|
179601
179626
|
config2.projectRoot,
|
|
@@ -180318,10 +180343,10 @@ import_fs.default.readdirSync = function(filepath, options) {
|
|
|
180318
180343
|
function contains2(...names2) {
|
|
180319
180344
|
return names2.some((name2) => file_names.includes(name2));
|
|
180320
180345
|
}
|
|
180321
|
-
if (contains2("+page.svelte") && !contains2("+page.js", "+page.ts", "+page.server.js", "+page.server.ts")) {
|
|
180346
|
+
if (contains2("+page.svelte", "+page.gql") && !contains2("+page.js", "+page.ts", "+page.server.js", "+page.server.ts")) {
|
|
180322
180347
|
result.push(virtual_file("+page.js", options));
|
|
180323
180348
|
}
|
|
180324
|
-
if (contains2("+layout.svelte") && !contains2("+layout.ts", "+layout.js")) {
|
|
180349
|
+
if (contains2("+layout.svelte", "+layout.gql") && !contains2("+layout.ts", "+layout.js")) {
|
|
180325
180350
|
result.push(virtual_file("+layout.js", options));
|
|
180326
180351
|
}
|
|
180327
180352
|
const posix_filepath = path_exports.posixify(filepath.toString());
|
|
@@ -181375,16 +181400,9 @@ var HoudiniSveltePlugin = async () => ({
|
|
|
181375
181400
|
return content.replace("HOUDINI_CLIENT_PATH", relativePath);
|
|
181376
181401
|
},
|
|
181377
181402
|
"adapter.js": ({ content }) => {
|
|
181378
|
-
const sveltekit_adapter = `import {
|
|
181379
|
-
import { get } from 'svelte/store';
|
|
181380
|
-
import { browser, prerendering } from '$app/environment'
|
|
181381
|
-
import { page } from '$app/stores'
|
|
181403
|
+
const sveltekit_adapter = `import { browser, prerendering } from '$app/environment'
|
|
181382
181404
|
import { error as svelteKitError } from '@sveltejs/kit'
|
|
181383
181405
|
|
|
181384
|
-
export function goTo(location, options) {
|
|
181385
|
-
go(location, options)
|
|
181386
|
-
}
|
|
181387
|
-
|
|
181388
181406
|
export const isBrowser = browser
|
|
181389
181407
|
|
|
181390
181408
|
export let clientStarted = false;
|
|
@@ -30808,10 +30808,10 @@ var require_main5 = __commonJS({
|
|
|
30808
30808
|
}
|
|
30809
30809
|
});
|
|
30810
30810
|
|
|
30811
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30811
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js
|
|
30812
30812
|
var HttpError, Redirect, ValidationError;
|
|
30813
30813
|
var init_control = __esm({
|
|
30814
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30814
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js"() {
|
|
30815
30815
|
HttpError = class {
|
|
30816
30816
|
constructor(status, body) {
|
|
30817
30817
|
this.status = status;
|
|
@@ -30842,7 +30842,7 @@ var init_control = __esm({
|
|
|
30842
30842
|
}
|
|
30843
30843
|
});
|
|
30844
30844
|
|
|
30845
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30845
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js
|
|
30846
30846
|
var exports_exports = {};
|
|
30847
30847
|
__export(exports_exports, {
|
|
30848
30848
|
error: () => error2,
|
|
@@ -30854,7 +30854,7 @@ function error2(status, message) {
|
|
|
30854
30854
|
return new HttpError(status, message);
|
|
30855
30855
|
}
|
|
30856
30856
|
function redirect(status, location) {
|
|
30857
|
-
if (isNaN(status) || status < 300 || status >
|
|
30857
|
+
if (isNaN(status) || status < 300 || status > 308) {
|
|
30858
30858
|
throw new Error("Invalid status code");
|
|
30859
30859
|
}
|
|
30860
30860
|
return new Redirect(status, location);
|
|
@@ -30873,7 +30873,7 @@ function invalid(status, data2) {
|
|
|
30873
30873
|
return new ValidationError(status, data2);
|
|
30874
30874
|
}
|
|
30875
30875
|
var init_exports = __esm({
|
|
30876
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30876
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js"() {
|
|
30877
30877
|
init_control();
|
|
30878
30878
|
}
|
|
30879
30879
|
});
|
|
@@ -88581,22 +88581,31 @@ var ListManager = class {
|
|
|
88581
88581
|
}
|
|
88582
88582
|
lists = /* @__PURE__ */ new Map();
|
|
88583
88583
|
listsByField = /* @__PURE__ */ new Map();
|
|
88584
|
-
get(listName, id2) {
|
|
88584
|
+
get(listName, id2, allLists) {
|
|
88585
88585
|
const matches2 = this.lists.get(listName);
|
|
88586
88586
|
if (!matches2 || matches2.size === 0) {
|
|
88587
88587
|
return null;
|
|
88588
88588
|
}
|
|
88589
|
+
if (allLists) {
|
|
88590
|
+
return new ListCollection(
|
|
88591
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
88592
|
+
);
|
|
88593
|
+
}
|
|
88589
88594
|
const head = [...matches2.values()][0];
|
|
88595
|
+
const { recordType } = head.lists[0];
|
|
88596
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
88590
88597
|
if (matches2?.size === 1) {
|
|
88591
|
-
|
|
88598
|
+
if (!id2) {
|
|
88599
|
+
return head;
|
|
88600
|
+
}
|
|
88601
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
88592
88602
|
}
|
|
88593
88603
|
if (!id2) {
|
|
88594
|
-
|
|
88595
|
-
`Found multiple instances of "${listName}". Please provide
|
|
88604
|
+
console.error(
|
|
88605
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
88596
88606
|
);
|
|
88607
|
+
return null;
|
|
88597
88608
|
}
|
|
88598
|
-
const { recordType } = head.lists[0];
|
|
88599
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
88600
88609
|
return this.lists.get(listName)?.get(parentID);
|
|
88601
88610
|
}
|
|
88602
88611
|
remove(listName, id2) {
|
|
@@ -89536,8 +89545,8 @@ var Cache2 = class {
|
|
|
89536
89545
|
variables
|
|
89537
89546
|
);
|
|
89538
89547
|
}
|
|
89539
|
-
list(name2, parentID) {
|
|
89540
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
89548
|
+
list(name2, parentID, allLists) {
|
|
89549
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
89541
89550
|
if (!handler) {
|
|
89542
89551
|
throw new Error(
|
|
89543
89552
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -89804,15 +89813,15 @@ var CacheInternal = class {
|
|
|
89804
89813
|
parentID = id2;
|
|
89805
89814
|
}
|
|
89806
89815
|
}
|
|
89807
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
89816
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
89808
89817
|
continue;
|
|
89809
89818
|
}
|
|
89810
89819
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
89811
89820
|
for (const target of targets) {
|
|
89812
89821
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
89813
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
89822
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
89814
89823
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
89815
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
89824
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
89816
89825
|
} else if (operation.action === "delete" && operation.type) {
|
|
89817
89826
|
if (typeof target !== "string") {
|
|
89818
89827
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -89823,7 +89832,7 @@ var CacheInternal = class {
|
|
|
89823
89832
|
}
|
|
89824
89833
|
this.cache.delete(targetID);
|
|
89825
89834
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
89826
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
89835
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
89827
89836
|
}
|
|
89828
89837
|
}
|
|
89829
89838
|
}
|
|
@@ -151643,22 +151652,31 @@ var ListManager2 = class {
|
|
|
151643
151652
|
}
|
|
151644
151653
|
lists = /* @__PURE__ */ new Map();
|
|
151645
151654
|
listsByField = /* @__PURE__ */ new Map();
|
|
151646
|
-
get(listName, id2) {
|
|
151655
|
+
get(listName, id2, allLists) {
|
|
151647
151656
|
const matches2 = this.lists.get(listName);
|
|
151648
151657
|
if (!matches2 || matches2.size === 0) {
|
|
151649
151658
|
return null;
|
|
151650
151659
|
}
|
|
151660
|
+
if (allLists) {
|
|
151661
|
+
return new ListCollection2(
|
|
151662
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
151663
|
+
);
|
|
151664
|
+
}
|
|
151651
151665
|
const head = [...matches2.values()][0];
|
|
151666
|
+
const { recordType } = head.lists[0];
|
|
151667
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
151652
151668
|
if (matches2?.size === 1) {
|
|
151653
|
-
|
|
151669
|
+
if (!id2) {
|
|
151670
|
+
return head;
|
|
151671
|
+
}
|
|
151672
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
151654
151673
|
}
|
|
151655
151674
|
if (!id2) {
|
|
151656
|
-
|
|
151657
|
-
`Found multiple instances of "${listName}". Please provide
|
|
151675
|
+
console.error(
|
|
151676
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
151658
151677
|
);
|
|
151678
|
+
return null;
|
|
151659
151679
|
}
|
|
151660
|
-
const { recordType } = head.lists[0];
|
|
151661
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
151662
151680
|
return this.lists.get(listName)?.get(parentID);
|
|
151663
151681
|
}
|
|
151664
151682
|
remove(listName, id2) {
|
|
@@ -152598,8 +152616,8 @@ var Cache22 = class {
|
|
|
152598
152616
|
variables
|
|
152599
152617
|
);
|
|
152600
152618
|
}
|
|
152601
|
-
list(name2, parentID) {
|
|
152602
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
152619
|
+
list(name2, parentID, allLists) {
|
|
152620
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
152603
152621
|
if (!handler) {
|
|
152604
152622
|
throw new Error(
|
|
152605
152623
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -152866,15 +152884,15 @@ var CacheInternal2 = class {
|
|
|
152866
152884
|
parentID = id2;
|
|
152867
152885
|
}
|
|
152868
152886
|
}
|
|
152869
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
152887
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
152870
152888
|
continue;
|
|
152871
152889
|
}
|
|
152872
152890
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
152873
152891
|
for (const target of targets) {
|
|
152874
152892
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
152875
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
152893
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
152876
152894
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
152877
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
152895
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
152878
152896
|
} else if (operation.action === "delete" && operation.type) {
|
|
152879
152897
|
if (typeof target !== "string") {
|
|
152880
152898
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -152885,7 +152903,7 @@ var CacheInternal2 = class {
|
|
|
152885
152903
|
}
|
|
152886
152904
|
this.cache.delete(targetID);
|
|
152887
152905
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
152888
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
152906
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
152889
152907
|
}
|
|
152890
152908
|
}
|
|
152891
152909
|
}
|
|
@@ -179499,6 +179517,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179499
179517
|
let layoutExports = [];
|
|
179500
179518
|
let pageQueries = [];
|
|
179501
179519
|
let layoutQueries = [];
|
|
179520
|
+
let validRoute = false;
|
|
179502
179521
|
for (const child of await fs_exports.readdir(dirpath)) {
|
|
179503
179522
|
const childPath = path_exports.join(dirpath, child);
|
|
179504
179523
|
if ((await fs_exports.stat(childPath)).isDirectory()) {
|
|
@@ -179506,18 +179525,21 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179506
179525
|
continue;
|
|
179507
179526
|
}
|
|
179508
179527
|
if (is_layout_script(framework2, childPath)) {
|
|
179528
|
+
validRoute = true;
|
|
179509
179529
|
const { houdini_load, exports } = await extract_load_function(config2, childPath);
|
|
179510
179530
|
await visitor.layoutQueries?.(houdini_load ?? [], childPath);
|
|
179511
179531
|
layoutQueries.push(...houdini_load ?? []);
|
|
179512
179532
|
await visitor.layoutExports?.(exports, childPath);
|
|
179513
179533
|
layoutExports.push(...exports);
|
|
179514
179534
|
} else if (is_page_script(framework2, childPath)) {
|
|
179535
|
+
validRoute = true;
|
|
179515
179536
|
const { houdini_load, exports } = await extract_load_function(config2, childPath);
|
|
179516
179537
|
await visitor.pageQueries?.(houdini_load ?? [], childPath);
|
|
179517
179538
|
pageQueries.push(...houdini_load ?? []);
|
|
179518
179539
|
await visitor.pageExports?.(exports, childPath);
|
|
179519
179540
|
pageExports.push(...exports);
|
|
179520
179541
|
} else if (is_layout_component(framework2, childPath)) {
|
|
179542
|
+
validRoute = true;
|
|
179521
179543
|
const contents = await fs_exports.readFile(childPath);
|
|
179522
179544
|
if (!contents) {
|
|
179523
179545
|
continue;
|
|
@@ -179541,6 +179563,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179541
179563
|
}
|
|
179542
179564
|
});
|
|
179543
179565
|
} else if (is_component(config2, framework2, child)) {
|
|
179566
|
+
validRoute = true;
|
|
179544
179567
|
const contents = await fs_exports.readFile(childPath);
|
|
179545
179568
|
if (!contents) {
|
|
179546
179569
|
continue;
|
|
@@ -179564,6 +179587,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179564
179587
|
}
|
|
179565
179588
|
});
|
|
179566
179589
|
} else if (child === plugin_config(config2).layoutQueryFilename) {
|
|
179590
|
+
validRoute = true;
|
|
179567
179591
|
const contents = await fs_exports.readFile(childPath);
|
|
179568
179592
|
if (!contents) {
|
|
179569
179593
|
continue;
|
|
@@ -179576,6 +179600,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179576
179600
|
throw routeQueryError(childPath);
|
|
179577
179601
|
}
|
|
179578
179602
|
} else if (child === plugin_config(config2).pageQueryFilename) {
|
|
179603
|
+
validRoute = true;
|
|
179579
179604
|
const contents = await fs_exports.readFile(childPath);
|
|
179580
179605
|
if (!contents) {
|
|
179581
179606
|
continue;
|
|
@@ -179591,7 +179616,7 @@ async function walk_routes(config2, framework2, visitor, dirpath = config2.route
|
|
|
179591
179616
|
continue;
|
|
179592
179617
|
}
|
|
179593
179618
|
}
|
|
179594
|
-
if (visitor.route &&
|
|
179619
|
+
if (visitor.route && validRoute) {
|
|
179595
179620
|
const relative_path_regex = /src(.*)/;
|
|
179596
179621
|
const svelteTypeFilePath = path_exports.join(
|
|
179597
179622
|
config2.projectRoot,
|
|
@@ -180314,10 +180339,10 @@ filesystem.readdirSync = function(filepath, options) {
|
|
|
180314
180339
|
function contains2(...names2) {
|
|
180315
180340
|
return names2.some((name2) => file_names.includes(name2));
|
|
180316
180341
|
}
|
|
180317
|
-
if (contains2("+page.svelte") && !contains2("+page.js", "+page.ts", "+page.server.js", "+page.server.ts")) {
|
|
180342
|
+
if (contains2("+page.svelte", "+page.gql") && !contains2("+page.js", "+page.ts", "+page.server.js", "+page.server.ts")) {
|
|
180318
180343
|
result.push(virtual_file("+page.js", options));
|
|
180319
180344
|
}
|
|
180320
|
-
if (contains2("+layout.svelte") && !contains2("+layout.ts", "+layout.js")) {
|
|
180345
|
+
if (contains2("+layout.svelte", "+layout.gql") && !contains2("+layout.ts", "+layout.js")) {
|
|
180321
180346
|
result.push(virtual_file("+layout.js", options));
|
|
180322
180347
|
}
|
|
180323
180348
|
const posix_filepath = path_exports.posixify(filepath.toString());
|
|
@@ -181371,16 +181396,9 @@ var HoudiniSveltePlugin = async () => ({
|
|
|
181371
181396
|
return content.replace("HOUDINI_CLIENT_PATH", relativePath);
|
|
181372
181397
|
},
|
|
181373
181398
|
"adapter.js": ({ content }) => {
|
|
181374
|
-
const sveltekit_adapter = `import {
|
|
181375
|
-
import { get } from 'svelte/store';
|
|
181376
|
-
import { browser, prerendering } from '$app/environment'
|
|
181377
|
-
import { page } from '$app/stores'
|
|
181399
|
+
const sveltekit_adapter = `import { browser, prerendering } from '$app/environment'
|
|
181378
181400
|
import { error as svelteKitError } from '@sveltejs/kit'
|
|
181379
181401
|
|
|
181380
|
-
export function goTo(location, options) {
|
|
181381
|
-
go(location, options)
|
|
181382
|
-
}
|
|
181383
|
-
|
|
181384
181402
|
export const isBrowser = browser
|
|
181385
181403
|
|
|
181386
181404
|
export let clientStarted = false;
|