houdini 1.2.13 → 1.2.14

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 +2 -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 +140 -24
  15. package/build/lib-esm/index.js +136 -23
  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 +26 -34
  44. package/build/vite-esm/index.js +26 -33
  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,7 @@ 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
70794
  fallback_unit_path: () => fallback_unit_path,
70795
70795
  is_layout: () => is_layout,
70796
70796
  layout_unit_path: () => layout_unit_path,
@@ -70802,13 +70802,10 @@ __export(conventions_exports, {
70802
70802
  read_layoutView: () => read_layoutView,
70803
70803
  read_pageQuery: () => read_pageQuery,
70804
70804
  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
70805
  router_index_path: () => router_index_path,
70810
70806
  router_path: () => router_path,
70811
- serialized_manifest_path: () => serialized_manifest_path
70807
+ serialized_manifest_path: () => serialized_manifest_path,
70808
+ server_adapter_path: () => server_adapter_path
70812
70809
  });
70813
70810
  function router_path(config4) {
70814
70811
  return path_exports.join(base_dir(config4), "Router.jsx");
@@ -70816,17 +70813,11 @@ function router_path(config4) {
70816
70813
  function page_entry_path(config4, id, base) {
70817
70814
  return path_exports.join(page_entries_dir(config4, base), `${id}.jsx`);
70818
70815
  }
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) {
70816
+ function server_adapter_path(config4, base) {
70823
70817
  return path_exports.join(units_dir(config4, base), "render", "server.js");
70824
70818
  }
70825
- function render_yoga_path(config4, base) {
70826
- return path_exports.join(units_dir(config4, base), "render", "yoga.js");
70827
- }
70828
- function render_app_path(config4, base) {
70829
- return path_exports.join(units_dir(config4, base), "render", "App.jsx");
70819
+ function adapter_config_path(config4, base) {
70820
+ return path_exports.join(units_dir(config4, base), "render", "config.js");
70830
70821
  }
70831
70822
  function page_unit_path(config4, id, base) {
70832
70823
  return path_exports.join(page_units_dir(config4, base), `${id}.jsx`);
@@ -72724,7 +72715,7 @@ async function paginate(config4, documents) {
72724
72715
  value: "__typename"
72725
72716
  }
72726
72717
  },
72727
- ...(typeConfig?.keys || ["id"]).map((key) => ({
72718
+ ...(typeConfig?.keys || [config4.defaultKeys[0]]).map((key) => ({
72728
72719
  kind: graphql11.Kind.FIELD,
72729
72720
  name: {
72730
72721
  kind: graphql11.Kind.NAME,
@@ -76644,7 +76635,7 @@ function nodeDirectives(config4, directives) {
76644
76635
  }
76645
76636
  if (!possibleNodes.includes(definitionType)) {
76646
76637
  ctx.reportError(
76647
- new graphql26.GraphQLError(paginateOnNonNodeMessage(config4, node.name.value))
76638
+ new graphql26.GraphQLError(paginateOnNonNodeMessage(node.name.value))
76648
76639
  );
76649
76640
  }
76650
76641
  }
@@ -76779,45 +76770,45 @@ function getAndVerifyNodeInterface(config4) {
76779
76770
  return null;
76780
76771
  }
76781
76772
  if (!graphql26.isInterfaceType(nodeInterface)) {
76782
- displayInvalidNodeFieldMessage(config4.logLevel);
76773
+ displayInvalidNodeFieldMessage(config4);
76783
76774
  return null;
76784
76775
  }
76785
76776
  const queryType = schema.getQueryType();
76786
76777
  if (!queryType) {
76787
- displayInvalidNodeFieldMessage(config4.logLevel);
76778
+ displayInvalidNodeFieldMessage(config4);
76788
76779
  return null;
76789
76780
  }
76790
76781
  const nodeField = queryType.getFields()["node"];
76791
76782
  if (!nodeField) {
76792
- displayInvalidNodeFieldMessage(config4.logLevel);
76783
+ displayInvalidNodeFieldMessage(config4);
76793
76784
  return null;
76794
76785
  }
76795
76786
  const args = nodeField.args;
76796
76787
  if (args.length === 0) {
76797
- displayInvalidNodeFieldMessage(config4.logLevel);
76788
+ displayInvalidNodeFieldMessage(config4);
76798
76789
  return null;
76799
76790
  }
76800
- const idArg = args.find((arg) => arg.name === "id");
76791
+ const idArg = args.find((arg) => arg.name === config4.defaultKeys[0]);
76801
76792
  if (!idArg) {
76802
- displayInvalidNodeFieldMessage(config4.logLevel);
76793
+ displayInvalidNodeFieldMessage(config4);
76803
76794
  return null;
76804
76795
  }
76805
76796
  const idType = unwrapType(config4, idArg.type);
76806
76797
  if (idType.type.name !== "ID") {
76807
- displayInvalidNodeFieldMessage(config4.logLevel);
76798
+ displayInvalidNodeFieldMessage(config4);
76808
76799
  return null;
76809
76800
  }
76810
76801
  const fieldReturnType = unwrapType(config4, nodeField.type);
76811
76802
  if (fieldReturnType.type.name !== "Node") {
76812
- displayInvalidNodeFieldMessage(config4.logLevel);
76803
+ displayInvalidNodeFieldMessage(config4);
76813
76804
  return null;
76814
76805
  }
76815
76806
  return nodeInterface;
76816
76807
  }
76817
76808
  var nbInvalidNodeFieldMessageDisplayed = 0;
76818
- function displayInvalidNodeFieldMessage(logLevel) {
76809
+ function displayInvalidNodeFieldMessage(config4) {
76819
76810
  if (nbInvalidNodeFieldMessageDisplayed === 0) {
76820
- if (logLevel === LogLevel.Full) {
76811
+ if (config4.logLevel === LogLevel.Full) {
76821
76812
  console.warn(invalidNodeFieldMessage);
76822
76813
  } else {
76823
76814
  console.warn(invalidNodeFieldMessageLight);
@@ -76831,18 +76822,18 @@ var invalidNodeFieldMessage = `\u26A0\uFE0F Your project defines a Node interfa
76831
76822
  If you are trying to provide the Node interface and its field, they must look like the following:
76832
76823
 
76833
76824
  interface Node {
76834
- id: ID!
76825
+ id: ID!
76835
76826
  }
76836
76827
 
76837
76828
  extend type Query {
76838
- node(id: ID!): Node
76829
+ node(id: ID!): Node
76839
76830
  }
76840
76831
 
76841
76832
  For more information, please visit these links:
76842
76833
  - https://graphql.org/learn/global-object-identification/
76843
76834
  - ${siteURL}/guides/caching-data#custom-ids
76844
76835
  `;
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.
76836
+ var paginateOnNonNodeMessage = (directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
76846
76837
  If this is happening inside of a fragment, make sure that the fragment either implements the Node interface or you
76847
76838
  have defined a resolver entry for the fragment type.
76848
76839
 
@@ -77269,12 +77260,13 @@ function Plugin(opts = {}) {
77269
77260
  sourceDir: viteConfig.build.outDir,
77270
77261
  publicBase: viteConfig.base,
77271
77262
  outDir: config3.routerBuildDirectory,
77272
- manifest
77263
+ manifest,
77264
+ adapterPath: "../$houdini/plugins/houdini-react/units/render/config.js"
77273
77265
  });
77274
77266
  },
77275
77267
  async buildStart(args) {
77276
- if (viteEnv.mode === "production") {
77277
- if (config3.localSchema && !isSecondaryBuild()) {
77268
+ if (viteEnv.mode === "production" && !isSecondaryBuild()) {
77269
+ if (config3.localSchema) {
77278
77270
  config3.schema = await loadLocalSchema(config3);
77279
77271
  }
77280
77272
  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,7 @@ 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,
70788
70789
  fallback_unit_path: () => fallback_unit_path,
70789
70790
  is_layout: () => is_layout,
70790
70791
  layout_unit_path: () => layout_unit_path,
@@ -70796,13 +70797,10 @@ __export(conventions_exports, {
70796
70797
  read_layoutView: () => read_layoutView,
70797
70798
  read_pageQuery: () => read_pageQuery,
70798
70799
  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
70800
  router_index_path: () => router_index_path,
70804
70801
  router_path: () => router_path,
70805
- serialized_manifest_path: () => serialized_manifest_path
70802
+ serialized_manifest_path: () => serialized_manifest_path,
70803
+ server_adapter_path: () => server_adapter_path
70806
70804
  });
70807
70805
  function router_path(config4) {
70808
70806
  return path_exports.join(base_dir(config4), "Router.jsx");
@@ -70810,17 +70808,11 @@ function router_path(config4) {
70810
70808
  function page_entry_path(config4, id, base) {
70811
70809
  return path_exports.join(page_entries_dir(config4, base), `${id}.jsx`);
70812
70810
  }
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) {
70811
+ function server_adapter_path(config4, base) {
70817
70812
  return path_exports.join(units_dir(config4, base), "render", "server.js");
70818
70813
  }
70819
- function render_yoga_path(config4, base) {
70820
- return path_exports.join(units_dir(config4, base), "render", "yoga.js");
70821
- }
70822
- function render_app_path(config4, base) {
70823
- return path_exports.join(units_dir(config4, base), "render", "App.jsx");
70814
+ function adapter_config_path(config4, base) {
70815
+ return path_exports.join(units_dir(config4, base), "render", "config.js");
70824
70816
  }
70825
70817
  function page_unit_path(config4, id, base) {
70826
70818
  return path_exports.join(page_units_dir(config4, base), `${id}.jsx`);
@@ -72718,7 +72710,7 @@ async function paginate(config4, documents) {
72718
72710
  value: "__typename"
72719
72711
  }
72720
72712
  },
72721
- ...(typeConfig?.keys || ["id"]).map((key) => ({
72713
+ ...(typeConfig?.keys || [config4.defaultKeys[0]]).map((key) => ({
72722
72714
  kind: graphql11.Kind.FIELD,
72723
72715
  name: {
72724
72716
  kind: graphql11.Kind.NAME,
@@ -76638,7 +76630,7 @@ function nodeDirectives(config4, directives) {
76638
76630
  }
76639
76631
  if (!possibleNodes.includes(definitionType)) {
76640
76632
  ctx.reportError(
76641
- new graphql26.GraphQLError(paginateOnNonNodeMessage(config4, node.name.value))
76633
+ new graphql26.GraphQLError(paginateOnNonNodeMessage(node.name.value))
76642
76634
  );
76643
76635
  }
76644
76636
  }
@@ -76773,45 +76765,45 @@ function getAndVerifyNodeInterface(config4) {
76773
76765
  return null;
76774
76766
  }
76775
76767
  if (!graphql26.isInterfaceType(nodeInterface)) {
76776
- displayInvalidNodeFieldMessage(config4.logLevel);
76768
+ displayInvalidNodeFieldMessage(config4);
76777
76769
  return null;
76778
76770
  }
76779
76771
  const queryType = schema.getQueryType();
76780
76772
  if (!queryType) {
76781
- displayInvalidNodeFieldMessage(config4.logLevel);
76773
+ displayInvalidNodeFieldMessage(config4);
76782
76774
  return null;
76783
76775
  }
76784
76776
  const nodeField = queryType.getFields()["node"];
76785
76777
  if (!nodeField) {
76786
- displayInvalidNodeFieldMessage(config4.logLevel);
76778
+ displayInvalidNodeFieldMessage(config4);
76787
76779
  return null;
76788
76780
  }
76789
76781
  const args = nodeField.args;
76790
76782
  if (args.length === 0) {
76791
- displayInvalidNodeFieldMessage(config4.logLevel);
76783
+ displayInvalidNodeFieldMessage(config4);
76792
76784
  return null;
76793
76785
  }
76794
- const idArg = args.find((arg) => arg.name === "id");
76786
+ const idArg = args.find((arg) => arg.name === config4.defaultKeys[0]);
76795
76787
  if (!idArg) {
76796
- displayInvalidNodeFieldMessage(config4.logLevel);
76788
+ displayInvalidNodeFieldMessage(config4);
76797
76789
  return null;
76798
76790
  }
76799
76791
  const idType = unwrapType(config4, idArg.type);
76800
76792
  if (idType.type.name !== "ID") {
76801
- displayInvalidNodeFieldMessage(config4.logLevel);
76793
+ displayInvalidNodeFieldMessage(config4);
76802
76794
  return null;
76803
76795
  }
76804
76796
  const fieldReturnType = unwrapType(config4, nodeField.type);
76805
76797
  if (fieldReturnType.type.name !== "Node") {
76806
- displayInvalidNodeFieldMessage(config4.logLevel);
76798
+ displayInvalidNodeFieldMessage(config4);
76807
76799
  return null;
76808
76800
  }
76809
76801
  return nodeInterface;
76810
76802
  }
76811
76803
  var nbInvalidNodeFieldMessageDisplayed = 0;
76812
- function displayInvalidNodeFieldMessage(logLevel) {
76804
+ function displayInvalidNodeFieldMessage(config4) {
76813
76805
  if (nbInvalidNodeFieldMessageDisplayed === 0) {
76814
- if (logLevel === LogLevel.Full) {
76806
+ if (config4.logLevel === LogLevel.Full) {
76815
76807
  console.warn(invalidNodeFieldMessage);
76816
76808
  } else {
76817
76809
  console.warn(invalidNodeFieldMessageLight);
@@ -76825,18 +76817,18 @@ var invalidNodeFieldMessage = `\u26A0\uFE0F Your project defines a Node interfa
76825
76817
  If you are trying to provide the Node interface and its field, they must look like the following:
76826
76818
 
76827
76819
  interface Node {
76828
- id: ID!
76820
+ id: ID!
76829
76821
  }
76830
76822
 
76831
76823
  extend type Query {
76832
- node(id: ID!): Node
76824
+ node(id: ID!): Node
76833
76825
  }
76834
76826
 
76835
76827
  For more information, please visit these links:
76836
76828
  - https://graphql.org/learn/global-object-identification/
76837
76829
  - ${siteURL}/guides/caching-data#custom-ids
76838
76830
  `;
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.
76831
+ var paginateOnNonNodeMessage = (directiveName) => `It looks like you are trying to use @${directiveName} on a document that does not have a valid type resolver.
76840
76832
  If this is happening inside of a fragment, make sure that the fragment either implements the Node interface or you
76841
76833
  have defined a resolver entry for the fragment type.
76842
76834
 
@@ -77263,12 +77255,13 @@ function Plugin(opts = {}) {
77263
77255
  sourceDir: viteConfig.build.outDir,
77264
77256
  publicBase: viteConfig.base,
77265
77257
  outDir: config3.routerBuildDirectory,
77266
- manifest
77258
+ manifest,
77259
+ adapterPath: "../$houdini/plugins/houdini-react/units/render/config.js"
77267
77260
  });
77268
77261
  },
77269
77262
  async buildStart(args) {
77270
- if (viteEnv.mode === "production") {
77271
- if (config3.localSchema && !isSecondaryBuild()) {
77263
+ if (viteEnv.mode === "production" && !isSecondaryBuild()) {
77264
+ if (config3.localSchema) {
77272
77265
  config3.schema = await loadLocalSchema(config3);
77273
77266
  }
77274
77267
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
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
  ],