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.
@@ -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 parse15(code, options, delegate) {
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 = parse15;
6145
+ exports3.parse = parse13;
6146
6146
  function parseModule(code, options, delegate) {
6147
6147
  var parsingOptions = options || {};
6148
6148
  parsingOptions.sourceType = "module";
6149
- return parse15(code, parsingOptions, delegate);
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 parse15(code, parsingOptions, delegate);
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 parse15(source, options) {
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 = parse15;
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 parse15(source, options) {
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 = parse15;
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;
@@ -91257,8 +91257,7 @@ var Config = class {
91257
91257
  let {
91258
91258
  schema,
91259
91259
  schemaPath = "./schema.graphql",
91260
- // Hey! If you change this default, please also update it in `/packages/houdini-svelte/src/plugin/fsPatch.ts`
91261
- runtimeDir = "$houdini",
91260
+ runtimeDir = ".houdini",
91262
91261
  exclude = [],
91263
91262
  module: module2 = "esm",
91264
91263
  scalars,
@@ -92506,8 +92505,6 @@ function plugin_config(config) {
92506
92505
  return {
92507
92506
  client: "./src/client",
92508
92507
  defaultRouteBlocking: false,
92509
- pageQueryFilename: "+page.gql",
92510
- layoutQueryFilename: "+layout.gql",
92511
92508
  static: false,
92512
92509
  forceRunesMode: false,
92513
92510
  ...cfg,
@@ -125080,14 +125077,14 @@ var require_lib62 = __commonJS3({
125080
125077
  super.checkParams(node, false, true);
125081
125078
  this.scope.exit();
125082
125079
  }
125083
- forwardNoArrowParamsConversionAt(node, parse132) {
125080
+ forwardNoArrowParamsConversionAt(node, parse13) {
125084
125081
  let result;
125085
125082
  if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) {
125086
125083
  this.state.noArrowParamsConversionAt.push(this.state.start);
125087
- result = parse132();
125084
+ result = parse13();
125088
125085
  this.state.noArrowParamsConversionAt.pop();
125089
125086
  } else {
125090
- result = parse132();
125087
+ result = parse13();
125091
125088
  }
125092
125089
  return result;
125093
125090
  }
@@ -164424,9 +164421,6 @@ function artifact_import({
164424
164421
  // src/plugin/transforms/componentQuery.ts
164425
164422
  var recast16 = __toESM(require_main4(), 1);
164426
164423
 
164427
- // src/plugin/kit.ts
164428
- var graphql37 = __toESM(require("graphql"), 1);
164429
-
164430
164424
  // src/plugin/extractLoadFunction.ts
164431
164425
  var graphql36 = __toESM(require("graphql"), 1);
164432
164426
  var import_vite = require("vite");
@@ -164557,7 +164551,9 @@ filepath: ${filepath}`
164557
164551
  load.push(element.quasi.quasis[0].value.raw);
164558
164552
  } else if (element.type === "CallExpression") {
164559
164553
  if (element.callee.type !== "Identifier" || element.callee.name !== "graphql" || element.arguments.length !== 1) {
164560
- throw new Error(`only graphql function can be passed to ${houdini_load_fn}`);
164554
+ throw new Error(
164555
+ `only graphql function can be passed to ${houdini_load_fn}. Filepath: ${filepath}`
164556
+ );
164561
164557
  }
164562
164558
  let documentString;
164563
164559
  const argument = element.arguments[0];
@@ -164662,18 +164658,6 @@ function is_layout3(framework, filename) {
164662
164658
  function is_component(config, framework, filename) {
164663
164659
  return framework === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework, filename) && !is_route(config, framework, filename);
164664
164660
  }
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
164661
  function resolve_relative(config, filename) {
164678
164662
  const match3 = filename.match("^((../)+)src/routes");
164679
164663
  if (match3) {
@@ -165009,7 +164993,6 @@ async function kit_init(page) {
165009
164993
  }
165010
164994
 
165011
164995
  // src/plugin/transforms/kit/load.ts
165012
- var graphql38 = __toESM(require("graphql"), 1);
165013
164996
  var recast18 = __toESM(require_main4(), 1);
165014
164997
 
165015
164998
  // src/plugin/routing.ts
@@ -165105,9 +165088,7 @@ async function kit_load_generator(page) {
165105
165088
  page,
165106
165089
  artifact: { name }
165107
165090
  }).id;
165108
- const [page_query, layout_query, inline_queries, page_info] = await Promise.all([
165109
- find_special_query("Page", page),
165110
- find_special_query("Layout", page),
165091
+ const [inline_queries, page_info] = await Promise.all([
165111
165092
  find_inline_queries(
165112
165093
  page,
165113
165094
  // if we are currently on the route file, there's nothing to parse
@@ -165126,12 +165107,6 @@ async function kit_load_generator(page) {
165126
165107
  if (script) {
165127
165108
  const queries_that_needs_a_load = [...houdini_load_queries, ...inline_queries];
165128
165109
  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
165110
  add_load({
165136
165111
  page,
165137
165112
  queries: queries_that_needs_a_load,
@@ -165378,22 +165353,6 @@ function add_load({
165378
165353
  );
165379
165354
  }
165380
165355
  }
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
165356
  function load_hook_statements(name, request_context, input_id, result_id) {
165398
165357
  return AST19.expressionStatement(
165399
165358
  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 parse15(code, options, delegate) {
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 = parse15;
6150
+ exports2.parse = parse13;
6151
6151
  function parseModule(code, options, delegate) {
6152
6152
  var parsingOptions = options || {};
6153
6153
  parsingOptions.sourceType = "module";
6154
- return parse15(code, parsingOptions, delegate);
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 parse15(code, parsingOptions, delegate);
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 parse15(source, options) {
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 = parse15;
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 parse15(source, options) {
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 = parse15;
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;
@@ -91254,8 +91254,7 @@ var Config = class {
91254
91254
  let {
91255
91255
  schema,
91256
91256
  schemaPath = "./schema.graphql",
91257
- // Hey! If you change this default, please also update it in `/packages/houdini-svelte/src/plugin/fsPatch.ts`
91258
- runtimeDir = "$houdini",
91257
+ runtimeDir = ".houdini",
91259
91258
  exclude = [],
91260
91259
  module = "esm",
91261
91260
  scalars,
@@ -92503,8 +92502,6 @@ function plugin_config(config) {
92503
92502
  return {
92504
92503
  client: "./src/client",
92505
92504
  defaultRouteBlocking: false,
92506
- pageQueryFilename: "+page.gql",
92507
- layoutQueryFilename: "+layout.gql",
92508
92505
  static: false,
92509
92506
  forceRunesMode: false,
92510
92507
  ...cfg,
@@ -125076,14 +125073,14 @@ var require_lib62 = __commonJS3({
125076
125073
  super.checkParams(node, false, true);
125077
125074
  this.scope.exit();
125078
125075
  }
125079
- forwardNoArrowParamsConversionAt(node, parse132) {
125076
+ forwardNoArrowParamsConversionAt(node, parse13) {
125080
125077
  let result;
125081
125078
  if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) {
125082
125079
  this.state.noArrowParamsConversionAt.push(this.state.start);
125083
- result = parse132();
125080
+ result = parse13();
125084
125081
  this.state.noArrowParamsConversionAt.pop();
125085
125082
  } else {
125086
- result = parse132();
125083
+ result = parse13();
125087
125084
  }
125088
125085
  return result;
125089
125086
  }
@@ -164420,9 +164417,6 @@ function artifact_import({
164420
164417
  // src/plugin/transforms/componentQuery.ts
164421
164418
  var recast16 = __toESM(require_main4(), 1);
164422
164419
 
164423
- // src/plugin/kit.ts
164424
- import * as graphql37 from "graphql";
164425
-
164426
164420
  // src/plugin/extractLoadFunction.ts
164427
164421
  import * as graphql36 from "graphql";
164428
164422
  import { transformWithEsbuild } from "vite";
@@ -164553,7 +164547,9 @@ filepath: ${filepath}`
164553
164547
  load.push(element.quasi.quasis[0].value.raw);
164554
164548
  } else if (element.type === "CallExpression") {
164555
164549
  if (element.callee.type !== "Identifier" || element.callee.name !== "graphql" || element.arguments.length !== 1) {
164556
- throw new Error(`only graphql function can be passed to ${houdini_load_fn}`);
164550
+ throw new Error(
164551
+ `only graphql function can be passed to ${houdini_load_fn}. Filepath: ${filepath}`
164552
+ );
164557
164553
  }
164558
164554
  let documentString;
164559
164555
  const argument = element.arguments[0];
@@ -164658,18 +164654,6 @@ function is_layout3(framework, filename) {
164658
164654
  function is_component(config, framework, filename) {
164659
164655
  return framework === "svelte" || filename.endsWith(".svelte") && !is_route_script(framework, filename) && !is_route(config, framework, filename);
164660
164656
  }
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
164657
  function resolve_relative(config, filename) {
164674
164658
  const match3 = filename.match("^((../)+)src/routes");
164675
164659
  if (match3) {
@@ -165005,7 +164989,6 @@ async function kit_init(page) {
165005
164989
  }
165006
164990
 
165007
164991
  // src/plugin/transforms/kit/load.ts
165008
- import * as graphql38 from "graphql";
165009
164992
  var recast18 = __toESM(require_main4(), 1);
165010
164993
 
165011
164994
  // src/plugin/routing.ts
@@ -165101,9 +165084,7 @@ async function kit_load_generator(page) {
165101
165084
  page,
165102
165085
  artifact: { name }
165103
165086
  }).id;
165104
- const [page_query, layout_query, inline_queries, page_info] = await Promise.all([
165105
- find_special_query("Page", page),
165106
- find_special_query("Layout", page),
165087
+ const [inline_queries, page_info] = await Promise.all([
165107
165088
  find_inline_queries(
165108
165089
  page,
165109
165090
  // if we are currently on the route file, there's nothing to parse
@@ -165122,12 +165103,6 @@ async function kit_load_generator(page) {
165122
165103
  if (script) {
165123
165104
  const queries_that_needs_a_load = [...houdini_load_queries, ...inline_queries];
165124
165105
  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
165106
  add_load({
165132
165107
  page,
165133
165108
  queries: queries_that_needs_a_load,
@@ -165374,22 +165349,6 @@ function add_load({
165374
165349
  );
165375
165350
  }
165376
165351
  }
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
165352
  function load_hook_statements(name, request_context, input_id, result_id) {
165394
165353
  return AST19.expressionStatement(
165395
165354
  AST19.awaitExpression(