houdini 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/cmd-cjs/index.js +130 -121
- package/build/cmd-esm/index.js +130 -121
- package/build/codegen/generators/artifacts/index.d.ts +2 -2
- package/build/codegen/generators/artifacts/indexFile.d.ts +2 -2
- package/build/codegen/generators/artifacts/selection.d.ts +2 -2
- package/build/codegen/generators/indexFile/index.d.ts +2 -2
- package/build/codegen/generators/persistedQueries/index.d.ts +2 -2
- package/build/codegen/generators/runtime/graphqlFunction.d.ts +2 -2
- package/build/codegen/generators/runtime/index.d.ts +2 -2
- package/build/codegen/generators/typescript/documentTypes.d.ts +2 -2
- package/build/codegen/generators/typescript/imperativeTypeDef.d.ts +2 -2
- package/build/codegen/generators/typescript/index.d.ts +2 -2
- package/build/codegen/index.d.ts +2 -2
- package/build/codegen/transforms/addID.d.ts +2 -2
- package/build/codegen/transforms/composeQueries.d.ts +4 -4
- package/build/codegen/transforms/fragmentVariables.d.ts +2 -2
- package/build/codegen/transforms/list.d.ts +2 -2
- package/build/codegen/transforms/paginate.d.ts +2 -2
- package/build/codegen/transforms/schema.d.ts +2 -2
- package/build/codegen/transforms/typename.d.ts +2 -2
- package/build/codegen/validators/noIDAlias.d.ts +2 -2
- package/build/codegen/validators/plugins.d.ts +2 -2
- package/build/codegen/validators/typeCheck.d.ts +2 -2
- package/build/codegen/validators/uniqueNames.d.ts +2 -2
- package/build/codegen-cjs/index.js +127 -118
- package/build/codegen-esm/index.js +127 -118
- package/build/lib/graphql.d.ts +2 -2
- package/build/lib/types.d.ts +35 -35
- package/build/lib-cjs/index.js +1 -1
- package/build/lib-esm/index.js +1 -1
- package/build/test/index.d.ts +3 -3
- package/build/test-cjs/index.js +125 -116
- package/build/test-esm/index.js +125 -116
- package/build/vite-cjs/index.js +130 -121
- package/build/vite-esm/index.js +130 -121
- package/package.json +1 -1
package/build/cmd-esm/index.js
CHANGED
|
@@ -70509,7 +70509,7 @@ async function getConfig({
|
|
|
70509
70509
|
}
|
|
70510
70510
|
}
|
|
70511
70511
|
_config.plugins = orderedPlugins(plugins);
|
|
70512
|
-
await Promise.all(_config.plugins.map((plugin2) => plugin2.
|
|
70512
|
+
await Promise.all(_config.plugins.map((plugin2) => plugin2.afterLoad?.({ config: _config })));
|
|
70513
70513
|
resolve2(_config);
|
|
70514
70514
|
return _config;
|
|
70515
70515
|
} catch (e2) {
|
|
@@ -71429,7 +71429,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
71429
71429
|
name: "generated::fragmentVariables",
|
|
71430
71430
|
kind: "HoudiniFragment" /* Fragment */,
|
|
71431
71431
|
document: doc,
|
|
71432
|
-
|
|
71432
|
+
originalParsed: doc,
|
|
71433
71433
|
generateStore: false,
|
|
71434
71434
|
generateArtifact: false,
|
|
71435
71435
|
filename: "generated::fragmentVariables",
|
|
@@ -72352,7 +72352,7 @@ async function paginate(config2, documents) {
|
|
|
72352
72352
|
filename: doc.filename,
|
|
72353
72353
|
name: refetchQueryName,
|
|
72354
72354
|
document: queryDoc,
|
|
72355
|
-
|
|
72355
|
+
originalParsed: queryDoc,
|
|
72356
72356
|
generateArtifact: true,
|
|
72357
72357
|
generateStore: false,
|
|
72358
72358
|
refetch: doc.refetch,
|
|
@@ -72772,7 +72772,7 @@ async function addListFragments(config2, documents) {
|
|
|
72772
72772
|
generateArtifact: false,
|
|
72773
72773
|
generateStore: false,
|
|
72774
72774
|
document: generatedDoc,
|
|
72775
|
-
|
|
72775
|
+
originalParsed: generatedDoc,
|
|
72776
72776
|
filename: "generated::lists",
|
|
72777
72777
|
originalString: "",
|
|
72778
72778
|
artifact: null
|
|
@@ -73300,11 +73300,11 @@ function artifactGenerator(stats) {
|
|
|
73300
73300
|
};
|
|
73301
73301
|
const plugin_data = config2.plugins.reduce(
|
|
73302
73302
|
(prev, plugin2) => {
|
|
73303
|
-
if (!plugin2.
|
|
73303
|
+
if (!plugin2.artifactData) {
|
|
73304
73304
|
return prev;
|
|
73305
73305
|
}
|
|
73306
73306
|
const result = { ...prev };
|
|
73307
|
-
const dataToAdd = plugin2.
|
|
73307
|
+
const dataToAdd = plugin2.artifactData({ config: config2, document: doc }) ?? {};
|
|
73308
73308
|
if (Object.keys(dataToAdd).length > 0) {
|
|
73309
73309
|
result[plugin2.name] = dataToAdd;
|
|
73310
73310
|
}
|
|
@@ -73349,10 +73349,10 @@ function artifactGenerator(stats) {
|
|
|
73349
73349
|
}
|
|
73350
73350
|
doc.artifact = artifact;
|
|
73351
73351
|
for (const plugin2 of config2.plugins) {
|
|
73352
|
-
if (!plugin2.
|
|
73352
|
+
if (!plugin2.artifactEnd) {
|
|
73353
73353
|
continue;
|
|
73354
73354
|
}
|
|
73355
|
-
plugin2.
|
|
73355
|
+
plugin2.artifactEnd({ config: config2, document: doc });
|
|
73356
73356
|
}
|
|
73357
73357
|
const file = AST5.program([
|
|
73358
73358
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
@@ -73392,18 +73392,18 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
73392
73392
|
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
73393
73393
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
73394
73394
|
const contents = await parseJS(fileContent);
|
|
73395
|
-
const
|
|
73396
|
-
(plugin2) => plugin2.
|
|
73397
|
-
)?.
|
|
73398
|
-
if (!
|
|
73395
|
+
const graphqlTagReturn = config2.plugins.find(
|
|
73396
|
+
(plugin2) => plugin2.graphqlTagReturn
|
|
73397
|
+
)?.graphqlTagReturn;
|
|
73398
|
+
if (!graphqlTagReturn || !contents) {
|
|
73399
73399
|
return fileContent;
|
|
73400
73400
|
}
|
|
73401
73401
|
const overloaded_returns = {};
|
|
73402
73402
|
for (const doc of docs) {
|
|
73403
|
-
const return_value =
|
|
73403
|
+
const return_value = graphqlTagReturn({
|
|
73404
73404
|
config: config2,
|
|
73405
73405
|
document: doc,
|
|
73406
|
-
|
|
73406
|
+
ensureImport({ identifier, module }) {
|
|
73407
73407
|
ensureImports({
|
|
73408
73408
|
config: config2,
|
|
73409
73409
|
body: contents.script.body,
|
|
@@ -73451,18 +73451,18 @@ async function injectPlugins({
|
|
|
73451
73451
|
importStatement,
|
|
73452
73452
|
exportStatement
|
|
73453
73453
|
}) {
|
|
73454
|
-
const
|
|
73455
|
-
let plugins = plugin2.
|
|
73454
|
+
const clientPlugins = config2.plugins.filter((plugin2) => plugin2.clientPlugins).reduce((acc, plugin2) => {
|
|
73455
|
+
let plugins = plugin2.clientPlugins;
|
|
73456
73456
|
if (typeof plugins === "function") {
|
|
73457
73457
|
plugins = plugins(config2, config2.pluginConfig(plugin2.name));
|
|
73458
73458
|
}
|
|
73459
73459
|
return [...acc, ...Object.entries(plugins)];
|
|
73460
73460
|
}, []);
|
|
73461
|
-
return
|
|
73462
|
-
${
|
|
73461
|
+
return clientPlugins.length > 0 ? `
|
|
73462
|
+
${clientPlugins.map((plugin2, i2) => importStatement(plugin2[0], `plugin${i2}`))}
|
|
73463
73463
|
|
|
73464
73464
|
const plugins = [
|
|
73465
|
-
${
|
|
73465
|
+
${clientPlugins.map((plugin2, i2) => {
|
|
73466
73466
|
const suffix = `(${JSON.stringify(plugin2[1])})`;
|
|
73467
73467
|
return `plugin${i2}${suffix}`;
|
|
73468
73468
|
}).join(",\n")}
|
|
@@ -73506,18 +73506,18 @@ ${exportStatement("config")}
|
|
|
73506
73506
|
},
|
|
73507
73507
|
[path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
|
|
73508
73508
|
}),
|
|
73509
|
-
...config2.plugins.filter((plugin2) => plugin2.
|
|
73509
|
+
...config2.plugins.filter((plugin2) => plugin2.includeRuntime).map((plugin2) => generatePluginRuntime(config2, plugin2)),
|
|
73510
73510
|
generatePluginIndex({ config: config2, exportStatement: exportStar })
|
|
73511
73511
|
]);
|
|
73512
73512
|
await generateGraphqlReturnTypes(config2, docs);
|
|
73513
73513
|
}
|
|
73514
73514
|
async function generatePluginRuntime(config2, plugin2) {
|
|
73515
|
-
if (houdini_mode.is_testing || !plugin2.
|
|
73515
|
+
if (houdini_mode.is_testing || !plugin2.includeRuntime) {
|
|
73516
73516
|
return;
|
|
73517
73517
|
}
|
|
73518
73518
|
const runtime_path = path_exports.join(
|
|
73519
73519
|
path_exports.dirname(plugin2.filepath),
|
|
73520
|
-
typeof plugin2.
|
|
73520
|
+
typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime[config2.module]
|
|
73521
73521
|
);
|
|
73522
73522
|
try {
|
|
73523
73523
|
await fs_exports.stat(runtime_path);
|
|
@@ -73533,7 +73533,7 @@ async function generatePluginRuntime(config2, plugin2) {
|
|
|
73533
73533
|
runtime_path,
|
|
73534
73534
|
pluginDir,
|
|
73535
73535
|
Object.fromEntries(
|
|
73536
|
-
Object.entries(plugin2.
|
|
73536
|
+
Object.entries(plugin2.transformRuntime ?? {}).map(([key, value]) => [
|
|
73537
73537
|
path_exports.join(runtime_path, key),
|
|
73538
73538
|
(content) => value({ config: config2, content })
|
|
73539
73539
|
])
|
|
@@ -73927,7 +73927,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
73927
73927
|
const typePaths = [];
|
|
73928
73928
|
const fragmentDefinitions = {};
|
|
73929
73929
|
for (const document of docs) {
|
|
73930
|
-
for (const defn of document.
|
|
73930
|
+
for (const defn of document.originalParsed.definitions.filter(
|
|
73931
73931
|
({ kind }) => kind === "FragmentDefinition"
|
|
73932
73932
|
)) {
|
|
73933
73933
|
fragmentDefinitions[defn.name.value] = defn;
|
|
@@ -73935,47 +73935,54 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
73935
73935
|
}
|
|
73936
73936
|
const missingScalars = /* @__PURE__ */ new Set();
|
|
73937
73937
|
await Promise.all(
|
|
73938
|
-
docs.map(
|
|
73939
|
-
|
|
73940
|
-
|
|
73941
|
-
|
|
73942
|
-
|
|
73943
|
-
|
|
73944
|
-
|
|
73945
|
-
|
|
73946
|
-
|
|
73947
|
-
|
|
73948
|
-
|
|
73949
|
-
|
|
73950
|
-
|
|
73951
|
-
|
|
73952
|
-
|
|
73953
|
-
applyFragments: definition.kind === "OperationDefinition"
|
|
73954
|
-
});
|
|
73955
|
-
if (definition?.kind === "OperationDefinition") {
|
|
73956
|
-
await generateOperationTypeDefs(
|
|
73957
|
-
config2,
|
|
73958
|
-
filename,
|
|
73959
|
-
program3.body,
|
|
73960
|
-
definition,
|
|
73961
|
-
selections,
|
|
73962
|
-
visitedTypes,
|
|
73963
|
-
missingScalars
|
|
73964
|
-
);
|
|
73965
|
-
} else {
|
|
73966
|
-
await generateFragmentTypeDefs(
|
|
73967
|
-
config2,
|
|
73968
|
-
filename,
|
|
73969
|
-
program3.body,
|
|
73970
|
-
selections,
|
|
73971
|
-
originalDocument.definitions,
|
|
73972
|
-
visitedTypes,
|
|
73973
|
-
missingScalars
|
|
73938
|
+
docs.map(
|
|
73939
|
+
async ({
|
|
73940
|
+
originalParsed: originalDocument,
|
|
73941
|
+
name,
|
|
73942
|
+
filename,
|
|
73943
|
+
generateArtifact
|
|
73944
|
+
}) => {
|
|
73945
|
+
if (!generateArtifact) {
|
|
73946
|
+
return;
|
|
73947
|
+
}
|
|
73948
|
+
const typeDefPath = config2.artifactTypePath(originalDocument);
|
|
73949
|
+
const program3 = AST11.program([]);
|
|
73950
|
+
const visitedTypes = /* @__PURE__ */ new Set();
|
|
73951
|
+
let definition = originalDocument.definitions.find(
|
|
73952
|
+
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
73974
73953
|
);
|
|
73954
|
+
const selections = flattenSelections({
|
|
73955
|
+
config: config2,
|
|
73956
|
+
filepath: filename,
|
|
73957
|
+
selections: definition.selectionSet.selections,
|
|
73958
|
+
fragmentDefinitions,
|
|
73959
|
+
applyFragments: definition.kind === "OperationDefinition"
|
|
73960
|
+
});
|
|
73961
|
+
if (definition?.kind === "OperationDefinition") {
|
|
73962
|
+
await generateOperationTypeDefs(
|
|
73963
|
+
config2,
|
|
73964
|
+
filename,
|
|
73965
|
+
program3.body,
|
|
73966
|
+
definition,
|
|
73967
|
+
selections,
|
|
73968
|
+
visitedTypes,
|
|
73969
|
+
missingScalars
|
|
73970
|
+
);
|
|
73971
|
+
} else {
|
|
73972
|
+
await generateFragmentTypeDefs(
|
|
73973
|
+
config2,
|
|
73974
|
+
filename,
|
|
73975
|
+
program3.body,
|
|
73976
|
+
selections,
|
|
73977
|
+
originalDocument.definitions,
|
|
73978
|
+
visitedTypes,
|
|
73979
|
+
missingScalars
|
|
73980
|
+
);
|
|
73981
|
+
}
|
|
73982
|
+
await fs_exports.writeFile(typeDefPath, recast11.print(program3).code);
|
|
73983
|
+
typePaths.push(typeDefPath);
|
|
73975
73984
|
}
|
|
73976
|
-
|
|
73977
|
-
typePaths.push(typeDefPath);
|
|
73978
|
-
})
|
|
73985
|
+
)
|
|
73979
73986
|
);
|
|
73980
73987
|
const typeIndex = AST11.program(
|
|
73981
73988
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
@@ -73990,28 +73997,28 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
73990
73997
|
AST11.exportAllDeclaration(AST11.literal("./graphql"), null)
|
|
73991
73998
|
])
|
|
73992
73999
|
);
|
|
73993
|
-
const
|
|
74000
|
+
const exportDefaultAs = ({ module, as }) => `
|
|
73994
74001
|
export { default as ${as} } from "${module}"
|
|
73995
74002
|
`;
|
|
73996
|
-
const
|
|
74003
|
+
const exportStarFrom2 = ({ module }) => `
|
|
73997
74004
|
export * from "${module}"
|
|
73998
74005
|
`;
|
|
73999
74006
|
let indexContent = recast11.print(typeIndex).code;
|
|
74000
74007
|
for (const plugin2 of config2.plugins) {
|
|
74001
|
-
if (!plugin2.
|
|
74008
|
+
if (!plugin2.indexFile) {
|
|
74002
74009
|
continue;
|
|
74003
74010
|
}
|
|
74004
|
-
indexContent = plugin2.
|
|
74011
|
+
indexContent = plugin2.indexFile({
|
|
74005
74012
|
config: config2,
|
|
74006
74013
|
content: indexContent,
|
|
74007
|
-
|
|
74008
|
-
|
|
74009
|
-
|
|
74014
|
+
exportDefaultAs,
|
|
74015
|
+
exportStarFrom: exportStarFrom2,
|
|
74016
|
+
pluginRoot: config2.pluginDirectory(plugin2.name),
|
|
74010
74017
|
typedef: true,
|
|
74011
74018
|
documents: docs
|
|
74012
74019
|
});
|
|
74013
|
-
if (plugin2.
|
|
74014
|
-
indexContent +=
|
|
74020
|
+
if (plugin2.includeRuntime) {
|
|
74021
|
+
indexContent += exportStarFrom2({
|
|
74015
74022
|
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(plugin2.name))
|
|
74016
74023
|
});
|
|
74017
74024
|
}
|
|
@@ -74258,10 +74265,10 @@ var graphql19 = __toESM(require_graphql2(), 1);
|
|
|
74258
74265
|
var recast12 = __toESM(require_main2(), 1);
|
|
74259
74266
|
var AST12 = recast12.types.builders;
|
|
74260
74267
|
async function imperativeCacheTypef(config2, docs) {
|
|
74261
|
-
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.
|
|
74268
|
+
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
74262
74269
|
config: config2,
|
|
74263
74270
|
document: doc,
|
|
74264
|
-
|
|
74271
|
+
ensureImport({ identifier, module }) {
|
|
74265
74272
|
ensureImports({
|
|
74266
74273
|
config: config2,
|
|
74267
74274
|
body,
|
|
@@ -74632,27 +74639,30 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
74632
74639
|
console.log("Can only write the queryMap to a json file");
|
|
74633
74640
|
return;
|
|
74634
74641
|
}
|
|
74635
|
-
const queryMap = docs.reduce(
|
|
74636
|
-
|
|
74637
|
-
|
|
74638
|
-
|
|
74639
|
-
|
|
74640
|
-
graphql20.
|
|
74641
|
-
|
|
74642
|
-
|
|
74643
|
-
|
|
74642
|
+
const queryMap = docs.reduce(
|
|
74643
|
+
(acc, { document, generateArtifact }) => {
|
|
74644
|
+
if (!generateArtifact) {
|
|
74645
|
+
return acc;
|
|
74646
|
+
}
|
|
74647
|
+
let rawString = graphql20.print(
|
|
74648
|
+
graphql20.visit(document, {
|
|
74649
|
+
Directive(node) {
|
|
74650
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
74651
|
+
return null;
|
|
74652
|
+
}
|
|
74644
74653
|
}
|
|
74645
|
-
}
|
|
74646
|
-
|
|
74647
|
-
|
|
74648
|
-
|
|
74649
|
-
|
|
74650
|
-
|
|
74651
|
-
|
|
74652
|
-
|
|
74653
|
-
|
|
74654
|
-
|
|
74655
|
-
|
|
74654
|
+
})
|
|
74655
|
+
);
|
|
74656
|
+
const operations = document.definitions.filter(
|
|
74657
|
+
({ kind }) => kind === graphql20.Kind.OPERATION_DEFINITION
|
|
74658
|
+
);
|
|
74659
|
+
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
74660
|
+
acc[hashDocument({ config: config2, document: rawString })] = rawString;
|
|
74661
|
+
}
|
|
74662
|
+
return acc;
|
|
74663
|
+
},
|
|
74664
|
+
{}
|
|
74665
|
+
);
|
|
74656
74666
|
if (Object.keys(queryMap).length === 0)
|
|
74657
74667
|
return;
|
|
74658
74668
|
await fs_exports.writeFile(config2.persistedQueryPath, JSON.stringify(queryMap, null, 4));
|
|
@@ -74721,32 +74731,32 @@ async function writeIndexFile2(config2, docs) {
|
|
|
74721
74731
|
const definitionsDir = relative2(config2.definitionsDirectory);
|
|
74722
74732
|
const cjs = config2.module === "commonjs";
|
|
74723
74733
|
let body = cjs ? cjsIndexFilePreamble : "";
|
|
74724
|
-
const
|
|
74725
|
-
const
|
|
74734
|
+
const exportStar = ({ module }) => "\n" + (cjs ? exportStarFrom(module) : `export * from "${module}"`) + "\n";
|
|
74735
|
+
const exportDefaultAs = ({ module, as }) => "\n" + (cjs ? exportDefaultFrom(module, as) : `export { default as ${as} } from "${module}"`) + "\n";
|
|
74726
74736
|
body += [
|
|
74727
|
-
|
|
74728
|
-
|
|
74729
|
-
|
|
74730
|
-
|
|
74737
|
+
exportStar({ module: "./" + path_exports.join(runtimeDir, "client") }),
|
|
74738
|
+
exportStar({ module: runtimeDir }),
|
|
74739
|
+
exportStar({ module: artifactDir }),
|
|
74740
|
+
exportStar({ module: definitionsDir })
|
|
74731
74741
|
].join("");
|
|
74732
74742
|
for (const plugin2 of config2.plugins) {
|
|
74733
|
-
if (plugin2.
|
|
74734
|
-
body = plugin2.
|
|
74743
|
+
if (plugin2.indexFile) {
|
|
74744
|
+
body = plugin2.indexFile({
|
|
74735
74745
|
config: config2,
|
|
74736
74746
|
content: body,
|
|
74737
|
-
|
|
74738
|
-
|
|
74739
|
-
|
|
74747
|
+
exportDefaultAs,
|
|
74748
|
+
exportStarFrom: exportStar,
|
|
74749
|
+
pluginRoot: config2.pluginDirectory(plugin2.name),
|
|
74740
74750
|
typedef: false,
|
|
74741
74751
|
documents: docs
|
|
74742
74752
|
});
|
|
74743
74753
|
}
|
|
74744
|
-
if (plugin2.
|
|
74745
|
-
body +=
|
|
74754
|
+
if (plugin2.includeRuntime) {
|
|
74755
|
+
body += exportStar({
|
|
74746
74756
|
module: relative2(config2.pluginRuntimeDirectory(plugin2.name))
|
|
74747
74757
|
});
|
|
74748
74758
|
}
|
|
74749
|
-
if (!plugin2.
|
|
74759
|
+
if (!plugin2.indexFile) {
|
|
74750
74760
|
continue;
|
|
74751
74761
|
}
|
|
74752
74762
|
}
|
|
@@ -75794,10 +75804,10 @@ async function runPipeline2(config2, docs) {
|
|
|
75794
75804
|
deleted: []
|
|
75795
75805
|
};
|
|
75796
75806
|
const generatePlugins = config2.plugins.filter((plugin2) => plugin2.generate);
|
|
75797
|
-
const
|
|
75807
|
+
const afterValidate = config2.plugins.filter((plugin2) => plugin2.afterValidate).map((plugin2) => plugin2.afterValidate);
|
|
75798
75808
|
const validate2 = config2.plugins.filter((plugin2) => plugin2.validate).map((plugin2) => plugin2.validate);
|
|
75799
|
-
const
|
|
75800
|
-
const
|
|
75809
|
+
const beforeValidate = config2.plugins.filter((plugin2) => plugin2.beforeValidate).map((plugin2) => plugin2.beforeValidate);
|
|
75810
|
+
const beforeGenerate = config2.plugins.filter((plugin2) => plugin2.beforeGenerate).map((plugin2) => plugin2.beforeGenerate);
|
|
75801
75811
|
const wrapHook = (hooks) => hooks.map(
|
|
75802
75812
|
(fn) => (config3, docs2) => fn({
|
|
75803
75813
|
config: config3,
|
|
@@ -75810,20 +75820,20 @@ async function runPipeline2(config2, docs) {
|
|
|
75810
75820
|
config2,
|
|
75811
75821
|
[
|
|
75812
75822
|
graphqlExtensions,
|
|
75813
|
-
...wrapHook(
|
|
75823
|
+
...wrapHook(beforeValidate),
|
|
75814
75824
|
typeCheck,
|
|
75815
75825
|
uniqueDocumentNames,
|
|
75816
75826
|
noIDAlias,
|
|
75817
75827
|
validatePlugins,
|
|
75818
75828
|
...wrapHook(validate2),
|
|
75819
|
-
...wrapHook(
|
|
75829
|
+
...wrapHook(afterValidate),
|
|
75820
75830
|
addID,
|
|
75821
75831
|
addTypename,
|
|
75822
75832
|
addListFragments,
|
|
75823
75833
|
paginate,
|
|
75824
75834
|
fragmentVariables,
|
|
75825
75835
|
includeFragmentDefinitions,
|
|
75826
|
-
...wrapHook(
|
|
75836
|
+
...wrapHook(beforeGenerate),
|
|
75827
75837
|
artifactGenerator(artifactStats),
|
|
75828
75838
|
runtimeGenerator,
|
|
75829
75839
|
writeIndexFile2,
|
|
@@ -75834,14 +75844,13 @@ async function runPipeline2(config2, docs) {
|
|
|
75834
75844
|
(plugin2) => async (config3, docs2) => await plugin2.generate({
|
|
75835
75845
|
config: config3,
|
|
75836
75846
|
documents: docs2,
|
|
75837
|
-
|
|
75847
|
+
pluginRoot: config3.pluginDirectory(plugin2.name)
|
|
75838
75848
|
})
|
|
75839
75849
|
)
|
|
75840
75850
|
],
|
|
75841
75851
|
docs
|
|
75842
75852
|
);
|
|
75843
75853
|
} catch (e2) {
|
|
75844
|
-
console.log(e2);
|
|
75845
75854
|
error = e2;
|
|
75846
75855
|
}
|
|
75847
75856
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
@@ -75891,9 +75900,9 @@ async function collectDocuments(config2) {
|
|
|
75891
75900
|
".ts": []
|
|
75892
75901
|
};
|
|
75893
75902
|
for (const plugin2 of config2.plugins) {
|
|
75894
|
-
if (plugin2.extensions && plugin2.
|
|
75903
|
+
if (plugin2.extensions && plugin2.extractDocuments) {
|
|
75895
75904
|
for (const extension of plugin2.extensions) {
|
|
75896
|
-
extractors[extension] = [...extractors[extension] || [], plugin2.
|
|
75905
|
+
extractors[extension] = [...extractors[extension] || [], plugin2.extractDocuments];
|
|
75897
75906
|
}
|
|
75898
75907
|
}
|
|
75899
75908
|
}
|
|
@@ -75992,7 +76001,7 @@ async function processGraphQLDocument(config2, filepath, document) {
|
|
|
75992
76001
|
kind,
|
|
75993
76002
|
document: parsedDoc,
|
|
75994
76003
|
filename: filepath,
|
|
75995
|
-
|
|
76004
|
+
originalParsed: parsedDoc,
|
|
75996
76005
|
generateArtifact: true,
|
|
75997
76006
|
generateStore: true,
|
|
75998
76007
|
originalString: document,
|
|
@@ -76476,8 +76485,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
76476
76485
|
}
|
|
76477
76486
|
packageJSON.devDependencies = {
|
|
76478
76487
|
...packageJSON.devDependencies,
|
|
76479
|
-
houdini: "^1.0.0-next.
|
|
76480
|
-
"houdini-svelte": "^1.0.0-next.
|
|
76488
|
+
houdini: "^1.0.0-next.6",
|
|
76489
|
+
"houdini-svelte": "^1.0.0-next.6"
|
|
76481
76490
|
};
|
|
76482
76491
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
76483
76492
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Config,
|
|
1
|
+
import type { Config, Document } from '../../../lib';
|
|
2
2
|
export default function artifactGenerator(stats: {
|
|
3
3
|
total: string[];
|
|
4
4
|
new: string[];
|
|
5
5
|
changed: string[];
|
|
6
6
|
deleted: string[];
|
|
7
|
-
}): (config: Config, docs:
|
|
7
|
+
}): (config: Config, docs: Document[]) => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function writeIndexFile(config: Config, docs:
|
|
1
|
+
import type { Config, Document } from '../../../lib';
|
|
2
|
+
export default function writeIndexFile(config: Config, docs: Document[]): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as graphql from 'graphql';
|
|
2
|
-
import type { Config,
|
|
2
|
+
import type { Config, Document } from '../../../lib';
|
|
3
3
|
import { type MutationOperation, type SubscriptionSelection } from '../../../runtime/lib/types';
|
|
4
4
|
export default function selection({ config, filepath, rootType, selections, operations, path, includeFragments, document, inConnection, }: {
|
|
5
5
|
config: Config;
|
|
@@ -11,6 +11,6 @@ export default function selection({ config, filepath, rootType, selections, oper
|
|
|
11
11
|
};
|
|
12
12
|
path?: string[];
|
|
13
13
|
includeFragments: boolean;
|
|
14
|
-
document:
|
|
14
|
+
document: Document;
|
|
15
15
|
inConnection?: boolean;
|
|
16
16
|
}): SubscriptionSelection;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function writeIndexFile(config: Config, docs:
|
|
1
|
+
import type { Config, Document } from '../../../lib';
|
|
2
|
+
export default function writeIndexFile(config: Config, docs: Document[]): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function persistOutputGenerator(config: Config, docs:
|
|
1
|
+
import type { Config, Document } from '../../../lib';
|
|
2
|
+
export default function persistOutputGenerator(config: Config, docs: Document[]): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type Config, type
|
|
2
|
-
export default function generateGraphqlReturnTypes(config: Config, docs:
|
|
1
|
+
import { type Config, type Document } from '../../../lib';
|
|
2
|
+
export default function generateGraphqlReturnTypes(config: Config, docs: Document[]): Promise<string | undefined>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function runtimeGenerator(config: Config, docs:
|
|
1
|
+
import type { Config, Document } from '../../../lib';
|
|
2
|
+
export default function runtimeGenerator(config: Config, docs: Document[]): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export declare function generateDocumentTypes(config: Config, docs:
|
|
1
|
+
import type { Config, Document } from '../../../lib';
|
|
2
|
+
export declare function generateDocumentTypes(config: Config, docs: Document[]): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type Config, type
|
|
2
|
-
export default function imperativeCacheTypef(config: Config, docs:
|
|
1
|
+
import { type Config, type Document } from '../../../lib';
|
|
2
|
+
export default function imperativeCacheTypef(config: Config, docs: Document[]): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function typescriptGenerator(config: Config, docs:
|
|
1
|
+
import type { Config, Document } from '../../../lib';
|
|
2
|
+
export default function typescriptGenerator(config: Config, docs: Document[]): Promise<void>;
|
package/build/codegen/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Config,
|
|
1
|
+
import type { Config, Document } from '../lib';
|
|
2
2
|
export default function compile(config: Config): Promise<void>;
|
|
3
|
-
export declare function runPipeline(config: Config, docs:
|
|
3
|
+
export declare function runPipeline(config: Config, docs: Document[]): Promise<void>;
|
|
4
4
|
export type DiscoveredDoc = {
|
|
5
5
|
filepath: string;
|
|
6
6
|
document: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function addID(config: Config, documents:
|
|
1
|
+
import type { Config, Document } from '../../lib';
|
|
2
|
+
export default function addID(config: Config, documents: Document[]): Promise<void>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type graphql from 'graphql';
|
|
2
|
-
import type { Config,
|
|
2
|
+
import type { Config, Document } from '../../lib';
|
|
3
3
|
export type FragmentDependency = {
|
|
4
4
|
definition: graphql.FragmentDefinitionNode;
|
|
5
5
|
requiredFragments: string[];
|
|
6
|
-
document:
|
|
6
|
+
document: Document;
|
|
7
7
|
};
|
|
8
|
-
export default function includeFragmentDefinitions(config: Config, documents:
|
|
9
|
-
export declare function collectFragments(config: Config, docs:
|
|
8
|
+
export default function includeFragmentDefinitions(config: Config, documents: Document[]): Promise<void>;
|
|
9
|
+
export declare function collectFragments(config: Config, docs: Document[]): Record<string, FragmentDependency>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as graphql from 'graphql';
|
|
2
|
-
import type { Config,
|
|
2
|
+
import type { Config, Document } from '../../lib';
|
|
3
3
|
import type { FragmentDependency } from './composeQueries';
|
|
4
|
-
export default function fragmentVariables(config: Config, documents:
|
|
4
|
+
export default function fragmentVariables(config: Config, documents: Document[]): Promise<void>;
|
|
5
5
|
type ValueMap = Record<string, graphql.ValueNode>;
|
|
6
6
|
export declare function inlineFragmentArgs({ config, filepath, fragmentDefinitions, document, generatedFragments, visitedFragments, scope, newName, }: {
|
|
7
7
|
config: Config;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as graphql from 'graphql';
|
|
2
|
-
import type { Config,
|
|
3
|
-
export default function addListFragments(config: Config, documents:
|
|
2
|
+
import type { Config, Document } from '../../lib';
|
|
3
|
+
export default function addListFragments(config: Config, documents: Document[]): Promise<void>;
|
|
4
4
|
export declare function connectionSelection(config: Config, field: graphql.GraphQLField<any, any>, type: graphql.GraphQLObjectType, selection: graphql.SelectionSetNode | undefined): {
|
|
5
5
|
selection: graphql.SelectionSetNode | undefined;
|
|
6
6
|
type: graphql.GraphQLObjectType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function paginate(config: Config, documents:
|
|
1
|
+
import type { Config, Document } from '../../lib';
|
|
2
|
+
export default function paginate(config: Config, documents: Document[]): Promise<void>;
|
|
3
3
|
export declare const pageInfoSelection: {
|
|
4
4
|
kind: "Field";
|
|
5
5
|
name: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function graphqlExtensions(config: Config, documents:
|
|
1
|
+
import type { Config, Document } from '../../lib';
|
|
2
|
+
export default function graphqlExtensions(config: Config, documents: Document[]): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function addTypename(config: Config, documents:
|
|
1
|
+
import type { Config, Document } from '../../lib';
|
|
2
|
+
export default function addTypename(config: Config, documents: Document[]): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config,
|
|
2
|
-
export default function noIDAlias(config: Config, docs:
|
|
1
|
+
import type { Config, Document } from '../../lib';
|
|
2
|
+
export default function noIDAlias(config: Config, docs: Document[]): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Config } from '../../lib/config';
|
|
2
|
-
import type {
|
|
3
|
-
export default function validatePlugins(config: Config, documents:
|
|
2
|
+
import type { Document } from '../../lib/types';
|
|
3
|
+
export default function validatePlugins(config: Config, documents: Document[]): Promise<void>;
|