houdini-svelte 2.2.0-next.5 → 3.0.0-next.11
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/config.d.ts +0 -10
- package/build/plugin/kit.d.ts +1 -3
- package/build/plugin-cjs/index.js +53 -345
- package/build/plugin-esm/index.js +53 -345
- package/build/preprocess-cjs/index.js +16 -57
- package/build/preprocess-esm/index.js +16 -57
- package/build/test-cjs/index.js +140 -407
- package/build/test-esm/index.js +140 -407
- package/package.json +2 -2
- package/build/plugin/fsPatch.d.ts +0 -27
package/build/test-cjs/index.js
CHANGED
|
@@ -2368,7 +2368,7 @@ var require_path_visitor4 = __commonJS({
|
|
|
2368
2368
|
}
|
|
2369
2369
|
return target;
|
|
2370
2370
|
}
|
|
2371
|
-
PathVisitor.visit = function
|
|
2371
|
+
PathVisitor.visit = function visit54(node, methods) {
|
|
2372
2372
|
return PathVisitor.fromMethodsObject(methods).visit(node);
|
|
2373
2373
|
};
|
|
2374
2374
|
var PVp = PathVisitor.prototype;
|
|
@@ -2559,7 +2559,7 @@ var require_path_visitor4 = __commonJS({
|
|
|
2559
2559
|
this.needToCallTraverse = false;
|
|
2560
2560
|
return visitChildren(path7, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
|
|
2561
2561
|
};
|
|
2562
|
-
sharedContextProtoMethods.visit = function
|
|
2562
|
+
sharedContextProtoMethods.visit = function visit54(path7, newVisitor) {
|
|
2563
2563
|
if (!(this instanceof this.Context)) {
|
|
2564
2564
|
throw new Error("");
|
|
2565
2565
|
}
|
|
@@ -4001,7 +4001,7 @@ var require_main5 = __commonJS({
|
|
|
4001
4001
|
var someField = _a.someField;
|
|
4002
4002
|
var Type = _a.Type;
|
|
4003
4003
|
var use = _a.use;
|
|
4004
|
-
var
|
|
4004
|
+
var visit54 = _a.visit;
|
|
4005
4005
|
exports2.astNodesAreEquivalent = astNodesAreEquivalent;
|
|
4006
4006
|
exports2.builders = builders;
|
|
4007
4007
|
exports2.builtInTypes = builtInTypes;
|
|
@@ -4018,7 +4018,7 @@ var require_main5 = __commonJS({
|
|
|
4018
4018
|
exports2.someField = someField;
|
|
4019
4019
|
exports2.Type = Type;
|
|
4020
4020
|
exports2.use = use;
|
|
4021
|
-
exports2.visit =
|
|
4021
|
+
exports2.visit = visit54;
|
|
4022
4022
|
Object.assign(namedTypes_1.namedTypes, n);
|
|
4023
4023
|
}
|
|
4024
4024
|
});
|
|
@@ -6097,7 +6097,7 @@ var require_esprima7 = __commonJS({
|
|
|
6097
6097
|
var jsx_parser_1 = __webpack_require__(3);
|
|
6098
6098
|
var parser_1 = __webpack_require__(8);
|
|
6099
6099
|
var tokenizer_1 = __webpack_require__(15);
|
|
6100
|
-
function
|
|
6100
|
+
function parse23(code, options, delegate) {
|
|
6101
6101
|
var commentHandler = null;
|
|
6102
6102
|
var proxyDelegate = function(node, metadata) {
|
|
6103
6103
|
if (delegate) {
|
|
@@ -6142,17 +6142,17 @@ var require_esprima7 = __commonJS({
|
|
|
6142
6142
|
}
|
|
6143
6143
|
return ast;
|
|
6144
6144
|
}
|
|
6145
|
-
exports3.parse =
|
|
6145
|
+
exports3.parse = parse23;
|
|
6146
6146
|
function parseModule(code, options, delegate) {
|
|
6147
6147
|
var parsingOptions = options || {};
|
|
6148
6148
|
parsingOptions.sourceType = "module";
|
|
6149
|
-
return
|
|
6149
|
+
return parse23(code, parsingOptions, delegate);
|
|
6150
6150
|
}
|
|
6151
6151
|
exports3.parseModule = parseModule;
|
|
6152
6152
|
function parseScript(code, options, delegate) {
|
|
6153
6153
|
var parsingOptions = options || {};
|
|
6154
6154
|
parsingOptions.sourceType = "script";
|
|
6155
|
-
return
|
|
6155
|
+
return parse23(code, parsingOptions, delegate);
|
|
6156
6156
|
}
|
|
6157
6157
|
exports3.parseScript = parseScript;
|
|
6158
6158
|
function tokenize(code, options, delegate) {
|
|
@@ -12292,7 +12292,7 @@ var require_esprima8 = __commonJS({
|
|
|
12292
12292
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12293
12293
|
exports2.parse = void 0;
|
|
12294
12294
|
var util_1 = require_util6();
|
|
12295
|
-
function
|
|
12295
|
+
function parse23(source, options) {
|
|
12296
12296
|
var comments = [];
|
|
12297
12297
|
var ast = require_esprima7().parse(source, {
|
|
12298
12298
|
loc: true,
|
|
@@ -12310,7 +12310,7 @@ var require_esprima8 = __commonJS({
|
|
|
12310
12310
|
}
|
|
12311
12311
|
return ast;
|
|
12312
12312
|
}
|
|
12313
|
-
exports2.parse =
|
|
12313
|
+
exports2.parse = parse23;
|
|
12314
12314
|
}
|
|
12315
12315
|
});
|
|
12316
12316
|
|
|
@@ -13448,7 +13448,7 @@ var require_parser4 = __commonJS({
|
|
|
13448
13448
|
var lines_1 = require_lines4();
|
|
13449
13449
|
var comments_1 = require_comments4();
|
|
13450
13450
|
var util = tslib_1.__importStar(require_util6());
|
|
13451
|
-
function
|
|
13451
|
+
function parse23(source, options) {
|
|
13452
13452
|
options = (0, options_1.normalize)(options);
|
|
13453
13453
|
var lines = (0, lines_1.fromString)(source, options);
|
|
13454
13454
|
var sourceWithoutTabs = lines.toString({
|
|
@@ -13520,7 +13520,7 @@ var require_parser4 = __commonJS({
|
|
|
13520
13520
|
(0, comments_1.attach)(comments, program.body.length ? file.program : file, lines);
|
|
13521
13521
|
return new TreeCopier(lines, tokens).copy(file);
|
|
13522
13522
|
}
|
|
13523
|
-
exports2.parse =
|
|
13523
|
+
exports2.parse = parse23;
|
|
13524
13524
|
var TreeCopier = function TreeCopier2(lines, tokens) {
|
|
13525
13525
|
assert_1.default.ok(this instanceof TreeCopier2);
|
|
13526
13526
|
this.lines = lines;
|
|
@@ -19606,7 +19606,7 @@ var require_jsonfile = __commonJS2({
|
|
|
19606
19606
|
}
|
|
19607
19607
|
var universalify = require_universalify();
|
|
19608
19608
|
var { stringify, stripBom } = require_utils2();
|
|
19609
|
-
async function
|
|
19609
|
+
async function _readFile(file, options = {}) {
|
|
19610
19610
|
if (typeof options === "string") {
|
|
19611
19611
|
options = { encoding: options };
|
|
19612
19612
|
}
|
|
@@ -19627,7 +19627,7 @@ var require_jsonfile = __commonJS2({
|
|
|
19627
19627
|
}
|
|
19628
19628
|
return obj;
|
|
19629
19629
|
}
|
|
19630
|
-
var readFile22 = universalify.fromPromise(
|
|
19630
|
+
var readFile22 = universalify.fromPromise(_readFile);
|
|
19631
19631
|
function readFileSync22(file, options = {}) {
|
|
19632
19632
|
if (typeof options === "string") {
|
|
19633
19633
|
options = { encoding: options };
|
|
@@ -20381,49 +20381,49 @@ var require_Dirent = __commonJS2({
|
|
|
20381
20381
|
var S_IFLNK = constants_1.constants.S_IFLNK;
|
|
20382
20382
|
var S_IFIFO = constants_1.constants.S_IFIFO;
|
|
20383
20383
|
var S_IFSOCK = constants_1.constants.S_IFSOCK;
|
|
20384
|
-
var
|
|
20384
|
+
var Dirent = (
|
|
20385
20385
|
/** @class */
|
|
20386
20386
|
function() {
|
|
20387
|
-
function
|
|
20387
|
+
function Dirent2() {
|
|
20388
20388
|
this.name = "";
|
|
20389
20389
|
this.mode = 0;
|
|
20390
20390
|
}
|
|
20391
|
-
|
|
20392
|
-
var dirent = new
|
|
20391
|
+
Dirent2.build = function(link, encoding) {
|
|
20392
|
+
var dirent = new Dirent2();
|
|
20393
20393
|
var mode = link.getNode().mode;
|
|
20394
20394
|
dirent.name = (0, encoding_1.strToEncoding)(link.getName(), encoding);
|
|
20395
20395
|
dirent.mode = mode;
|
|
20396
20396
|
return dirent;
|
|
20397
20397
|
};
|
|
20398
|
-
|
|
20398
|
+
Dirent2.prototype._checkModeProperty = function(property) {
|
|
20399
20399
|
return (this.mode & S_IFMT) === property;
|
|
20400
20400
|
};
|
|
20401
|
-
|
|
20401
|
+
Dirent2.prototype.isDirectory = function() {
|
|
20402
20402
|
return this._checkModeProperty(S_IFDIR);
|
|
20403
20403
|
};
|
|
20404
|
-
|
|
20404
|
+
Dirent2.prototype.isFile = function() {
|
|
20405
20405
|
return this._checkModeProperty(S_IFREG);
|
|
20406
20406
|
};
|
|
20407
|
-
|
|
20407
|
+
Dirent2.prototype.isBlockDevice = function() {
|
|
20408
20408
|
return this._checkModeProperty(S_IFBLK);
|
|
20409
20409
|
};
|
|
20410
|
-
|
|
20410
|
+
Dirent2.prototype.isCharacterDevice = function() {
|
|
20411
20411
|
return this._checkModeProperty(S_IFCHR);
|
|
20412
20412
|
};
|
|
20413
|
-
|
|
20413
|
+
Dirent2.prototype.isSymbolicLink = function() {
|
|
20414
20414
|
return this._checkModeProperty(S_IFLNK);
|
|
20415
20415
|
};
|
|
20416
|
-
|
|
20416
|
+
Dirent2.prototype.isFIFO = function() {
|
|
20417
20417
|
return this._checkModeProperty(S_IFIFO);
|
|
20418
20418
|
};
|
|
20419
|
-
|
|
20419
|
+
Dirent2.prototype.isSocket = function() {
|
|
20420
20420
|
return this._checkModeProperty(S_IFSOCK);
|
|
20421
20421
|
};
|
|
20422
|
-
return
|
|
20422
|
+
return Dirent2;
|
|
20423
20423
|
}()
|
|
20424
20424
|
);
|
|
20425
|
-
exports2.Dirent =
|
|
20426
|
-
exports2.default =
|
|
20425
|
+
exports2.Dirent = Dirent;
|
|
20426
|
+
exports2.default = Dirent;
|
|
20427
20427
|
}
|
|
20428
20428
|
});
|
|
20429
20429
|
var require_setImmediate = __commonJS2({
|
|
@@ -85302,15 +85302,6 @@ function serialized_manifest_path(config, base = base_dir(config)) {
|
|
|
85302
85302
|
return join2(base, "manifest.json");
|
|
85303
85303
|
}
|
|
85304
85304
|
var t2 = __toESM2(require_lib5(), 1);
|
|
85305
|
-
function definitionFromAncestors(ancestors) {
|
|
85306
|
-
let parents = [...ancestors];
|
|
85307
|
-
parents.shift();
|
|
85308
|
-
let definition = parents.shift();
|
|
85309
|
-
while (Array.isArray(definition) && definition) {
|
|
85310
|
-
definition = parents.shift();
|
|
85311
|
-
}
|
|
85312
|
-
return { parents, definition };
|
|
85313
|
-
}
|
|
85314
85305
|
function formatErrors(e22, afterError) {
|
|
85315
85306
|
const errors = Array.isArray(e22) ? e22 : [e22];
|
|
85316
85307
|
for (const error of errors) {
|
|
@@ -91174,7 +91165,7 @@ var require_jsonfile3 = __commonJS3({
|
|
|
91174
91165
|
}
|
|
91175
91166
|
var universalify = require_universalify2();
|
|
91176
91167
|
var { stringify, stripBom } = require_utils22();
|
|
91177
|
-
async function
|
|
91168
|
+
async function _readFile(file, options = {}) {
|
|
91178
91169
|
if (typeof options === "string") {
|
|
91179
91170
|
options = { encoding: options };
|
|
91180
91171
|
}
|
|
@@ -91195,7 +91186,7 @@ var require_jsonfile3 = __commonJS3({
|
|
|
91195
91186
|
}
|
|
91196
91187
|
return obj;
|
|
91197
91188
|
}
|
|
91198
|
-
var readFile22 = universalify.fromPromise(
|
|
91189
|
+
var readFile22 = universalify.fromPromise(_readFile);
|
|
91199
91190
|
function readFileSync22(file, options = {}) {
|
|
91200
91191
|
if (typeof options === "string") {
|
|
91201
91192
|
options = { encoding: options };
|
|
@@ -91949,49 +91940,49 @@ var require_Dirent2 = __commonJS3({
|
|
|
91949
91940
|
var S_IFLNK = constants_1.constants.S_IFLNK;
|
|
91950
91941
|
var S_IFIFO = constants_1.constants.S_IFIFO;
|
|
91951
91942
|
var S_IFSOCK = constants_1.constants.S_IFSOCK;
|
|
91952
|
-
var
|
|
91943
|
+
var Dirent = (
|
|
91953
91944
|
/** @class */
|
|
91954
91945
|
function() {
|
|
91955
|
-
function
|
|
91946
|
+
function Dirent2() {
|
|
91956
91947
|
this.name = "";
|
|
91957
91948
|
this.mode = 0;
|
|
91958
91949
|
}
|
|
91959
|
-
|
|
91960
|
-
var dirent = new
|
|
91950
|
+
Dirent2.build = function(link, encoding) {
|
|
91951
|
+
var dirent = new Dirent2();
|
|
91961
91952
|
var mode = link.getNode().mode;
|
|
91962
91953
|
dirent.name = (0, encoding_1.strToEncoding)(link.getName(), encoding);
|
|
91963
91954
|
dirent.mode = mode;
|
|
91964
91955
|
return dirent;
|
|
91965
91956
|
};
|
|
91966
|
-
|
|
91957
|
+
Dirent2.prototype._checkModeProperty = function(property) {
|
|
91967
91958
|
return (this.mode & S_IFMT) === property;
|
|
91968
91959
|
};
|
|
91969
|
-
|
|
91960
|
+
Dirent2.prototype.isDirectory = function() {
|
|
91970
91961
|
return this._checkModeProperty(S_IFDIR);
|
|
91971
91962
|
};
|
|
91972
|
-
|
|
91963
|
+
Dirent2.prototype.isFile = function() {
|
|
91973
91964
|
return this._checkModeProperty(S_IFREG);
|
|
91974
91965
|
};
|
|
91975
|
-
|
|
91966
|
+
Dirent2.prototype.isBlockDevice = function() {
|
|
91976
91967
|
return this._checkModeProperty(S_IFBLK);
|
|
91977
91968
|
};
|
|
91978
|
-
|
|
91969
|
+
Dirent2.prototype.isCharacterDevice = function() {
|
|
91979
91970
|
return this._checkModeProperty(S_IFCHR);
|
|
91980
91971
|
};
|
|
91981
|
-
|
|
91972
|
+
Dirent2.prototype.isSymbolicLink = function() {
|
|
91982
91973
|
return this._checkModeProperty(S_IFLNK);
|
|
91983
91974
|
};
|
|
91984
|
-
|
|
91975
|
+
Dirent2.prototype.isFIFO = function() {
|
|
91985
91976
|
return this._checkModeProperty(S_IFIFO);
|
|
91986
91977
|
};
|
|
91987
|
-
|
|
91978
|
+
Dirent2.prototype.isSocket = function() {
|
|
91988
91979
|
return this._checkModeProperty(S_IFSOCK);
|
|
91989
91980
|
};
|
|
91990
|
-
return
|
|
91981
|
+
return Dirent2;
|
|
91991
91982
|
}()
|
|
91992
91983
|
);
|
|
91993
|
-
exports2.Dirent =
|
|
91994
|
-
exports2.default =
|
|
91984
|
+
exports2.Dirent = Dirent;
|
|
91985
|
+
exports2.default = Dirent;
|
|
91995
91986
|
}
|
|
91996
91987
|
});
|
|
91997
91988
|
var require_setImmediate2 = __commonJS3({
|
|
@@ -150834,7 +150825,7 @@ function walkAncestors(schema2, filepath, ancestors) {
|
|
|
150834
150825
|
}
|
|
150835
150826
|
return getRootType(field.type);
|
|
150836
150827
|
}
|
|
150837
|
-
function
|
|
150828
|
+
function definitionFromAncestors(ancestors) {
|
|
150838
150829
|
let parents = [...ancestors];
|
|
150839
150830
|
parents.shift();
|
|
150840
150831
|
let definition = parents.shift();
|
|
@@ -153398,10 +153389,10 @@ var AST32 = recast22.types.builders;
|
|
|
153398
153389
|
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
153399
153390
|
type,
|
|
153400
153391
|
wrappers
|
|
153401
|
-
}, body) {
|
|
153392
|
+
}, body, input) {
|
|
153402
153393
|
let result;
|
|
153403
153394
|
if (graphql62.isScalarType(type)) {
|
|
153404
|
-
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
153395
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null, input);
|
|
153405
153396
|
} else if (graphql62.isEnumType(type)) {
|
|
153406
153397
|
result = enumReference(config, body, type.name);
|
|
153407
153398
|
} else {
|
|
@@ -153418,14 +153409,15 @@ function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
|
153418
153409
|
}
|
|
153419
153410
|
return result;
|
|
153420
153411
|
}
|
|
153421
|
-
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
153412
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body, input) {
|
|
153422
153413
|
const { type, wrappers } = unwrapType2(config, definition.type);
|
|
153423
153414
|
return unwrappedTsTypeReference(
|
|
153424
153415
|
config,
|
|
153425
153416
|
filepath,
|
|
153426
153417
|
missingScalars,
|
|
153427
153418
|
{ type, wrappers },
|
|
153428
|
-
body
|
|
153419
|
+
body,
|
|
153420
|
+
input
|
|
153429
153421
|
);
|
|
153430
153422
|
}
|
|
153431
153423
|
function enumReference(config, body, name) {
|
|
@@ -153454,7 +153446,7 @@ function nullableField(inner, input = false) {
|
|
|
153454
153446
|
}
|
|
153455
153447
|
return AST32.tsUnionType(members);
|
|
153456
153448
|
}
|
|
153457
|
-
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
153449
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field, input) {
|
|
153458
153450
|
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
153459
153451
|
if (!field) {
|
|
153460
153452
|
return AST32.tsNeverKeyword();
|
|
@@ -153513,6 +153505,9 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
153513
153505
|
return AST32.tsBooleanKeyword();
|
|
153514
153506
|
}
|
|
153515
153507
|
case "ID": {
|
|
153508
|
+
if (input) {
|
|
153509
|
+
return AST32.tsUnionType([AST32.tsStringKeyword(), AST32.tsNumberKeyword()]);
|
|
153510
|
+
}
|
|
153516
153511
|
return AST32.tsStringKeyword();
|
|
153517
153512
|
}
|
|
153518
153513
|
default: {
|
|
@@ -153523,7 +153518,8 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
153523
153518
|
missingScalars,
|
|
153524
153519
|
target.ofType,
|
|
153525
153520
|
body,
|
|
153526
|
-
field
|
|
153521
|
+
field,
|
|
153522
|
+
input
|
|
153527
153523
|
);
|
|
153528
153524
|
}
|
|
153529
153525
|
if (config.scalars?.[target.name]) {
|
|
@@ -156157,7 +156153,7 @@ ${exportStatement("config")}
|
|
|
156157
156153
|
var recast11 = __toESM3(require_main22(), 1);
|
|
156158
156154
|
var recast7 = __toESM3(require_main22(), 1);
|
|
156159
156155
|
var AST8 = recast7.types.builders;
|
|
156160
|
-
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
156156
|
+
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType, input) {
|
|
156161
156157
|
const { type } = unwrapType2(config, rootType);
|
|
156162
156158
|
if (graphql19.isScalarType(type)) {
|
|
156163
156159
|
return;
|
|
@@ -156182,12 +156178,20 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
|
|
|
156182
156178
|
}
|
|
156183
156179
|
const members = [];
|
|
156184
156180
|
for (const field of Object.values(type.getFields())) {
|
|
156185
|
-
addReferencedInputTypes(
|
|
156181
|
+
addReferencedInputTypes(
|
|
156182
|
+
config,
|
|
156183
|
+
filepath,
|
|
156184
|
+
body,
|
|
156185
|
+
visitedTypes,
|
|
156186
|
+
missingScalars,
|
|
156187
|
+
field.type,
|
|
156188
|
+
input
|
|
156189
|
+
);
|
|
156186
156190
|
members.push(
|
|
156187
156191
|
AST8.tsPropertySignature(
|
|
156188
156192
|
AST8.identifier(field.name),
|
|
156189
156193
|
AST8.tsTypeAnnotation(
|
|
156190
|
-
tsTypeReference(config, filepath, missingScalars, field, body)
|
|
156194
|
+
tsTypeReference(config, filepath, missingScalars, field, body, input)
|
|
156191
156195
|
),
|
|
156192
156196
|
graphql19.isNullableType(field.type)
|
|
156193
156197
|
)
|
|
@@ -156223,7 +156227,8 @@ function inlineType({
|
|
|
156223
156227
|
includeFragments,
|
|
156224
156228
|
allOptional,
|
|
156225
156229
|
forceNonNull,
|
|
156226
|
-
field
|
|
156230
|
+
field,
|
|
156231
|
+
input
|
|
156227
156232
|
}) {
|
|
156228
156233
|
const { type, wrappers } = unwrapType2(config, rootType);
|
|
156229
156234
|
let result;
|
|
@@ -156235,7 +156240,8 @@ function inlineType({
|
|
|
156235
156240
|
missingScalars,
|
|
156236
156241
|
type,
|
|
156237
156242
|
body,
|
|
156238
|
-
field
|
|
156243
|
+
field,
|
|
156244
|
+
input
|
|
156239
156245
|
);
|
|
156240
156246
|
} else if (graphql20.isEnumType(type)) {
|
|
156241
156247
|
ensureImports2({
|
|
@@ -156343,7 +156349,8 @@ function inlineType({
|
|
|
156343
156349
|
field: {
|
|
156344
156350
|
field: attributeName,
|
|
156345
156351
|
parent: type.name
|
|
156346
|
-
}
|
|
156352
|
+
},
|
|
156353
|
+
input
|
|
156347
156354
|
});
|
|
156348
156355
|
const hasIncludeOrSkipDirective = selection.directives && selection.directives.filter(
|
|
156349
156356
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
@@ -156407,7 +156414,8 @@ function inlineType({
|
|
|
156407
156414
|
missingScalars,
|
|
156408
156415
|
includeFragments,
|
|
156409
156416
|
allOptional,
|
|
156410
|
-
field: null
|
|
156417
|
+
field: null,
|
|
156418
|
+
input: false
|
|
156411
156419
|
});
|
|
156412
156420
|
let objectType = fragmentType;
|
|
156413
156421
|
if (fragmentType.type === "TSUnionType") {
|
|
@@ -156874,7 +156882,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
156874
156882
|
body,
|
|
156875
156883
|
missingScalars,
|
|
156876
156884
|
includeFragments: true,
|
|
156877
|
-
field: null
|
|
156885
|
+
field: null,
|
|
156886
|
+
input: false
|
|
156878
156887
|
});
|
|
156879
156888
|
if (artifact.kind === "HoudiniQuery") {
|
|
156880
156889
|
resultType = withLoadingState({
|
|
@@ -156923,7 +156932,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
156923
156932
|
body,
|
|
156924
156933
|
visitedTypes,
|
|
156925
156934
|
missingScalars,
|
|
156926
|
-
variableDefinition.type
|
|
156935
|
+
variableDefinition.type,
|
|
156936
|
+
true
|
|
156927
156937
|
);
|
|
156928
156938
|
}
|
|
156929
156939
|
body.push(
|
|
@@ -156941,7 +156951,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
156941
156951
|
filepath,
|
|
156942
156952
|
missingScalars,
|
|
156943
156953
|
definition2,
|
|
156944
|
-
body
|
|
156954
|
+
body,
|
|
156955
|
+
true
|
|
156945
156956
|
)
|
|
156946
156957
|
),
|
|
156947
156958
|
definition2.type.kind !== "NonNullType"
|
|
@@ -156976,7 +156987,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
156976
156987
|
missingScalars,
|
|
156977
156988
|
includeFragments: false,
|
|
156978
156989
|
allOptional: true,
|
|
156979
|
-
field: null
|
|
156990
|
+
field: null,
|
|
156991
|
+
input: false
|
|
156980
156992
|
})
|
|
156981
156993
|
)
|
|
156982
156994
|
)
|
|
@@ -157009,7 +157021,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
157009
157021
|
filepath,
|
|
157010
157022
|
missingScalars,
|
|
157011
157023
|
definition2,
|
|
157012
|
-
body
|
|
157024
|
+
body,
|
|
157025
|
+
false
|
|
157013
157026
|
)
|
|
157014
157027
|
),
|
|
157015
157028
|
definition2.type.kind !== "NonNullType"
|
|
@@ -157072,7 +157085,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
157072
157085
|
visitedTypes,
|
|
157073
157086
|
missingScalars,
|
|
157074
157087
|
includeFragments: true,
|
|
157075
|
-
field: null
|
|
157088
|
+
field: null,
|
|
157089
|
+
input: false
|
|
157076
157090
|
})
|
|
157077
157091
|
})
|
|
157078
157092
|
)
|
|
@@ -157165,7 +157179,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
157165
157179
|
{
|
|
157166
157180
|
field: key,
|
|
157167
157181
|
parent: type.name
|
|
157168
|
-
}
|
|
157182
|
+
},
|
|
157183
|
+
false
|
|
157169
157184
|
)
|
|
157170
157185
|
)
|
|
157171
157186
|
);
|
|
@@ -157192,7 +157207,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
157192
157207
|
{
|
|
157193
157208
|
field: key,
|
|
157194
157209
|
parent: type.name
|
|
157195
|
-
}
|
|
157210
|
+
},
|
|
157211
|
+
false
|
|
157196
157212
|
)
|
|
157197
157213
|
);
|
|
157198
157214
|
} else if (graphql21.isEnumType(unwrapped.type)) {
|
|
@@ -157230,7 +157246,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
157230
157246
|
body,
|
|
157231
157247
|
visitedTypes,
|
|
157232
157248
|
/* @__PURE__ */ new Set(),
|
|
157233
|
-
arg.type
|
|
157249
|
+
arg.type,
|
|
157250
|
+
true
|
|
157234
157251
|
);
|
|
157235
157252
|
const prop = AST13.tsPropertySignature(
|
|
157236
157253
|
AST13.identifier(arg.name),
|
|
@@ -157240,7 +157257,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
157240
157257
|
filepath,
|
|
157241
157258
|
/* @__PURE__ */ new Set(),
|
|
157242
157259
|
arg,
|
|
157243
|
-
body
|
|
157260
|
+
body,
|
|
157261
|
+
graphql21.isInputType(arg.type)
|
|
157244
157262
|
)
|
|
157245
157263
|
)
|
|
157246
157264
|
);
|
|
@@ -157352,7 +157370,8 @@ function listDefinitions(config, filepath, body, docs) {
|
|
|
157352
157370
|
filepath,
|
|
157353
157371
|
/* @__PURE__ */ new Set(),
|
|
157354
157372
|
arg,
|
|
157355
|
-
body
|
|
157373
|
+
body,
|
|
157374
|
+
graphql21.isInputType(arg.type)
|
|
157356
157375
|
)
|
|
157357
157376
|
)
|
|
157358
157377
|
);
|
|
@@ -160335,7 +160354,7 @@ async function typeCheck(config, docs) {
|
|
|
160335
160354
|
if (![config.listDirective, config.paginateDirective].includes(directive.name.value)) {
|
|
160336
160355
|
return;
|
|
160337
160356
|
}
|
|
160338
|
-
const { parents, definition } =
|
|
160357
|
+
const { parents, definition } = definitionFromAncestors(ancestors);
|
|
160339
160358
|
let needsParent = false;
|
|
160340
160359
|
if (definition.kind !== "OperationDefinition" && definition.kind !== "FragmentDefinition" || definition.kind === "OperationDefinition" && definition.operation !== "query") {
|
|
160341
160360
|
errors.push(
|
|
@@ -161001,7 +161020,7 @@ function nodeDirectives(config, directives) {
|
|
|
161001
161020
|
if (!directives.includes(node.name.value)) {
|
|
161002
161021
|
return;
|
|
161003
161022
|
}
|
|
161004
|
-
let { definition } =
|
|
161023
|
+
let { definition } = definitionFromAncestors(ancestors);
|
|
161005
161024
|
let definitionType = "";
|
|
161006
161025
|
if (definition.kind === "OperationDefinition") {
|
|
161007
161026
|
if (definition.operation !== "query") {
|
|
@@ -162155,49 +162174,49 @@ var require_Dirent3 = __commonJS4({
|
|
|
162155
162174
|
var S_IFLNK = constants_1.constants.S_IFLNK;
|
|
162156
162175
|
var S_IFIFO = constants_1.constants.S_IFIFO;
|
|
162157
162176
|
var S_IFSOCK = constants_1.constants.S_IFSOCK;
|
|
162158
|
-
var
|
|
162177
|
+
var Dirent = (
|
|
162159
162178
|
/** @class */
|
|
162160
162179
|
function() {
|
|
162161
|
-
function
|
|
162180
|
+
function Dirent2() {
|
|
162162
162181
|
this.name = "";
|
|
162163
162182
|
this.mode = 0;
|
|
162164
162183
|
}
|
|
162165
|
-
|
|
162166
|
-
var dirent = new
|
|
162184
|
+
Dirent2.build = function(link, encoding) {
|
|
162185
|
+
var dirent = new Dirent2();
|
|
162167
162186
|
var mode = link.getNode().mode;
|
|
162168
162187
|
dirent.name = (0, encoding_1.strToEncoding)(link.getName(), encoding);
|
|
162169
162188
|
dirent.mode = mode;
|
|
162170
162189
|
return dirent;
|
|
162171
162190
|
};
|
|
162172
|
-
|
|
162191
|
+
Dirent2.prototype._checkModeProperty = function(property) {
|
|
162173
162192
|
return (this.mode & S_IFMT) === property;
|
|
162174
162193
|
};
|
|
162175
|
-
|
|
162194
|
+
Dirent2.prototype.isDirectory = function() {
|
|
162176
162195
|
return this._checkModeProperty(S_IFDIR);
|
|
162177
162196
|
};
|
|
162178
|
-
|
|
162197
|
+
Dirent2.prototype.isFile = function() {
|
|
162179
162198
|
return this._checkModeProperty(S_IFREG);
|
|
162180
162199
|
};
|
|
162181
|
-
|
|
162200
|
+
Dirent2.prototype.isBlockDevice = function() {
|
|
162182
162201
|
return this._checkModeProperty(S_IFBLK);
|
|
162183
162202
|
};
|
|
162184
|
-
|
|
162203
|
+
Dirent2.prototype.isCharacterDevice = function() {
|
|
162185
162204
|
return this._checkModeProperty(S_IFCHR);
|
|
162186
162205
|
};
|
|
162187
|
-
|
|
162206
|
+
Dirent2.prototype.isSymbolicLink = function() {
|
|
162188
162207
|
return this._checkModeProperty(S_IFLNK);
|
|
162189
162208
|
};
|
|
162190
|
-
|
|
162209
|
+
Dirent2.prototype.isFIFO = function() {
|
|
162191
162210
|
return this._checkModeProperty(S_IFIFO);
|
|
162192
162211
|
};
|
|
162193
|
-
|
|
162212
|
+
Dirent2.prototype.isSocket = function() {
|
|
162194
162213
|
return this._checkModeProperty(S_IFSOCK);
|
|
162195
162214
|
};
|
|
162196
|
-
return
|
|
162215
|
+
return Dirent2;
|
|
162197
162216
|
}()
|
|
162198
162217
|
);
|
|
162199
|
-
exports2.Dirent =
|
|
162200
|
-
exports2.default =
|
|
162218
|
+
exports2.Dirent = Dirent;
|
|
162219
|
+
exports2.default = Dirent;
|
|
162201
162220
|
}
|
|
162202
162221
|
});
|
|
162203
162222
|
var require_setImmediate3 = __commonJS4({
|
|
@@ -168027,7 +168046,7 @@ var require_jsonfile4 = __commonJS4({
|
|
|
168027
168046
|
}
|
|
168028
168047
|
var universalify = require_universalify3();
|
|
168029
168048
|
var { stringify, stripBom } = require_utils23();
|
|
168030
|
-
async function
|
|
168049
|
+
async function _readFile(file, options = {}) {
|
|
168031
168050
|
if (typeof options === "string") {
|
|
168032
168051
|
options = { encoding: options };
|
|
168033
168052
|
}
|
|
@@ -168048,7 +168067,7 @@ var require_jsonfile4 = __commonJS4({
|
|
|
168048
168067
|
}
|
|
168049
168068
|
return obj;
|
|
168050
168069
|
}
|
|
168051
|
-
var readFile22 = universalify.fromPromise(
|
|
168070
|
+
var readFile22 = universalify.fromPromise(_readFile);
|
|
168052
168071
|
function readFileSync22(file, options = {}) {
|
|
168053
168072
|
if (typeof options === "string") {
|
|
168054
168073
|
options = { encoding: options };
|
|
@@ -226511,8 +226530,7 @@ var Config = class {
|
|
|
226511
226530
|
let {
|
|
226512
226531
|
schema: schema2,
|
|
226513
226532
|
schemaPath = "./schema.graphql",
|
|
226514
|
-
|
|
226515
|
-
runtimeDir = "$houdini",
|
|
226533
|
+
runtimeDir = ".houdini",
|
|
226516
226534
|
exclude = [],
|
|
226517
226535
|
module: module2 = "esm",
|
|
226518
226536
|
scalars,
|
|
@@ -228198,8 +228216,6 @@ function plugin_config(config) {
|
|
|
228198
228216
|
return {
|
|
228199
228217
|
client: "./src/client",
|
|
228200
228218
|
defaultRouteBlocking: false,
|
|
228201
|
-
pageQueryFilename: "+page.gql",
|
|
228202
|
-
layoutQueryFilename: "+layout.gql",
|
|
228203
228219
|
static: false,
|
|
228204
228220
|
forceRunesMode: false,
|
|
228205
228221
|
...cfg,
|
|
@@ -228217,9 +228233,6 @@ function plugin_config(config) {
|
|
|
228217
228233
|
};
|
|
228218
228234
|
}
|
|
228219
228235
|
|
|
228220
|
-
// src/plugin/kit.ts
|
|
228221
|
-
var graphql41 = __toESM(require("graphql"), 1);
|
|
228222
|
-
|
|
228223
228236
|
// ../houdini/build/vite-esm/index.js
|
|
228224
228237
|
var import_module4 = require("module");
|
|
228225
228238
|
var import_node_fs2 = require("node:fs");
|
|
@@ -231214,7 +231227,7 @@ var require_jsonfile5 = __commonJS5({
|
|
|
231214
231227
|
}
|
|
231215
231228
|
var universalify = require_universalify4();
|
|
231216
231229
|
var { stringify, stripBom } = require_utils24();
|
|
231217
|
-
async function
|
|
231230
|
+
async function _readFile(file, options = {}) {
|
|
231218
231231
|
if (typeof options === "string") {
|
|
231219
231232
|
options = { encoding: options };
|
|
231220
231233
|
}
|
|
@@ -231235,7 +231248,7 @@ var require_jsonfile5 = __commonJS5({
|
|
|
231235
231248
|
}
|
|
231236
231249
|
return obj;
|
|
231237
231250
|
}
|
|
231238
|
-
var readFile22 = universalify.fromPromise(
|
|
231251
|
+
var readFile22 = universalify.fromPromise(_readFile);
|
|
231239
231252
|
function readFileSync22(file, options = {}) {
|
|
231240
231253
|
if (typeof options === "string") {
|
|
231241
231254
|
options = { encoding: options };
|
|
@@ -231989,49 +232002,49 @@ var require_Dirent4 = __commonJS5({
|
|
|
231989
232002
|
var S_IFLNK = constants_1.constants.S_IFLNK;
|
|
231990
232003
|
var S_IFIFO = constants_1.constants.S_IFIFO;
|
|
231991
232004
|
var S_IFSOCK = constants_1.constants.S_IFSOCK;
|
|
231992
|
-
var
|
|
232005
|
+
var Dirent = (
|
|
231993
232006
|
/** @class */
|
|
231994
232007
|
function() {
|
|
231995
|
-
function
|
|
232008
|
+
function Dirent2() {
|
|
231996
232009
|
this.name = "";
|
|
231997
232010
|
this.mode = 0;
|
|
231998
232011
|
}
|
|
231999
|
-
|
|
232000
|
-
var dirent = new
|
|
232012
|
+
Dirent2.build = function(link, encoding) {
|
|
232013
|
+
var dirent = new Dirent2();
|
|
232001
232014
|
var mode = link.getNode().mode;
|
|
232002
232015
|
dirent.name = (0, encoding_1.strToEncoding)(link.getName(), encoding);
|
|
232003
232016
|
dirent.mode = mode;
|
|
232004
232017
|
return dirent;
|
|
232005
232018
|
};
|
|
232006
|
-
|
|
232019
|
+
Dirent2.prototype._checkModeProperty = function(property) {
|
|
232007
232020
|
return (this.mode & S_IFMT) === property;
|
|
232008
232021
|
};
|
|
232009
|
-
|
|
232022
|
+
Dirent2.prototype.isDirectory = function() {
|
|
232010
232023
|
return this._checkModeProperty(S_IFDIR);
|
|
232011
232024
|
};
|
|
232012
|
-
|
|
232025
|
+
Dirent2.prototype.isFile = function() {
|
|
232013
232026
|
return this._checkModeProperty(S_IFREG);
|
|
232014
232027
|
};
|
|
232015
|
-
|
|
232028
|
+
Dirent2.prototype.isBlockDevice = function() {
|
|
232016
232029
|
return this._checkModeProperty(S_IFBLK);
|
|
232017
232030
|
};
|
|
232018
|
-
|
|
232031
|
+
Dirent2.prototype.isCharacterDevice = function() {
|
|
232019
232032
|
return this._checkModeProperty(S_IFCHR);
|
|
232020
232033
|
};
|
|
232021
|
-
|
|
232034
|
+
Dirent2.prototype.isSymbolicLink = function() {
|
|
232022
232035
|
return this._checkModeProperty(S_IFLNK);
|
|
232023
232036
|
};
|
|
232024
|
-
|
|
232037
|
+
Dirent2.prototype.isFIFO = function() {
|
|
232025
232038
|
return this._checkModeProperty(S_IFIFO);
|
|
232026
232039
|
};
|
|
232027
|
-
|
|
232040
|
+
Dirent2.prototype.isSocket = function() {
|
|
232028
232041
|
return this._checkModeProperty(S_IFSOCK);
|
|
232029
232042
|
};
|
|
232030
|
-
return
|
|
232043
|
+
return Dirent2;
|
|
232031
232044
|
}()
|
|
232032
232045
|
);
|
|
232033
|
-
exports2.Dirent =
|
|
232034
|
-
exports2.default =
|
|
232046
|
+
exports2.Dirent = Dirent;
|
|
232047
|
+
exports2.default = Dirent;
|
|
232035
232048
|
}
|
|
232036
232049
|
});
|
|
232037
232050
|
var require_setImmediate4 = __commonJS5({
|
|
@@ -300249,7 +300262,9 @@ filepath: ${filepath}`
|
|
|
300249
300262
|
load.push(element.quasi.quasis[0].value.raw);
|
|
300250
300263
|
} else if (element.type === "CallExpression") {
|
|
300251
300264
|
if (element.callee.type !== "Identifier" || element.callee.name !== "graphql" || element.arguments.length !== 1) {
|
|
300252
|
-
throw new Error(
|
|
300265
|
+
throw new Error(
|
|
300266
|
+
`only graphql function can be passed to ${houdini_load_fn}. Filepath: ${filepath}`
|
|
300267
|
+
);
|
|
300253
300268
|
}
|
|
300254
300269
|
let documentString;
|
|
300255
300270
|
const argument = element.arguments[0];
|
|
@@ -300357,18 +300372,6 @@ function is_layout3(framework2, filename) {
|
|
|
300357
300372
|
function is_component(config, framework2, filename) {
|
|
300358
300373
|
return framework2 === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework2, filename) && !is_route(config, framework2, filename);
|
|
300359
300374
|
}
|
|
300360
|
-
function page_query_path(config, filename) {
|
|
300361
|
-
return path_exports.join(
|
|
300362
|
-
path_exports.dirname(resolve_relative(config, filename)),
|
|
300363
|
-
plugin_config(config).pageQueryFilename
|
|
300364
|
-
);
|
|
300365
|
-
}
|
|
300366
|
-
function layout_query_path(config, filename) {
|
|
300367
|
-
return path_exports.join(
|
|
300368
|
-
path_exports.dirname(resolve_relative(config, filename)),
|
|
300369
|
-
plugin_config(config).layoutQueryFilename
|
|
300370
|
-
);
|
|
300371
|
-
}
|
|
300372
300375
|
function resolve_relative(config, filename) {
|
|
300373
300376
|
const match5 = filename.match("^((../)+)src/routes");
|
|
300374
300377
|
if (match5) {
|
|
@@ -300478,32 +300481,6 @@ async function walk_routes(config, framework2, visitor, dirpath = config.routesD
|
|
|
300478
300481
|
componentQueries.push({ query: definition, componentPath: childPath });
|
|
300479
300482
|
}
|
|
300480
300483
|
});
|
|
300481
|
-
} else if (child === plugin_config(config).layoutQueryFilename) {
|
|
300482
|
-
validRoute = true;
|
|
300483
|
-
const contents = await fs_exports.readFile(childPath);
|
|
300484
|
-
if (!contents) {
|
|
300485
|
-
continue;
|
|
300486
|
-
}
|
|
300487
|
-
try {
|
|
300488
|
-
const query = config.extractQueryDefinition(graphql41.parse(contents));
|
|
300489
|
-
await visitor.routeLayoutQuery?.(query, childPath);
|
|
300490
|
-
layoutQueries.push(query);
|
|
300491
|
-
} catch (e3) {
|
|
300492
|
-
throw routeQueryError(childPath);
|
|
300493
|
-
}
|
|
300494
|
-
} else if (child === plugin_config(config).pageQueryFilename) {
|
|
300495
|
-
validRoute = true;
|
|
300496
|
-
const contents = await fs_exports.readFile(childPath);
|
|
300497
|
-
if (!contents) {
|
|
300498
|
-
continue;
|
|
300499
|
-
}
|
|
300500
|
-
try {
|
|
300501
|
-
const query = config.extractQueryDefinition(graphql41.parse(contents));
|
|
300502
|
-
await visitor.routePageQuery?.(query, childPath);
|
|
300503
|
-
pageQueries.push(query);
|
|
300504
|
-
} catch (e3) {
|
|
300505
|
-
throw routeQueryError(childPath);
|
|
300506
|
-
}
|
|
300507
300484
|
} else {
|
|
300508
300485
|
continue;
|
|
300509
300486
|
}
|
|
@@ -300535,10 +300512,6 @@ async function walk_routes(config, framework2, visitor, dirpath = config.routesD
|
|
|
300535
300512
|
);
|
|
300536
300513
|
}
|
|
300537
300514
|
}
|
|
300538
|
-
var routeQueryError = (filepath) => ({
|
|
300539
|
-
filepath,
|
|
300540
|
-
message: "route query error"
|
|
300541
|
-
});
|
|
300542
300515
|
function route_page_path(config, filename) {
|
|
300543
300516
|
return resolve_relative(config, filename).replace(".js", ".svelte").replace(".ts", ".svelte");
|
|
300544
300517
|
}
|
|
@@ -301230,180 +301203,12 @@ async function codegen_default(input) {
|
|
|
301230
301203
|
]);
|
|
301231
301204
|
}
|
|
301232
301205
|
|
|
301233
|
-
// src/plugin/fsPatch.ts
|
|
301234
|
-
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
301235
|
-
var import_promises9 = __toESM(require("node:fs/promises"), 1);
|
|
301236
|
-
|
|
301237
301206
|
// src/plugin/state.ts
|
|
301238
301207
|
var _config;
|
|
301239
301208
|
function setConfig(config) {
|
|
301240
301209
|
_config = config;
|
|
301241
301210
|
}
|
|
301242
301211
|
|
|
301243
|
-
// src/plugin/fsPatch.ts
|
|
301244
|
-
var fsPatch_default = (getFramework) => ({
|
|
301245
|
-
async resolveId(filepath, _, { config, isEntry }) {
|
|
301246
|
-
if (!isEntry) {
|
|
301247
|
-
const match5 = filepath.match("^((../)+)src/routes");
|
|
301248
|
-
if (match5) {
|
|
301249
|
-
return path_exports.join(config.projectRoot, filepath.substring(match5[1].length));
|
|
301250
|
-
}
|
|
301251
|
-
return filepath.startsWith("/src") ? { id: path_exports.join(config.projectRoot, filepath) } : null;
|
|
301252
|
-
}
|
|
301253
|
-
filepath = path_exports.posixify(filepath.toString());
|
|
301254
|
-
if (is_route_script(getFramework(), filepath) || is_root_layout(config, filepath) || is_root_layout_server(config, filepath)) {
|
|
301255
|
-
return {
|
|
301256
|
-
id: resolve_relative(config, filepath)
|
|
301257
|
-
};
|
|
301258
|
-
}
|
|
301259
|
-
},
|
|
301260
|
-
load: async (filepath, { config }) => {
|
|
301261
|
-
filepath = path_exports.posixify(filepath.toString());
|
|
301262
|
-
if (is_route_script(getFramework(), filepath) || is_root_layout_server(config, filepath)) {
|
|
301263
|
-
filepath = resolve_relative(config, filepath);
|
|
301264
|
-
return {
|
|
301265
|
-
code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config.projectRoot, filepath)) || ""
|
|
301266
|
-
};
|
|
301267
|
-
}
|
|
301268
|
-
if (is_root_layout(config, filepath)) {
|
|
301269
|
-
filepath = resolve_relative(config, filepath);
|
|
301270
|
-
return {
|
|
301271
|
-
code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config.projectRoot, filepath)) || empty_layout
|
|
301272
|
-
};
|
|
301273
|
-
}
|
|
301274
|
-
}
|
|
301275
|
-
});
|
|
301276
|
-
var _readDirSync = import_node_fs3.default.readdirSync;
|
|
301277
|
-
var _statSync = import_node_fs3.default.statSync;
|
|
301278
|
-
var _readFileSync = import_node_fs3.default.readFileSync;
|
|
301279
|
-
var _unlinkSync = import_node_fs3.default.unlinkSync;
|
|
301280
|
-
function getStringFilepath(fp) {
|
|
301281
|
-
if (fp instanceof URL) {
|
|
301282
|
-
return fp.pathname;
|
|
301283
|
-
}
|
|
301284
|
-
return fp.toString();
|
|
301285
|
-
}
|
|
301286
|
-
import_node_fs3.default.readFileSync = function(fp, options) {
|
|
301287
|
-
const filepath = getStringFilepath(fp);
|
|
301288
|
-
if (filepath.endsWith("+page.js") || filepath.endsWith("+layout.js") || filepath.replace(".ts", ".js").endsWith("+layout.server.js")) {
|
|
301289
|
-
try {
|
|
301290
|
-
return _readFileSync(fp, options);
|
|
301291
|
-
} catch {
|
|
301292
|
-
return typeof options === "string" || options?.encoding ? "" : Buffer.from("");
|
|
301293
|
-
}
|
|
301294
|
-
}
|
|
301295
|
-
if (filepath.endsWith(path_exports.join("src", "routes", "+layout.svelte"))) {
|
|
301296
|
-
try {
|
|
301297
|
-
return _readFileSync(fp, options);
|
|
301298
|
-
} catch {
|
|
301299
|
-
return typeof options === "string" || options?.encoding ? empty_layout : Buffer.from(empty_layout);
|
|
301300
|
-
}
|
|
301301
|
-
}
|
|
301302
|
-
return _readFileSync(fp, options);
|
|
301303
|
-
};
|
|
301304
|
-
import_node_fs3.default.statSync = function(fp, options) {
|
|
301305
|
-
let filepath = getStringFilepath(fp);
|
|
301306
|
-
if (!filepath.includes("routes") || !path_exports.basename(filepath).startsWith("+")) {
|
|
301307
|
-
return _statSync(fp, options);
|
|
301308
|
-
}
|
|
301309
|
-
try {
|
|
301310
|
-
const result = _statSync(fp, options);
|
|
301311
|
-
return result;
|
|
301312
|
-
} catch (error) {
|
|
301313
|
-
filepath = path_exports.posixify(filepath);
|
|
301314
|
-
const mock5 = virtual_file(path_exports.basename(filepath), { withFileTypes: true });
|
|
301315
|
-
if (filepath.endsWith(path_exports.join("routes", "+layout.svelte")) || filepath.endsWith(path_exports.join("routes", "+layout.svelte")) || filepath.endsWith(path_exports.join("routes", "+layout.server.js")) || filepath.endsWith(path_exports.join("routes", "+layout.server.js"))) {
|
|
301316
|
-
return mock5;
|
|
301317
|
-
} else if (filepath.endsWith("+layout.js")) {
|
|
301318
|
-
return mock5;
|
|
301319
|
-
} else if (filepath.endsWith("+page.js")) {
|
|
301320
|
-
return mock5;
|
|
301321
|
-
}
|
|
301322
|
-
throw error;
|
|
301323
|
-
}
|
|
301324
|
-
};
|
|
301325
|
-
import_node_fs3.default.unlinkSync = function(filepath) {
|
|
301326
|
-
try {
|
|
301327
|
-
_unlinkSync(filepath);
|
|
301328
|
-
} catch {
|
|
301329
|
-
}
|
|
301330
|
-
};
|
|
301331
|
-
import_node_fs3.default.readdirSync = function(fp, options) {
|
|
301332
|
-
const filepath = getStringFilepath(fp);
|
|
301333
|
-
if (!filepath.includes("routes")) return _readDirSync(fp, options);
|
|
301334
|
-
const result = _readDirSync(fp, options);
|
|
301335
|
-
const file_names = result.map((file) => {
|
|
301336
|
-
if (file instanceof import_node_fs3.Dirent) {
|
|
301337
|
-
return file.name;
|
|
301338
|
-
} else if (typeof file === "string") {
|
|
301339
|
-
return file;
|
|
301340
|
-
} else {
|
|
301341
|
-
return "";
|
|
301342
|
-
}
|
|
301343
|
-
});
|
|
301344
|
-
function contains(...names) {
|
|
301345
|
-
return names.some((name) => file_names.includes(name));
|
|
301346
|
-
}
|
|
301347
|
-
if (contains("+page.svelte", "+page.gql") && !contains("+page.js", "+page.ts")) {
|
|
301348
|
-
result.push(virtual_file("+page.js", options));
|
|
301349
|
-
}
|
|
301350
|
-
const posix_filepath = path_exports.posixify(filepath);
|
|
301351
|
-
if ((is_root_route(posix_filepath) || contains("+layout.svelte", "+layout.gql")) && !contains("+layout.ts", "+layout.js")) {
|
|
301352
|
-
result.push(virtual_file("+layout.js", options));
|
|
301353
|
-
}
|
|
301354
|
-
if (is_root_route(posix_filepath) && !contains("+layout.svelte")) {
|
|
301355
|
-
result.push(virtual_file("+layout.svelte", options));
|
|
301356
|
-
}
|
|
301357
|
-
if (is_root_route(posix_filepath) && !contains("+layout.server.js", "+layout.server.ts") && !plugin_config(_config).static) {
|
|
301358
|
-
result.push(virtual_file("+layout.server.js", options));
|
|
301359
|
-
}
|
|
301360
|
-
return result;
|
|
301361
|
-
};
|
|
301362
|
-
Object.defineProperty(globalThis, "fs", {
|
|
301363
|
-
configurable: true,
|
|
301364
|
-
enumerable: true,
|
|
301365
|
-
value: import_node_fs3.default
|
|
301366
|
-
});
|
|
301367
|
-
var _readFile = import_promises9.default.readFile;
|
|
301368
|
-
import_promises9.default.readFile = async (path7, options) => {
|
|
301369
|
-
if (path7.toString().endsWith("+layout.svelte")) {
|
|
301370
|
-
try {
|
|
301371
|
-
return await _readFile(path7, options);
|
|
301372
|
-
} catch {
|
|
301373
|
-
return typeof options === "string" || options?.encoding ? empty_layout : Buffer.from(empty_layout);
|
|
301374
|
-
}
|
|
301375
|
-
}
|
|
301376
|
-
return _readFile(path7, options);
|
|
301377
|
-
};
|
|
301378
|
-
Object.defineProperty(globalThis, "fs/promises", {
|
|
301379
|
-
configurable: true,
|
|
301380
|
-
enumerable: true,
|
|
301381
|
-
value: import_promises9.default
|
|
301382
|
-
});
|
|
301383
|
-
function virtual_file(name, options) {
|
|
301384
|
-
return !options?.withFileTypes ? name : {
|
|
301385
|
-
name,
|
|
301386
|
-
isFile: () => true,
|
|
301387
|
-
isDirectory: () => false,
|
|
301388
|
-
isBlockDevice: () => false,
|
|
301389
|
-
isFIFO: () => false,
|
|
301390
|
-
isCharacterDevice: () => false,
|
|
301391
|
-
isSocket: () => false,
|
|
301392
|
-
isSymbolicLink: () => false
|
|
301393
|
-
};
|
|
301394
|
-
}
|
|
301395
|
-
function is_root_route(filepath) {
|
|
301396
|
-
filepath = filepath.toString();
|
|
301397
|
-
if (filepath.toString().endsWith("/")) {
|
|
301398
|
-
filepath = filepath.slice(0, -1);
|
|
301399
|
-
}
|
|
301400
|
-
return filepath.endsWith(path_exports.join("src", "routes")) && // ignore the src/routes that exists in the type roots
|
|
301401
|
-
!filepath.includes(".svelte-kit") && // ! Hey! This second value always needs to correspond to the default value for the runtimeDir
|
|
301402
|
-
// if you're changing this here, please also update it in `/packages/houdini/src/lib/config.ts`
|
|
301403
|
-
!filepath.includes(_config.runtimeDir ?? "$houdini");
|
|
301404
|
-
}
|
|
301405
|
-
var empty_layout = "<slot />";
|
|
301406
|
-
|
|
301407
301212
|
// src/plugin/transforms/index.ts
|
|
301408
301213
|
var recast25 = __toESM(require_main6(), 1);
|
|
301409
301214
|
|
|
@@ -301714,7 +301519,6 @@ async function kit_init(page) {
|
|
|
301714
301519
|
}
|
|
301715
301520
|
|
|
301716
301521
|
// src/plugin/transforms/kit/load.ts
|
|
301717
|
-
var graphql45 = __toESM(require("graphql"), 1);
|
|
301718
301522
|
var recast19 = __toESM(require_main6(), 1);
|
|
301719
301523
|
var AST20 = recast19.types.builders;
|
|
301720
301524
|
async function kit_load_generator(page) {
|
|
@@ -301729,9 +301533,7 @@ async function kit_load_generator(page) {
|
|
|
301729
301533
|
page,
|
|
301730
301534
|
artifact: { name }
|
|
301731
301535
|
}).id;
|
|
301732
|
-
const [
|
|
301733
|
-
find_special_query("Page", page),
|
|
301734
|
-
find_special_query("Layout", page),
|
|
301536
|
+
const [inline_queries, page_info] = await Promise.all([
|
|
301735
301537
|
find_inline_queries(
|
|
301736
301538
|
page,
|
|
301737
301539
|
// if we are currently on the route file, there's nothing to parse
|
|
@@ -301750,12 +301552,6 @@ async function kit_load_generator(page) {
|
|
|
301750
301552
|
if (script) {
|
|
301751
301553
|
const queries_that_needs_a_load = [...houdini_load_queries, ...inline_queries];
|
|
301752
301554
|
const isLayout = is_layout3(page.framework, page.filepath);
|
|
301753
|
-
if (isLayout && layout_query) {
|
|
301754
|
-
queries_that_needs_a_load.push(layout_query);
|
|
301755
|
-
}
|
|
301756
|
-
if (!isLayout && page_query) {
|
|
301757
|
-
queries_that_needs_a_load.push(page_query);
|
|
301758
|
-
}
|
|
301759
301555
|
add_load({
|
|
301760
301556
|
page,
|
|
301761
301557
|
queries: queries_that_needs_a_load,
|
|
@@ -302002,22 +301798,6 @@ function add_load({
|
|
|
302002
301798
|
);
|
|
302003
301799
|
}
|
|
302004
301800
|
}
|
|
302005
|
-
async function find_special_query(type, page) {
|
|
302006
|
-
const query_path = type === "Page" ? page_query_path(page.config, page.filepath) : layout_query_path(page.config, page.filepath);
|
|
302007
|
-
const contents = await fs_exports.readFile(query_path);
|
|
302008
|
-
if (!contents) {
|
|
302009
|
-
return null;
|
|
302010
|
-
}
|
|
302011
|
-
const parsed = graphql45.parse(contents);
|
|
302012
|
-
const definition = parsed.definitions.find(
|
|
302013
|
-
(defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
|
|
302014
|
-
);
|
|
302015
|
-
if (!definition) {
|
|
302016
|
-
formatErrors({ message: "gql file must contain a query.", filepath: query_path });
|
|
302017
|
-
return null;
|
|
302018
|
-
}
|
|
302019
|
-
return definition;
|
|
302020
|
-
}
|
|
302021
301801
|
function load_hook_statements(name, request_context, input_id, result_id) {
|
|
302022
301802
|
return AST20.expressionStatement(
|
|
302023
301803
|
AST20.awaitExpression(
|
|
@@ -302378,7 +302158,6 @@ function replace_tag_content(source, start, end, insert) {
|
|
|
302378
302158
|
var replace_between = (origin, startIndex, endIndex, insertion) => origin.substring(0, startIndex) + insertion + origin.substring(endIndex);
|
|
302379
302159
|
|
|
302380
302160
|
// src/plugin/validate.ts
|
|
302381
|
-
var graphql46 = __toESM(require("graphql"), 1);
|
|
302382
302161
|
async function validate4({
|
|
302383
302162
|
config,
|
|
302384
302163
|
documents
|
|
@@ -302405,28 +302184,6 @@ async function validate4({
|
|
|
302405
302184
|
})
|
|
302406
302185
|
);
|
|
302407
302186
|
}
|
|
302408
|
-
graphql46.visit(doc.document, {
|
|
302409
|
-
Directive(node, _, __, ___, ancestors) {
|
|
302410
|
-
const blockingDirectives = [
|
|
302411
|
-
config.blockingDirective,
|
|
302412
|
-
config.blockingDisableDirective
|
|
302413
|
-
];
|
|
302414
|
-
if (!blockingDirectives.includes(node.name.value)) {
|
|
302415
|
-
return;
|
|
302416
|
-
}
|
|
302417
|
-
const { definition } = definitionFromAncestors(ancestors);
|
|
302418
|
-
const listDirective = definition.directives?.map((c) => c.name.value) ?? [];
|
|
302419
|
-
if (listDirective.includes(config.blockingDirective) && listDirective.includes(config.blockingDisableDirective)) {
|
|
302420
|
-
errors.push(
|
|
302421
|
-
new HoudiniError({
|
|
302422
|
-
filepath: doc.filename,
|
|
302423
|
-
message: `You can't apply both @${config.blockingDirective} and @${config.blockingDisableDirective} at the same time`
|
|
302424
|
-
})
|
|
302425
|
-
);
|
|
302426
|
-
}
|
|
302427
|
-
return;
|
|
302428
|
-
}
|
|
302429
|
-
});
|
|
302430
302187
|
}
|
|
302431
302188
|
if (errors.length > 0) {
|
|
302432
302189
|
throw errors;
|
|
@@ -302485,24 +302242,6 @@ export const redirect = svelteKitRedirect
|
|
|
302485
302242
|
artifactData,
|
|
302486
302243
|
// custom logic to pull a graphql document out of a svelte file
|
|
302487
302244
|
extractDocuments: extract_default,
|
|
302488
|
-
schema({ config }) {
|
|
302489
|
-
return `
|
|
302490
|
-
"""
|
|
302491
|
-
@${config.loadDirective} is used to enable automatic fetch on inline queries.
|
|
302492
|
-
"""
|
|
302493
|
-
directive @${config.loadDirective} on QUERY
|
|
302494
|
-
|
|
302495
|
-
"""
|
|
302496
|
-
@${config.blockingDirective} is used to always await the fetch.
|
|
302497
|
-
"""
|
|
302498
|
-
directive @${config.blockingDirective} on QUERY
|
|
302499
|
-
|
|
302500
|
-
"""
|
|
302501
|
-
@${config.blockingDisableDirective} is used to not always await the fetch (in CSR for example). Note that "throwOnError" will not throw in this case.
|
|
302502
|
-
"""
|
|
302503
|
-
directive @${config.blockingDisableDirective} on QUERY
|
|
302504
|
-
`;
|
|
302505
|
-
},
|
|
302506
302245
|
// we have some custom document validation logic
|
|
302507
302246
|
validate: validate4,
|
|
302508
302247
|
// we need to write the svelte specific runtime
|
|
@@ -302540,10 +302279,6 @@ directive @${config.blockingDisableDirective} on QUERY
|
|
|
302540
302279
|
include({ config, filepath }) {
|
|
302541
302280
|
return config.includeFile(resolve_relative(config, filepath), { ignore_plugins: true });
|
|
302542
302281
|
},
|
|
302543
|
-
// add custom vite config
|
|
302544
|
-
vite: {
|
|
302545
|
-
...fsPatch_default(() => framework)
|
|
302546
|
-
},
|
|
302547
302282
|
/**
|
|
302548
302283
|
* Setup
|
|
302549
302284
|
*/
|
|
@@ -302645,8 +302380,6 @@ async function route_test({
|
|
|
302645
302380
|
await Promise.all([
|
|
302646
302381
|
fs_exports.writeFile(page_path, component),
|
|
302647
302382
|
fs_exports.writeFile(route_data_path(config, page_path), script),
|
|
302648
|
-
fs_exports.writeFile(page_query_path(config, page_path), page_query),
|
|
302649
|
-
fs_exports.writeFile(layout_query_path(config, page_path), layout_query),
|
|
302650
302383
|
fs_exports.writeFile(layout_path, layout),
|
|
302651
302384
|
fs_exports.writeFile(layout_script_path, layout_script)
|
|
302652
302385
|
]);
|