houdini-svelte 2.2.0-next.1 → 2.2.0-next.3
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-cjs/index.js +2 -4
- package/build/plugin-esm/index.js +2 -4
- package/build/preprocess-cjs/index.js +39 -9
- package/build/preprocess-esm/index.js +39 -9
- package/build/runtime/types.d.ts +1 -1
- package/build/runtime-cjs/types.d.ts +1 -1
- package/build/runtime-esm/types.d.ts +1 -1
- package/build/test-cjs/index.js +30 -7
- package/build/test-esm/index.js +30 -7
- package/package.json +2 -2
|
@@ -161078,9 +161078,7 @@ import type { ${functionImportsToBring.join(
|
|
|
161078
161078
|
", "
|
|
161079
161079
|
)} } from '${houdiniRelative}/plugins/houdini-svelte/runtime/types';` : "";
|
|
161080
161080
|
typeImports = typeImports.concat(functionImports).concat(layoutTypeImports).concat(pageTypeImports).concat(componentQueryTypeImports);
|
|
161081
|
-
|
|
161082
|
-
const pageParams = `${pageQueries.length > 0 && !utilityTypes.includes("PageParams") ? "\ntype PageParams = PageLoadEvent['params'];" : ""}`;
|
|
161083
|
-
utilityTypes = utilityTypes.concat(layoutParams).concat(pageParams).replaceAll(/\$types\.js/gm, "$houdini");
|
|
161081
|
+
utilityTypes = utilityTypes.replaceAll(/\$types\.js/gm, "$houdini");
|
|
161084
161082
|
typeExports = typeExports.concat(append_loadInput([...layoutQueries, ...pageQueries])).concat(layout_append_beforeLoad).concat(page_append_beforeLoad).concat(layout_append_afterLoad).concat(page_append_afterLoad).concat(layout_append_onError).concat(page_append_onError).concat(layout_append_VariablesFunction).concat(page_append_VariablesFunction).concat(component_append_VariablesFunction).replace(
|
|
161085
161083
|
//regex to append our generated stores to the existing
|
|
161086
161084
|
//match all between 'LayoutData =' and ';' and combine additional types
|
|
@@ -161165,7 +161163,7 @@ function append_VariablesFunction(type, filepath, config, queries) {
|
|
|
161165
161163
|
return `
|
|
161166
161164
|
export type ${config.variableFunctionName(
|
|
161167
161165
|
name
|
|
161168
|
-
)} = VariableFunction<${type}
|
|
161166
|
+
)} = VariableFunction<${type}LoadEvent, ${input_type}>;`;
|
|
161169
161167
|
}).join("\n");
|
|
161170
161168
|
}
|
|
161171
161169
|
function append_ComponentVariablesFunction(filepath, config, queries) {
|
|
@@ -161073,9 +161073,7 @@ import type { ${functionImportsToBring.join(
|
|
|
161073
161073
|
", "
|
|
161074
161074
|
)} } from '${houdiniRelative}/plugins/houdini-svelte/runtime/types';` : "";
|
|
161075
161075
|
typeImports = typeImports.concat(functionImports).concat(layoutTypeImports).concat(pageTypeImports).concat(componentQueryTypeImports);
|
|
161076
|
-
|
|
161077
|
-
const pageParams = `${pageQueries.length > 0 && !utilityTypes.includes("PageParams") ? "\ntype PageParams = PageLoadEvent['params'];" : ""}`;
|
|
161078
|
-
utilityTypes = utilityTypes.concat(layoutParams).concat(pageParams).replaceAll(/\$types\.js/gm, "$houdini");
|
|
161076
|
+
utilityTypes = utilityTypes.replaceAll(/\$types\.js/gm, "$houdini");
|
|
161079
161077
|
typeExports = typeExports.concat(append_loadInput([...layoutQueries, ...pageQueries])).concat(layout_append_beforeLoad).concat(page_append_beforeLoad).concat(layout_append_afterLoad).concat(page_append_afterLoad).concat(layout_append_onError).concat(page_append_onError).concat(layout_append_VariablesFunction).concat(page_append_VariablesFunction).concat(component_append_VariablesFunction).replace(
|
|
161080
161078
|
//regex to append our generated stores to the existing
|
|
161081
161079
|
//match all between 'LayoutData =' and ';' and combine additional types
|
|
@@ -161160,7 +161158,7 @@ function append_VariablesFunction(type, filepath, config, queries) {
|
|
|
161160
161158
|
return `
|
|
161161
161159
|
export type ${config.variableFunctionName(
|
|
161162
161160
|
name
|
|
161163
|
-
)} = VariableFunction<${type}
|
|
161161
|
+
)} = VariableFunction<${type}LoadEvent, ${input_type}>;`;
|
|
161164
161162
|
}).join("\n");
|
|
161165
161163
|
}
|
|
161166
161164
|
function append_ComponentVariablesFunction(filepath, config, queries) {
|
|
@@ -88458,7 +88458,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|
|
88458
88458
|
});
|
|
88459
88459
|
});
|
|
88460
88460
|
}
|
|
88461
|
-
async function pullSchema(url, fetchTimeout, schemaPath, headers,
|
|
88461
|
+
async function pullSchema(url, fetchTimeout, schemaPath, headers, writeToDisk = true) {
|
|
88462
88462
|
let content = "";
|
|
88463
88463
|
try {
|
|
88464
88464
|
const fetchWithTimeout = (url2, timeoutMs, options) => {
|
|
@@ -88496,8 +88496,15 @@ async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
|
|
|
88496
88496
|
} else {
|
|
88497
88497
|
fileData = JSON.stringify(jsonSchema);
|
|
88498
88498
|
}
|
|
88499
|
-
if (
|
|
88500
|
-
|
|
88499
|
+
if (writeToDisk) {
|
|
88500
|
+
try {
|
|
88501
|
+
await writeFile(schemaPath, fileData);
|
|
88502
|
+
} catch (e22) {
|
|
88503
|
+
console.warn(
|
|
88504
|
+
`\u26A0\uFE0F Couldn't write your pulled schema to disk: ${e22.message}
|
|
88505
|
+
If this is expected, please set watchSchema.writePolledSchema to false in your config file.`
|
|
88506
|
+
);
|
|
88507
|
+
}
|
|
88501
88508
|
}
|
|
88502
88509
|
return fileData;
|
|
88503
88510
|
} catch (e22) {
|
|
@@ -91220,6 +91227,7 @@ var Config = class {
|
|
|
91220
91227
|
routesDir;
|
|
91221
91228
|
schemaPollInterval;
|
|
91222
91229
|
schemaPollTimeout;
|
|
91230
|
+
schemaPollWriteToDisk = false;
|
|
91223
91231
|
schemaPollHeaders;
|
|
91224
91232
|
pluginMode = false;
|
|
91225
91233
|
plugins = [];
|
|
@@ -91296,6 +91304,7 @@ var Config = class {
|
|
|
91296
91304
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
91297
91305
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
91298
91306
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
91307
|
+
this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
|
|
91299
91308
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
91300
91309
|
this.rootDir = join2(this.projectRoot, this.runtimeDir);
|
|
91301
91310
|
this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
|
|
@@ -91328,11 +91337,17 @@ var Config = class {
|
|
|
91328
91337
|
const include = [`src/**/*{${extensions.join(",")}}`];
|
|
91329
91338
|
for (const plugin2 of this.plugins) {
|
|
91330
91339
|
const runtimeDir = this.pluginRuntimeSource(plugin2);
|
|
91331
|
-
|
|
91340
|
+
const staticDir = this.pluginStaticRuntimeSource(plugin2);
|
|
91341
|
+
if (!runtimeDir && !staticDir) {
|
|
91332
91342
|
continue;
|
|
91333
91343
|
}
|
|
91334
|
-
const
|
|
91335
|
-
|
|
91344
|
+
for (const dir of [runtimeDir, staticDir]) {
|
|
91345
|
+
if (!dir) {
|
|
91346
|
+
continue;
|
|
91347
|
+
}
|
|
91348
|
+
const includePath = relative(this.projectRoot, dir);
|
|
91349
|
+
include.push(`${includePath}/**/*{${extensions.join(",")}}`);
|
|
91350
|
+
}
|
|
91336
91351
|
}
|
|
91337
91352
|
return include;
|
|
91338
91353
|
}
|
|
@@ -91386,6 +91401,15 @@ var Config = class {
|
|
|
91386
91401
|
typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
|
|
91387
91402
|
);
|
|
91388
91403
|
}
|
|
91404
|
+
pluginStaticRuntimeSource(plugin2) {
|
|
91405
|
+
if (!plugin2.staticRuntime) {
|
|
91406
|
+
return null;
|
|
91407
|
+
}
|
|
91408
|
+
return join2(
|
|
91409
|
+
dirname(plugin2.filepath),
|
|
91410
|
+
typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
|
|
91411
|
+
);
|
|
91412
|
+
}
|
|
91389
91413
|
async sourceFiles() {
|
|
91390
91414
|
return [
|
|
91391
91415
|
...new Set(
|
|
@@ -91582,6 +91606,9 @@ var Config = class {
|
|
|
91582
91606
|
pluginRuntimeDirectory(name) {
|
|
91583
91607
|
return join2(this.pluginDirectory(name), "runtime");
|
|
91584
91608
|
}
|
|
91609
|
+
pluginStaticRuntimeDirectory(name) {
|
|
91610
|
+
return join2(this.pluginDirectory(name), "static");
|
|
91611
|
+
}
|
|
91585
91612
|
get pluginRootDirectory() {
|
|
91586
91613
|
return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
|
|
91587
91614
|
}
|
|
@@ -91959,17 +91986,20 @@ async function getConfig({
|
|
|
91959
91986
|
if (!_config.localSchema && _config.schemaPath && !_config.schema) {
|
|
91960
91987
|
let schemaOk = true;
|
|
91961
91988
|
if (apiURL) {
|
|
91962
|
-
if (glob2.hasMagic(_config.schemaPath)) {
|
|
91989
|
+
if (glob2.hasMagic(_config.schemaPath) && _config.schemaPollWriteToDisk) {
|
|
91963
91990
|
console.log(
|
|
91964
91991
|
`\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
|
|
91965
|
-
This will prevent your schema from being
|
|
91992
|
+
This will prevent your schema from being written to disk. If this is expected, please set the writePolledSchema value to false.`
|
|
91966
91993
|
);
|
|
91994
|
+
_config.schemaPollWriteToDisk = false;
|
|
91967
91995
|
} else if (!await readFile(_config.schemaPath)) {
|
|
91968
91996
|
console.log("\u231B Pulling schema from api");
|
|
91969
91997
|
schemaOk = await pullSchema(
|
|
91970
91998
|
apiURL,
|
|
91971
91999
|
_config.schemaPollTimeout,
|
|
91972
|
-
_config.schemaPath
|
|
92000
|
+
_config.schemaPath,
|
|
92001
|
+
{},
|
|
92002
|
+
_config.schemaPollWriteToDisk
|
|
91973
92003
|
) !== null;
|
|
91974
92004
|
}
|
|
91975
92005
|
}
|
|
@@ -88455,7 +88455,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|
|
88455
88455
|
});
|
|
88456
88456
|
});
|
|
88457
88457
|
}
|
|
88458
|
-
async function pullSchema(url, fetchTimeout, schemaPath, headers,
|
|
88458
|
+
async function pullSchema(url, fetchTimeout, schemaPath, headers, writeToDisk = true) {
|
|
88459
88459
|
let content = "";
|
|
88460
88460
|
try {
|
|
88461
88461
|
const fetchWithTimeout = (url2, timeoutMs, options) => {
|
|
@@ -88493,8 +88493,15 @@ async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
|
|
|
88493
88493
|
} else {
|
|
88494
88494
|
fileData = JSON.stringify(jsonSchema);
|
|
88495
88495
|
}
|
|
88496
|
-
if (
|
|
88497
|
-
|
|
88496
|
+
if (writeToDisk) {
|
|
88497
|
+
try {
|
|
88498
|
+
await writeFile(schemaPath, fileData);
|
|
88499
|
+
} catch (e22) {
|
|
88500
|
+
console.warn(
|
|
88501
|
+
`\u26A0\uFE0F Couldn't write your pulled schema to disk: ${e22.message}
|
|
88502
|
+
If this is expected, please set watchSchema.writePolledSchema to false in your config file.`
|
|
88503
|
+
);
|
|
88504
|
+
}
|
|
88498
88505
|
}
|
|
88499
88506
|
return fileData;
|
|
88500
88507
|
} catch (e22) {
|
|
@@ -91217,6 +91224,7 @@ var Config = class {
|
|
|
91217
91224
|
routesDir;
|
|
91218
91225
|
schemaPollInterval;
|
|
91219
91226
|
schemaPollTimeout;
|
|
91227
|
+
schemaPollWriteToDisk = false;
|
|
91220
91228
|
schemaPollHeaders;
|
|
91221
91229
|
pluginMode = false;
|
|
91222
91230
|
plugins = [];
|
|
@@ -91293,6 +91301,7 @@ var Config = class {
|
|
|
91293
91301
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
91294
91302
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
91295
91303
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
91304
|
+
this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
|
|
91296
91305
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
91297
91306
|
this.rootDir = join2(this.projectRoot, this.runtimeDir);
|
|
91298
91307
|
this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
|
|
@@ -91325,11 +91334,17 @@ var Config = class {
|
|
|
91325
91334
|
const include = [`src/**/*{${extensions.join(",")}}`];
|
|
91326
91335
|
for (const plugin2 of this.plugins) {
|
|
91327
91336
|
const runtimeDir = this.pluginRuntimeSource(plugin2);
|
|
91328
|
-
|
|
91337
|
+
const staticDir = this.pluginStaticRuntimeSource(plugin2);
|
|
91338
|
+
if (!runtimeDir && !staticDir) {
|
|
91329
91339
|
continue;
|
|
91330
91340
|
}
|
|
91331
|
-
const
|
|
91332
|
-
|
|
91341
|
+
for (const dir of [runtimeDir, staticDir]) {
|
|
91342
|
+
if (!dir) {
|
|
91343
|
+
continue;
|
|
91344
|
+
}
|
|
91345
|
+
const includePath = relative(this.projectRoot, dir);
|
|
91346
|
+
include.push(`${includePath}/**/*{${extensions.join(",")}}`);
|
|
91347
|
+
}
|
|
91333
91348
|
}
|
|
91334
91349
|
return include;
|
|
91335
91350
|
}
|
|
@@ -91383,6 +91398,15 @@ var Config = class {
|
|
|
91383
91398
|
typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
|
|
91384
91399
|
);
|
|
91385
91400
|
}
|
|
91401
|
+
pluginStaticRuntimeSource(plugin2) {
|
|
91402
|
+
if (!plugin2.staticRuntime) {
|
|
91403
|
+
return null;
|
|
91404
|
+
}
|
|
91405
|
+
return join2(
|
|
91406
|
+
dirname(plugin2.filepath),
|
|
91407
|
+
typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
|
|
91408
|
+
);
|
|
91409
|
+
}
|
|
91386
91410
|
async sourceFiles() {
|
|
91387
91411
|
return [
|
|
91388
91412
|
...new Set(
|
|
@@ -91579,6 +91603,9 @@ var Config = class {
|
|
|
91579
91603
|
pluginRuntimeDirectory(name) {
|
|
91580
91604
|
return join2(this.pluginDirectory(name), "runtime");
|
|
91581
91605
|
}
|
|
91606
|
+
pluginStaticRuntimeDirectory(name) {
|
|
91607
|
+
return join2(this.pluginDirectory(name), "static");
|
|
91608
|
+
}
|
|
91582
91609
|
get pluginRootDirectory() {
|
|
91583
91610
|
return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
|
|
91584
91611
|
}
|
|
@@ -91956,17 +91983,20 @@ async function getConfig({
|
|
|
91956
91983
|
if (!_config.localSchema && _config.schemaPath && !_config.schema) {
|
|
91957
91984
|
let schemaOk = true;
|
|
91958
91985
|
if (apiURL) {
|
|
91959
|
-
if (glob2.hasMagic(_config.schemaPath)) {
|
|
91986
|
+
if (glob2.hasMagic(_config.schemaPath) && _config.schemaPollWriteToDisk) {
|
|
91960
91987
|
console.log(
|
|
91961
91988
|
`\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
|
|
91962
|
-
This will prevent your schema from being
|
|
91989
|
+
This will prevent your schema from being written to disk. If this is expected, please set the writePolledSchema value to false.`
|
|
91963
91990
|
);
|
|
91991
|
+
_config.schemaPollWriteToDisk = false;
|
|
91964
91992
|
} else if (!await readFile(_config.schemaPath)) {
|
|
91965
91993
|
console.log("\u231B Pulling schema from api");
|
|
91966
91994
|
schemaOk = await pullSchema(
|
|
91967
91995
|
apiURL,
|
|
91968
91996
|
_config.schemaPollTimeout,
|
|
91969
|
-
_config.schemaPath
|
|
91997
|
+
_config.schemaPath,
|
|
91998
|
+
{},
|
|
91999
|
+
_config.schemaPollWriteToDisk
|
|
91970
92000
|
) !== null;
|
|
91971
92001
|
}
|
|
91972
92002
|
}
|
package/build/runtime/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type QueryInputs<_Data> = FetchQueryResult<_Data> & {
|
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export type VariableFunction<
|
|
10
|
+
export type VariableFunction<_Event extends LoadEvent, _Input> = (event: _Event) => _Input | Promise<_Input>;
|
|
11
11
|
export type AfterLoadFunction<_Params extends Record<string, string>, _Data, _Input, _ReturnType extends Record<string, any>> = (args: {
|
|
12
12
|
event: LoadEvent<_Params>;
|
|
13
13
|
data: _Data;
|
|
@@ -7,7 +7,7 @@ export type QueryInputs<_Data> = FetchQueryResult<_Data> & {
|
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export type VariableFunction<
|
|
10
|
+
export type VariableFunction<_Event extends LoadEvent, _Input> = (event: _Event) => _Input | Promise<_Input>;
|
|
11
11
|
export type AfterLoadFunction<_Params extends Record<string, string>, _Data, _Input, _ReturnType extends Record<string, any>> = (args: {
|
|
12
12
|
event: LoadEvent<_Params>;
|
|
13
13
|
data: _Data;
|
|
@@ -7,7 +7,7 @@ export type QueryInputs<_Data> = FetchQueryResult<_Data> & {
|
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export type VariableFunction<
|
|
10
|
+
export type VariableFunction<_Event extends LoadEvent, _Input> = (event: _Event) => _Input | Promise<_Input>;
|
|
11
11
|
export type AfterLoadFunction<_Params extends Record<string, string>, _Data, _Input, _ReturnType extends Record<string, any>> = (args: {
|
|
12
12
|
event: LoadEvent<_Params>;
|
|
13
13
|
data: _Data;
|
package/build/test-cjs/index.js
CHANGED
|
@@ -157605,6 +157605,11 @@ async function writeIndexFile2(config, docs) {
|
|
|
157605
157605
|
module: relative22(config.pluginRuntimeDirectory(plugin2.name))
|
|
157606
157606
|
});
|
|
157607
157607
|
}
|
|
157608
|
+
if (plugin2.staticRuntime) {
|
|
157609
|
+
body += exportStar({
|
|
157610
|
+
module: relative22(config.pluginStaticRuntimeDirectory(plugin2.name))
|
|
157611
|
+
});
|
|
157612
|
+
}
|
|
157608
157613
|
}
|
|
157609
157614
|
await fs_exports2.writeFile(path_exports2.join(config.rootDir, "index.js"), body);
|
|
157610
157615
|
}
|
|
@@ -226462,6 +226467,7 @@ var Config = class {
|
|
|
226462
226467
|
routesDir;
|
|
226463
226468
|
schemaPollInterval;
|
|
226464
226469
|
schemaPollTimeout;
|
|
226470
|
+
schemaPollWriteToDisk = false;
|
|
226465
226471
|
schemaPollHeaders;
|
|
226466
226472
|
pluginMode = false;
|
|
226467
226473
|
plugins = [];
|
|
@@ -226538,6 +226544,7 @@ var Config = class {
|
|
|
226538
226544
|
this.routesDir = join4(this.projectRoot, "src", "routes");
|
|
226539
226545
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
226540
226546
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
226547
|
+
this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
|
|
226541
226548
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
226542
226549
|
this.rootDir = join4(this.projectRoot, this.runtimeDir);
|
|
226543
226550
|
this.persistedQueriesPath = persistedQueriesPath ?? join4(this.rootDir, "persisted_queries.json");
|
|
@@ -226570,11 +226577,17 @@ var Config = class {
|
|
|
226570
226577
|
const include = [`src/**/*{${extensions.join(",")}}`];
|
|
226571
226578
|
for (const plugin2 of this.plugins) {
|
|
226572
226579
|
const runtimeDir = this.pluginRuntimeSource(plugin2);
|
|
226573
|
-
|
|
226580
|
+
const staticDir = this.pluginStaticRuntimeSource(plugin2);
|
|
226581
|
+
if (!runtimeDir && !staticDir) {
|
|
226574
226582
|
continue;
|
|
226575
226583
|
}
|
|
226576
|
-
const
|
|
226577
|
-
|
|
226584
|
+
for (const dir of [runtimeDir, staticDir]) {
|
|
226585
|
+
if (!dir) {
|
|
226586
|
+
continue;
|
|
226587
|
+
}
|
|
226588
|
+
const includePath = relative3(this.projectRoot, dir);
|
|
226589
|
+
include.push(`${includePath}/**/*{${extensions.join(",")}}`);
|
|
226590
|
+
}
|
|
226578
226591
|
}
|
|
226579
226592
|
return include;
|
|
226580
226593
|
}
|
|
@@ -226628,6 +226641,15 @@ var Config = class {
|
|
|
226628
226641
|
typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
|
|
226629
226642
|
);
|
|
226630
226643
|
}
|
|
226644
|
+
pluginStaticRuntimeSource(plugin2) {
|
|
226645
|
+
if (!plugin2.staticRuntime) {
|
|
226646
|
+
return null;
|
|
226647
|
+
}
|
|
226648
|
+
return join4(
|
|
226649
|
+
dirname3(plugin2.filepath),
|
|
226650
|
+
typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
|
|
226651
|
+
);
|
|
226652
|
+
}
|
|
226631
226653
|
async sourceFiles() {
|
|
226632
226654
|
return [
|
|
226633
226655
|
...new Set(
|
|
@@ -226824,6 +226846,9 @@ var Config = class {
|
|
|
226824
226846
|
pluginRuntimeDirectory(name) {
|
|
226825
226847
|
return join4(this.pluginDirectory(name), "runtime");
|
|
226826
226848
|
}
|
|
226849
|
+
pluginStaticRuntimeDirectory(name) {
|
|
226850
|
+
return join4(this.pluginDirectory(name), "static");
|
|
226851
|
+
}
|
|
226827
226852
|
get pluginRootDirectory() {
|
|
226828
226853
|
return houdini_mode3.is_testing ? "../../../" : join4(this.rootDir, "plugins");
|
|
226829
226854
|
}
|
|
@@ -300720,9 +300745,7 @@ import type { ${functionImportsToBring.join(
|
|
|
300720
300745
|
", "
|
|
300721
300746
|
)} } from '${houdiniRelative}/plugins/houdini-svelte/runtime/types';` : "";
|
|
300722
300747
|
typeImports = typeImports.concat(functionImports).concat(layoutTypeImports).concat(pageTypeImports).concat(componentQueryTypeImports);
|
|
300723
|
-
|
|
300724
|
-
const pageParams = `${pageQueries.length > 0 && !utilityTypes.includes("PageParams") ? "\ntype PageParams = PageLoadEvent['params'];" : ""}`;
|
|
300725
|
-
utilityTypes = utilityTypes.concat(layoutParams).concat(pageParams).replaceAll(/\$types\.js/gm, "$houdini");
|
|
300748
|
+
utilityTypes = utilityTypes.replaceAll(/\$types\.js/gm, "$houdini");
|
|
300726
300749
|
typeExports = typeExports.concat(append_loadInput([...layoutQueries, ...pageQueries])).concat(layout_append_beforeLoad).concat(page_append_beforeLoad).concat(layout_append_afterLoad).concat(page_append_afterLoad).concat(layout_append_onError).concat(page_append_onError).concat(layout_append_VariablesFunction).concat(page_append_VariablesFunction).concat(component_append_VariablesFunction).replace(
|
|
300727
300750
|
//regex to append our generated stores to the existing
|
|
300728
300751
|
//match all between 'LayoutData =' and ';' and combine additional types
|
|
@@ -300807,7 +300830,7 @@ function append_VariablesFunction(type, filepath, config, queries) {
|
|
|
300807
300830
|
return `
|
|
300808
300831
|
export type ${config.variableFunctionName(
|
|
300809
300832
|
name
|
|
300810
|
-
)} = VariableFunction<${type}
|
|
300833
|
+
)} = VariableFunction<${type}LoadEvent, ${input_type}>;`;
|
|
300811
300834
|
}).join("\n");
|
|
300812
300835
|
}
|
|
300813
300836
|
function append_ComponentVariablesFunction(filepath, config, queries) {
|
package/build/test-esm/index.js
CHANGED
|
@@ -157596,6 +157596,11 @@ async function writeIndexFile2(config, docs) {
|
|
|
157596
157596
|
module: relative22(config.pluginRuntimeDirectory(plugin2.name))
|
|
157597
157597
|
});
|
|
157598
157598
|
}
|
|
157599
|
+
if (plugin2.staticRuntime) {
|
|
157600
|
+
body += exportStar({
|
|
157601
|
+
module: relative22(config.pluginStaticRuntimeDirectory(plugin2.name))
|
|
157602
|
+
});
|
|
157603
|
+
}
|
|
157599
157604
|
}
|
|
157600
157605
|
await fs_exports2.writeFile(path_exports2.join(config.rootDir, "index.js"), body);
|
|
157601
157606
|
}
|
|
@@ -226452,6 +226457,7 @@ var Config = class {
|
|
|
226452
226457
|
routesDir;
|
|
226453
226458
|
schemaPollInterval;
|
|
226454
226459
|
schemaPollTimeout;
|
|
226460
|
+
schemaPollWriteToDisk = false;
|
|
226455
226461
|
schemaPollHeaders;
|
|
226456
226462
|
pluginMode = false;
|
|
226457
226463
|
plugins = [];
|
|
@@ -226528,6 +226534,7 @@ var Config = class {
|
|
|
226528
226534
|
this.routesDir = join4(this.projectRoot, "src", "routes");
|
|
226529
226535
|
this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
|
|
226530
226536
|
this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
|
|
226537
|
+
this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
|
|
226531
226538
|
this.schemaPollHeaders = watchSchema?.headers ?? {};
|
|
226532
226539
|
this.rootDir = join4(this.projectRoot, this.runtimeDir);
|
|
226533
226540
|
this.persistedQueriesPath = persistedQueriesPath ?? join4(this.rootDir, "persisted_queries.json");
|
|
@@ -226560,11 +226567,17 @@ var Config = class {
|
|
|
226560
226567
|
const include = [`src/**/*{${extensions.join(",")}}`];
|
|
226561
226568
|
for (const plugin2 of this.plugins) {
|
|
226562
226569
|
const runtimeDir = this.pluginRuntimeSource(plugin2);
|
|
226563
|
-
|
|
226570
|
+
const staticDir = this.pluginStaticRuntimeSource(plugin2);
|
|
226571
|
+
if (!runtimeDir && !staticDir) {
|
|
226564
226572
|
continue;
|
|
226565
226573
|
}
|
|
226566
|
-
const
|
|
226567
|
-
|
|
226574
|
+
for (const dir of [runtimeDir, staticDir]) {
|
|
226575
|
+
if (!dir) {
|
|
226576
|
+
continue;
|
|
226577
|
+
}
|
|
226578
|
+
const includePath = relative3(this.projectRoot, dir);
|
|
226579
|
+
include.push(`${includePath}/**/*{${extensions.join(",")}}`);
|
|
226580
|
+
}
|
|
226568
226581
|
}
|
|
226569
226582
|
return include;
|
|
226570
226583
|
}
|
|
@@ -226618,6 +226631,15 @@ var Config = class {
|
|
|
226618
226631
|
typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
|
|
226619
226632
|
);
|
|
226620
226633
|
}
|
|
226634
|
+
pluginStaticRuntimeSource(plugin2) {
|
|
226635
|
+
if (!plugin2.staticRuntime) {
|
|
226636
|
+
return null;
|
|
226637
|
+
}
|
|
226638
|
+
return join4(
|
|
226639
|
+
dirname3(plugin2.filepath),
|
|
226640
|
+
typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
|
|
226641
|
+
);
|
|
226642
|
+
}
|
|
226621
226643
|
async sourceFiles() {
|
|
226622
226644
|
return [
|
|
226623
226645
|
...new Set(
|
|
@@ -226814,6 +226836,9 @@ var Config = class {
|
|
|
226814
226836
|
pluginRuntimeDirectory(name) {
|
|
226815
226837
|
return join4(this.pluginDirectory(name), "runtime");
|
|
226816
226838
|
}
|
|
226839
|
+
pluginStaticRuntimeDirectory(name) {
|
|
226840
|
+
return join4(this.pluginDirectory(name), "static");
|
|
226841
|
+
}
|
|
226817
226842
|
get pluginRootDirectory() {
|
|
226818
226843
|
return houdini_mode3.is_testing ? "../../../" : join4(this.rootDir, "plugins");
|
|
226819
226844
|
}
|
|
@@ -300709,9 +300734,7 @@ import type { ${functionImportsToBring.join(
|
|
|
300709
300734
|
", "
|
|
300710
300735
|
)} } from '${houdiniRelative}/plugins/houdini-svelte/runtime/types';` : "";
|
|
300711
300736
|
typeImports = typeImports.concat(functionImports).concat(layoutTypeImports).concat(pageTypeImports).concat(componentQueryTypeImports);
|
|
300712
|
-
|
|
300713
|
-
const pageParams = `${pageQueries.length > 0 && !utilityTypes.includes("PageParams") ? "\ntype PageParams = PageLoadEvent['params'];" : ""}`;
|
|
300714
|
-
utilityTypes = utilityTypes.concat(layoutParams).concat(pageParams).replaceAll(/\$types\.js/gm, "$houdini");
|
|
300737
|
+
utilityTypes = utilityTypes.replaceAll(/\$types\.js/gm, "$houdini");
|
|
300715
300738
|
typeExports = typeExports.concat(append_loadInput([...layoutQueries, ...pageQueries])).concat(layout_append_beforeLoad).concat(page_append_beforeLoad).concat(layout_append_afterLoad).concat(page_append_afterLoad).concat(layout_append_onError).concat(page_append_onError).concat(layout_append_VariablesFunction).concat(page_append_VariablesFunction).concat(component_append_VariablesFunction).replace(
|
|
300716
300739
|
//regex to append our generated stores to the existing
|
|
300717
300740
|
//match all between 'LayoutData =' and ';' and combine additional types
|
|
@@ -300796,7 +300819,7 @@ function append_VariablesFunction(type, filepath, config, queries) {
|
|
|
300796
300819
|
return `
|
|
300797
300820
|
export type ${config.variableFunctionName(
|
|
300798
300821
|
name
|
|
300799
|
-
)} = VariableFunction<${type}
|
|
300822
|
+
)} = VariableFunction<${type}LoadEvent, ${input_type}>;`;
|
|
300800
300823
|
}).join("\n");
|
|
300801
300824
|
}
|
|
300802
300825
|
function append_ComponentVariablesFunction(filepath, config, queries) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini-svelte",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.3",
|
|
4
4
|
"description": "The svelte plugin for houdini",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"graphql": "^16.10.0",
|
|
31
31
|
"recast": "^0.23.1",
|
|
32
32
|
"rollup": "^4.39.0",
|
|
33
|
-
"houdini": "^2.0.0-next.
|
|
33
|
+
"houdini": "^2.0.0-next.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@sveltejs/kit": "^2.9.0",
|