houdini 1.0.0-next.19 → 1.0.0-next.20

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.
@@ -0,0 +1,3 @@
1
+ import type { ConfigFile } from '../lib/config';
2
+ declare const configs: ((old: ConfigFile) => ConfigFile)[];
3
+ export default configs;
@@ -82,6 +82,9 @@ class HoudiniClient {
82
82
  }
83
83
  function createPluginHooks(plugins) {
84
84
  return plugins.reduce((hooks, plugin) => {
85
+ if (typeof plugin !== "function") {
86
+ throw new Error("Encountered client plugin that's not a function");
87
+ }
85
88
  const result = plugin();
86
89
  if (!result) {
87
90
  return hooks;
@@ -0,0 +1,3 @@
1
+ import type { ConfigFile } from '../lib/config';
2
+ declare const configs: ((old: ConfigFile) => ConfigFile)[];
3
+ export default configs;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var pluginConfig_exports = {};
20
+ __export(pluginConfig_exports, {
21
+ default: () => pluginConfig_default
22
+ });
23
+ module.exports = __toCommonJS(pluginConfig_exports);
24
+ const configs = [];
25
+ var pluginConfig_default = configs;
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {});
@@ -33,6 +33,7 @@ __export(config_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(config_exports);
35
35
  var import_config = __toESM(require("../imports/config"), 1);
36
+ var import_pluginConfig = __toESM(require("../imports/pluginConfig"), 1);
36
37
  let mockConfig = null;
37
38
  function getMockConfig() {
38
39
  return mockConfig;
@@ -67,12 +68,21 @@ function computeID(configFile, type, data) {
67
68
  }
68
69
  return id.slice(0, -2);
69
70
  }
71
+ let _configFile = null;
70
72
  function getCurrentConfig() {
71
73
  const mockConfig2 = getMockConfig();
72
74
  if (mockConfig2) {
73
75
  return mockConfig2;
74
76
  }
75
- return defaultConfigValues(import_config.default);
77
+ if (_configFile) {
78
+ return _configFile;
79
+ }
80
+ let configFile = defaultConfigValues(import_config.default);
81
+ for (const pluginConfig of import_pluginConfig.default) {
82
+ configFile = pluginConfig(configFile);
83
+ }
84
+ _configFile = configFile;
85
+ return configFile;
76
86
  }
77
87
  // Annotate the CommonJS export names for ESM import in node:
78
88
  0 && (module.exports = {
@@ -53,6 +53,9 @@ class HoudiniClient {
53
53
  }
54
54
  function createPluginHooks(plugins) {
55
55
  return plugins.reduce((hooks, plugin) => {
56
+ if (typeof plugin !== "function") {
57
+ throw new Error("Encountered client plugin that's not a function");
58
+ }
56
59
  const result = plugin();
57
60
  if (!result) {
58
61
  return hooks;
@@ -0,0 +1,3 @@
1
+ import type { ConfigFile } from '../lib/config';
2
+ declare const configs: ((old: ConfigFile) => ConfigFile)[];
3
+ export default configs;
@@ -0,0 +1,5 @@
1
+ const configs = [];
2
+ var pluginConfig_default = configs;
3
+ export {
4
+ pluginConfig_default as default
5
+ };
@@ -1,4 +1,5 @@
1
1
  import config from "../imports/config";
2
+ import pluginConfigs from "../imports/pluginConfig";
2
3
  let mockConfig = null;
3
4
  function getMockConfig() {
4
5
  return mockConfig;
@@ -33,12 +34,21 @@ function computeID(configFile, type, data) {
33
34
  }
34
35
  return id.slice(0, -2);
35
36
  }
37
+ let _configFile = null;
36
38
  function getCurrentConfig() {
37
39
  const mockConfig2 = getMockConfig();
38
40
  if (mockConfig2) {
39
41
  return mockConfig2;
40
42
  }
41
- return defaultConfigValues(config);
43
+ if (_configFile) {
44
+ return _configFile;
45
+ }
46
+ let configFile = defaultConfigValues(config);
47
+ for (const pluginConfig of pluginConfigs) {
48
+ configFile = pluginConfig(configFile);
49
+ }
50
+ _configFile = configFile;
51
+ return configFile;
42
52
  }
43
53
  export {
44
54
  computeID,