houdini 2.0.0-next.0 → 2.0.0-next.1

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.
@@ -72731,7 +72731,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
72731
72731
  }
72732
72732
 
72733
72733
  // src/lib/introspection.ts
72734
- async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
72734
+ async function pullSchema(url, fetchTimeout, schemaPath, headers, writeToDisk = true) {
72735
72735
  let content = "";
72736
72736
  try {
72737
72737
  const fetchWithTimeout = (url2, timeoutMs, options) => {
@@ -72769,8 +72769,15 @@ async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
72769
72769
  } else {
72770
72770
  fileData = JSON.stringify(jsonSchema);
72771
72771
  }
72772
- if (!skipWriting) {
72773
- await writeFile(schemaPath, fileData);
72772
+ if (writeToDisk) {
72773
+ try {
72774
+ await writeFile(schemaPath, fileData);
72775
+ } catch (e2) {
72776
+ console.warn(
72777
+ `\u26A0\uFE0F Couldn't write your pulled schema to disk: ${e2.message}
72778
+ If this is expected, please set watchSchema.writePolledSchema to false in your config file.`
72779
+ );
72780
+ }
72774
72781
  }
72775
72782
  return fileData;
72776
72783
  } catch (e2) {
@@ -77838,6 +77845,7 @@ var Config = class {
77838
77845
  routesDir;
77839
77846
  schemaPollInterval;
77840
77847
  schemaPollTimeout;
77848
+ schemaPollWriteToDisk = false;
77841
77849
  schemaPollHeaders;
77842
77850
  pluginMode = false;
77843
77851
  plugins = [];
@@ -77914,6 +77922,7 @@ var Config = class {
77914
77922
  this.routesDir = join2(this.projectRoot, "src", "routes");
77915
77923
  this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
77916
77924
  this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
77925
+ this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
77917
77926
  this.schemaPollHeaders = watchSchema?.headers ?? {};
77918
77927
  this.rootDir = join2(this.projectRoot, this.runtimeDir);
77919
77928
  this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
@@ -77946,11 +77955,17 @@ var Config = class {
77946
77955
  const include = [`src/**/*{${extensions.join(",")}}`];
77947
77956
  for (const plugin2 of this.plugins) {
77948
77957
  const runtimeDir = this.pluginRuntimeSource(plugin2);
77949
- if (!runtimeDir) {
77958
+ const staticDir = this.pluginStaticRuntimeSource(plugin2);
77959
+ if (!runtimeDir && !staticDir) {
77950
77960
  continue;
77951
77961
  }
77952
- const includePath = relative(this.projectRoot, runtimeDir);
77953
- include.push(`${includePath}/**/*{${extensions.join(",")}}`);
77962
+ for (const dir of [runtimeDir, staticDir]) {
77963
+ if (!dir) {
77964
+ continue;
77965
+ }
77966
+ const includePath = relative(this.projectRoot, dir);
77967
+ include.push(`${includePath}/**/*{${extensions.join(",")}}`);
77968
+ }
77954
77969
  }
77955
77970
  return include;
77956
77971
  }
@@ -78004,6 +78019,15 @@ var Config = class {
78004
78019
  typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
78005
78020
  );
78006
78021
  }
78022
+ pluginStaticRuntimeSource(plugin2) {
78023
+ if (!plugin2.staticRuntime) {
78024
+ return null;
78025
+ }
78026
+ return join2(
78027
+ dirname(plugin2.filepath),
78028
+ typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
78029
+ );
78030
+ }
78007
78031
  async sourceFiles() {
78008
78032
  return [
78009
78033
  ...new Set(
@@ -78200,6 +78224,9 @@ var Config = class {
78200
78224
  pluginRuntimeDirectory(name) {
78201
78225
  return join2(this.pluginDirectory(name), "runtime");
78202
78226
  }
78227
+ pluginStaticRuntimeDirectory(name) {
78228
+ return join2(this.pluginDirectory(name), "static");
78229
+ }
78203
78230
  get pluginRootDirectory() {
78204
78231
  return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
78205
78232
  }
@@ -78577,17 +78604,20 @@ async function getConfig({
78577
78604
  if (!_config.localSchema && _config.schemaPath && !_config.schema) {
78578
78605
  let schemaOk = true;
78579
78606
  if (apiURL) {
78580
- if (glob2.hasMagic(_config.schemaPath)) {
78607
+ if (glob2.hasMagic(_config.schemaPath) && _config.schemaPollWriteToDisk) {
78581
78608
  console.log(
78582
78609
  `\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
78583
- This will prevent your schema from being pulled.`
78610
+ This will prevent your schema from being written to disk. If this is expected, please set the writePolledSchema value to false.`
78584
78611
  );
78612
+ _config.schemaPollWriteToDisk = false;
78585
78613
  } else if (!await readFile(_config.schemaPath)) {
78586
78614
  console.log("\u231B Pulling schema from api");
78587
78615
  schemaOk = await pullSchema(
78588
78616
  apiURL,
78589
78617
  _config.schemaPollTimeout,
78590
- _config.schemaPath
78618
+ _config.schemaPath,
78619
+ {},
78620
+ _config.schemaPollWriteToDisk
78591
78621
  ) !== null;
78592
78622
  }
78593
78623
  }
@@ -72642,7 +72642,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
72642
72642
  }
72643
72643
 
72644
72644
  // src/lib/introspection.ts
72645
- async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
72645
+ async function pullSchema(url, fetchTimeout, schemaPath, headers, writeToDisk = true) {
72646
72646
  let content = "";
72647
72647
  try {
72648
72648
  const fetchWithTimeout = (url2, timeoutMs, options) => {
@@ -72680,8 +72680,15 @@ async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
72680
72680
  } else {
72681
72681
  fileData = JSON.stringify(jsonSchema);
72682
72682
  }
72683
- if (!skipWriting) {
72684
- await writeFile(schemaPath, fileData);
72683
+ if (writeToDisk) {
72684
+ try {
72685
+ await writeFile(schemaPath, fileData);
72686
+ } catch (e2) {
72687
+ console.warn(
72688
+ `\u26A0\uFE0F Couldn't write your pulled schema to disk: ${e2.message}
72689
+ If this is expected, please set watchSchema.writePolledSchema to false in your config file.`
72690
+ );
72691
+ }
72685
72692
  }
72686
72693
  return fileData;
72687
72694
  } catch (e2) {
@@ -77748,6 +77755,7 @@ var Config = class {
77748
77755
  routesDir;
77749
77756
  schemaPollInterval;
77750
77757
  schemaPollTimeout;
77758
+ schemaPollWriteToDisk = false;
77751
77759
  schemaPollHeaders;
77752
77760
  pluginMode = false;
77753
77761
  plugins = [];
@@ -77824,6 +77832,7 @@ var Config = class {
77824
77832
  this.routesDir = join2(this.projectRoot, "src", "routes");
77825
77833
  this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
77826
77834
  this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
77835
+ this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
77827
77836
  this.schemaPollHeaders = watchSchema?.headers ?? {};
77828
77837
  this.rootDir = join2(this.projectRoot, this.runtimeDir);
77829
77838
  this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
@@ -77856,11 +77865,17 @@ var Config = class {
77856
77865
  const include = [`src/**/*{${extensions.join(",")}}`];
77857
77866
  for (const plugin2 of this.plugins) {
77858
77867
  const runtimeDir = this.pluginRuntimeSource(plugin2);
77859
- if (!runtimeDir) {
77868
+ const staticDir = this.pluginStaticRuntimeSource(plugin2);
77869
+ if (!runtimeDir && !staticDir) {
77860
77870
  continue;
77861
77871
  }
77862
- const includePath = relative(this.projectRoot, runtimeDir);
77863
- include.push(`${includePath}/**/*{${extensions.join(",")}}`);
77872
+ for (const dir of [runtimeDir, staticDir]) {
77873
+ if (!dir) {
77874
+ continue;
77875
+ }
77876
+ const includePath = relative(this.projectRoot, dir);
77877
+ include.push(`${includePath}/**/*{${extensions.join(",")}}`);
77878
+ }
77864
77879
  }
77865
77880
  return include;
77866
77881
  }
@@ -77914,6 +77929,15 @@ var Config = class {
77914
77929
  typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
77915
77930
  );
77916
77931
  }
77932
+ pluginStaticRuntimeSource(plugin2) {
77933
+ if (!plugin2.staticRuntime) {
77934
+ return null;
77935
+ }
77936
+ return join2(
77937
+ dirname(plugin2.filepath),
77938
+ typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
77939
+ );
77940
+ }
77917
77941
  async sourceFiles() {
77918
77942
  return [
77919
77943
  ...new Set(
@@ -78110,6 +78134,9 @@ var Config = class {
78110
78134
  pluginRuntimeDirectory(name) {
78111
78135
  return join2(this.pluginDirectory(name), "runtime");
78112
78136
  }
78137
+ pluginStaticRuntimeDirectory(name) {
78138
+ return join2(this.pluginDirectory(name), "static");
78139
+ }
78113
78140
  get pluginRootDirectory() {
78114
78141
  return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
78115
78142
  }
@@ -78487,17 +78514,20 @@ async function getConfig({
78487
78514
  if (!_config.localSchema && _config.schemaPath && !_config.schema) {
78488
78515
  let schemaOk = true;
78489
78516
  if (apiURL) {
78490
- if (glob2.hasMagic(_config.schemaPath)) {
78517
+ if (glob2.hasMagic(_config.schemaPath) && _config.schemaPollWriteToDisk) {
78491
78518
  console.log(
78492
78519
  `\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
78493
- This will prevent your schema from being pulled.`
78520
+ This will prevent your schema from being written to disk. If this is expected, please set the writePolledSchema value to false.`
78494
78521
  );
78522
+ _config.schemaPollWriteToDisk = false;
78495
78523
  } else if (!await readFile(_config.schemaPath)) {
78496
78524
  console.log("\u231B Pulling schema from api");
78497
78525
  schemaOk = await pullSchema(
78498
78526
  apiURL,
78499
78527
  _config.schemaPollTimeout,
78500
- _config.schemaPath
78528
+ _config.schemaPath,
78529
+ {},
78530
+ _config.schemaPollWriteToDisk
78501
78531
  ) !== null;
78502
78532
  }
78503
78533
  }
@@ -196,6 +196,13 @@ export type WatchSchemaConfig = {
196
196
  * logic you need
197
197
  */
198
198
  headers?: Record<string, string | ((env: Record<string, string | undefined>) => string)> | ((env: Record<string, string | undefined>) => Record<string, string>);
199
+ /**
200
+ * Write the schema to disk on pull.
201
+ * Useful for IDE integration.
202
+ * Set to false when you have read only access to the schema or directory it's in.
203
+ * Defaults to true
204
+ */
205
+ writePolledSchema?: boolean;
199
206
  };
200
207
  export type ScalarSpec = {
201
208
  type: string;
@@ -196,6 +196,13 @@ export type WatchSchemaConfig = {
196
196
  * logic you need
197
197
  */
198
198
  headers?: Record<string, string | ((env: Record<string, string | undefined>) => string)> | ((env: Record<string, string | undefined>) => Record<string, string>);
199
+ /**
200
+ * Write the schema to disk on pull.
201
+ * Useful for IDE integration.
202
+ * Set to false when you have read only access to the schema or directory it's in.
203
+ * Defaults to true
204
+ */
205
+ writePolledSchema?: boolean;
199
206
  };
200
207
  export type ScalarSpec = {
201
208
  type: string;
@@ -196,6 +196,13 @@ export type WatchSchemaConfig = {
196
196
  * logic you need
197
197
  */
198
198
  headers?: Record<string, string | ((env: Record<string, string | undefined>) => string)> | ((env: Record<string, string | undefined>) => Record<string, string>);
199
+ /**
200
+ * Write the schema to disk on pull.
201
+ * Useful for IDE integration.
202
+ * Set to false when you have read only access to the schema or directory it's in.
203
+ * Defaults to true
204
+ */
205
+ writePolledSchema?: boolean;
199
206
  };
200
207
  export type ScalarSpec = {
201
208
  type: string;
@@ -65637,6 +65637,7 @@ var Config = class {
65637
65637
  routesDir;
65638
65638
  schemaPollInterval;
65639
65639
  schemaPollTimeout;
65640
+ schemaPollWriteToDisk = false;
65640
65641
  schemaPollHeaders;
65641
65642
  pluginMode = false;
65642
65643
  plugins = [];
@@ -65713,6 +65714,7 @@ var Config = class {
65713
65714
  this.routesDir = join(this.projectRoot, "src", "routes");
65714
65715
  this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
65715
65716
  this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
65717
+ this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
65716
65718
  this.schemaPollHeaders = watchSchema?.headers ?? {};
65717
65719
  this.rootDir = join(this.projectRoot, this.runtimeDir);
65718
65720
  this.persistedQueriesPath = persistedQueriesPath ?? join(this.rootDir, "persisted_queries.json");
@@ -65745,11 +65747,17 @@ var Config = class {
65745
65747
  const include = [`src/**/*{${extensions.join(",")}}`];
65746
65748
  for (const plugin2 of this.plugins) {
65747
65749
  const runtimeDir = this.pluginRuntimeSource(plugin2);
65748
- if (!runtimeDir) {
65750
+ const staticDir = this.pluginStaticRuntimeSource(plugin2);
65751
+ if (!runtimeDir && !staticDir) {
65749
65752
  continue;
65750
65753
  }
65751
- const includePath = relative(this.projectRoot, runtimeDir);
65752
- include.push(`${includePath}/**/*{${extensions.join(",")}}`);
65754
+ for (const dir of [runtimeDir, staticDir]) {
65755
+ if (!dir) {
65756
+ continue;
65757
+ }
65758
+ const includePath = relative(this.projectRoot, dir);
65759
+ include.push(`${includePath}/**/*{${extensions.join(",")}}`);
65760
+ }
65753
65761
  }
65754
65762
  return include;
65755
65763
  }
@@ -65803,6 +65811,15 @@ var Config = class {
65803
65811
  typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
65804
65812
  );
65805
65813
  }
65814
+ pluginStaticRuntimeSource(plugin2) {
65815
+ if (!plugin2.staticRuntime) {
65816
+ return null;
65817
+ }
65818
+ return join(
65819
+ dirname(plugin2.filepath),
65820
+ typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
65821
+ );
65822
+ }
65806
65823
  async sourceFiles() {
65807
65824
  return [
65808
65825
  ...new Set(
@@ -65999,6 +66016,9 @@ var Config = class {
65999
66016
  pluginRuntimeDirectory(name) {
66000
66017
  return join(this.pluginDirectory(name), "runtime");
66001
66018
  }
66019
+ pluginStaticRuntimeDirectory(name) {
66020
+ return join(this.pluginDirectory(name), "static");
66021
+ }
66002
66022
  get pluginRootDirectory() {
66003
66023
  return houdini_mode.is_testing ? "../../../" : join(this.rootDir, "plugins");
66004
66024
  }
@@ -70703,6 +70723,11 @@ async function writeIndexFile2(config, docs) {
70703
70723
  module: relative2(config.pluginRuntimeDirectory(plugin2.name))
70704
70724
  });
70705
70725
  }
70726
+ if (plugin2.staticRuntime) {
70727
+ body += exportStar({
70728
+ module: relative2(config.pluginStaticRuntimeDirectory(plugin2.name))
70729
+ });
70730
+ }
70706
70731
  }
70707
70732
  await fs_exports.writeFile(path_exports.join(config.rootDir, "index.js"), body);
70708
70733
  }
@@ -65633,6 +65633,7 @@ var Config = class {
65633
65633
  routesDir;
65634
65634
  schemaPollInterval;
65635
65635
  schemaPollTimeout;
65636
+ schemaPollWriteToDisk = false;
65636
65637
  schemaPollHeaders;
65637
65638
  pluginMode = false;
65638
65639
  plugins = [];
@@ -65709,6 +65710,7 @@ var Config = class {
65709
65710
  this.routesDir = join(this.projectRoot, "src", "routes");
65710
65711
  this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
65711
65712
  this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
65713
+ this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
65712
65714
  this.schemaPollHeaders = watchSchema?.headers ?? {};
65713
65715
  this.rootDir = join(this.projectRoot, this.runtimeDir);
65714
65716
  this.persistedQueriesPath = persistedQueriesPath ?? join(this.rootDir, "persisted_queries.json");
@@ -65741,11 +65743,17 @@ var Config = class {
65741
65743
  const include = [`src/**/*{${extensions.join(",")}}`];
65742
65744
  for (const plugin2 of this.plugins) {
65743
65745
  const runtimeDir = this.pluginRuntimeSource(plugin2);
65744
- if (!runtimeDir) {
65746
+ const staticDir = this.pluginStaticRuntimeSource(plugin2);
65747
+ if (!runtimeDir && !staticDir) {
65745
65748
  continue;
65746
65749
  }
65747
- const includePath = relative(this.projectRoot, runtimeDir);
65748
- include.push(`${includePath}/**/*{${extensions.join(",")}}`);
65750
+ for (const dir of [runtimeDir, staticDir]) {
65751
+ if (!dir) {
65752
+ continue;
65753
+ }
65754
+ const includePath = relative(this.projectRoot, dir);
65755
+ include.push(`${includePath}/**/*{${extensions.join(",")}}`);
65756
+ }
65749
65757
  }
65750
65758
  return include;
65751
65759
  }
@@ -65799,6 +65807,15 @@ var Config = class {
65799
65807
  typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
65800
65808
  );
65801
65809
  }
65810
+ pluginStaticRuntimeSource(plugin2) {
65811
+ if (!plugin2.staticRuntime) {
65812
+ return null;
65813
+ }
65814
+ return join(
65815
+ dirname(plugin2.filepath),
65816
+ typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
65817
+ );
65818
+ }
65802
65819
  async sourceFiles() {
65803
65820
  return [
65804
65821
  ...new Set(
@@ -65995,6 +66012,9 @@ var Config = class {
65995
66012
  pluginRuntimeDirectory(name) {
65996
66013
  return join(this.pluginDirectory(name), "runtime");
65997
66014
  }
66015
+ pluginStaticRuntimeDirectory(name) {
66016
+ return join(this.pluginDirectory(name), "static");
66017
+ }
65998
66018
  get pluginRootDirectory() {
65999
66019
  return houdini_mode.is_testing ? "../../../" : join(this.rootDir, "plugins");
66000
66020
  }
@@ -70699,6 +70719,11 @@ async function writeIndexFile2(config, docs) {
70699
70719
  module: relative2(config.pluginRuntimeDirectory(plugin2.name))
70700
70720
  });
70701
70721
  }
70722
+ if (plugin2.staticRuntime) {
70723
+ body += exportStar({
70724
+ module: relative2(config.pluginStaticRuntimeDirectory(plugin2.name))
70725
+ });
70726
+ }
70702
70727
  }
70703
70728
  await fs_exports.writeFile(path_exports.join(config.rootDir, "index.js"), body);
70704
70729
  }
@@ -72468,7 +72468,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
72468
72468
  }
72469
72469
 
72470
72470
  // src/lib/introspection.ts
72471
- async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
72471
+ async function pullSchema(url, fetchTimeout, schemaPath, headers, writeToDisk = true) {
72472
72472
  let content = "";
72473
72473
  try {
72474
72474
  const fetchWithTimeout = (url2, timeoutMs, options) => {
@@ -72506,8 +72506,15 @@ async function pullSchema(url, fetchTimeout, schemaPath, headers, skipWriting) {
72506
72506
  } else {
72507
72507
  fileData = JSON.stringify(jsonSchema);
72508
72508
  }
72509
- if (!skipWriting) {
72510
- await writeFile(schemaPath, fileData);
72509
+ if (writeToDisk) {
72510
+ try {
72511
+ await writeFile(schemaPath, fileData);
72512
+ } catch (e2) {
72513
+ console.warn(
72514
+ `\u26A0\uFE0F Couldn't write your pulled schema to disk: ${e2.message}
72515
+ If this is expected, please set watchSchema.writePolledSchema to false in your config file.`
72516
+ );
72517
+ }
72511
72518
  }
72512
72519
  return fileData;
72513
72520
  } catch (e2) {
@@ -75734,6 +75741,7 @@ var Config = class {
75734
75741
  routesDir;
75735
75742
  schemaPollInterval;
75736
75743
  schemaPollTimeout;
75744
+ schemaPollWriteToDisk = false;
75737
75745
  schemaPollHeaders;
75738
75746
  pluginMode = false;
75739
75747
  plugins = [];
@@ -75810,6 +75818,7 @@ var Config = class {
75810
75818
  this.routesDir = join2(this.projectRoot, "src", "routes");
75811
75819
  this.schemaPollInterval = watchSchema?.interval === void 0 ? 2e3 : watchSchema.interval;
75812
75820
  this.schemaPollTimeout = watchSchema?.timeout ?? 3e4;
75821
+ this.schemaPollWriteToDisk = watchSchema?.writePolledSchema ?? true;
75813
75822
  this.schemaPollHeaders = watchSchema?.headers ?? {};
75814
75823
  this.rootDir = join2(this.projectRoot, this.runtimeDir);
75815
75824
  this.persistedQueriesPath = persistedQueriesPath ?? join2(this.rootDir, "persisted_queries.json");
@@ -75842,11 +75851,17 @@ var Config = class {
75842
75851
  const include = [`src/**/*{${extensions.join(",")}}`];
75843
75852
  for (const plugin2 of this.plugins) {
75844
75853
  const runtimeDir = this.pluginRuntimeSource(plugin2);
75845
- if (!runtimeDir) {
75854
+ const staticDir = this.pluginStaticRuntimeSource(plugin2);
75855
+ if (!runtimeDir && !staticDir) {
75846
75856
  continue;
75847
75857
  }
75848
- const includePath = relative(this.projectRoot, runtimeDir);
75849
- include.push(`${includePath}/**/*{${extensions.join(",")}}`);
75858
+ for (const dir of [runtimeDir, staticDir]) {
75859
+ if (!dir) {
75860
+ continue;
75861
+ }
75862
+ const includePath = relative(this.projectRoot, dir);
75863
+ include.push(`${includePath}/**/*{${extensions.join(",")}}`);
75864
+ }
75850
75865
  }
75851
75866
  return include;
75852
75867
  }
@@ -75900,6 +75915,15 @@ var Config = class {
75900
75915
  typeof plugin2.includeRuntime === "string" ? plugin2.includeRuntime : plugin2.includeRuntime?.[this.module]
75901
75916
  );
75902
75917
  }
75918
+ pluginStaticRuntimeSource(plugin2) {
75919
+ if (!plugin2.staticRuntime) {
75920
+ return null;
75921
+ }
75922
+ return join2(
75923
+ dirname(plugin2.filepath),
75924
+ typeof plugin2.staticRuntime === "string" ? plugin2.staticRuntime : plugin2.staticRuntime?.[this.module]
75925
+ );
75926
+ }
75903
75927
  async sourceFiles() {
75904
75928
  return [
75905
75929
  ...new Set(
@@ -76096,6 +76120,9 @@ var Config = class {
76096
76120
  pluginRuntimeDirectory(name) {
76097
76121
  return join2(this.pluginDirectory(name), "runtime");
76098
76122
  }
76123
+ pluginStaticRuntimeDirectory(name) {
76124
+ return join2(this.pluginDirectory(name), "static");
76125
+ }
76099
76126
  get pluginRootDirectory() {
76100
76127
  return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
76101
76128
  }
@@ -76473,17 +76500,20 @@ async function getConfig({
76473
76500
  if (!_config.localSchema && _config.schemaPath && !_config.schema) {
76474
76501
  let schemaOk = true;
76475
76502
  if (apiURL) {
76476
- if (glob2.hasMagic(_config.schemaPath)) {
76503
+ if (glob2.hasMagic(_config.schemaPath) && _config.schemaPollWriteToDisk) {
76477
76504
  console.log(
76478
76505
  `\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
76479
- This will prevent your schema from being pulled.`
76506
+ This will prevent your schema from being written to disk. If this is expected, please set the writePolledSchema value to false.`
76480
76507
  );
76508
+ _config.schemaPollWriteToDisk = false;
76481
76509
  } else if (!await readFile(_config.schemaPath)) {
76482
76510
  console.log("\u231B Pulling schema from api");
76483
76511
  schemaOk = await pullSchema(
76484
76512
  apiURL,
76485
76513
  _config.schemaPollTimeout,
76486
- _config.schemaPath
76514
+ _config.schemaPath,
76515
+ {},
76516
+ _config.schemaPollWriteToDisk
76487
76517
  ) !== null;
76488
76518
  }
76489
76519
  }
@@ -79817,6 +79847,50 @@ function moduleStatments(config2) {
79817
79847
  exportStarStatement
79818
79848
  };
79819
79849
  }
79850
+ async function generateStaticRuntimes({ config: config2 }) {
79851
+ if (houdini_mode.is_testing) {
79852
+ return;
79853
+ }
79854
+ const { importStatement, exportDefaultStatement, exportStarStatement } = moduleStatments(config2);
79855
+ await Promise.all(
79856
+ config2.plugins.filter((plugin2) => plugin2.staticRuntime).map(async (plugin2) => {
79857
+ const runtime_path = config2.pluginStaticRuntimeSource(plugin2);
79858
+ if (!runtime_path) {
79859
+ return;
79860
+ }
79861
+ try {
79862
+ await stat(runtime_path);
79863
+ } catch {
79864
+ throw new HoudiniError({
79865
+ message: "Cannot find runtime to generate for " + plugin2.name,
79866
+ description: "Maybe it was bundled?"
79867
+ });
79868
+ }
79869
+ const pluginDir = config2.pluginStaticRuntimeDirectory(plugin2.name);
79870
+ let transformMap = plugin2.transformRuntime ?? {};
79871
+ if (transformMap && typeof transformMap === "function") {
79872
+ transformMap = transformMap([], { config: config2 });
79873
+ }
79874
+ await mkdirp(pluginDir);
79875
+ await recursiveCopy(
79876
+ runtime_path,
79877
+ pluginDir,
79878
+ Object.fromEntries(
79879
+ Object.entries(transformMap).map(([key, value]) => [
79880
+ join2(runtime_path, key),
79881
+ (content) => value({
79882
+ config: config2,
79883
+ content,
79884
+ importStatement,
79885
+ exportDefaultStatement,
79886
+ exportStarStatement
79887
+ })
79888
+ ])
79889
+ )
79890
+ );
79891
+ })
79892
+ );
79893
+ }
79820
79894
  async function generatePluginRuntimes({
79821
79895
  config: config2,
79822
79896
  docs
@@ -81418,6 +81492,11 @@ async function writeIndexFile2(config2, docs) {
81418
81492
  module: relative2(config2.pluginRuntimeDirectory(plugin2.name))
81419
81493
  });
81420
81494
  }
81495
+ if (plugin2.staticRuntime) {
81496
+ body += exportStar({
81497
+ module: relative2(config2.pluginStaticRuntimeDirectory(plugin2.name))
81498
+ });
81499
+ }
81421
81500
  }
81422
81501
  await fs_exports.writeFile(path_exports.join(config2.rootDir, "index.js"), body);
81423
81502
  }
@@ -85335,6 +85414,7 @@ async function componentFields2(config2, docs) {
85335
85414
 
85336
85415
  // src/codegen/index.ts
85337
85416
  async function compile(config2) {
85417
+ await generateStaticRuntimes({ config: config2 });
85338
85418
  const documents = await collectDocuments(config2);
85339
85419
  return await runPipeline2(config2, documents);
85340
85420
  }
@@ -85946,7 +86026,8 @@ function watch_remote_schema(opts = {}) {
85946
86026
  apiURL,
85947
86027
  config2.schemaPollTimeout,
85948
86028
  config2.schemaPath ?? path_exports.resolve(process.cwd(), "schema.json"),
85949
- await config2.pullHeaders()
86029
+ await config2.pullHeaders(),
86030
+ config2.schemaPollWriteToDisk
85950
86031
  );
85951
86032
  nbPullError = schemaState ? 0 : nbPullError + 1;
85952
86033
  } catch (e2) {