houdini-svelte 1.0.0-next.5 → 1.0.0-next.6
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/plugin/artifactData.d.ts +2 -2
- package/build/plugin/codegen/stores/fragment.d.ts +2 -2
- package/build/plugin/codegen/stores/mutation.d.ts +2 -2
- package/build/plugin/codegen/stores/query.d.ts +2 -2
- package/build/plugin/codegen/stores/subscription.d.ts +2 -2
- package/build/plugin/kit.d.ts +1 -1
- package/build/plugin/naming.d.ts +1 -1
- package/build/plugin/validate.d.ts +2 -2
- package/build/plugin-cjs/index.js +40 -40
- package/build/plugin-esm/index.js +40 -40
- package/build/preprocess-cjs/index.js +6 -6
- package/build/preprocess-esm/index.js +6 -6
- package/build/test/index.d.ts +3 -3
- package/build/test-cjs/index.js +167 -158
- package/build/test-esm/index.js +167 -158
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Document, Config } from 'houdini';
|
|
2
2
|
export type PluginArtifactData = {
|
|
3
3
|
isManualLoad?: boolean;
|
|
4
4
|
};
|
|
5
5
|
export declare function artifactData({ config, document, }: {
|
|
6
6
|
config: Config;
|
|
7
|
-
document:
|
|
7
|
+
document: Document;
|
|
8
8
|
}): PluginArtifactData;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function fragmentStore({ config,
|
|
1
|
+
import type { Document, GenerateHookInput } from 'houdini';
|
|
2
|
+
export declare function fragmentStore({ config, pluginRoot }: GenerateHookInput, doc: Document): Promise<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function mutationStore({ config,
|
|
1
|
+
import type { Document, GenerateHookInput } from 'houdini';
|
|
2
|
+
export declare function mutationStore({ config, pluginRoot }: GenerateHookInput, doc: Document): Promise<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function queryStore({ config,
|
|
1
|
+
import type { Document, GenerateHookInput } from 'houdini';
|
|
2
|
+
export declare function queryStore({ config, pluginRoot }: GenerateHookInput, doc: Document): Promise<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function subscriptionStore({ config,
|
|
1
|
+
import type { Document, GenerateHookInput } from 'houdini';
|
|
2
|
+
export declare function subscriptionStore({ config, pluginRoot }: GenerateHookInput, doc: Document): Promise<string>;
|
package/build/plugin/kit.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export type HoudiniRouteScript = {
|
|
|
45
45
|
};
|
|
46
46
|
export declare function route_page_path(config: Config, filename: string): string;
|
|
47
47
|
export declare function stores_directory_name(): string;
|
|
48
|
-
export declare function stores_directory(
|
|
48
|
+
export declare function stores_directory(pluginRoot: string): string;
|
|
49
49
|
export declare function type_route_dir(config: Config): string;
|
|
50
50
|
export declare function store_import_path({ config, name }: {
|
|
51
51
|
config: Config;
|
package/build/plugin/naming.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const query_variable_fn: (name: string) => string;
|
|
2
2
|
export declare const houdini_load_fn = "_houdini_load";
|
|
3
3
|
export declare const houdini_before_load_fn = "_houdini_beforeLoad";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const houdini_afterLoad_fn = "_houdini_afterLoad";
|
|
5
5
|
export declare const houdini_on_error_fn = "_houdini_onError";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Config,
|
|
1
|
+
import type { Config, Document } from 'houdini';
|
|
2
2
|
export default function validateDocuments({ config, documents, }: {
|
|
3
3
|
config: Config;
|
|
4
|
-
documents:
|
|
4
|
+
documents: Document[];
|
|
5
5
|
}): Promise<void>;
|
|
@@ -30977,10 +30977,10 @@ var require_main5 = __commonJS({
|
|
|
30977
30977
|
}
|
|
30978
30978
|
});
|
|
30979
30979
|
|
|
30980
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.
|
|
30980
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.4/node_modules/@sveltejs/kit/src/runtime/control.js
|
|
30981
30981
|
var HttpError, Redirect, ActionFailure;
|
|
30982
30982
|
var init_control = __esm({
|
|
30983
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.
|
|
30983
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.4/node_modules/@sveltejs/kit/src/runtime/control.js"() {
|
|
30984
30984
|
HttpError = class {
|
|
30985
30985
|
constructor(status, body) {
|
|
30986
30986
|
this.status = status;
|
|
@@ -31020,7 +31020,7 @@ var init_prod_ssr = __esm({
|
|
|
31020
31020
|
}
|
|
31021
31021
|
});
|
|
31022
31022
|
|
|
31023
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.
|
|
31023
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.4/node_modules/@sveltejs/kit/src/exports/index.js
|
|
31024
31024
|
var exports_exports = {};
|
|
31025
31025
|
__export(exports_exports, {
|
|
31026
31026
|
error: () => error2,
|
|
@@ -31058,7 +31058,7 @@ function invalid() {
|
|
|
31058
31058
|
throw new Error("invalid(...) is now fail(...)");
|
|
31059
31059
|
}
|
|
31060
31060
|
var init_exports = __esm({
|
|
31061
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.
|
|
31061
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.4/node_modules/@sveltejs/kit/src/exports/index.js"() {
|
|
31062
31062
|
init_control();
|
|
31063
31063
|
init_prod_ssr();
|
|
31064
31064
|
}
|
|
@@ -181451,7 +181451,7 @@ var query_variable_fn = (name) => {
|
|
|
181451
181451
|
};
|
|
181452
181452
|
var houdini_load_fn = "_houdini_load";
|
|
181453
181453
|
var houdini_before_load_fn = "_houdini_beforeLoad";
|
|
181454
|
-
var
|
|
181454
|
+
var houdini_afterLoad_fn = "_houdini_afterLoad";
|
|
181455
181455
|
var houdini_on_error_fn = "_houdini_onError";
|
|
181456
181456
|
|
|
181457
181457
|
// src/plugin/extractLoadFunction.ts
|
|
@@ -181820,8 +181820,8 @@ function route_page_path(config4, filename) {
|
|
|
181820
181820
|
function stores_directory_name() {
|
|
181821
181821
|
return "stores";
|
|
181822
181822
|
}
|
|
181823
|
-
function stores_directory(
|
|
181824
|
-
return path_exports.join(
|
|
181823
|
+
function stores_directory(pluginRoot) {
|
|
181824
|
+
return path_exports.join(pluginRoot, stores_directory_name());
|
|
181825
181825
|
}
|
|
181826
181826
|
function type_route_dir(config4) {
|
|
181827
181827
|
return path_exports.join(config4.typeRootDir, "src", "routes");
|
|
@@ -182189,10 +182189,10 @@ async function svelteKitGenerator(framework2, { config: config4 }) {
|
|
|
182189
182189
|
uniqueLayoutQueries
|
|
182190
182190
|
);
|
|
182191
182191
|
const beforePageLoad = pageExports.includes(houdini_before_load_fn);
|
|
182192
|
-
const afterPageLoad = pageExports.includes(
|
|
182192
|
+
const afterPageLoad = pageExports.includes(houdini_afterLoad_fn);
|
|
182193
182193
|
const onPageError = pageExports.includes(houdini_on_error_fn);
|
|
182194
182194
|
const beforeLayoutLoad = layoutExports.includes(houdini_before_load_fn);
|
|
182195
|
-
const afterLayoutLoad = layoutExports.includes(
|
|
182195
|
+
const afterLayoutLoad = layoutExports.includes(houdini_afterLoad_fn);
|
|
182196
182196
|
const onLayoutError = layoutExports.includes(houdini_on_error_fn);
|
|
182197
182197
|
const layout_append_VariablesFunction = append_VariablesFunction(
|
|
182198
182198
|
"Layout",
|
|
@@ -182328,7 +182328,7 @@ type LoadInput = { ${queries.filter((query) => query.variableDefinitions?.length
|
|
|
182328
182328
|
}
|
|
182329
182329
|
function append_afterLoad(afterLoad, type, queries) {
|
|
182330
182330
|
return afterLoad ? `
|
|
182331
|
-
type AfterLoadReturn = Awaited<ReturnType<typeof import('./+${type.toLowerCase()}').${
|
|
182331
|
+
type AfterLoadReturn = Awaited<ReturnType<typeof import('./+${type.toLowerCase()}').${houdini_afterLoad_fn}>>;
|
|
182332
182332
|
type AfterLoadData = {
|
|
182333
182333
|
${internal_append_afterLoad(queries)}
|
|
182334
182334
|
};
|
|
@@ -182375,7 +182375,7 @@ function store_import2(cfg, which) {
|
|
|
182375
182375
|
}
|
|
182376
182376
|
|
|
182377
182377
|
// src/plugin/codegen/stores/fragment.ts
|
|
182378
|
-
async function fragmentStore({ config: config4,
|
|
182378
|
+
async function fragmentStore({ config: config4, pluginRoot }, doc) {
|
|
182379
182379
|
const fileName = doc.name;
|
|
182380
182380
|
const artifactName = `${doc.name}`;
|
|
182381
182381
|
const storeName = store_name({ config: config4, name: doc.name });
|
|
@@ -182419,14 +182419,14 @@ export declare class ${storeName} extends ${store_class}<${_data}, {}> {
|
|
|
182419
182419
|
export declare const load_${artifactName}: (params: QueryStoreFetchParams<${_data}, {}>) => Promise<${storeName}>
|
|
182420
182420
|
`;
|
|
182421
182421
|
await Promise.all([
|
|
182422
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182423
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182422
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.d.ts`), typeDefs),
|
|
182423
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.js`), storeContent)
|
|
182424
182424
|
]);
|
|
182425
182425
|
return fileName;
|
|
182426
182426
|
}
|
|
182427
182427
|
|
|
182428
182428
|
// src/plugin/codegen/stores/mutation.ts
|
|
182429
|
-
async function mutationStore({ config: config4,
|
|
182429
|
+
async function mutationStore({ config: config4, pluginRoot }, doc) {
|
|
182430
182430
|
const fileName = doc.name;
|
|
182431
182431
|
const storeName = store_name({ config: config4, name: doc.name });
|
|
182432
182432
|
const artifactName = `${doc.name}`;
|
|
@@ -182455,19 +182455,19 @@ export declare class ${storeName} extends ${store_class}<${_data}, ${_input}, ${
|
|
|
182455
182455
|
}
|
|
182456
182456
|
`;
|
|
182457
182457
|
await Promise.all([
|
|
182458
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182459
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182458
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.js`), storeData),
|
|
182459
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.d.ts`), typeDefs)
|
|
182460
182460
|
]);
|
|
182461
182461
|
return fileName;
|
|
182462
182462
|
}
|
|
182463
182463
|
|
|
182464
182464
|
// src/plugin/codegen/stores/query.ts
|
|
182465
|
-
async function queryStore({ config: config4,
|
|
182465
|
+
async function queryStore({ config: config4, pluginRoot }, doc) {
|
|
182466
182466
|
const fileName = doc.name;
|
|
182467
182467
|
const artifactName = `${doc.name}`;
|
|
182468
182468
|
const storeName = store_name({ config: config4, name: doc.name });
|
|
182469
182469
|
let variables = false;
|
|
182470
|
-
const operation = doc.
|
|
182470
|
+
const operation = doc.originalParsed.definitions.find(
|
|
182471
182471
|
(defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
|
|
182472
182472
|
);
|
|
182473
182473
|
if (operation) {
|
|
@@ -182580,14 +182580,14 @@ export declare class ${storeName} extends ${store_class}<${_data}, ${_input}> {
|
|
|
182580
182580
|
export declare const load_${artifactName}: (params: QueryStoreFetchParams<${_data}, ${_input}>) => Promise<{${artifactName}: ${storeName}}>
|
|
182581
182581
|
`;
|
|
182582
182582
|
await Promise.all([
|
|
182583
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182584
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182583
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.js`), storeData),
|
|
182584
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.d.ts`), typeDefs)
|
|
182585
182585
|
]);
|
|
182586
182586
|
return fileName;
|
|
182587
182587
|
}
|
|
182588
182588
|
|
|
182589
182589
|
// src/plugin/codegen/stores/subscription.ts
|
|
182590
|
-
async function subscriptionStore({ config: config4,
|
|
182590
|
+
async function subscriptionStore({ config: config4, pluginRoot }, doc) {
|
|
182591
182591
|
const fileName = doc.name;
|
|
182592
182592
|
const storeName = store_name({ config: config4, name: doc.name });
|
|
182593
182593
|
const artifactName = `${doc.name}`;
|
|
@@ -182615,8 +182615,8 @@ export declare class ${storeName} extends ${store_class}<${_data} | undefined, $
|
|
|
182615
182615
|
}
|
|
182616
182616
|
`;
|
|
182617
182617
|
await Promise.all([
|
|
182618
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182619
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182618
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.d.ts`), typeDefs),
|
|
182619
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.js`), storeContent)
|
|
182620
182620
|
]);
|
|
182621
182621
|
return fileName;
|
|
182622
182622
|
}
|
|
@@ -182644,7 +182644,7 @@ async function storesGenerator(input) {
|
|
|
182644
182644
|
const listOfStoresOrdered = listOfStores.filter((c2) => c2 !== null).sort((a, b) => (a + "").localeCompare(b + ""));
|
|
182645
182645
|
const dataIndex = listOfStoresOrdered.map((c2) => `export * from './${c2}'`).join(`
|
|
182646
182646
|
`);
|
|
182647
|
-
await fs_exports.writeFile(path_exports.join(stores_directory(input.
|
|
182647
|
+
await fs_exports.writeFile(path_exports.join(stores_directory(input.pluginRoot), `index.js`), dataIndex);
|
|
182648
182648
|
const dataIndexDTs = `import type { DataSource } from '$houdini/runtime'
|
|
182649
182649
|
|
|
182650
182650
|
export type Result<DataType> = {
|
|
@@ -182654,7 +182654,7 @@ export type Result<DataType> = {
|
|
|
182654
182654
|
data?: DataType | null
|
|
182655
182655
|
error?: Error | null
|
|
182656
182656
|
}`;
|
|
182657
|
-
const storePath = stores_directory(input.
|
|
182657
|
+
const storePath = stores_directory(input.pluginRoot);
|
|
182658
182658
|
await fs_exports.writeFile(path_exports.join(storePath, `index.d.ts`), dataIndexDTs + `
|
|
182659
182659
|
` + dataIndex);
|
|
182660
182660
|
await cleanupFiles(storePath, listOfStoresOrdered);
|
|
@@ -182664,7 +182664,7 @@ export type Result<DataType> = {
|
|
|
182664
182664
|
async function codegen_default(input) {
|
|
182665
182665
|
await Promise.all([
|
|
182666
182666
|
fs_exports.mkdirp(type_route_dir(input.config)),
|
|
182667
|
-
fs_exports.mkdirp(stores_directory(input.
|
|
182667
|
+
fs_exports.mkdirp(stores_directory(input.pluginRoot))
|
|
182668
182668
|
]);
|
|
182669
182669
|
await Promise.all([
|
|
182670
182670
|
svelteKitGenerator(input.framework, input),
|
|
@@ -183173,7 +183173,7 @@ function add_load({
|
|
|
183173
183173
|
sourceModule: "$houdini/runtime/lib/config"
|
|
183174
183174
|
});
|
|
183175
183175
|
let before_load = page_info.exports.includes(houdini_before_load_fn);
|
|
183176
|
-
let
|
|
183176
|
+
let afterLoad = page_info.exports.includes(houdini_afterLoad_fn);
|
|
183177
183177
|
let on_error = page_info.exports.includes(houdini_on_error_fn);
|
|
183178
183178
|
const request_context = AST18.identifier("houdini_context");
|
|
183179
183179
|
const promise_list = AST18.identifier("promises");
|
|
@@ -183252,7 +183252,7 @@ function add_load({
|
|
|
183252
183252
|
AST18.objectProperty(AST18.literal("event"), AST18.identifier("context")),
|
|
183253
183253
|
AST18.objectProperty(
|
|
183254
183254
|
AST18.literal("blocking"),
|
|
183255
|
-
AST18.booleanLiteral(
|
|
183255
|
+
AST18.booleanLiteral(afterLoad || on_error)
|
|
183256
183256
|
)
|
|
183257
183257
|
])
|
|
183258
183258
|
])
|
|
@@ -183336,7 +183336,7 @@ function add_load({
|
|
|
183336
183336
|
preload_fn.body.body.splice(1, 0, load_hook_statements("before", ...args));
|
|
183337
183337
|
}
|
|
183338
183338
|
}
|
|
183339
|
-
if (
|
|
183339
|
+
if (afterLoad) {
|
|
183340
183340
|
preload_fn.body.body.splice(
|
|
183341
183341
|
preload_fn.body.body.length - 1,
|
|
183342
183342
|
0,
|
|
@@ -183371,7 +183371,7 @@ function load_hook_statements(name, request_context, input_id, result_id) {
|
|
|
183371
183371
|
AST18.objectProperty(
|
|
183372
183372
|
AST18.literal("hookFn"),
|
|
183373
183373
|
AST18.identifier(
|
|
183374
|
-
name === "before" ? houdini_before_load_fn :
|
|
183374
|
+
name === "before" ? houdini_before_load_fn : houdini_afterLoad_fn
|
|
183375
183375
|
)
|
|
183376
183376
|
),
|
|
183377
183377
|
...name === "after" ? [
|
|
@@ -183905,11 +183905,11 @@ var _config;
|
|
|
183905
183905
|
var pluginHooks = async () => ({
|
|
183906
183906
|
order: "core",
|
|
183907
183907
|
extensions: [".svelte"],
|
|
183908
|
-
|
|
183908
|
+
includeRuntime: {
|
|
183909
183909
|
esm: "../runtime-esm",
|
|
183910
183910
|
commonjs: "../runtime-cjs"
|
|
183911
183911
|
},
|
|
183912
|
-
|
|
183912
|
+
transformRuntime: {
|
|
183913
183913
|
"adapter.js": ({ content }) => {
|
|
183914
183914
|
const sveltekit_adapter = `import { browser, building } from '$app/environment'
|
|
183915
183915
|
import { error as svelteKitError } from '@sveltejs/kit'
|
|
@@ -183945,8 +183945,8 @@ export default client
|
|
|
183945
183945
|
`;
|
|
183946
183946
|
}
|
|
183947
183947
|
},
|
|
183948
|
-
|
|
183949
|
-
|
|
183948
|
+
artifactData,
|
|
183949
|
+
extractDocuments: extract_default,
|
|
183950
183950
|
validate: validateDocuments,
|
|
183951
183951
|
generate(input) {
|
|
183952
183952
|
return codegen_default({
|
|
@@ -183954,7 +183954,7 @@ export default client
|
|
|
183954
183954
|
framework
|
|
183955
183955
|
});
|
|
183956
183956
|
},
|
|
183957
|
-
|
|
183957
|
+
graphqlTagReturn({ config: config4, document: doc, ensureImport: ensure_import }) {
|
|
183958
183958
|
if (doc.generateStore) {
|
|
183959
183959
|
const store = store_name({ config: config4, name: doc.name });
|
|
183960
183960
|
ensure_import({
|
|
@@ -183967,11 +183967,11 @@ export default client
|
|
|
183967
183967
|
return store;
|
|
183968
183968
|
}
|
|
183969
183969
|
},
|
|
183970
|
-
|
|
183971
|
-
const storesDir = "./" + path_exports.relative(config4.rootDir, stores_directory(
|
|
183972
|
-
return content +
|
|
183970
|
+
indexFile({ config: config4, content, exportStarFrom, pluginRoot }) {
|
|
183971
|
+
const storesDir = "./" + path_exports.relative(config4.rootDir, stores_directory(pluginRoot)).split(path_exports.sep).join("/");
|
|
183972
|
+
return content + exportStarFrom({ module: storesDir });
|
|
183973
183973
|
},
|
|
183974
|
-
|
|
183974
|
+
transformFile(page2) {
|
|
183975
183975
|
return apply_transforms(framework, page2);
|
|
183976
183976
|
},
|
|
183977
183977
|
include({ config: config4, filepath }) {
|
|
@@ -183980,7 +183980,7 @@ export default client
|
|
|
183980
183980
|
vite: {
|
|
183981
183981
|
...fsPatch_default(() => framework)
|
|
183982
183982
|
},
|
|
183983
|
-
async
|
|
183983
|
+
async afterLoad({ config: cfg }) {
|
|
183984
183984
|
_config = cfg;
|
|
183985
183985
|
const cfgPlugin = plugin_config(cfg);
|
|
183986
183986
|
let client_file_exists = false;
|
|
@@ -30982,10 +30982,10 @@ var require_main5 = __commonJS({
|
|
|
30982
30982
|
}
|
|
30983
30983
|
});
|
|
30984
30984
|
|
|
30985
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.
|
|
30985
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.4/node_modules/@sveltejs/kit/src/runtime/control.js
|
|
30986
30986
|
var HttpError, Redirect, ActionFailure;
|
|
30987
30987
|
var init_control = __esm({
|
|
30988
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.
|
|
30988
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.4/node_modules/@sveltejs/kit/src/runtime/control.js"() {
|
|
30989
30989
|
HttpError = class {
|
|
30990
30990
|
constructor(status, body) {
|
|
30991
30991
|
this.status = status;
|
|
@@ -31025,7 +31025,7 @@ var init_prod_ssr = __esm({
|
|
|
31025
31025
|
}
|
|
31026
31026
|
});
|
|
31027
31027
|
|
|
31028
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.
|
|
31028
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.4/node_modules/@sveltejs/kit/src/exports/index.js
|
|
31029
31029
|
var exports_exports = {};
|
|
31030
31030
|
__export(exports_exports, {
|
|
31031
31031
|
error: () => error2,
|
|
@@ -31063,7 +31063,7 @@ function invalid() {
|
|
|
31063
31063
|
throw new Error("invalid(...) is now fail(...)");
|
|
31064
31064
|
}
|
|
31065
31065
|
var init_exports = __esm({
|
|
31066
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.
|
|
31066
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0_svelte@3.55.0+vite@4.0.4/node_modules/@sveltejs/kit/src/exports/index.js"() {
|
|
31067
31067
|
init_control();
|
|
31068
31068
|
init_prod_ssr();
|
|
31069
31069
|
}
|
|
@@ -181445,7 +181445,7 @@ var query_variable_fn = (name) => {
|
|
|
181445
181445
|
};
|
|
181446
181446
|
var houdini_load_fn = "_houdini_load";
|
|
181447
181447
|
var houdini_before_load_fn = "_houdini_beforeLoad";
|
|
181448
|
-
var
|
|
181448
|
+
var houdini_afterLoad_fn = "_houdini_afterLoad";
|
|
181449
181449
|
var houdini_on_error_fn = "_houdini_onError";
|
|
181450
181450
|
|
|
181451
181451
|
// src/plugin/extractLoadFunction.ts
|
|
@@ -181814,8 +181814,8 @@ function route_page_path(config4, filename) {
|
|
|
181814
181814
|
function stores_directory_name() {
|
|
181815
181815
|
return "stores";
|
|
181816
181816
|
}
|
|
181817
|
-
function stores_directory(
|
|
181818
|
-
return path_exports.join(
|
|
181817
|
+
function stores_directory(pluginRoot) {
|
|
181818
|
+
return path_exports.join(pluginRoot, stores_directory_name());
|
|
181819
181819
|
}
|
|
181820
181820
|
function type_route_dir(config4) {
|
|
181821
181821
|
return path_exports.join(config4.typeRootDir, "src", "routes");
|
|
@@ -182183,10 +182183,10 @@ async function svelteKitGenerator(framework2, { config: config4 }) {
|
|
|
182183
182183
|
uniqueLayoutQueries
|
|
182184
182184
|
);
|
|
182185
182185
|
const beforePageLoad = pageExports.includes(houdini_before_load_fn);
|
|
182186
|
-
const afterPageLoad = pageExports.includes(
|
|
182186
|
+
const afterPageLoad = pageExports.includes(houdini_afterLoad_fn);
|
|
182187
182187
|
const onPageError = pageExports.includes(houdini_on_error_fn);
|
|
182188
182188
|
const beforeLayoutLoad = layoutExports.includes(houdini_before_load_fn);
|
|
182189
|
-
const afterLayoutLoad = layoutExports.includes(
|
|
182189
|
+
const afterLayoutLoad = layoutExports.includes(houdini_afterLoad_fn);
|
|
182190
182190
|
const onLayoutError = layoutExports.includes(houdini_on_error_fn);
|
|
182191
182191
|
const layout_append_VariablesFunction = append_VariablesFunction(
|
|
182192
182192
|
"Layout",
|
|
@@ -182322,7 +182322,7 @@ type LoadInput = { ${queries.filter((query) => query.variableDefinitions?.length
|
|
|
182322
182322
|
}
|
|
182323
182323
|
function append_afterLoad(afterLoad, type, queries) {
|
|
182324
182324
|
return afterLoad ? `
|
|
182325
|
-
type AfterLoadReturn = Awaited<ReturnType<typeof import('./+${type.toLowerCase()}').${
|
|
182325
|
+
type AfterLoadReturn = Awaited<ReturnType<typeof import('./+${type.toLowerCase()}').${houdini_afterLoad_fn}>>;
|
|
182326
182326
|
type AfterLoadData = {
|
|
182327
182327
|
${internal_append_afterLoad(queries)}
|
|
182328
182328
|
};
|
|
@@ -182369,7 +182369,7 @@ function store_import2(cfg, which) {
|
|
|
182369
182369
|
}
|
|
182370
182370
|
|
|
182371
182371
|
// src/plugin/codegen/stores/fragment.ts
|
|
182372
|
-
async function fragmentStore({ config: config4,
|
|
182372
|
+
async function fragmentStore({ config: config4, pluginRoot }, doc) {
|
|
182373
182373
|
const fileName = doc.name;
|
|
182374
182374
|
const artifactName = `${doc.name}`;
|
|
182375
182375
|
const storeName = store_name({ config: config4, name: doc.name });
|
|
@@ -182413,14 +182413,14 @@ export declare class ${storeName} extends ${store_class}<${_data}, {}> {
|
|
|
182413
182413
|
export declare const load_${artifactName}: (params: QueryStoreFetchParams<${_data}, {}>) => Promise<${storeName}>
|
|
182414
182414
|
`;
|
|
182415
182415
|
await Promise.all([
|
|
182416
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182417
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182416
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.d.ts`), typeDefs),
|
|
182417
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.js`), storeContent)
|
|
182418
182418
|
]);
|
|
182419
182419
|
return fileName;
|
|
182420
182420
|
}
|
|
182421
182421
|
|
|
182422
182422
|
// src/plugin/codegen/stores/mutation.ts
|
|
182423
|
-
async function mutationStore({ config: config4,
|
|
182423
|
+
async function mutationStore({ config: config4, pluginRoot }, doc) {
|
|
182424
182424
|
const fileName = doc.name;
|
|
182425
182425
|
const storeName = store_name({ config: config4, name: doc.name });
|
|
182426
182426
|
const artifactName = `${doc.name}`;
|
|
@@ -182449,19 +182449,19 @@ export declare class ${storeName} extends ${store_class}<${_data}, ${_input}, ${
|
|
|
182449
182449
|
}
|
|
182450
182450
|
`;
|
|
182451
182451
|
await Promise.all([
|
|
182452
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182453
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182452
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.js`), storeData),
|
|
182453
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.d.ts`), typeDefs)
|
|
182454
182454
|
]);
|
|
182455
182455
|
return fileName;
|
|
182456
182456
|
}
|
|
182457
182457
|
|
|
182458
182458
|
// src/plugin/codegen/stores/query.ts
|
|
182459
|
-
async function queryStore({ config: config4,
|
|
182459
|
+
async function queryStore({ config: config4, pluginRoot }, doc) {
|
|
182460
182460
|
const fileName = doc.name;
|
|
182461
182461
|
const artifactName = `${doc.name}`;
|
|
182462
182462
|
const storeName = store_name({ config: config4, name: doc.name });
|
|
182463
182463
|
let variables = false;
|
|
182464
|
-
const operation = doc.
|
|
182464
|
+
const operation = doc.originalParsed.definitions.find(
|
|
182465
182465
|
(defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
|
|
182466
182466
|
);
|
|
182467
182467
|
if (operation) {
|
|
@@ -182574,14 +182574,14 @@ export declare class ${storeName} extends ${store_class}<${_data}, ${_input}> {
|
|
|
182574
182574
|
export declare const load_${artifactName}: (params: QueryStoreFetchParams<${_data}, ${_input}>) => Promise<{${artifactName}: ${storeName}}>
|
|
182575
182575
|
`;
|
|
182576
182576
|
await Promise.all([
|
|
182577
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182578
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182577
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.js`), storeData),
|
|
182578
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.d.ts`), typeDefs)
|
|
182579
182579
|
]);
|
|
182580
182580
|
return fileName;
|
|
182581
182581
|
}
|
|
182582
182582
|
|
|
182583
182583
|
// src/plugin/codegen/stores/subscription.ts
|
|
182584
|
-
async function subscriptionStore({ config: config4,
|
|
182584
|
+
async function subscriptionStore({ config: config4, pluginRoot }, doc) {
|
|
182585
182585
|
const fileName = doc.name;
|
|
182586
182586
|
const storeName = store_name({ config: config4, name: doc.name });
|
|
182587
182587
|
const artifactName = `${doc.name}`;
|
|
@@ -182609,8 +182609,8 @@ export declare class ${storeName} extends ${store_class}<${_data} | undefined, $
|
|
|
182609
182609
|
}
|
|
182610
182610
|
`;
|
|
182611
182611
|
await Promise.all([
|
|
182612
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182613
|
-
fs_exports.writeFile(path_exports.join(stores_directory(
|
|
182612
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.d.ts`), typeDefs),
|
|
182613
|
+
fs_exports.writeFile(path_exports.join(stores_directory(pluginRoot), `${fileName}.js`), storeContent)
|
|
182614
182614
|
]);
|
|
182615
182615
|
return fileName;
|
|
182616
182616
|
}
|
|
@@ -182638,7 +182638,7 @@ async function storesGenerator(input) {
|
|
|
182638
182638
|
const listOfStoresOrdered = listOfStores.filter((c2) => c2 !== null).sort((a, b) => (a + "").localeCompare(b + ""));
|
|
182639
182639
|
const dataIndex = listOfStoresOrdered.map((c2) => `export * from './${c2}'`).join(`
|
|
182640
182640
|
`);
|
|
182641
|
-
await fs_exports.writeFile(path_exports.join(stores_directory(input.
|
|
182641
|
+
await fs_exports.writeFile(path_exports.join(stores_directory(input.pluginRoot), `index.js`), dataIndex);
|
|
182642
182642
|
const dataIndexDTs = `import type { DataSource } from '$houdini/runtime'
|
|
182643
182643
|
|
|
182644
182644
|
export type Result<DataType> = {
|
|
@@ -182648,7 +182648,7 @@ export type Result<DataType> = {
|
|
|
182648
182648
|
data?: DataType | null
|
|
182649
182649
|
error?: Error | null
|
|
182650
182650
|
}`;
|
|
182651
|
-
const storePath = stores_directory(input.
|
|
182651
|
+
const storePath = stores_directory(input.pluginRoot);
|
|
182652
182652
|
await fs_exports.writeFile(path_exports.join(storePath, `index.d.ts`), dataIndexDTs + `
|
|
182653
182653
|
` + dataIndex);
|
|
182654
182654
|
await cleanupFiles(storePath, listOfStoresOrdered);
|
|
@@ -182658,7 +182658,7 @@ export type Result<DataType> = {
|
|
|
182658
182658
|
async function codegen_default(input) {
|
|
182659
182659
|
await Promise.all([
|
|
182660
182660
|
fs_exports.mkdirp(type_route_dir(input.config)),
|
|
182661
|
-
fs_exports.mkdirp(stores_directory(input.
|
|
182661
|
+
fs_exports.mkdirp(stores_directory(input.pluginRoot))
|
|
182662
182662
|
]);
|
|
182663
182663
|
await Promise.all([
|
|
182664
182664
|
svelteKitGenerator(input.framework, input),
|
|
@@ -183167,7 +183167,7 @@ function add_load({
|
|
|
183167
183167
|
sourceModule: "$houdini/runtime/lib/config"
|
|
183168
183168
|
});
|
|
183169
183169
|
let before_load = page_info.exports.includes(houdini_before_load_fn);
|
|
183170
|
-
let
|
|
183170
|
+
let afterLoad = page_info.exports.includes(houdini_afterLoad_fn);
|
|
183171
183171
|
let on_error = page_info.exports.includes(houdini_on_error_fn);
|
|
183172
183172
|
const request_context = AST18.identifier("houdini_context");
|
|
183173
183173
|
const promise_list = AST18.identifier("promises");
|
|
@@ -183246,7 +183246,7 @@ function add_load({
|
|
|
183246
183246
|
AST18.objectProperty(AST18.literal("event"), AST18.identifier("context")),
|
|
183247
183247
|
AST18.objectProperty(
|
|
183248
183248
|
AST18.literal("blocking"),
|
|
183249
|
-
AST18.booleanLiteral(
|
|
183249
|
+
AST18.booleanLiteral(afterLoad || on_error)
|
|
183250
183250
|
)
|
|
183251
183251
|
])
|
|
183252
183252
|
])
|
|
@@ -183330,7 +183330,7 @@ function add_load({
|
|
|
183330
183330
|
preload_fn.body.body.splice(1, 0, load_hook_statements("before", ...args));
|
|
183331
183331
|
}
|
|
183332
183332
|
}
|
|
183333
|
-
if (
|
|
183333
|
+
if (afterLoad) {
|
|
183334
183334
|
preload_fn.body.body.splice(
|
|
183335
183335
|
preload_fn.body.body.length - 1,
|
|
183336
183336
|
0,
|
|
@@ -183365,7 +183365,7 @@ function load_hook_statements(name, request_context, input_id, result_id) {
|
|
|
183365
183365
|
AST18.objectProperty(
|
|
183366
183366
|
AST18.literal("hookFn"),
|
|
183367
183367
|
AST18.identifier(
|
|
183368
|
-
name === "before" ? houdini_before_load_fn :
|
|
183368
|
+
name === "before" ? houdini_before_load_fn : houdini_afterLoad_fn
|
|
183369
183369
|
)
|
|
183370
183370
|
),
|
|
183371
183371
|
...name === "after" ? [
|
|
@@ -183899,11 +183899,11 @@ var _config;
|
|
|
183899
183899
|
var pluginHooks = async () => ({
|
|
183900
183900
|
order: "core",
|
|
183901
183901
|
extensions: [".svelte"],
|
|
183902
|
-
|
|
183902
|
+
includeRuntime: {
|
|
183903
183903
|
esm: "../runtime-esm",
|
|
183904
183904
|
commonjs: "../runtime-cjs"
|
|
183905
183905
|
},
|
|
183906
|
-
|
|
183906
|
+
transformRuntime: {
|
|
183907
183907
|
"adapter.js": ({ content }) => {
|
|
183908
183908
|
const sveltekit_adapter = `import { browser, building } from '$app/environment'
|
|
183909
183909
|
import { error as svelteKitError } from '@sveltejs/kit'
|
|
@@ -183939,8 +183939,8 @@ export default client
|
|
|
183939
183939
|
`;
|
|
183940
183940
|
}
|
|
183941
183941
|
},
|
|
183942
|
-
|
|
183943
|
-
|
|
183942
|
+
artifactData,
|
|
183943
|
+
extractDocuments: extract_default,
|
|
183944
183944
|
validate: validateDocuments,
|
|
183945
183945
|
generate(input) {
|
|
183946
183946
|
return codegen_default({
|
|
@@ -183948,7 +183948,7 @@ export default client
|
|
|
183948
183948
|
framework
|
|
183949
183949
|
});
|
|
183950
183950
|
},
|
|
183951
|
-
|
|
183951
|
+
graphqlTagReturn({ config: config4, document: doc, ensureImport: ensure_import }) {
|
|
183952
183952
|
if (doc.generateStore) {
|
|
183953
183953
|
const store = store_name({ config: config4, name: doc.name });
|
|
183954
183954
|
ensure_import({
|
|
@@ -183961,11 +183961,11 @@ export default client
|
|
|
183961
183961
|
return store;
|
|
183962
183962
|
}
|
|
183963
183963
|
},
|
|
183964
|
-
|
|
183965
|
-
const storesDir = "./" + path_exports.relative(config4.rootDir, stores_directory(
|
|
183966
|
-
return content +
|
|
183964
|
+
indexFile({ config: config4, content, exportStarFrom, pluginRoot }) {
|
|
183965
|
+
const storesDir = "./" + path_exports.relative(config4.rootDir, stores_directory(pluginRoot)).split(path_exports.sep).join("/");
|
|
183966
|
+
return content + exportStarFrom({ module: storesDir });
|
|
183967
183967
|
},
|
|
183968
|
-
|
|
183968
|
+
transformFile(page2) {
|
|
183969
183969
|
return apply_transforms(framework, page2);
|
|
183970
183970
|
},
|
|
183971
183971
|
include({ config: config4, filepath }) {
|
|
@@ -183974,7 +183974,7 @@ export default client
|
|
|
183974
183974
|
vite: {
|
|
183975
183975
|
...fsPatch_default(() => framework)
|
|
183976
183976
|
},
|
|
183977
|
-
async
|
|
183977
|
+
async afterLoad({ config: cfg }) {
|
|
183978
183978
|
_config = cfg;
|
|
183979
183979
|
const cfgPlugin = plugin_config(cfg);
|
|
183980
183980
|
let client_file_exists = false;
|