houdini-svelte 2.2.0-next.4 → 3.0.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-esm/index.js
CHANGED
|
@@ -2373,7 +2373,7 @@ var require_path_visitor4 = __commonJS({
|
|
|
2373
2373
|
}
|
|
2374
2374
|
return target;
|
|
2375
2375
|
}
|
|
2376
|
-
PathVisitor.visit = function
|
|
2376
|
+
PathVisitor.visit = function visit54(node, methods) {
|
|
2377
2377
|
return PathVisitor.fromMethodsObject(methods).visit(node);
|
|
2378
2378
|
};
|
|
2379
2379
|
var PVp = PathVisitor.prototype;
|
|
@@ -2564,7 +2564,7 @@ var require_path_visitor4 = __commonJS({
|
|
|
2564
2564
|
this.needToCallTraverse = false;
|
|
2565
2565
|
return visitChildren(path7, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
|
|
2566
2566
|
};
|
|
2567
|
-
sharedContextProtoMethods.visit = function
|
|
2567
|
+
sharedContextProtoMethods.visit = function visit54(path7, newVisitor) {
|
|
2568
2568
|
if (!(this instanceof this.Context)) {
|
|
2569
2569
|
throw new Error("");
|
|
2570
2570
|
}
|
|
@@ -4006,7 +4006,7 @@ var require_main5 = __commonJS({
|
|
|
4006
4006
|
var someField = _a.someField;
|
|
4007
4007
|
var Type = _a.Type;
|
|
4008
4008
|
var use = _a.use;
|
|
4009
|
-
var
|
|
4009
|
+
var visit54 = _a.visit;
|
|
4010
4010
|
exports.astNodesAreEquivalent = astNodesAreEquivalent;
|
|
4011
4011
|
exports.builders = builders;
|
|
4012
4012
|
exports.builtInTypes = builtInTypes;
|
|
@@ -4023,7 +4023,7 @@ var require_main5 = __commonJS({
|
|
|
4023
4023
|
exports.someField = someField;
|
|
4024
4024
|
exports.Type = Type;
|
|
4025
4025
|
exports.use = use;
|
|
4026
|
-
exports.visit =
|
|
4026
|
+
exports.visit = visit54;
|
|
4027
4027
|
Object.assign(namedTypes_1.namedTypes, n);
|
|
4028
4028
|
}
|
|
4029
4029
|
});
|
|
@@ -6102,7 +6102,7 @@ var require_esprima7 = __commonJS({
|
|
|
6102
6102
|
var jsx_parser_1 = __webpack_require__(3);
|
|
6103
6103
|
var parser_1 = __webpack_require__(8);
|
|
6104
6104
|
var tokenizer_1 = __webpack_require__(15);
|
|
6105
|
-
function
|
|
6105
|
+
function parse23(code, options, delegate) {
|
|
6106
6106
|
var commentHandler = null;
|
|
6107
6107
|
var proxyDelegate = function(node, metadata) {
|
|
6108
6108
|
if (delegate) {
|
|
@@ -6147,17 +6147,17 @@ var require_esprima7 = __commonJS({
|
|
|
6147
6147
|
}
|
|
6148
6148
|
return ast;
|
|
6149
6149
|
}
|
|
6150
|
-
exports2.parse =
|
|
6150
|
+
exports2.parse = parse23;
|
|
6151
6151
|
function parseModule(code, options, delegate) {
|
|
6152
6152
|
var parsingOptions = options || {};
|
|
6153
6153
|
parsingOptions.sourceType = "module";
|
|
6154
|
-
return
|
|
6154
|
+
return parse23(code, parsingOptions, delegate);
|
|
6155
6155
|
}
|
|
6156
6156
|
exports2.parseModule = parseModule;
|
|
6157
6157
|
function parseScript(code, options, delegate) {
|
|
6158
6158
|
var parsingOptions = options || {};
|
|
6159
6159
|
parsingOptions.sourceType = "script";
|
|
6160
|
-
return
|
|
6160
|
+
return parse23(code, parsingOptions, delegate);
|
|
6161
6161
|
}
|
|
6162
6162
|
exports2.parseScript = parseScript;
|
|
6163
6163
|
function tokenize(code, options, delegate) {
|
|
@@ -12297,7 +12297,7 @@ var require_esprima8 = __commonJS({
|
|
|
12297
12297
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12298
12298
|
exports.parse = void 0;
|
|
12299
12299
|
var util_1 = require_util6();
|
|
12300
|
-
function
|
|
12300
|
+
function parse23(source, options) {
|
|
12301
12301
|
var comments = [];
|
|
12302
12302
|
var ast = require_esprima7().parse(source, {
|
|
12303
12303
|
loc: true,
|
|
@@ -12315,7 +12315,7 @@ var require_esprima8 = __commonJS({
|
|
|
12315
12315
|
}
|
|
12316
12316
|
return ast;
|
|
12317
12317
|
}
|
|
12318
|
-
exports.parse =
|
|
12318
|
+
exports.parse = parse23;
|
|
12319
12319
|
}
|
|
12320
12320
|
});
|
|
12321
12321
|
|
|
@@ -13453,7 +13453,7 @@ var require_parser4 = __commonJS({
|
|
|
13453
13453
|
var lines_1 = require_lines4();
|
|
13454
13454
|
var comments_1 = require_comments4();
|
|
13455
13455
|
var util = tslib_1.__importStar(require_util6());
|
|
13456
|
-
function
|
|
13456
|
+
function parse23(source, options) {
|
|
13457
13457
|
options = (0, options_1.normalize)(options);
|
|
13458
13458
|
var lines = (0, lines_1.fromString)(source, options);
|
|
13459
13459
|
var sourceWithoutTabs = lines.toString({
|
|
@@ -13525,7 +13525,7 @@ var require_parser4 = __commonJS({
|
|
|
13525
13525
|
(0, comments_1.attach)(comments, program.body.length ? file.program : file, lines);
|
|
13526
13526
|
return new TreeCopier(lines, tokens).copy(file);
|
|
13527
13527
|
}
|
|
13528
|
-
exports.parse =
|
|
13528
|
+
exports.parse = parse23;
|
|
13529
13529
|
var TreeCopier = function TreeCopier2(lines, tokens) {
|
|
13530
13530
|
assert_1.default.ok(this instanceof TreeCopier2);
|
|
13531
13531
|
this.lines = lines;
|
|
@@ -19598,7 +19598,7 @@ var require_jsonfile = __commonJS2({
|
|
|
19598
19598
|
}
|
|
19599
19599
|
var universalify = require_universalify();
|
|
19600
19600
|
var { stringify, stripBom } = require_utils2();
|
|
19601
|
-
async function
|
|
19601
|
+
async function _readFile(file, options = {}) {
|
|
19602
19602
|
if (typeof options === "string") {
|
|
19603
19603
|
options = { encoding: options };
|
|
19604
19604
|
}
|
|
@@ -19619,7 +19619,7 @@ var require_jsonfile = __commonJS2({
|
|
|
19619
19619
|
}
|
|
19620
19620
|
return obj;
|
|
19621
19621
|
}
|
|
19622
|
-
var readFile22 = universalify.fromPromise(
|
|
19622
|
+
var readFile22 = universalify.fromPromise(_readFile);
|
|
19623
19623
|
function readFileSync22(file, options = {}) {
|
|
19624
19624
|
if (typeof options === "string") {
|
|
19625
19625
|
options = { encoding: options };
|
|
@@ -20373,49 +20373,49 @@ var require_Dirent = __commonJS2({
|
|
|
20373
20373
|
var S_IFLNK = constants_1.constants.S_IFLNK;
|
|
20374
20374
|
var S_IFIFO = constants_1.constants.S_IFIFO;
|
|
20375
20375
|
var S_IFSOCK = constants_1.constants.S_IFSOCK;
|
|
20376
|
-
var
|
|
20376
|
+
var Dirent = (
|
|
20377
20377
|
/** @class */
|
|
20378
20378
|
function() {
|
|
20379
|
-
function
|
|
20379
|
+
function Dirent2() {
|
|
20380
20380
|
this.name = "";
|
|
20381
20381
|
this.mode = 0;
|
|
20382
20382
|
}
|
|
20383
|
-
|
|
20384
|
-
var dirent = new
|
|
20383
|
+
Dirent2.build = function(link, encoding) {
|
|
20384
|
+
var dirent = new Dirent2();
|
|
20385
20385
|
var mode = link.getNode().mode;
|
|
20386
20386
|
dirent.name = (0, encoding_1.strToEncoding)(link.getName(), encoding);
|
|
20387
20387
|
dirent.mode = mode;
|
|
20388
20388
|
return dirent;
|
|
20389
20389
|
};
|
|
20390
|
-
|
|
20390
|
+
Dirent2.prototype._checkModeProperty = function(property) {
|
|
20391
20391
|
return (this.mode & S_IFMT) === property;
|
|
20392
20392
|
};
|
|
20393
|
-
|
|
20393
|
+
Dirent2.prototype.isDirectory = function() {
|
|
20394
20394
|
return this._checkModeProperty(S_IFDIR);
|
|
20395
20395
|
};
|
|
20396
|
-
|
|
20396
|
+
Dirent2.prototype.isFile = function() {
|
|
20397
20397
|
return this._checkModeProperty(S_IFREG);
|
|
20398
20398
|
};
|
|
20399
|
-
|
|
20399
|
+
Dirent2.prototype.isBlockDevice = function() {
|
|
20400
20400
|
return this._checkModeProperty(S_IFBLK);
|
|
20401
20401
|
};
|
|
20402
|
-
|
|
20402
|
+
Dirent2.prototype.isCharacterDevice = function() {
|
|
20403
20403
|
return this._checkModeProperty(S_IFCHR);
|
|
20404
20404
|
};
|
|
20405
|
-
|
|
20405
|
+
Dirent2.prototype.isSymbolicLink = function() {
|
|
20406
20406
|
return this._checkModeProperty(S_IFLNK);
|
|
20407
20407
|
};
|
|
20408
|
-
|
|
20408
|
+
Dirent2.prototype.isFIFO = function() {
|
|
20409
20409
|
return this._checkModeProperty(S_IFIFO);
|
|
20410
20410
|
};
|
|
20411
|
-
|
|
20411
|
+
Dirent2.prototype.isSocket = function() {
|
|
20412
20412
|
return this._checkModeProperty(S_IFSOCK);
|
|
20413
20413
|
};
|
|
20414
|
-
return
|
|
20414
|
+
return Dirent2;
|
|
20415
20415
|
}()
|
|
20416
20416
|
);
|
|
20417
|
-
exports.Dirent =
|
|
20418
|
-
exports.default =
|
|
20417
|
+
exports.Dirent = Dirent;
|
|
20418
|
+
exports.default = Dirent;
|
|
20419
20419
|
}
|
|
20420
20420
|
});
|
|
20421
20421
|
var require_setImmediate = __commonJS2({
|
|
@@ -85294,15 +85294,6 @@ function serialized_manifest_path(config, base = base_dir(config)) {
|
|
|
85294
85294
|
return join2(base, "manifest.json");
|
|
85295
85295
|
}
|
|
85296
85296
|
var t2 = __toESM2(require_lib5(), 1);
|
|
85297
|
-
function definitionFromAncestors(ancestors) {
|
|
85298
|
-
let parents = [...ancestors];
|
|
85299
|
-
parents.shift();
|
|
85300
|
-
let definition = parents.shift();
|
|
85301
|
-
while (Array.isArray(definition) && definition) {
|
|
85302
|
-
definition = parents.shift();
|
|
85303
|
-
}
|
|
85304
|
-
return { parents, definition };
|
|
85305
|
-
}
|
|
85306
85297
|
function formatErrors(e22, afterError) {
|
|
85307
85298
|
const errors = Array.isArray(e22) ? e22 : [e22];
|
|
85308
85299
|
for (const error of errors) {
|
|
@@ -91165,7 +91156,7 @@ var require_jsonfile3 = __commonJS3({
|
|
|
91165
91156
|
}
|
|
91166
91157
|
var universalify = require_universalify2();
|
|
91167
91158
|
var { stringify, stripBom } = require_utils22();
|
|
91168
|
-
async function
|
|
91159
|
+
async function _readFile(file, options = {}) {
|
|
91169
91160
|
if (typeof options === "string") {
|
|
91170
91161
|
options = { encoding: options };
|
|
91171
91162
|
}
|
|
@@ -91186,7 +91177,7 @@ var require_jsonfile3 = __commonJS3({
|
|
|
91186
91177
|
}
|
|
91187
91178
|
return obj;
|
|
91188
91179
|
}
|
|
91189
|
-
var readFile22 = universalify.fromPromise(
|
|
91180
|
+
var readFile22 = universalify.fromPromise(_readFile);
|
|
91190
91181
|
function readFileSync22(file, options = {}) {
|
|
91191
91182
|
if (typeof options === "string") {
|
|
91192
91183
|
options = { encoding: options };
|
|
@@ -91940,49 +91931,49 @@ var require_Dirent2 = __commonJS3({
|
|
|
91940
91931
|
var S_IFLNK = constants_1.constants.S_IFLNK;
|
|
91941
91932
|
var S_IFIFO = constants_1.constants.S_IFIFO;
|
|
91942
91933
|
var S_IFSOCK = constants_1.constants.S_IFSOCK;
|
|
91943
|
-
var
|
|
91934
|
+
var Dirent = (
|
|
91944
91935
|
/** @class */
|
|
91945
91936
|
function() {
|
|
91946
|
-
function
|
|
91937
|
+
function Dirent2() {
|
|
91947
91938
|
this.name = "";
|
|
91948
91939
|
this.mode = 0;
|
|
91949
91940
|
}
|
|
91950
|
-
|
|
91951
|
-
var dirent = new
|
|
91941
|
+
Dirent2.build = function(link, encoding) {
|
|
91942
|
+
var dirent = new Dirent2();
|
|
91952
91943
|
var mode = link.getNode().mode;
|
|
91953
91944
|
dirent.name = (0, encoding_1.strToEncoding)(link.getName(), encoding);
|
|
91954
91945
|
dirent.mode = mode;
|
|
91955
91946
|
return dirent;
|
|
91956
91947
|
};
|
|
91957
|
-
|
|
91948
|
+
Dirent2.prototype._checkModeProperty = function(property) {
|
|
91958
91949
|
return (this.mode & S_IFMT) === property;
|
|
91959
91950
|
};
|
|
91960
|
-
|
|
91951
|
+
Dirent2.prototype.isDirectory = function() {
|
|
91961
91952
|
return this._checkModeProperty(S_IFDIR);
|
|
91962
91953
|
};
|
|
91963
|
-
|
|
91954
|
+
Dirent2.prototype.isFile = function() {
|
|
91964
91955
|
return this._checkModeProperty(S_IFREG);
|
|
91965
91956
|
};
|
|
91966
|
-
|
|
91957
|
+
Dirent2.prototype.isBlockDevice = function() {
|
|
91967
91958
|
return this._checkModeProperty(S_IFBLK);
|
|
91968
91959
|
};
|
|
91969
|
-
|
|
91960
|
+
Dirent2.prototype.isCharacterDevice = function() {
|
|
91970
91961
|
return this._checkModeProperty(S_IFCHR);
|
|
91971
91962
|
};
|
|
91972
|
-
|
|
91963
|
+
Dirent2.prototype.isSymbolicLink = function() {
|
|
91973
91964
|
return this._checkModeProperty(S_IFLNK);
|
|
91974
91965
|
};
|
|
91975
|
-
|
|
91966
|
+
Dirent2.prototype.isFIFO = function() {
|
|
91976
91967
|
return this._checkModeProperty(S_IFIFO);
|
|
91977
91968
|
};
|
|
91978
|
-
|
|
91969
|
+
Dirent2.prototype.isSocket = function() {
|
|
91979
91970
|
return this._checkModeProperty(S_IFSOCK);
|
|
91980
91971
|
};
|
|
91981
|
-
return
|
|
91972
|
+
return Dirent2;
|
|
91982
91973
|
}()
|
|
91983
91974
|
);
|
|
91984
|
-
exports.Dirent =
|
|
91985
|
-
exports.default =
|
|
91975
|
+
exports.Dirent = Dirent;
|
|
91976
|
+
exports.default = Dirent;
|
|
91986
91977
|
}
|
|
91987
91978
|
});
|
|
91988
91979
|
var require_setImmediate2 = __commonJS3({
|
|
@@ -150825,7 +150816,7 @@ function walkAncestors(schema2, filepath, ancestors) {
|
|
|
150825
150816
|
}
|
|
150826
150817
|
return getRootType(field.type);
|
|
150827
150818
|
}
|
|
150828
|
-
function
|
|
150819
|
+
function definitionFromAncestors(ancestors) {
|
|
150829
150820
|
let parents = [...ancestors];
|
|
150830
150821
|
parents.shift();
|
|
150831
150822
|
let definition = parents.shift();
|
|
@@ -153389,10 +153380,10 @@ var AST32 = recast22.types.builders;
|
|
|
153389
153380
|
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
153390
153381
|
type,
|
|
153391
153382
|
wrappers
|
|
153392
|
-
}, body) {
|
|
153383
|
+
}, body, input) {
|
|
153393
153384
|
let result;
|
|
153394
153385
|
if (graphql62.isScalarType(type)) {
|
|
153395
|
-
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
153386
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null, input);
|
|
153396
153387
|
} else if (graphql62.isEnumType(type)) {
|
|
153397
153388
|
result = enumReference(config, body, type.name);
|
|
153398
153389
|
} else {
|
|
@@ -153409,14 +153400,15 @@ function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
|
153409
153400
|
}
|
|
153410
153401
|
return result;
|
|
153411
153402
|
}
|
|
153412
|
-
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
153403
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body, input) {
|
|
153413
153404
|
const { type, wrappers } = unwrapType2(config, definition.type);
|
|
153414
153405
|
return unwrappedTsTypeReference(
|
|
153415
153406
|
config,
|
|
153416
153407
|
filepath,
|
|
153417
153408
|
missingScalars,
|
|
153418
153409
|
{ type, wrappers },
|
|
153419
|
-
body
|
|
153410
|
+
body,
|
|
153411
|
+
input
|
|
153420
153412
|
);
|
|
153421
153413
|
}
|
|
153422
153414
|
function enumReference(config, body, name) {
|
|
@@ -153445,7 +153437,7 @@ function nullableField(inner, input = false) {
|
|
|
153445
153437
|
}
|
|
153446
153438
|
return AST32.tsUnionType(members);
|
|
153447
153439
|
}
|
|
153448
|
-
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
153440
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field, input) {
|
|
153449
153441
|
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
153450
153442
|
if (!field) {
|
|
153451
153443
|
return AST32.tsNeverKeyword();
|
|
@@ -153504,6 +153496,9 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
153504
153496
|
return AST32.tsBooleanKeyword();
|
|
153505
153497
|
}
|
|
153506
153498
|
case "ID": {
|
|
153499
|
+
if (input) {
|
|
153500
|
+
return AST32.tsUnionType([AST32.tsStringKeyword(), AST32.tsNumberKeyword()]);
|
|
153501
|
+
}
|
|
153507
153502
|
return AST32.tsStringKeyword();
|
|
153508
153503
|
}
|
|
153509
153504
|
default: {
|
|
@@ -153514,7 +153509,8 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
153514
153509
|
missingScalars,
|
|
153515
153510
|
target.ofType,
|
|
153516
153511
|
body,
|
|
153517
|
-
field
|
|
153512
|
+
field,
|
|
153513
|
+
input
|
|
153518
153514
|
);
|
|
153519
153515
|
}
|
|
153520
153516
|
if (config.scalars?.[target.name]) {
|
|
@@ -156148,7 +156144,7 @@ ${exportStatement("config")}
|
|
|
156148
156144
|
var recast11 = __toESM3(require_main22(), 1);
|
|
156149
156145
|
var recast7 = __toESM3(require_main22(), 1);
|
|
156150
156146
|
var AST8 = recast7.types.builders;
|
|
156151
|
-
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
156147
|
+
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType, input) {
|
|
156152
156148
|
const { type } = unwrapType2(config, rootType);
|
|
156153
156149
|
if (graphql19.isScalarType(type)) {
|
|
156154
156150
|
return;
|
|
@@ -156173,12 +156169,20 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
|
|
|
156173
156169
|
}
|
|
156174
156170
|
const members = [];
|
|
156175
156171
|
for (const field of Object.values(type.getFields())) {
|
|
156176
|
-
addReferencedInputTypes(
|
|
156172
|
+
addReferencedInputTypes(
|
|
156173
|
+
config,
|
|
156174
|
+
filepath,
|
|
156175
|
+
body,
|
|
156176
|
+
visitedTypes,
|
|
156177
|
+
missingScalars,
|
|
156178
|
+
field.type,
|
|
156179
|
+
input
|
|
156180
|
+
);
|
|
156177
156181
|
members.push(
|
|
156178
156182
|
AST8.tsPropertySignature(
|
|
156179
156183
|
AST8.identifier(field.name),
|
|
156180
156184
|
AST8.tsTypeAnnotation(
|
|
156181
|
-
tsTypeReference(config, filepath, missingScalars, field, body)
|
|
156185
|
+
tsTypeReference(config, filepath, missingScalars, field, body, input)
|
|
156182
156186
|
),
|
|
156183
156187
|
graphql19.isNullableType(field.type)
|
|
156184
156188
|
)
|
|
@@ -156214,7 +156218,8 @@ function inlineType({
|
|
|
156214
156218
|
includeFragments,
|
|
156215
156219
|
allOptional,
|
|
156216
156220
|
forceNonNull,
|
|
156217
|
-
field
|
|
156221
|
+
field,
|
|
156222
|
+
input
|
|
156218
156223
|
}) {
|
|
156219
156224
|
const { type, wrappers } = unwrapType2(config, rootType);
|
|
156220
156225
|
let result;
|
|
@@ -156226,7 +156231,8 @@ function inlineType({
|
|
|
156226
156231
|
missingScalars,
|
|
156227
156232
|
type,
|
|
156228
156233
|
body,
|
|
156229
|
-
field
|
|
156234
|
+
field,
|
|
156235
|
+
input
|
|
156230
156236
|
);
|
|
156231
156237
|
} else if (graphql20.isEnumType(type)) {
|
|
156232
156238
|
ensureImports2({
|
|
@@ -156334,7 +156340,8 @@ function inlineType({
|
|
|
156334
156340
|
field: {
|
|
156335
156341
|
field: attributeName,
|
|
156336
156342
|
parent: type.name
|
|
156337
|
-
}
|
|
156343
|
+
},
|
|
156344
|
+
input
|
|
156338
156345
|
});
|
|
156339
156346
|
const hasIncludeOrSkipDirective = selection.directives && selection.directives.filter(
|
|
156340
156347
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
@@ -156398,7 +156405,8 @@ function inlineType({
|
|
|
156398
156405
|
missingScalars,
|
|
156399
156406
|
includeFragments,
|
|
156400
156407
|
allOptional,
|
|
156401
|
-
field: null
|
|
156408
|
+
field: null,
|
|
156409
|
+
input: false
|
|
156402
156410
|
});
|
|
156403
156411
|
let objectType = fragmentType;
|
|
156404
156412
|
if (fragmentType.type === "TSUnionType") {
|
|
@@ -156865,7 +156873,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
156865
156873
|
body,
|
|
156866
156874
|
missingScalars,
|
|
156867
156875
|
includeFragments: true,
|
|
156868
|
-
field: null
|
|
156876
|
+
field: null,
|
|
156877
|
+
input: false
|
|
156869
156878
|
});
|
|
156870
156879
|
if (artifact.kind === "HoudiniQuery") {
|
|
156871
156880
|
resultType = withLoadingState({
|
|
@@ -156914,7 +156923,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
156914
156923
|
body,
|
|
156915
156924
|
visitedTypes,
|
|
156916
156925
|
missingScalars,
|
|
156917
|
-
variableDefinition.type
|
|
156926
|
+
variableDefinition.type,
|
|
156927
|
+
true
|
|
156918
156928
|
);
|
|
156919
156929
|
}
|
|
156920
156930
|
body.push(
|
|
@@ -156932,7 +156942,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
156932
156942
|
filepath,
|
|
156933
156943
|
missingScalars,
|
|
156934
156944
|
definition2,
|
|
156935
|
-
body
|
|
156945
|
+
body,
|
|
156946
|
+
true
|
|
156936
156947
|
)
|
|
156937
156948
|
),
|
|
156938
156949
|
definition2.type.kind !== "NonNullType"
|
|
@@ -156967,7 +156978,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
156967
156978
|
missingScalars,
|
|
156968
156979
|
includeFragments: false,
|
|
156969
156980
|
allOptional: true,
|
|
156970
|
-
field: null
|
|
156981
|
+
field: null,
|
|
156982
|
+
input: false
|
|
156971
156983
|
})
|
|
156972
156984
|
)
|
|
156973
156985
|
)
|
|
@@ -157000,7 +157012,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
157000
157012
|
filepath,
|
|
157001
157013
|
missingScalars,
|
|
157002
157014
|
definition2,
|
|
157003
|
-
body
|
|
157015
|
+
body,
|
|
157016
|
+
false
|
|
157004
157017
|
)
|
|
157005
157018
|
),
|
|
157006
157019
|
definition2.type.kind !== "NonNullType"
|
|
@@ -157063,7 +157076,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
157063
157076
|
visitedTypes,
|
|
157064
157077
|
missingScalars,
|
|
157065
157078
|
includeFragments: true,
|
|
157066
|
-
field: null
|
|
157079
|
+
field: null,
|
|
157080
|
+
input: false
|
|
157067
157081
|
})
|
|
157068
157082
|
})
|
|
157069
157083
|
)
|
|
@@ -157156,7 +157170,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
157156
157170
|
{
|
|
157157
157171
|
field: key,
|
|
157158
157172
|
parent: type.name
|
|
157159
|
-
}
|
|
157173
|
+
},
|
|
157174
|
+
false
|
|
157160
157175
|
)
|
|
157161
157176
|
)
|
|
157162
157177
|
);
|
|
@@ -157183,7 +157198,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
157183
157198
|
{
|
|
157184
157199
|
field: key,
|
|
157185
157200
|
parent: type.name
|
|
157186
|
-
}
|
|
157201
|
+
},
|
|
157202
|
+
false
|
|
157187
157203
|
)
|
|
157188
157204
|
);
|
|
157189
157205
|
} else if (graphql21.isEnumType(unwrapped.type)) {
|
|
@@ -157221,7 +157237,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
157221
157237
|
body,
|
|
157222
157238
|
visitedTypes,
|
|
157223
157239
|
/* @__PURE__ */ new Set(),
|
|
157224
|
-
arg.type
|
|
157240
|
+
arg.type,
|
|
157241
|
+
true
|
|
157225
157242
|
);
|
|
157226
157243
|
const prop = AST13.tsPropertySignature(
|
|
157227
157244
|
AST13.identifier(arg.name),
|
|
@@ -157231,7 +157248,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
157231
157248
|
filepath,
|
|
157232
157249
|
/* @__PURE__ */ new Set(),
|
|
157233
157250
|
arg,
|
|
157234
|
-
body
|
|
157251
|
+
body,
|
|
157252
|
+
graphql21.isInputType(arg.type)
|
|
157235
157253
|
)
|
|
157236
157254
|
)
|
|
157237
157255
|
);
|
|
@@ -157343,7 +157361,8 @@ function listDefinitions(config, filepath, body, docs) {
|
|
|
157343
157361
|
filepath,
|
|
157344
157362
|
/* @__PURE__ */ new Set(),
|
|
157345
157363
|
arg,
|
|
157346
|
-
body
|
|
157364
|
+
body,
|
|
157365
|
+
graphql21.isInputType(arg.type)
|
|
157347
157366
|
)
|
|
157348
157367
|
)
|
|
157349
157368
|
);
|
|
@@ -160326,7 +160345,7 @@ async function typeCheck(config, docs) {
|
|
|
160326
160345
|
if (![config.listDirective, config.paginateDirective].includes(directive.name.value)) {
|
|
160327
160346
|
return;
|
|
160328
160347
|
}
|
|
160329
|
-
const { parents, definition } =
|
|
160348
|
+
const { parents, definition } = definitionFromAncestors(ancestors);
|
|
160330
160349
|
let needsParent = false;
|
|
160331
160350
|
if (definition.kind !== "OperationDefinition" && definition.kind !== "FragmentDefinition" || definition.kind === "OperationDefinition" && definition.operation !== "query") {
|
|
160332
160351
|
errors.push(
|
|
@@ -160992,7 +161011,7 @@ function nodeDirectives(config, directives) {
|
|
|
160992
161011
|
if (!directives.includes(node.name.value)) {
|
|
160993
161012
|
return;
|
|
160994
161013
|
}
|
|
160995
|
-
let { definition } =
|
|
161014
|
+
let { definition } = definitionFromAncestors(ancestors);
|
|
160996
161015
|
let definitionType = "";
|
|
160997
161016
|
if (definition.kind === "OperationDefinition") {
|
|
160998
161017
|
if (definition.operation !== "query") {
|
|
@@ -162145,49 +162164,49 @@ var require_Dirent3 = __commonJS4({
|
|
|
162145
162164
|
var S_IFLNK = constants_1.constants.S_IFLNK;
|
|
162146
162165
|
var S_IFIFO = constants_1.constants.S_IFIFO;
|
|
162147
162166
|
var S_IFSOCK = constants_1.constants.S_IFSOCK;
|
|
162148
|
-
var
|
|
162167
|
+
var Dirent = (
|
|
162149
162168
|
/** @class */
|
|
162150
162169
|
function() {
|
|
162151
|
-
function
|
|
162170
|
+
function Dirent2() {
|
|
162152
162171
|
this.name = "";
|
|
162153
162172
|
this.mode = 0;
|
|
162154
162173
|
}
|
|
162155
|
-
|
|
162156
|
-
var dirent = new
|
|
162174
|
+
Dirent2.build = function(link, encoding) {
|
|
162175
|
+
var dirent = new Dirent2();
|
|
162157
162176
|
var mode = link.getNode().mode;
|
|
162158
162177
|
dirent.name = (0, encoding_1.strToEncoding)(link.getName(), encoding);
|
|
162159
162178
|
dirent.mode = mode;
|
|
162160
162179
|
return dirent;
|
|
162161
162180
|
};
|
|
162162
|
-
|
|
162181
|
+
Dirent2.prototype._checkModeProperty = function(property) {
|
|
162163
162182
|
return (this.mode & S_IFMT) === property;
|
|
162164
162183
|
};
|
|
162165
|
-
|
|
162184
|
+
Dirent2.prototype.isDirectory = function() {
|
|
162166
162185
|
return this._checkModeProperty(S_IFDIR);
|
|
162167
162186
|
};
|
|
162168
|
-
|
|
162187
|
+
Dirent2.prototype.isFile = function() {
|
|
162169
162188
|
return this._checkModeProperty(S_IFREG);
|
|
162170
162189
|
};
|
|
162171
|
-
|
|
162190
|
+
Dirent2.prototype.isBlockDevice = function() {
|
|
162172
162191
|
return this._checkModeProperty(S_IFBLK);
|
|
162173
162192
|
};
|
|
162174
|
-
|
|
162193
|
+
Dirent2.prototype.isCharacterDevice = function() {
|
|
162175
162194
|
return this._checkModeProperty(S_IFCHR);
|
|
162176
162195
|
};
|
|
162177
|
-
|
|
162196
|
+
Dirent2.prototype.isSymbolicLink = function() {
|
|
162178
162197
|
return this._checkModeProperty(S_IFLNK);
|
|
162179
162198
|
};
|
|
162180
|
-
|
|
162199
|
+
Dirent2.prototype.isFIFO = function() {
|
|
162181
162200
|
return this._checkModeProperty(S_IFIFO);
|
|
162182
162201
|
};
|
|
162183
|
-
|
|
162202
|
+
Dirent2.prototype.isSocket = function() {
|
|
162184
162203
|
return this._checkModeProperty(S_IFSOCK);
|
|
162185
162204
|
};
|
|
162186
|
-
return
|
|
162205
|
+
return Dirent2;
|
|
162187
162206
|
}()
|
|
162188
162207
|
);
|
|
162189
|
-
exports.Dirent =
|
|
162190
|
-
exports.default =
|
|
162208
|
+
exports.Dirent = Dirent;
|
|
162209
|
+
exports.default = Dirent;
|
|
162191
162210
|
}
|
|
162192
162211
|
});
|
|
162193
162212
|
var require_setImmediate3 = __commonJS4({
|
|
@@ -168017,7 +168036,7 @@ var require_jsonfile4 = __commonJS4({
|
|
|
168017
168036
|
}
|
|
168018
168037
|
var universalify = require_universalify3();
|
|
168019
168038
|
var { stringify, stripBom } = require_utils23();
|
|
168020
|
-
async function
|
|
168039
|
+
async function _readFile(file, options = {}) {
|
|
168021
168040
|
if (typeof options === "string") {
|
|
168022
168041
|
options = { encoding: options };
|
|
168023
168042
|
}
|
|
@@ -168038,7 +168057,7 @@ var require_jsonfile4 = __commonJS4({
|
|
|
168038
168057
|
}
|
|
168039
168058
|
return obj;
|
|
168040
168059
|
}
|
|
168041
|
-
var readFile22 = universalify.fromPromise(
|
|
168060
|
+
var readFile22 = universalify.fromPromise(_readFile);
|
|
168042
168061
|
function readFileSync22(file, options = {}) {
|
|
168043
168062
|
if (typeof options === "string") {
|
|
168044
168063
|
options = { encoding: options };
|
|
@@ -226501,8 +226520,7 @@ var Config = class {
|
|
|
226501
226520
|
let {
|
|
226502
226521
|
schema: schema2,
|
|
226503
226522
|
schemaPath = "./schema.graphql",
|
|
226504
|
-
|
|
226505
|
-
runtimeDir = "$houdini",
|
|
226523
|
+
runtimeDir = ".houdini",
|
|
226506
226524
|
exclude = [],
|
|
226507
226525
|
module = "esm",
|
|
226508
226526
|
scalars,
|
|
@@ -228188,8 +228206,6 @@ function plugin_config(config) {
|
|
|
228188
228206
|
return {
|
|
228189
228207
|
client: "./src/client",
|
|
228190
228208
|
defaultRouteBlocking: false,
|
|
228191
|
-
pageQueryFilename: "+page.gql",
|
|
228192
|
-
layoutQueryFilename: "+layout.gql",
|
|
228193
228209
|
static: false,
|
|
228194
228210
|
forceRunesMode: false,
|
|
228195
228211
|
...cfg,
|
|
@@ -228207,9 +228223,6 @@ function plugin_config(config) {
|
|
|
228207
228223
|
};
|
|
228208
228224
|
}
|
|
228209
228225
|
|
|
228210
|
-
// src/plugin/kit.ts
|
|
228211
|
-
import * as graphql41 from "graphql";
|
|
228212
|
-
|
|
228213
228226
|
// ../houdini/build/vite-esm/index.js
|
|
228214
228227
|
import { createRequire as conflict_free4 } from "module";
|
|
228215
228228
|
import { statSync as statSync2, createReadStream as createReadStream2, promises as fs22 } from "node:fs";
|
|
@@ -231203,7 +231216,7 @@ var require_jsonfile5 = __commonJS5({
|
|
|
231203
231216
|
}
|
|
231204
231217
|
var universalify = require_universalify4();
|
|
231205
231218
|
var { stringify, stripBom } = require_utils24();
|
|
231206
|
-
async function
|
|
231219
|
+
async function _readFile(file, options = {}) {
|
|
231207
231220
|
if (typeof options === "string") {
|
|
231208
231221
|
options = { encoding: options };
|
|
231209
231222
|
}
|
|
@@ -231224,7 +231237,7 @@ var require_jsonfile5 = __commonJS5({
|
|
|
231224
231237
|
}
|
|
231225
231238
|
return obj;
|
|
231226
231239
|
}
|
|
231227
|
-
var readFile22 = universalify.fromPromise(
|
|
231240
|
+
var readFile22 = universalify.fromPromise(_readFile);
|
|
231228
231241
|
function readFileSync22(file, options = {}) {
|
|
231229
231242
|
if (typeof options === "string") {
|
|
231230
231243
|
options = { encoding: options };
|
|
@@ -231978,49 +231991,49 @@ var require_Dirent4 = __commonJS5({
|
|
|
231978
231991
|
var S_IFLNK = constants_1.constants.S_IFLNK;
|
|
231979
231992
|
var S_IFIFO = constants_1.constants.S_IFIFO;
|
|
231980
231993
|
var S_IFSOCK = constants_1.constants.S_IFSOCK;
|
|
231981
|
-
var
|
|
231994
|
+
var Dirent = (
|
|
231982
231995
|
/** @class */
|
|
231983
231996
|
function() {
|
|
231984
|
-
function
|
|
231997
|
+
function Dirent2() {
|
|
231985
231998
|
this.name = "";
|
|
231986
231999
|
this.mode = 0;
|
|
231987
232000
|
}
|
|
231988
|
-
|
|
231989
|
-
var dirent = new
|
|
232001
|
+
Dirent2.build = function(link, encoding) {
|
|
232002
|
+
var dirent = new Dirent2();
|
|
231990
232003
|
var mode = link.getNode().mode;
|
|
231991
232004
|
dirent.name = (0, encoding_1.strToEncoding)(link.getName(), encoding);
|
|
231992
232005
|
dirent.mode = mode;
|
|
231993
232006
|
return dirent;
|
|
231994
232007
|
};
|
|
231995
|
-
|
|
232008
|
+
Dirent2.prototype._checkModeProperty = function(property) {
|
|
231996
232009
|
return (this.mode & S_IFMT) === property;
|
|
231997
232010
|
};
|
|
231998
|
-
|
|
232011
|
+
Dirent2.prototype.isDirectory = function() {
|
|
231999
232012
|
return this._checkModeProperty(S_IFDIR);
|
|
232000
232013
|
};
|
|
232001
|
-
|
|
232014
|
+
Dirent2.prototype.isFile = function() {
|
|
232002
232015
|
return this._checkModeProperty(S_IFREG);
|
|
232003
232016
|
};
|
|
232004
|
-
|
|
232017
|
+
Dirent2.prototype.isBlockDevice = function() {
|
|
232005
232018
|
return this._checkModeProperty(S_IFBLK);
|
|
232006
232019
|
};
|
|
232007
|
-
|
|
232020
|
+
Dirent2.prototype.isCharacterDevice = function() {
|
|
232008
232021
|
return this._checkModeProperty(S_IFCHR);
|
|
232009
232022
|
};
|
|
232010
|
-
|
|
232023
|
+
Dirent2.prototype.isSymbolicLink = function() {
|
|
232011
232024
|
return this._checkModeProperty(S_IFLNK);
|
|
232012
232025
|
};
|
|
232013
|
-
|
|
232026
|
+
Dirent2.prototype.isFIFO = function() {
|
|
232014
232027
|
return this._checkModeProperty(S_IFIFO);
|
|
232015
232028
|
};
|
|
232016
|
-
|
|
232029
|
+
Dirent2.prototype.isSocket = function() {
|
|
232017
232030
|
return this._checkModeProperty(S_IFSOCK);
|
|
232018
232031
|
};
|
|
232019
|
-
return
|
|
232032
|
+
return Dirent2;
|
|
232020
232033
|
}()
|
|
232021
232034
|
);
|
|
232022
|
-
exports.Dirent =
|
|
232023
|
-
exports.default =
|
|
232035
|
+
exports.Dirent = Dirent;
|
|
232036
|
+
exports.default = Dirent;
|
|
232024
232037
|
}
|
|
232025
232038
|
});
|
|
232026
232039
|
var require_setImmediate4 = __commonJS5({
|
|
@@ -300238,7 +300251,9 @@ filepath: ${filepath}`
|
|
|
300238
300251
|
load.push(element.quasi.quasis[0].value.raw);
|
|
300239
300252
|
} else if (element.type === "CallExpression") {
|
|
300240
300253
|
if (element.callee.type !== "Identifier" || element.callee.name !== "graphql" || element.arguments.length !== 1) {
|
|
300241
|
-
throw new Error(
|
|
300254
|
+
throw new Error(
|
|
300255
|
+
`only graphql function can be passed to ${houdini_load_fn}. Filepath: ${filepath}`
|
|
300256
|
+
);
|
|
300242
300257
|
}
|
|
300243
300258
|
let documentString;
|
|
300244
300259
|
const argument = element.arguments[0];
|
|
@@ -300346,18 +300361,6 @@ function is_layout3(framework2, filename) {
|
|
|
300346
300361
|
function is_component(config, framework2, filename) {
|
|
300347
300362
|
return framework2 === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework2, filename) && !is_route(config, framework2, filename);
|
|
300348
300363
|
}
|
|
300349
|
-
function page_query_path(config, filename) {
|
|
300350
|
-
return path_exports.join(
|
|
300351
|
-
path_exports.dirname(resolve_relative(config, filename)),
|
|
300352
|
-
plugin_config(config).pageQueryFilename
|
|
300353
|
-
);
|
|
300354
|
-
}
|
|
300355
|
-
function layout_query_path(config, filename) {
|
|
300356
|
-
return path_exports.join(
|
|
300357
|
-
path_exports.dirname(resolve_relative(config, filename)),
|
|
300358
|
-
plugin_config(config).layoutQueryFilename
|
|
300359
|
-
);
|
|
300360
|
-
}
|
|
300361
300364
|
function resolve_relative(config, filename) {
|
|
300362
300365
|
const match5 = filename.match("^((../)+)src/routes");
|
|
300363
300366
|
if (match5) {
|
|
@@ -300467,32 +300470,6 @@ async function walk_routes(config, framework2, visitor, dirpath = config.routesD
|
|
|
300467
300470
|
componentQueries.push({ query: definition, componentPath: childPath });
|
|
300468
300471
|
}
|
|
300469
300472
|
});
|
|
300470
|
-
} else if (child === plugin_config(config).layoutQueryFilename) {
|
|
300471
|
-
validRoute = true;
|
|
300472
|
-
const contents = await fs_exports.readFile(childPath);
|
|
300473
|
-
if (!contents) {
|
|
300474
|
-
continue;
|
|
300475
|
-
}
|
|
300476
|
-
try {
|
|
300477
|
-
const query = config.extractQueryDefinition(graphql41.parse(contents));
|
|
300478
|
-
await visitor.routeLayoutQuery?.(query, childPath);
|
|
300479
|
-
layoutQueries.push(query);
|
|
300480
|
-
} catch (e3) {
|
|
300481
|
-
throw routeQueryError(childPath);
|
|
300482
|
-
}
|
|
300483
|
-
} else if (child === plugin_config(config).pageQueryFilename) {
|
|
300484
|
-
validRoute = true;
|
|
300485
|
-
const contents = await fs_exports.readFile(childPath);
|
|
300486
|
-
if (!contents) {
|
|
300487
|
-
continue;
|
|
300488
|
-
}
|
|
300489
|
-
try {
|
|
300490
|
-
const query = config.extractQueryDefinition(graphql41.parse(contents));
|
|
300491
|
-
await visitor.routePageQuery?.(query, childPath);
|
|
300492
|
-
pageQueries.push(query);
|
|
300493
|
-
} catch (e3) {
|
|
300494
|
-
throw routeQueryError(childPath);
|
|
300495
|
-
}
|
|
300496
300473
|
} else {
|
|
300497
300474
|
continue;
|
|
300498
300475
|
}
|
|
@@ -300524,10 +300501,6 @@ async function walk_routes(config, framework2, visitor, dirpath = config.routesD
|
|
|
300524
300501
|
);
|
|
300525
300502
|
}
|
|
300526
300503
|
}
|
|
300527
|
-
var routeQueryError = (filepath) => ({
|
|
300528
|
-
filepath,
|
|
300529
|
-
message: "route query error"
|
|
300530
|
-
});
|
|
300531
300504
|
function route_page_path(config, filename) {
|
|
300532
300505
|
return resolve_relative(config, filename).replace(".js", ".svelte").replace(".ts", ".svelte");
|
|
300533
300506
|
}
|
|
@@ -301219,180 +301192,12 @@ async function codegen_default(input) {
|
|
|
301219
301192
|
]);
|
|
301220
301193
|
}
|
|
301221
301194
|
|
|
301222
|
-
// src/plugin/fsPatch.ts
|
|
301223
|
-
import filesystem, { Dirent } from "node:fs";
|
|
301224
|
-
import filesystemPromises from "node:fs/promises";
|
|
301225
|
-
|
|
301226
301195
|
// src/plugin/state.ts
|
|
301227
301196
|
var _config;
|
|
301228
301197
|
function setConfig(config) {
|
|
301229
301198
|
_config = config;
|
|
301230
301199
|
}
|
|
301231
301200
|
|
|
301232
|
-
// src/plugin/fsPatch.ts
|
|
301233
|
-
var fsPatch_default = (getFramework) => ({
|
|
301234
|
-
async resolveId(filepath, _, { config, isEntry }) {
|
|
301235
|
-
if (!isEntry) {
|
|
301236
|
-
const match5 = filepath.match("^((../)+)src/routes");
|
|
301237
|
-
if (match5) {
|
|
301238
|
-
return path_exports.join(config.projectRoot, filepath.substring(match5[1].length));
|
|
301239
|
-
}
|
|
301240
|
-
return filepath.startsWith("/src") ? { id: path_exports.join(config.projectRoot, filepath) } : null;
|
|
301241
|
-
}
|
|
301242
|
-
filepath = path_exports.posixify(filepath.toString());
|
|
301243
|
-
if (is_route_script(getFramework(), filepath) || is_root_layout(config, filepath) || is_root_layout_server(config, filepath)) {
|
|
301244
|
-
return {
|
|
301245
|
-
id: resolve_relative(config, filepath)
|
|
301246
|
-
};
|
|
301247
|
-
}
|
|
301248
|
-
},
|
|
301249
|
-
load: async (filepath, { config }) => {
|
|
301250
|
-
filepath = path_exports.posixify(filepath.toString());
|
|
301251
|
-
if (is_route_script(getFramework(), filepath) || is_root_layout_server(config, filepath)) {
|
|
301252
|
-
filepath = resolve_relative(config, filepath);
|
|
301253
|
-
return {
|
|
301254
|
-
code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config.projectRoot, filepath)) || ""
|
|
301255
|
-
};
|
|
301256
|
-
}
|
|
301257
|
-
if (is_root_layout(config, filepath)) {
|
|
301258
|
-
filepath = resolve_relative(config, filepath);
|
|
301259
|
-
return {
|
|
301260
|
-
code: await fs_exports.readFile(filepath) || await fs_exports.readFile(path_exports.join(config.projectRoot, filepath)) || empty_layout
|
|
301261
|
-
};
|
|
301262
|
-
}
|
|
301263
|
-
}
|
|
301264
|
-
});
|
|
301265
|
-
var _readDirSync = filesystem.readdirSync;
|
|
301266
|
-
var _statSync = filesystem.statSync;
|
|
301267
|
-
var _readFileSync = filesystem.readFileSync;
|
|
301268
|
-
var _unlinkSync = filesystem.unlinkSync;
|
|
301269
|
-
function getStringFilepath(fp) {
|
|
301270
|
-
if (fp instanceof URL) {
|
|
301271
|
-
return fp.pathname;
|
|
301272
|
-
}
|
|
301273
|
-
return fp.toString();
|
|
301274
|
-
}
|
|
301275
|
-
filesystem.readFileSync = function(fp, options) {
|
|
301276
|
-
const filepath = getStringFilepath(fp);
|
|
301277
|
-
if (filepath.endsWith("+page.js") || filepath.endsWith("+layout.js") || filepath.replace(".ts", ".js").endsWith("+layout.server.js")) {
|
|
301278
|
-
try {
|
|
301279
|
-
return _readFileSync(fp, options);
|
|
301280
|
-
} catch {
|
|
301281
|
-
return typeof options === "string" || options?.encoding ? "" : Buffer.from("");
|
|
301282
|
-
}
|
|
301283
|
-
}
|
|
301284
|
-
if (filepath.endsWith(path_exports.join("src", "routes", "+layout.svelte"))) {
|
|
301285
|
-
try {
|
|
301286
|
-
return _readFileSync(fp, options);
|
|
301287
|
-
} catch {
|
|
301288
|
-
return typeof options === "string" || options?.encoding ? empty_layout : Buffer.from(empty_layout);
|
|
301289
|
-
}
|
|
301290
|
-
}
|
|
301291
|
-
return _readFileSync(fp, options);
|
|
301292
|
-
};
|
|
301293
|
-
filesystem.statSync = function(fp, options) {
|
|
301294
|
-
let filepath = getStringFilepath(fp);
|
|
301295
|
-
if (!filepath.includes("routes") || !path_exports.basename(filepath).startsWith("+")) {
|
|
301296
|
-
return _statSync(fp, options);
|
|
301297
|
-
}
|
|
301298
|
-
try {
|
|
301299
|
-
const result = _statSync(fp, options);
|
|
301300
|
-
return result;
|
|
301301
|
-
} catch (error) {
|
|
301302
|
-
filepath = path_exports.posixify(filepath);
|
|
301303
|
-
const mock5 = virtual_file(path_exports.basename(filepath), { withFileTypes: true });
|
|
301304
|
-
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"))) {
|
|
301305
|
-
return mock5;
|
|
301306
|
-
} else if (filepath.endsWith("+layout.js")) {
|
|
301307
|
-
return mock5;
|
|
301308
|
-
} else if (filepath.endsWith("+page.js")) {
|
|
301309
|
-
return mock5;
|
|
301310
|
-
}
|
|
301311
|
-
throw error;
|
|
301312
|
-
}
|
|
301313
|
-
};
|
|
301314
|
-
filesystem.unlinkSync = function(filepath) {
|
|
301315
|
-
try {
|
|
301316
|
-
_unlinkSync(filepath);
|
|
301317
|
-
} catch {
|
|
301318
|
-
}
|
|
301319
|
-
};
|
|
301320
|
-
filesystem.readdirSync = function(fp, options) {
|
|
301321
|
-
const filepath = getStringFilepath(fp);
|
|
301322
|
-
if (!filepath.includes("routes")) return _readDirSync(fp, options);
|
|
301323
|
-
const result = _readDirSync(fp, options);
|
|
301324
|
-
const file_names = result.map((file) => {
|
|
301325
|
-
if (file instanceof Dirent) {
|
|
301326
|
-
return file.name;
|
|
301327
|
-
} else if (typeof file === "string") {
|
|
301328
|
-
return file;
|
|
301329
|
-
} else {
|
|
301330
|
-
return "";
|
|
301331
|
-
}
|
|
301332
|
-
});
|
|
301333
|
-
function contains(...names) {
|
|
301334
|
-
return names.some((name) => file_names.includes(name));
|
|
301335
|
-
}
|
|
301336
|
-
if (contains("+page.svelte", "+page.gql") && !contains("+page.js", "+page.ts")) {
|
|
301337
|
-
result.push(virtual_file("+page.js", options));
|
|
301338
|
-
}
|
|
301339
|
-
const posix_filepath = path_exports.posixify(filepath);
|
|
301340
|
-
if ((is_root_route(posix_filepath) || contains("+layout.svelte", "+layout.gql")) && !contains("+layout.ts", "+layout.js")) {
|
|
301341
|
-
result.push(virtual_file("+layout.js", options));
|
|
301342
|
-
}
|
|
301343
|
-
if (is_root_route(posix_filepath) && !contains("+layout.svelte")) {
|
|
301344
|
-
result.push(virtual_file("+layout.svelte", options));
|
|
301345
|
-
}
|
|
301346
|
-
if (is_root_route(posix_filepath) && !contains("+layout.server.js", "+layout.server.ts") && !plugin_config(_config).static) {
|
|
301347
|
-
result.push(virtual_file("+layout.server.js", options));
|
|
301348
|
-
}
|
|
301349
|
-
return result;
|
|
301350
|
-
};
|
|
301351
|
-
Object.defineProperty(globalThis, "fs", {
|
|
301352
|
-
configurable: true,
|
|
301353
|
-
enumerable: true,
|
|
301354
|
-
value: filesystem
|
|
301355
|
-
});
|
|
301356
|
-
var _readFile = filesystemPromises.readFile;
|
|
301357
|
-
filesystemPromises.readFile = async (path7, options) => {
|
|
301358
|
-
if (path7.toString().endsWith("+layout.svelte")) {
|
|
301359
|
-
try {
|
|
301360
|
-
return await _readFile(path7, options);
|
|
301361
|
-
} catch {
|
|
301362
|
-
return typeof options === "string" || options?.encoding ? empty_layout : Buffer.from(empty_layout);
|
|
301363
|
-
}
|
|
301364
|
-
}
|
|
301365
|
-
return _readFile(path7, options);
|
|
301366
|
-
};
|
|
301367
|
-
Object.defineProperty(globalThis, "fs/promises", {
|
|
301368
|
-
configurable: true,
|
|
301369
|
-
enumerable: true,
|
|
301370
|
-
value: filesystemPromises
|
|
301371
|
-
});
|
|
301372
|
-
function virtual_file(name, options) {
|
|
301373
|
-
return !options?.withFileTypes ? name : {
|
|
301374
|
-
name,
|
|
301375
|
-
isFile: () => true,
|
|
301376
|
-
isDirectory: () => false,
|
|
301377
|
-
isBlockDevice: () => false,
|
|
301378
|
-
isFIFO: () => false,
|
|
301379
|
-
isCharacterDevice: () => false,
|
|
301380
|
-
isSocket: () => false,
|
|
301381
|
-
isSymbolicLink: () => false
|
|
301382
|
-
};
|
|
301383
|
-
}
|
|
301384
|
-
function is_root_route(filepath) {
|
|
301385
|
-
filepath = filepath.toString();
|
|
301386
|
-
if (filepath.toString().endsWith("/")) {
|
|
301387
|
-
filepath = filepath.slice(0, -1);
|
|
301388
|
-
}
|
|
301389
|
-
return filepath.endsWith(path_exports.join("src", "routes")) && // ignore the src/routes that exists in the type roots
|
|
301390
|
-
!filepath.includes(".svelte-kit") && // ! Hey! This second value always needs to correspond to the default value for the runtimeDir
|
|
301391
|
-
// if you're changing this here, please also update it in `/packages/houdini/src/lib/config.ts`
|
|
301392
|
-
!filepath.includes(_config.runtimeDir ?? "$houdini");
|
|
301393
|
-
}
|
|
301394
|
-
var empty_layout = "<slot />";
|
|
301395
|
-
|
|
301396
301201
|
// src/plugin/transforms/index.ts
|
|
301397
301202
|
var recast25 = __toESM(require_main6(), 1);
|
|
301398
301203
|
|
|
@@ -301703,7 +301508,6 @@ async function kit_init(page) {
|
|
|
301703
301508
|
}
|
|
301704
301509
|
|
|
301705
301510
|
// src/plugin/transforms/kit/load.ts
|
|
301706
|
-
import * as graphql45 from "graphql";
|
|
301707
301511
|
var recast19 = __toESM(require_main6(), 1);
|
|
301708
301512
|
var AST20 = recast19.types.builders;
|
|
301709
301513
|
async function kit_load_generator(page) {
|
|
@@ -301718,9 +301522,7 @@ async function kit_load_generator(page) {
|
|
|
301718
301522
|
page,
|
|
301719
301523
|
artifact: { name }
|
|
301720
301524
|
}).id;
|
|
301721
|
-
const [
|
|
301722
|
-
find_special_query("Page", page),
|
|
301723
|
-
find_special_query("Layout", page),
|
|
301525
|
+
const [inline_queries, page_info] = await Promise.all([
|
|
301724
301526
|
find_inline_queries(
|
|
301725
301527
|
page,
|
|
301726
301528
|
// if we are currently on the route file, there's nothing to parse
|
|
@@ -301739,12 +301541,6 @@ async function kit_load_generator(page) {
|
|
|
301739
301541
|
if (script) {
|
|
301740
301542
|
const queries_that_needs_a_load = [...houdini_load_queries, ...inline_queries];
|
|
301741
301543
|
const isLayout = is_layout3(page.framework, page.filepath);
|
|
301742
|
-
if (isLayout && layout_query) {
|
|
301743
|
-
queries_that_needs_a_load.push(layout_query);
|
|
301744
|
-
}
|
|
301745
|
-
if (!isLayout && page_query) {
|
|
301746
|
-
queries_that_needs_a_load.push(page_query);
|
|
301747
|
-
}
|
|
301748
301544
|
add_load({
|
|
301749
301545
|
page,
|
|
301750
301546
|
queries: queries_that_needs_a_load,
|
|
@@ -301991,22 +301787,6 @@ function add_load({
|
|
|
301991
301787
|
);
|
|
301992
301788
|
}
|
|
301993
301789
|
}
|
|
301994
|
-
async function find_special_query(type, page) {
|
|
301995
|
-
const query_path = type === "Page" ? page_query_path(page.config, page.filepath) : layout_query_path(page.config, page.filepath);
|
|
301996
|
-
const contents = await fs_exports.readFile(query_path);
|
|
301997
|
-
if (!contents) {
|
|
301998
|
-
return null;
|
|
301999
|
-
}
|
|
302000
|
-
const parsed = graphql45.parse(contents);
|
|
302001
|
-
const definition = parsed.definitions.find(
|
|
302002
|
-
(defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
|
|
302003
|
-
);
|
|
302004
|
-
if (!definition) {
|
|
302005
|
-
formatErrors({ message: "gql file must contain a query.", filepath: query_path });
|
|
302006
|
-
return null;
|
|
302007
|
-
}
|
|
302008
|
-
return definition;
|
|
302009
|
-
}
|
|
302010
301790
|
function load_hook_statements(name, request_context, input_id, result_id) {
|
|
302011
301791
|
return AST20.expressionStatement(
|
|
302012
301792
|
AST20.awaitExpression(
|
|
@@ -302367,7 +302147,6 @@ function replace_tag_content(source, start, end, insert) {
|
|
|
302367
302147
|
var replace_between = (origin, startIndex, endIndex, insertion) => origin.substring(0, startIndex) + insertion + origin.substring(endIndex);
|
|
302368
302148
|
|
|
302369
302149
|
// src/plugin/validate.ts
|
|
302370
|
-
import * as graphql46 from "graphql";
|
|
302371
302150
|
async function validate4({
|
|
302372
302151
|
config,
|
|
302373
302152
|
documents
|
|
@@ -302394,28 +302173,6 @@ async function validate4({
|
|
|
302394
302173
|
})
|
|
302395
302174
|
);
|
|
302396
302175
|
}
|
|
302397
|
-
graphql46.visit(doc.document, {
|
|
302398
|
-
Directive(node, _, __, ___, ancestors) {
|
|
302399
|
-
const blockingDirectives = [
|
|
302400
|
-
config.blockingDirective,
|
|
302401
|
-
config.blockingDisableDirective
|
|
302402
|
-
];
|
|
302403
|
-
if (!blockingDirectives.includes(node.name.value)) {
|
|
302404
|
-
return;
|
|
302405
|
-
}
|
|
302406
|
-
const { definition } = definitionFromAncestors(ancestors);
|
|
302407
|
-
const listDirective = definition.directives?.map((c) => c.name.value) ?? [];
|
|
302408
|
-
if (listDirective.includes(config.blockingDirective) && listDirective.includes(config.blockingDisableDirective)) {
|
|
302409
|
-
errors.push(
|
|
302410
|
-
new HoudiniError({
|
|
302411
|
-
filepath: doc.filename,
|
|
302412
|
-
message: `You can't apply both @${config.blockingDirective} and @${config.blockingDisableDirective} at the same time`
|
|
302413
|
-
})
|
|
302414
|
-
);
|
|
302415
|
-
}
|
|
302416
|
-
return;
|
|
302417
|
-
}
|
|
302418
|
-
});
|
|
302419
302176
|
}
|
|
302420
302177
|
if (errors.length > 0) {
|
|
302421
302178
|
throw errors;
|
|
@@ -302474,24 +302231,6 @@ export const redirect = svelteKitRedirect
|
|
|
302474
302231
|
artifactData,
|
|
302475
302232
|
// custom logic to pull a graphql document out of a svelte file
|
|
302476
302233
|
extractDocuments: extract_default,
|
|
302477
|
-
schema({ config }) {
|
|
302478
|
-
return `
|
|
302479
|
-
"""
|
|
302480
|
-
@${config.loadDirective} is used to enable automatic fetch on inline queries.
|
|
302481
|
-
"""
|
|
302482
|
-
directive @${config.loadDirective} on QUERY
|
|
302483
|
-
|
|
302484
|
-
"""
|
|
302485
|
-
@${config.blockingDirective} is used to always await the fetch.
|
|
302486
|
-
"""
|
|
302487
|
-
directive @${config.blockingDirective} on QUERY
|
|
302488
|
-
|
|
302489
|
-
"""
|
|
302490
|
-
@${config.blockingDisableDirective} is used to not always await the fetch (in CSR for example). Note that "throwOnError" will not throw in this case.
|
|
302491
|
-
"""
|
|
302492
|
-
directive @${config.blockingDisableDirective} on QUERY
|
|
302493
|
-
`;
|
|
302494
|
-
},
|
|
302495
302234
|
// we have some custom document validation logic
|
|
302496
302235
|
validate: validate4,
|
|
302497
302236
|
// we need to write the svelte specific runtime
|
|
@@ -302529,10 +302268,6 @@ directive @${config.blockingDisableDirective} on QUERY
|
|
|
302529
302268
|
include({ config, filepath }) {
|
|
302530
302269
|
return config.includeFile(resolve_relative(config, filepath), { ignore_plugins: true });
|
|
302531
302270
|
},
|
|
302532
|
-
// add custom vite config
|
|
302533
|
-
vite: {
|
|
302534
|
-
...fsPatch_default(() => framework)
|
|
302535
|
-
},
|
|
302536
302271
|
/**
|
|
302537
302272
|
* Setup
|
|
302538
302273
|
*/
|
|
@@ -302634,8 +302369,6 @@ async function route_test({
|
|
|
302634
302369
|
await Promise.all([
|
|
302635
302370
|
fs_exports.writeFile(page_path, component),
|
|
302636
302371
|
fs_exports.writeFile(route_data_path(config, page_path), script),
|
|
302637
|
-
fs_exports.writeFile(page_query_path(config, page_path), page_query),
|
|
302638
|
-
fs_exports.writeFile(layout_query_path(config, page_path), layout_query),
|
|
302639
302372
|
fs_exports.writeFile(layout_path, layout),
|
|
302640
302373
|
fs_exports.writeFile(layout_script_path, layout_script)
|
|
302641
302374
|
]);
|