houdini 1.2.13 → 1.2.15

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.
Files changed (45) hide show
  1. package/build/adapter/index.d.ts +3 -0
  2. package/build/adapter-cjs/index.js +33 -0
  3. package/build/adapter-cjs/package.json +1 -0
  4. package/build/adapter-esm/index.js +9 -0
  5. package/build/adapter-esm/package.json +1 -0
  6. package/build/cmd-cjs/index.js +19 -19
  7. package/build/cmd-esm/index.js +18 -18
  8. package/build/codegen-cjs/index.js +16 -17
  9. package/build/codegen-esm/index.js +16 -16
  10. package/build/lib/index.d.ts +2 -0
  11. package/build/lib/router/conventions.d.ts +3 -4
  12. package/build/lib/router/index.d.ts +1 -1
  13. package/build/lib/router/types.d.ts +1 -0
  14. package/build/lib-cjs/index.js +142 -22
  15. package/build/lib-esm/index.js +138 -21
  16. package/build/runtime/lib/types.d.ts +1 -1
  17. package/build/runtime/router/match.d.ts +38 -0
  18. package/build/runtime/router/server.d.ts +22 -25
  19. package/build/runtime/router/session.d.ts +22 -0
  20. package/build/runtime/router/types.d.ts +23 -0
  21. package/build/runtime-cjs/lib/types.d.ts +1 -1
  22. package/build/runtime-cjs/lib/types.js +2 -0
  23. package/build/runtime-cjs/router/match.d.ts +38 -0
  24. package/build/runtime-cjs/router/match.js +149 -0
  25. package/build/runtime-cjs/router/server.d.ts +22 -25
  26. package/build/runtime-cjs/router/server.js +71 -49
  27. package/build/runtime-cjs/router/session.d.ts +22 -0
  28. package/build/runtime-cjs/router/session.js +77 -0
  29. package/build/runtime-cjs/router/types.d.ts +23 -0
  30. package/build/runtime-cjs/router/types.js +16 -0
  31. package/build/runtime-esm/lib/types.d.ts +1 -1
  32. package/build/runtime-esm/lib/types.js +1 -0
  33. package/build/runtime-esm/router/match.d.ts +38 -0
  34. package/build/runtime-esm/router/match.js +122 -0
  35. package/build/runtime-esm/router/server.d.ts +22 -25
  36. package/build/runtime-esm/router/server.js +64 -47
  37. package/build/runtime-esm/router/session.d.ts +22 -0
  38. package/build/runtime-esm/router/session.js +52 -0
  39. package/build/runtime-esm/router/types.d.ts +23 -0
  40. package/build/runtime-esm/router/types.js +0 -0
  41. package/build/test-cjs/index.js +16 -17
  42. package/build/test-esm/index.js +16 -16
  43. package/build/vite-cjs/index.js +28 -32
  44. package/build/vite-esm/index.js +28 -31
  45. package/package.json +10 -1
@@ -1,4 +1,3 @@
1
- import { createRequire as conflict_free } from 'module'; const require = conflict_free(import.meta.url);
2
1
  "use strict";
3
2
  var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
@@ -69514,7 +69513,7 @@ var LogLevel = {
69514
69513
 
69515
69514
  // src/lib/config.ts
69516
69515
  var import_meta = {};
69517
- var currentDir = global.__dirname || dirname((0, import_node_url2.fileURLToPath)(import_meta.url));
69516
+ var currentDir = dirname((0, import_node_url2.fileURLToPath)(import_meta.url));
69518
69517
  var Config = class {
69519
69518
  filepath;
69520
69519
  rootDir;
@@ -70791,6 +70790,8 @@ async function find_graphql(config4, parsedScript, walker) {
70791
70790
  // src/lib/router/conventions.ts
70792
70791
  var conventions_exports = {};
70793
70792
  __export(conventions_exports, {
70793
+ adapter_config_path: () => adapter_config_path,
70794
+ app_component_path: () => app_component_path,
70794
70795
  fallback_unit_path: () => fallback_unit_path,
70795
70796
  is_layout: () => is_layout,
70796
70797
  layout_unit_path: () => layout_unit_path,
@@ -70802,13 +70803,10 @@ __export(conventions_exports, {
70802
70803
  read_layoutView: () => read_layoutView,
70803
70804
  read_pageQuery: () => read_pageQuery,
70804
70805
  read_pageView: () => read_pageView,
70805
- render_app_path: () => render_app_path,
70806
- render_client_path: () => render_client_path,
70807
- render_server_path: () => render_server_path,
70808
- render_yoga_path: () => render_yoga_path,
70809
70806
  router_index_path: () => router_index_path,
70810
70807
  router_path: () => router_path,
70811
- serialized_manifest_path: () => serialized_manifest_path
70808
+ serialized_manifest_path: () => serialized_manifest_path,
70809
+ server_adapter_path: () => server_adapter_path
70812
70810
  });
70813
70811
  function router_path(config4) {
70814
70812
  return path_exports.join(base_dir(config4), "Router.jsx");
@@ -70816,16 +70814,13 @@ function router_path(config4) {
70816
70814
  function page_entry_path(config4, id, base) {
70817
70815
  return path_exports.join(page_entries_dir(config4, base), `${id}.jsx`);
70818
70816
  }
70819
- function render_client_path(config4, base) {
70820
- return path_exports.join(units_dir(config4, base), "render", "client.jsx");
70821
- }
70822
- function render_server_path(config4, base) {
70817
+ function server_adapter_path(config4, base) {
70823
70818
  return path_exports.join(units_dir(config4, base), "render", "server.js");
70824
70819
  }
70825
- function render_yoga_path(config4, base) {
70826
- return path_exports.join(units_dir(config4, base), "render", "yoga.js");
70820
+ function adapter_config_path(config4, base) {
70821
+ return path_exports.join(units_dir(config4, base), "render", "config.js");
70827
70822
  }
70828
- function render_app_path(config4, base) {
70823
+ function app_component_path(config4, base) {
70829
70824
  return path_exports.join(units_dir(config4, base), "render", "App.jsx");
70830
70825
  }
70831
70826
  function page_unit_path(config4, id, base) {
@@ -72724,7 +72719,7 @@ async function paginate(config4, documents) {
72724
72719
  value: "__typename"
72725
72720
  }
72726
72721
  },
72727
- ...(typeConfig?.keys || ["id"]).map((key) => ({
72722
+ ...(typeConfig?.keys || [config4.defaultKeys[0]]).map((key) => ({
72728
72723
  kind: graphql11.Kind.FIELD,
72729
72724
  name: {
72730
72725
  kind: graphql11.Kind.NAME,
@@ -76644,7 +76639,7 @@ function nodeDirectives(config4, directives) {
76644
76639
  }
76645
76640
  if (!possibleNodes.includes(definitionType)) {
76646
76641
  ctx.reportError(
76647
- new graphql26.GraphQLError(paginateOnNonNodeMessage(config4, node.name.value))
76642
+ new graphql26.GraphQLError(paginateOnNonNodeMessage(node.name.value))
76648
76643
  );
76649
76644
  }
76650
76645
  }
@@ -76779,45 +76774,45 @@ function getAndVerifyNodeInterface(config4) {
76779
76774
  return null;
76780
76775
  }
76781
76776
  if (!graphql26.isInterfaceType(nodeInterface)) {
76782
- displayInvalidNodeFieldMessage(config4.logLevel);
76777
+ displayInvalidNodeFieldMessage(config4);
76783
76778
  return null;
76784
76779
  }
76785
76780
  const queryType = schema.getQueryType();
76786
76781
  if (!queryType) {
76787
- displayInvalidNodeFieldMessage(config4.logLevel);
76782
+ displayInvalidNodeFieldMessage(config4);
76788
76783
  return null;
76789
76784
  }
76790
76785
  const nodeField = queryType.getFields()["node"];
76791
76786
  if (!nodeField) {
76792
- displayInvalidNodeFieldMessage(config4.logLevel);
76787
+ displayInvalidNodeFieldMessage(config4);
76793
76788
  return null;
76794
76789
  }
76795
76790
  const args = nodeField.args;
76796
76791
  if (args.length === 0) {
76797
- displayInvalidNodeFieldMessage(config4.logLevel);
76792
+ displayInvalidNodeFieldMessage(config4);
76798
76793
  return null;
76799
76794
  }
76800
- const idArg = args.find((arg) => arg.name === "id");
76795
+ const idArg = args.find((arg) => arg.name === config4.defaultKeys[0]);
76801
76796
  if (!idArg) {
76802
- displayInvalidNodeFieldMessage(config4.logLevel);
76797
+ displayInvalidNodeFieldMessage(config4);
76803
76798
  return null;
76804
76799
  }
76805
76800
  const idType = unwrapType(config4, idArg.type);
76806
76801
  if (idType.type.name !== "ID") {
76807
- displayInvalidNodeFieldMessage(config4.logLevel);
76802
+ displayInvalidNodeFieldMessage(config4);
76808
76803
  return null;
76809
76804
  }
76810
76805
  const fieldReturnType = unwrapType(config4, nodeField.type);
76811
76806
  if (fieldReturnType.type.name !== "Node") {
76812
- displayInvalidNodeFieldMessage(config4.logLevel);
76807
+ displayInvalidNodeFieldMessage(config4);
76813
76808
  return null;
76814
76809
  }
76815
76810
  return nodeInterface;
76816
76811
  }
76817
76812
  var nbInvalidNodeFieldMessageDisplayed = 0;
76818
- function displayInvalidNodeFieldMessage(logLevel) {
76813
+ function displayInvalidNodeFieldMessage(config4) {
76819
76814
  if (nbInvalidNodeFieldMessageDisplayed === 0) {
76820
- if (logLevel === LogLevel.Full) {
76815
+ if (config4.logLevel === LogLevel.Full) {
76821
76816
  console.warn(invalidNodeFieldMessage);
76822
76817
  } else {
76823
76818
  console.warn(invalidNodeFieldMessageLight);
@@ -76831,18 +76826,18 @@ var invalidNodeFieldMessage = `\u26A0\uFE0F Your project defines a Node interfa
76831
76826
  If you are trying to provide the Node interface and its field, they must look like the following:
76832
76827
 
76833
76828
  interface Node {
76834
- id: ID!
76829
+ id: ID!
76835
76830
  }
76836
76831
 
76837
76832
  extend type Query {
76838
- node(id: ID!): Node
76833
+ node(id: ID!): Node
76839
76834
  }
76840
76835
 
76841
76836
  For more information, please visit these links:
76842
76837
  - https://graphql.org/learn/global-object-identification/
76843
76838
  - ${siteURL}/guides/caching-data#custom-ids
76844
76839
  `;
76845
- var paginateOnNonNodeMessage = (config4, directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
76840
+ var paginateOnNonNodeMessage = (directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
76846
76841
  If this is happening inside of a fragment, make sure that the fragment either implements the Node interface or you
76847
76842
  have defined a resolver entry for the fragment type.
76848
76843
 
@@ -77269,12 +77264,13 @@ function Plugin(opts = {}) {
77269
77264
  sourceDir: viteConfig.build.outDir,
77270
77265
  publicBase: viteConfig.base,
77271
77266
  outDir: config3.routerBuildDirectory,
77272
- manifest
77267
+ manifest,
77268
+ adapterPath: "../$houdini/plugins/houdini-react/units/render/config.js"
77273
77269
  });
77274
77270
  },
77275
77271
  async buildStart(args) {
77276
- if (viteEnv.mode === "production") {
77277
- if (config3.localSchema && !isSecondaryBuild()) {
77272
+ if (viteEnv.mode === "production" && !isSecondaryBuild()) {
77273
+ if (config3.localSchema) {
77278
77274
  config3.schema = await loadLocalSchema(config3);
77279
77275
  }
77280
77276
  try {
@@ -69508,7 +69508,7 @@ var LogLevel = {
69508
69508
  };
69509
69509
 
69510
69510
  // src/lib/config.ts
69511
- var currentDir = global.__dirname || dirname(fileURLToPath(import.meta.url));
69511
+ var currentDir = dirname(fileURLToPath(import.meta.url));
69512
69512
  var Config = class {
69513
69513
  filepath;
69514
69514
  rootDir;
@@ -70785,6 +70785,8 @@ async function find_graphql(config4, parsedScript, walker) {
70785
70785
  // src/lib/router/conventions.ts
70786
70786
  var conventions_exports = {};
70787
70787
  __export(conventions_exports, {
70788
+ adapter_config_path: () => adapter_config_path,
70789
+ app_component_path: () => app_component_path,
70788
70790
  fallback_unit_path: () => fallback_unit_path,
70789
70791
  is_layout: () => is_layout,
70790
70792
  layout_unit_path: () => layout_unit_path,
@@ -70796,13 +70798,10 @@ __export(conventions_exports, {
70796
70798
  read_layoutView: () => read_layoutView,
70797
70799
  read_pageQuery: () => read_pageQuery,
70798
70800
  read_pageView: () => read_pageView,
70799
- render_app_path: () => render_app_path,
70800
- render_client_path: () => render_client_path,
70801
- render_server_path: () => render_server_path,
70802
- render_yoga_path: () => render_yoga_path,
70803
70801
  router_index_path: () => router_index_path,
70804
70802
  router_path: () => router_path,
70805
- serialized_manifest_path: () => serialized_manifest_path
70803
+ serialized_manifest_path: () => serialized_manifest_path,
70804
+ server_adapter_path: () => server_adapter_path
70806
70805
  });
70807
70806
  function router_path(config4) {
70808
70807
  return path_exports.join(base_dir(config4), "Router.jsx");
@@ -70810,16 +70809,13 @@ function router_path(config4) {
70810
70809
  function page_entry_path(config4, id, base) {
70811
70810
  return path_exports.join(page_entries_dir(config4, base), `${id}.jsx`);
70812
70811
  }
70813
- function render_client_path(config4, base) {
70814
- return path_exports.join(units_dir(config4, base), "render", "client.jsx");
70815
- }
70816
- function render_server_path(config4, base) {
70812
+ function server_adapter_path(config4, base) {
70817
70813
  return path_exports.join(units_dir(config4, base), "render", "server.js");
70818
70814
  }
70819
- function render_yoga_path(config4, base) {
70820
- return path_exports.join(units_dir(config4, base), "render", "yoga.js");
70815
+ function adapter_config_path(config4, base) {
70816
+ return path_exports.join(units_dir(config4, base), "render", "config.js");
70821
70817
  }
70822
- function render_app_path(config4, base) {
70818
+ function app_component_path(config4, base) {
70823
70819
  return path_exports.join(units_dir(config4, base), "render", "App.jsx");
70824
70820
  }
70825
70821
  function page_unit_path(config4, id, base) {
@@ -72718,7 +72714,7 @@ async function paginate(config4, documents) {
72718
72714
  value: "__typename"
72719
72715
  }
72720
72716
  },
72721
- ...(typeConfig?.keys || ["id"]).map((key) => ({
72717
+ ...(typeConfig?.keys || [config4.defaultKeys[0]]).map((key) => ({
72722
72718
  kind: graphql11.Kind.FIELD,
72723
72719
  name: {
72724
72720
  kind: graphql11.Kind.NAME,
@@ -76638,7 +76634,7 @@ function nodeDirectives(config4, directives) {
76638
76634
  }
76639
76635
  if (!possibleNodes.includes(definitionType)) {
76640
76636
  ctx.reportError(
76641
- new graphql26.GraphQLError(paginateOnNonNodeMessage(config4, node.name.value))
76637
+ new graphql26.GraphQLError(paginateOnNonNodeMessage(node.name.value))
76642
76638
  );
76643
76639
  }
76644
76640
  }
@@ -76773,45 +76769,45 @@ function getAndVerifyNodeInterface(config4) {
76773
76769
  return null;
76774
76770
  }
76775
76771
  if (!graphql26.isInterfaceType(nodeInterface)) {
76776
- displayInvalidNodeFieldMessage(config4.logLevel);
76772
+ displayInvalidNodeFieldMessage(config4);
76777
76773
  return null;
76778
76774
  }
76779
76775
  const queryType = schema.getQueryType();
76780
76776
  if (!queryType) {
76781
- displayInvalidNodeFieldMessage(config4.logLevel);
76777
+ displayInvalidNodeFieldMessage(config4);
76782
76778
  return null;
76783
76779
  }
76784
76780
  const nodeField = queryType.getFields()["node"];
76785
76781
  if (!nodeField) {
76786
- displayInvalidNodeFieldMessage(config4.logLevel);
76782
+ displayInvalidNodeFieldMessage(config4);
76787
76783
  return null;
76788
76784
  }
76789
76785
  const args = nodeField.args;
76790
76786
  if (args.length === 0) {
76791
- displayInvalidNodeFieldMessage(config4.logLevel);
76787
+ displayInvalidNodeFieldMessage(config4);
76792
76788
  return null;
76793
76789
  }
76794
- const idArg = args.find((arg) => arg.name === "id");
76790
+ const idArg = args.find((arg) => arg.name === config4.defaultKeys[0]);
76795
76791
  if (!idArg) {
76796
- displayInvalidNodeFieldMessage(config4.logLevel);
76792
+ displayInvalidNodeFieldMessage(config4);
76797
76793
  return null;
76798
76794
  }
76799
76795
  const idType = unwrapType(config4, idArg.type);
76800
76796
  if (idType.type.name !== "ID") {
76801
- displayInvalidNodeFieldMessage(config4.logLevel);
76797
+ displayInvalidNodeFieldMessage(config4);
76802
76798
  return null;
76803
76799
  }
76804
76800
  const fieldReturnType = unwrapType(config4, nodeField.type);
76805
76801
  if (fieldReturnType.type.name !== "Node") {
76806
- displayInvalidNodeFieldMessage(config4.logLevel);
76802
+ displayInvalidNodeFieldMessage(config4);
76807
76803
  return null;
76808
76804
  }
76809
76805
  return nodeInterface;
76810
76806
  }
76811
76807
  var nbInvalidNodeFieldMessageDisplayed = 0;
76812
- function displayInvalidNodeFieldMessage(logLevel) {
76808
+ function displayInvalidNodeFieldMessage(config4) {
76813
76809
  if (nbInvalidNodeFieldMessageDisplayed === 0) {
76814
- if (logLevel === LogLevel.Full) {
76810
+ if (config4.logLevel === LogLevel.Full) {
76815
76811
  console.warn(invalidNodeFieldMessage);
76816
76812
  } else {
76817
76813
  console.warn(invalidNodeFieldMessageLight);
@@ -76825,18 +76821,18 @@ var invalidNodeFieldMessage = `\u26A0\uFE0F Your project defines a Node interfa
76825
76821
  If you are trying to provide the Node interface and its field, they must look like the following:
76826
76822
 
76827
76823
  interface Node {
76828
- id: ID!
76824
+ id: ID!
76829
76825
  }
76830
76826
 
76831
76827
  extend type Query {
76832
- node(id: ID!): Node
76828
+ node(id: ID!): Node
76833
76829
  }
76834
76830
 
76835
76831
  For more information, please visit these links:
76836
76832
  - https://graphql.org/learn/global-object-identification/
76837
76833
  - ${siteURL}/guides/caching-data#custom-ids
76838
76834
  `;
76839
- var paginateOnNonNodeMessage = (config4, directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
76835
+ var paginateOnNonNodeMessage = (directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
76840
76836
  If this is happening inside of a fragment, make sure that the fragment either implements the Node interface or you
76841
76837
  have defined a resolver entry for the fragment type.
76842
76838
 
@@ -77263,12 +77259,13 @@ function Plugin(opts = {}) {
77263
77259
  sourceDir: viteConfig.build.outDir,
77264
77260
  publicBase: viteConfig.base,
77265
77261
  outDir: config3.routerBuildDirectory,
77266
- manifest
77262
+ manifest,
77263
+ adapterPath: "../$houdini/plugins/houdini-react/units/render/config.js"
77267
77264
  });
77268
77265
  },
77269
77266
  async buildStart(args) {
77270
- if (viteEnv.mode === "production") {
77271
- if (config3.localSchema && !isSecondaryBuild()) {
77267
+ if (viteEnv.mode === "production" && !isSecondaryBuild()) {
77268
+ if (config3.localSchema) {
77272
77269
  config3.schema = await loadLocalSchema(config3);
77273
77270
  }
77274
77271
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "The disappearing GraphQL clients",
5
5
  "keywords": [
6
6
  "typescript",
@@ -38,6 +38,7 @@
38
38
  "@types/fs-extra": "^9.0.13",
39
39
  "@types/micromatch": "^4.0.2",
40
40
  "@ungap/structured-clone": "^1.0.2",
41
+ "@whatwg-node/server": "^0.9.14",
41
42
  "ast-types": "^0.16.1",
42
43
  "commander": "^9.4.0",
43
44
  "deepmerge": "^4.2.2",
@@ -59,6 +60,11 @@
59
60
  ],
60
61
  "exports": {
61
62
  "./package.json": "./package.json",
63
+ "./adapter": {
64
+ "types": "./build/adapter/index.d.ts",
65
+ "import": "./build/adapter-esm/index.js",
66
+ "require": "./build/adapter-cjs/index.js"
67
+ },
62
68
  "./codegen": {
63
69
  "types": "./build/codegen/index.d.ts",
64
70
  "import": "./build/codegen-esm/index.js",
@@ -82,6 +88,9 @@
82
88
  },
83
89
  "typesVersions": {
84
90
  "*": {
91
+ "adapter": [
92
+ "build/adapter/index.d.ts"
93
+ ],
85
94
  "codegen": [
86
95
  "build/codegen/index.d.ts"
87
96
  ],