houdini-svelte 2.2.0-next.5 → 3.0.0-next.7
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 +15 -55
- package/build/preprocess-esm/index.js +15 -55
- package/build/test-cjs/index.js +87 -381
- package/build/test-esm/index.js +87 -381
- package/package.json +2 -2
- package/build/plugin/fsPatch.d.ts +0 -27
|
@@ -6097,7 +6097,7 @@ var require_esprima5 = __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 parse13(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_esprima5 = __commonJS({
|
|
|
6142
6142
|
}
|
|
6143
6143
|
return ast;
|
|
6144
6144
|
}
|
|
6145
|
-
exports3.parse =
|
|
6145
|
+
exports3.parse = parse13;
|
|
6146
6146
|
function parseModule(code, options, delegate) {
|
|
6147
6147
|
var parsingOptions = options || {};
|
|
6148
6148
|
parsingOptions.sourceType = "module";
|
|
6149
|
-
return
|
|
6149
|
+
return parse13(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 parse13(code, parsingOptions, delegate);
|
|
6156
6156
|
}
|
|
6157
6157
|
exports3.parseScript = parseScript;
|
|
6158
6158
|
function tokenize(code, options, delegate) {
|
|
@@ -12292,7 +12292,7 @@ var require_esprima6 = __commonJS({
|
|
|
12292
12292
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12293
12293
|
exports2.parse = void 0;
|
|
12294
12294
|
var util_1 = require_util4();
|
|
12295
|
-
function
|
|
12295
|
+
function parse13(source, options) {
|
|
12296
12296
|
var comments = [];
|
|
12297
12297
|
var ast = require_esprima5().parse(source, {
|
|
12298
12298
|
loc: true,
|
|
@@ -12310,7 +12310,7 @@ var require_esprima6 = __commonJS({
|
|
|
12310
12310
|
}
|
|
12311
12311
|
return ast;
|
|
12312
12312
|
}
|
|
12313
|
-
exports2.parse =
|
|
12313
|
+
exports2.parse = parse13;
|
|
12314
12314
|
}
|
|
12315
12315
|
});
|
|
12316
12316
|
|
|
@@ -13448,7 +13448,7 @@ var require_parser2 = __commonJS({
|
|
|
13448
13448
|
var lines_1 = require_lines2();
|
|
13449
13449
|
var comments_1 = require_comments2();
|
|
13450
13450
|
var util = tslib_1.__importStar(require_util4());
|
|
13451
|
-
function
|
|
13451
|
+
function parse13(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_parser2 = __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 = parse13;
|
|
13524
13524
|
var TreeCopier = function TreeCopier2(lines, tokens) {
|
|
13525
13525
|
assert_1.default.ok(this instanceof TreeCopier2);
|
|
13526
13526
|
this.lines = lines;
|
|
@@ -92506,8 +92506,6 @@ function plugin_config(config) {
|
|
|
92506
92506
|
return {
|
|
92507
92507
|
client: "./src/client",
|
|
92508
92508
|
defaultRouteBlocking: false,
|
|
92509
|
-
pageQueryFilename: "+page.gql",
|
|
92510
|
-
layoutQueryFilename: "+layout.gql",
|
|
92511
92509
|
static: false,
|
|
92512
92510
|
forceRunesMode: false,
|
|
92513
92511
|
...cfg,
|
|
@@ -125080,14 +125078,14 @@ var require_lib62 = __commonJS3({
|
|
|
125080
125078
|
super.checkParams(node, false, true);
|
|
125081
125079
|
this.scope.exit();
|
|
125082
125080
|
}
|
|
125083
|
-
forwardNoArrowParamsConversionAt(node,
|
|
125081
|
+
forwardNoArrowParamsConversionAt(node, parse13) {
|
|
125084
125082
|
let result;
|
|
125085
125083
|
if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) {
|
|
125086
125084
|
this.state.noArrowParamsConversionAt.push(this.state.start);
|
|
125087
|
-
result =
|
|
125085
|
+
result = parse13();
|
|
125088
125086
|
this.state.noArrowParamsConversionAt.pop();
|
|
125089
125087
|
} else {
|
|
125090
|
-
result =
|
|
125088
|
+
result = parse13();
|
|
125091
125089
|
}
|
|
125092
125090
|
return result;
|
|
125093
125091
|
}
|
|
@@ -164424,9 +164422,6 @@ function artifact_import({
|
|
|
164424
164422
|
// src/plugin/transforms/componentQuery.ts
|
|
164425
164423
|
var recast16 = __toESM(require_main4(), 1);
|
|
164426
164424
|
|
|
164427
|
-
// src/plugin/kit.ts
|
|
164428
|
-
var graphql37 = __toESM(require("graphql"), 1);
|
|
164429
|
-
|
|
164430
164425
|
// src/plugin/extractLoadFunction.ts
|
|
164431
164426
|
var graphql36 = __toESM(require("graphql"), 1);
|
|
164432
164427
|
var import_vite = require("vite");
|
|
@@ -164557,7 +164552,9 @@ filepath: ${filepath}`
|
|
|
164557
164552
|
load.push(element.quasi.quasis[0].value.raw);
|
|
164558
164553
|
} else if (element.type === "CallExpression") {
|
|
164559
164554
|
if (element.callee.type !== "Identifier" || element.callee.name !== "graphql" || element.arguments.length !== 1) {
|
|
164560
|
-
throw new Error(
|
|
164555
|
+
throw new Error(
|
|
164556
|
+
`only graphql function can be passed to ${houdini_load_fn}. Filepath: ${filepath}`
|
|
164557
|
+
);
|
|
164561
164558
|
}
|
|
164562
164559
|
let documentString;
|
|
164563
164560
|
const argument = element.arguments[0];
|
|
@@ -164662,18 +164659,6 @@ function is_layout3(framework, filename) {
|
|
|
164662
164659
|
function is_component(config, framework, filename) {
|
|
164663
164660
|
return framework === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework, filename) && !is_route(config, framework, filename);
|
|
164664
164661
|
}
|
|
164665
|
-
function page_query_path(config, filename) {
|
|
164666
|
-
return path_exports.join(
|
|
164667
|
-
path_exports.dirname(resolve_relative(config, filename)),
|
|
164668
|
-
plugin_config(config).pageQueryFilename
|
|
164669
|
-
);
|
|
164670
|
-
}
|
|
164671
|
-
function layout_query_path(config, filename) {
|
|
164672
|
-
return path_exports.join(
|
|
164673
|
-
path_exports.dirname(resolve_relative(config, filename)),
|
|
164674
|
-
plugin_config(config).layoutQueryFilename
|
|
164675
|
-
);
|
|
164676
|
-
}
|
|
164677
164662
|
function resolve_relative(config, filename) {
|
|
164678
164663
|
const match3 = filename.match("^((../)+)src/routes");
|
|
164679
164664
|
if (match3) {
|
|
@@ -165009,7 +164994,6 @@ async function kit_init(page) {
|
|
|
165009
164994
|
}
|
|
165010
164995
|
|
|
165011
164996
|
// src/plugin/transforms/kit/load.ts
|
|
165012
|
-
var graphql38 = __toESM(require("graphql"), 1);
|
|
165013
164997
|
var recast18 = __toESM(require_main4(), 1);
|
|
165014
164998
|
|
|
165015
164999
|
// src/plugin/routing.ts
|
|
@@ -165105,9 +165089,7 @@ async function kit_load_generator(page) {
|
|
|
165105
165089
|
page,
|
|
165106
165090
|
artifact: { name }
|
|
165107
165091
|
}).id;
|
|
165108
|
-
const [
|
|
165109
|
-
find_special_query("Page", page),
|
|
165110
|
-
find_special_query("Layout", page),
|
|
165092
|
+
const [inline_queries, page_info] = await Promise.all([
|
|
165111
165093
|
find_inline_queries(
|
|
165112
165094
|
page,
|
|
165113
165095
|
// if we are currently on the route file, there's nothing to parse
|
|
@@ -165126,12 +165108,6 @@ async function kit_load_generator(page) {
|
|
|
165126
165108
|
if (script) {
|
|
165127
165109
|
const queries_that_needs_a_load = [...houdini_load_queries, ...inline_queries];
|
|
165128
165110
|
const isLayout = is_layout3(page.framework, page.filepath);
|
|
165129
|
-
if (isLayout && layout_query) {
|
|
165130
|
-
queries_that_needs_a_load.push(layout_query);
|
|
165131
|
-
}
|
|
165132
|
-
if (!isLayout && page_query) {
|
|
165133
|
-
queries_that_needs_a_load.push(page_query);
|
|
165134
|
-
}
|
|
165135
165111
|
add_load({
|
|
165136
165112
|
page,
|
|
165137
165113
|
queries: queries_that_needs_a_load,
|
|
@@ -165378,22 +165354,6 @@ function add_load({
|
|
|
165378
165354
|
);
|
|
165379
165355
|
}
|
|
165380
165356
|
}
|
|
165381
|
-
async function find_special_query(type, page) {
|
|
165382
|
-
const query_path = type === "Page" ? page_query_path(page.config, page.filepath) : layout_query_path(page.config, page.filepath);
|
|
165383
|
-
const contents = await fs_exports.readFile(query_path);
|
|
165384
|
-
if (!contents) {
|
|
165385
|
-
return null;
|
|
165386
|
-
}
|
|
165387
|
-
const parsed = graphql38.parse(contents);
|
|
165388
|
-
const definition = parsed.definitions.find(
|
|
165389
|
-
(defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
|
|
165390
|
-
);
|
|
165391
|
-
if (!definition) {
|
|
165392
|
-
formatErrors({ message: "gql file must contain a query.", filepath: query_path });
|
|
165393
|
-
return null;
|
|
165394
|
-
}
|
|
165395
|
-
return definition;
|
|
165396
|
-
}
|
|
165397
165357
|
function load_hook_statements(name, request_context, input_id, result_id) {
|
|
165398
165358
|
return AST19.expressionStatement(
|
|
165399
165359
|
AST19.awaitExpression(
|
|
@@ -6102,7 +6102,7 @@ var require_esprima5 = __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 parse13(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_esprima5 = __commonJS({
|
|
|
6147
6147
|
}
|
|
6148
6148
|
return ast;
|
|
6149
6149
|
}
|
|
6150
|
-
exports2.parse =
|
|
6150
|
+
exports2.parse = parse13;
|
|
6151
6151
|
function parseModule(code, options, delegate) {
|
|
6152
6152
|
var parsingOptions = options || {};
|
|
6153
6153
|
parsingOptions.sourceType = "module";
|
|
6154
|
-
return
|
|
6154
|
+
return parse13(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 parse13(code, parsingOptions, delegate);
|
|
6161
6161
|
}
|
|
6162
6162
|
exports2.parseScript = parseScript;
|
|
6163
6163
|
function tokenize(code, options, delegate) {
|
|
@@ -12297,7 +12297,7 @@ var require_esprima6 = __commonJS({
|
|
|
12297
12297
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12298
12298
|
exports.parse = void 0;
|
|
12299
12299
|
var util_1 = require_util4();
|
|
12300
|
-
function
|
|
12300
|
+
function parse13(source, options) {
|
|
12301
12301
|
var comments = [];
|
|
12302
12302
|
var ast = require_esprima5().parse(source, {
|
|
12303
12303
|
loc: true,
|
|
@@ -12315,7 +12315,7 @@ var require_esprima6 = __commonJS({
|
|
|
12315
12315
|
}
|
|
12316
12316
|
return ast;
|
|
12317
12317
|
}
|
|
12318
|
-
exports.parse =
|
|
12318
|
+
exports.parse = parse13;
|
|
12319
12319
|
}
|
|
12320
12320
|
});
|
|
12321
12321
|
|
|
@@ -13453,7 +13453,7 @@ var require_parser2 = __commonJS({
|
|
|
13453
13453
|
var lines_1 = require_lines2();
|
|
13454
13454
|
var comments_1 = require_comments2();
|
|
13455
13455
|
var util = tslib_1.__importStar(require_util4());
|
|
13456
|
-
function
|
|
13456
|
+
function parse13(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_parser2 = __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 = parse13;
|
|
13529
13529
|
var TreeCopier = function TreeCopier2(lines, tokens) {
|
|
13530
13530
|
assert_1.default.ok(this instanceof TreeCopier2);
|
|
13531
13531
|
this.lines = lines;
|
|
@@ -92503,8 +92503,6 @@ function plugin_config(config) {
|
|
|
92503
92503
|
return {
|
|
92504
92504
|
client: "./src/client",
|
|
92505
92505
|
defaultRouteBlocking: false,
|
|
92506
|
-
pageQueryFilename: "+page.gql",
|
|
92507
|
-
layoutQueryFilename: "+layout.gql",
|
|
92508
92506
|
static: false,
|
|
92509
92507
|
forceRunesMode: false,
|
|
92510
92508
|
...cfg,
|
|
@@ -125076,14 +125074,14 @@ var require_lib62 = __commonJS3({
|
|
|
125076
125074
|
super.checkParams(node, false, true);
|
|
125077
125075
|
this.scope.exit();
|
|
125078
125076
|
}
|
|
125079
|
-
forwardNoArrowParamsConversionAt(node,
|
|
125077
|
+
forwardNoArrowParamsConversionAt(node, parse13) {
|
|
125080
125078
|
let result;
|
|
125081
125079
|
if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) {
|
|
125082
125080
|
this.state.noArrowParamsConversionAt.push(this.state.start);
|
|
125083
|
-
result =
|
|
125081
|
+
result = parse13();
|
|
125084
125082
|
this.state.noArrowParamsConversionAt.pop();
|
|
125085
125083
|
} else {
|
|
125086
|
-
result =
|
|
125084
|
+
result = parse13();
|
|
125087
125085
|
}
|
|
125088
125086
|
return result;
|
|
125089
125087
|
}
|
|
@@ -164420,9 +164418,6 @@ function artifact_import({
|
|
|
164420
164418
|
// src/plugin/transforms/componentQuery.ts
|
|
164421
164419
|
var recast16 = __toESM(require_main4(), 1);
|
|
164422
164420
|
|
|
164423
|
-
// src/plugin/kit.ts
|
|
164424
|
-
import * as graphql37 from "graphql";
|
|
164425
|
-
|
|
164426
164421
|
// src/plugin/extractLoadFunction.ts
|
|
164427
164422
|
import * as graphql36 from "graphql";
|
|
164428
164423
|
import { transformWithEsbuild } from "vite";
|
|
@@ -164553,7 +164548,9 @@ filepath: ${filepath}`
|
|
|
164553
164548
|
load.push(element.quasi.quasis[0].value.raw);
|
|
164554
164549
|
} else if (element.type === "CallExpression") {
|
|
164555
164550
|
if (element.callee.type !== "Identifier" || element.callee.name !== "graphql" || element.arguments.length !== 1) {
|
|
164556
|
-
throw new Error(
|
|
164551
|
+
throw new Error(
|
|
164552
|
+
`only graphql function can be passed to ${houdini_load_fn}. Filepath: ${filepath}`
|
|
164553
|
+
);
|
|
164557
164554
|
}
|
|
164558
164555
|
let documentString;
|
|
164559
164556
|
const argument = element.arguments[0];
|
|
@@ -164658,18 +164655,6 @@ function is_layout3(framework, filename) {
|
|
|
164658
164655
|
function is_component(config, framework, filename) {
|
|
164659
164656
|
return framework === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework, filename) && !is_route(config, framework, filename);
|
|
164660
164657
|
}
|
|
164661
|
-
function page_query_path(config, filename) {
|
|
164662
|
-
return path_exports.join(
|
|
164663
|
-
path_exports.dirname(resolve_relative(config, filename)),
|
|
164664
|
-
plugin_config(config).pageQueryFilename
|
|
164665
|
-
);
|
|
164666
|
-
}
|
|
164667
|
-
function layout_query_path(config, filename) {
|
|
164668
|
-
return path_exports.join(
|
|
164669
|
-
path_exports.dirname(resolve_relative(config, filename)),
|
|
164670
|
-
plugin_config(config).layoutQueryFilename
|
|
164671
|
-
);
|
|
164672
|
-
}
|
|
164673
164658
|
function resolve_relative(config, filename) {
|
|
164674
164659
|
const match3 = filename.match("^((../)+)src/routes");
|
|
164675
164660
|
if (match3) {
|
|
@@ -165005,7 +164990,6 @@ async function kit_init(page) {
|
|
|
165005
164990
|
}
|
|
165006
164991
|
|
|
165007
164992
|
// src/plugin/transforms/kit/load.ts
|
|
165008
|
-
import * as graphql38 from "graphql";
|
|
165009
164993
|
var recast18 = __toESM(require_main4(), 1);
|
|
165010
164994
|
|
|
165011
164995
|
// src/plugin/routing.ts
|
|
@@ -165101,9 +165085,7 @@ async function kit_load_generator(page) {
|
|
|
165101
165085
|
page,
|
|
165102
165086
|
artifact: { name }
|
|
165103
165087
|
}).id;
|
|
165104
|
-
const [
|
|
165105
|
-
find_special_query("Page", page),
|
|
165106
|
-
find_special_query("Layout", page),
|
|
165088
|
+
const [inline_queries, page_info] = await Promise.all([
|
|
165107
165089
|
find_inline_queries(
|
|
165108
165090
|
page,
|
|
165109
165091
|
// if we are currently on the route file, there's nothing to parse
|
|
@@ -165122,12 +165104,6 @@ async function kit_load_generator(page) {
|
|
|
165122
165104
|
if (script) {
|
|
165123
165105
|
const queries_that_needs_a_load = [...houdini_load_queries, ...inline_queries];
|
|
165124
165106
|
const isLayout = is_layout3(page.framework, page.filepath);
|
|
165125
|
-
if (isLayout && layout_query) {
|
|
165126
|
-
queries_that_needs_a_load.push(layout_query);
|
|
165127
|
-
}
|
|
165128
|
-
if (!isLayout && page_query) {
|
|
165129
|
-
queries_that_needs_a_load.push(page_query);
|
|
165130
|
-
}
|
|
165131
165107
|
add_load({
|
|
165132
165108
|
page,
|
|
165133
165109
|
queries: queries_that_needs_a_load,
|
|
@@ -165374,22 +165350,6 @@ function add_load({
|
|
|
165374
165350
|
);
|
|
165375
165351
|
}
|
|
165376
165352
|
}
|
|
165377
|
-
async function find_special_query(type, page) {
|
|
165378
|
-
const query_path = type === "Page" ? page_query_path(page.config, page.filepath) : layout_query_path(page.config, page.filepath);
|
|
165379
|
-
const contents = await fs_exports.readFile(query_path);
|
|
165380
|
-
if (!contents) {
|
|
165381
|
-
return null;
|
|
165382
|
-
}
|
|
165383
|
-
const parsed = graphql38.parse(contents);
|
|
165384
|
-
const definition = parsed.definitions.find(
|
|
165385
|
-
(defn) => defn.kind === "OperationDefinition" && defn.operation === "query"
|
|
165386
|
-
);
|
|
165387
|
-
if (!definition) {
|
|
165388
|
-
formatErrors({ message: "gql file must contain a query.", filepath: query_path });
|
|
165389
|
-
return null;
|
|
165390
|
-
}
|
|
165391
|
-
return definition;
|
|
165392
|
-
}
|
|
165393
165353
|
function load_hook_statements(name, request_context, input_id, result_id) {
|
|
165394
165354
|
return AST19.expressionStatement(
|
|
165395
165355
|
AST19.awaitExpression(
|