houdini 1.2.50 → 1.2.51

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.
@@ -65090,6 +65090,137 @@ function plugin(name, hooks) {
65090
65090
  return data;
65091
65091
  }
65092
65092
 
65093
+ // src/lib/router/conventions.ts
65094
+ var conventions_exports = {};
65095
+ __export(conventions_exports, {
65096
+ adapter_config_path: () => adapter_config_path,
65097
+ app_component_path: () => app_component_path,
65098
+ componentField_unit_path: () => componentField_unit_path,
65099
+ fallback_unit_path: () => fallback_unit_path,
65100
+ is_layout: () => is_layout,
65101
+ layout_unit_path: () => layout_unit_path,
65102
+ page_entries_dir: () => page_entries_dir,
65103
+ page_entry_path: () => page_entry_path,
65104
+ page_id: () => page_id,
65105
+ page_unit_path: () => page_unit_path,
65106
+ read_layoutQuery: () => read_layoutQuery,
65107
+ read_layoutView: () => read_layoutView,
65108
+ read_pageQuery: () => read_pageQuery,
65109
+ read_pageView: () => read_pageView,
65110
+ router_index_path: () => router_index_path,
65111
+ router_path: () => router_path,
65112
+ serialized_manifest_path: () => serialized_manifest_path,
65113
+ server_adapter_path: () => server_adapter_path,
65114
+ temp_dir: () => temp_dir,
65115
+ units_dir: () => units_dir,
65116
+ vite_render_path: () => vite_render_path
65117
+ });
65118
+ function router_path(config) {
65119
+ return path_exports.join(base_dir(config), "Router.jsx");
65120
+ }
65121
+ function page_entry_path(config, id, base) {
65122
+ return path_exports.join(page_entries_dir(config, base), `${id}.jsx`);
65123
+ }
65124
+ function server_adapter_path(config, base) {
65125
+ return path_exports.join(units_dir(config, base), "render", "server.js");
65126
+ }
65127
+ function adapter_config_path(config, base) {
65128
+ return path_exports.join(units_dir(config, base), "render", "config.js");
65129
+ }
65130
+ function vite_render_path(config, base) {
65131
+ return path_exports.join(units_dir(config, base), "render", "vite.js");
65132
+ }
65133
+ function app_component_path(config, base) {
65134
+ return path_exports.join(units_dir(config, base), "render", "App.jsx");
65135
+ }
65136
+ function page_unit_path(config, id, base) {
65137
+ return path_exports.join(page_units_dir(config, base), `${id}.jsx`);
65138
+ }
65139
+ function layout_unit_path(config, id, base) {
65140
+ return path_exports.join(layout_units_dir(config, base), `${id}.jsx`);
65141
+ }
65142
+ function componentField_unit_path(config, id, base) {
65143
+ return path_exports.join(units_dir(config, base), "componentFields", `wrapper_${id}.jsx`);
65144
+ }
65145
+ function fallback_unit_path(config, which, id, base) {
65146
+ return path_exports.join(fallbacks_units_dir(config, which, base), `${id}.jsx`);
65147
+ }
65148
+ async function read_pageQuery(base) {
65149
+ const target = path_exports.join(base, "+page.gql");
65150
+ return [target, await fs_exports.readFile(target)];
65151
+ }
65152
+ async function read_pageView(base) {
65153
+ for (const name of ["+page.tsx", "+page.jsx"]) {
65154
+ let target = path_exports.join(base, name);
65155
+ let result = await fs_exports.readFile(target);
65156
+ if (result) {
65157
+ return [target, result];
65158
+ }
65159
+ }
65160
+ return [null, null];
65161
+ }
65162
+ async function read_layoutQuery(base) {
65163
+ const target = path_exports.join(base, "+layout.gql");
65164
+ return [target, await fs_exports.readFile(target)];
65165
+ }
65166
+ async function read_layoutView(base) {
65167
+ for (const name of ["+layout.tsx", "+layout.jsx"]) {
65168
+ let target = path_exports.join(base, name);
65169
+ let result = await fs_exports.readFile(target);
65170
+ if (result) {
65171
+ return [target, result];
65172
+ }
65173
+ }
65174
+ return [null, null];
65175
+ }
65176
+ function temp_dir(config, key) {
65177
+ return path_exports.join(config.rootDir, "temp", key);
65178
+ }
65179
+ function router_index_path(config) {
65180
+ return path_exports.join(config.routesDir, "..", "+index.jsx");
65181
+ }
65182
+ function is_layout(path3) {
65183
+ return path3.endsWith("+layout.tsx") || path3.endsWith("+layout.jsx");
65184
+ }
65185
+ function page_id(path3) {
65186
+ if (path3.endsWith("/") && path3.length > 1) {
65187
+ path3 = path3.substring(0, path3.length - 1);
65188
+ }
65189
+ const special_chars = ["/", "]", "[", "(", ")", "-"];
65190
+ const mask = "_";
65191
+ let copy = "";
65192
+ for (const char of path3) {
65193
+ const match = special_chars.indexOf(char);
65194
+ if (match !== -1) {
65195
+ copy += mask;
65196
+ } else {
65197
+ copy += char;
65198
+ }
65199
+ }
65200
+ return copy;
65201
+ }
65202
+ function page_entries_dir(config, base) {
65203
+ return path_exports.join(units_dir(config, base), "entries");
65204
+ }
65205
+ function page_units_dir(config, base) {
65206
+ return path_exports.join(units_dir(config, base), "pages");
65207
+ }
65208
+ function layout_units_dir(config, base) {
65209
+ return path_exports.join(units_dir(config, base), "layouts");
65210
+ }
65211
+ function fallbacks_units_dir(config, which, base) {
65212
+ return path_exports.join(units_dir(config, base), "fallbacks", which);
65213
+ }
65214
+ function units_dir(config, base = base_dir(config)) {
65215
+ return path_exports.join(base, "units");
65216
+ }
65217
+ function base_dir(config) {
65218
+ return config.pluginDirectory("houdini-react");
65219
+ }
65220
+ function serialized_manifest_path(config, base = base_dir(config)) {
65221
+ return path_exports.join(base, "manifest.json");
65222
+ }
65223
+
65093
65224
  // src/lib/router/manifest.ts
65094
65225
  var t2 = __toESM(require_lib5(), 1);
65095
65226
  var graphql2 = __toESM(require("graphql"), 1);
@@ -67321,7 +67452,7 @@ function isSecondaryBuild() {
67321
67452
  async function buildLocalSchema(config) {
67322
67453
  const { build } = await import("vite");
67323
67454
  const schema = import_node_path2.default.join(config.localApiDir, "+schema");
67324
- const outDir = import_node_path2.default.join(config.rootDir, "temp");
67455
+ const outDir = conventions_exports.temp_dir(config, "schema");
67325
67456
  process.env.HOUDINI_SECONDARY_BUILD = "true";
67326
67457
  try {
67327
67458
  await fs_exports.remove(import_node_path2.default.join(outDir, "assets", "schema.js"));
@@ -67340,7 +67471,7 @@ async function buildLocalSchema(config) {
67340
67471
  schema
67341
67472
  },
67342
67473
  output: {
67343
- entryFileNames: "assets/[name].js"
67474
+ entryFileNames: "[name].js"
67344
67475
  }
67345
67476
  },
67346
67477
  ssr: true,
@@ -67358,7 +67489,10 @@ async function loadLocalSchema(config) {
67358
67489
  if (!isSecondaryBuild()) {
67359
67490
  await buildLocalSchema(config);
67360
67491
  }
67361
- const { default: schema } = await import(import_node_path2.default.join(config.rootDir, "temp", "assets", `schema.js?${Date.now().valueOf()}}`));
67492
+ const { default: schema } = await import(import_node_path2.default.join(
67493
+ conventions_exports.temp_dir(config, "schema"),
67494
+ `schema.js?${Date.now().valueOf()}}`
67495
+ ));
67362
67496
  return schema;
67363
67497
  }
67364
67498
 
@@ -67396,6 +67530,7 @@ var Config = class {
67396
67530
  schemaPollHeaders;
67397
67531
  pluginMode = false;
67398
67532
  plugins = [];
67533
+ adapter;
67399
67534
  componentFields = {};
67400
67535
  constructor({
67401
67536
  filepath,
@@ -78192,12 +78327,12 @@ async function packageJSON(targetPath, frameworkInfo) {
78192
78327
  }
78193
78328
  packageJSON2.devDependencies = {
78194
78329
  ...packageJSON2.devDependencies,
78195
- houdini: "^1.2.50"
78330
+ houdini: "^1.2.51"
78196
78331
  };
78197
78332
  if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
78198
78333
  packageJSON2.devDependencies = {
78199
78334
  ...packageJSON2.devDependencies,
78200
- "houdini-svelte": "^1.2.50"
78335
+ "houdini-svelte": "^1.2.51"
78201
78336
  };
78202
78337
  } else {
78203
78338
  throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
@@ -65096,6 +65096,137 @@ function plugin(name, hooks) {
65096
65096
  return data;
65097
65097
  }
65098
65098
 
65099
+ // src/lib/router/conventions.ts
65100
+ var conventions_exports = {};
65101
+ __export(conventions_exports, {
65102
+ adapter_config_path: () => adapter_config_path,
65103
+ app_component_path: () => app_component_path,
65104
+ componentField_unit_path: () => componentField_unit_path,
65105
+ fallback_unit_path: () => fallback_unit_path,
65106
+ is_layout: () => is_layout,
65107
+ layout_unit_path: () => layout_unit_path,
65108
+ page_entries_dir: () => page_entries_dir,
65109
+ page_entry_path: () => page_entry_path,
65110
+ page_id: () => page_id,
65111
+ page_unit_path: () => page_unit_path,
65112
+ read_layoutQuery: () => read_layoutQuery,
65113
+ read_layoutView: () => read_layoutView,
65114
+ read_pageQuery: () => read_pageQuery,
65115
+ read_pageView: () => read_pageView,
65116
+ router_index_path: () => router_index_path,
65117
+ router_path: () => router_path,
65118
+ serialized_manifest_path: () => serialized_manifest_path,
65119
+ server_adapter_path: () => server_adapter_path,
65120
+ temp_dir: () => temp_dir,
65121
+ units_dir: () => units_dir,
65122
+ vite_render_path: () => vite_render_path
65123
+ });
65124
+ function router_path(config) {
65125
+ return path_exports.join(base_dir(config), "Router.jsx");
65126
+ }
65127
+ function page_entry_path(config, id, base) {
65128
+ return path_exports.join(page_entries_dir(config, base), `${id}.jsx`);
65129
+ }
65130
+ function server_adapter_path(config, base) {
65131
+ return path_exports.join(units_dir(config, base), "render", "server.js");
65132
+ }
65133
+ function adapter_config_path(config, base) {
65134
+ return path_exports.join(units_dir(config, base), "render", "config.js");
65135
+ }
65136
+ function vite_render_path(config, base) {
65137
+ return path_exports.join(units_dir(config, base), "render", "vite.js");
65138
+ }
65139
+ function app_component_path(config, base) {
65140
+ return path_exports.join(units_dir(config, base), "render", "App.jsx");
65141
+ }
65142
+ function page_unit_path(config, id, base) {
65143
+ return path_exports.join(page_units_dir(config, base), `${id}.jsx`);
65144
+ }
65145
+ function layout_unit_path(config, id, base) {
65146
+ return path_exports.join(layout_units_dir(config, base), `${id}.jsx`);
65147
+ }
65148
+ function componentField_unit_path(config, id, base) {
65149
+ return path_exports.join(units_dir(config, base), "componentFields", `wrapper_${id}.jsx`);
65150
+ }
65151
+ function fallback_unit_path(config, which, id, base) {
65152
+ return path_exports.join(fallbacks_units_dir(config, which, base), `${id}.jsx`);
65153
+ }
65154
+ async function read_pageQuery(base) {
65155
+ const target = path_exports.join(base, "+page.gql");
65156
+ return [target, await fs_exports.readFile(target)];
65157
+ }
65158
+ async function read_pageView(base) {
65159
+ for (const name of ["+page.tsx", "+page.jsx"]) {
65160
+ let target = path_exports.join(base, name);
65161
+ let result = await fs_exports.readFile(target);
65162
+ if (result) {
65163
+ return [target, result];
65164
+ }
65165
+ }
65166
+ return [null, null];
65167
+ }
65168
+ async function read_layoutQuery(base) {
65169
+ const target = path_exports.join(base, "+layout.gql");
65170
+ return [target, await fs_exports.readFile(target)];
65171
+ }
65172
+ async function read_layoutView(base) {
65173
+ for (const name of ["+layout.tsx", "+layout.jsx"]) {
65174
+ let target = path_exports.join(base, name);
65175
+ let result = await fs_exports.readFile(target);
65176
+ if (result) {
65177
+ return [target, result];
65178
+ }
65179
+ }
65180
+ return [null, null];
65181
+ }
65182
+ function temp_dir(config, key) {
65183
+ return path_exports.join(config.rootDir, "temp", key);
65184
+ }
65185
+ function router_index_path(config) {
65186
+ return path_exports.join(config.routesDir, "..", "+index.jsx");
65187
+ }
65188
+ function is_layout(path3) {
65189
+ return path3.endsWith("+layout.tsx") || path3.endsWith("+layout.jsx");
65190
+ }
65191
+ function page_id(path3) {
65192
+ if (path3.endsWith("/") && path3.length > 1) {
65193
+ path3 = path3.substring(0, path3.length - 1);
65194
+ }
65195
+ const special_chars = ["/", "]", "[", "(", ")", "-"];
65196
+ const mask = "_";
65197
+ let copy = "";
65198
+ for (const char of path3) {
65199
+ const match = special_chars.indexOf(char);
65200
+ if (match !== -1) {
65201
+ copy += mask;
65202
+ } else {
65203
+ copy += char;
65204
+ }
65205
+ }
65206
+ return copy;
65207
+ }
65208
+ function page_entries_dir(config, base) {
65209
+ return path_exports.join(units_dir(config, base), "entries");
65210
+ }
65211
+ function page_units_dir(config, base) {
65212
+ return path_exports.join(units_dir(config, base), "pages");
65213
+ }
65214
+ function layout_units_dir(config, base) {
65215
+ return path_exports.join(units_dir(config, base), "layouts");
65216
+ }
65217
+ function fallbacks_units_dir(config, which, base) {
65218
+ return path_exports.join(units_dir(config, base), "fallbacks", which);
65219
+ }
65220
+ function units_dir(config, base = base_dir(config)) {
65221
+ return path_exports.join(base, "units");
65222
+ }
65223
+ function base_dir(config) {
65224
+ return config.pluginDirectory("houdini-react");
65225
+ }
65226
+ function serialized_manifest_path(config, base = base_dir(config)) {
65227
+ return path_exports.join(base, "manifest.json");
65228
+ }
65229
+
65099
65230
  // src/lib/router/manifest.ts
65100
65231
  var t2 = __toESM(require_lib5(), 1);
65101
65232
  import * as graphql2 from "graphql";
@@ -67327,7 +67458,7 @@ function isSecondaryBuild() {
67327
67458
  async function buildLocalSchema(config) {
67328
67459
  const { build } = await import("vite");
67329
67460
  const schema = path2.join(config.localApiDir, "+schema");
67330
- const outDir = path2.join(config.rootDir, "temp");
67461
+ const outDir = conventions_exports.temp_dir(config, "schema");
67331
67462
  process.env.HOUDINI_SECONDARY_BUILD = "true";
67332
67463
  try {
67333
67464
  await fs_exports.remove(path2.join(outDir, "assets", "schema.js"));
@@ -67346,7 +67477,7 @@ async function buildLocalSchema(config) {
67346
67477
  schema
67347
67478
  },
67348
67479
  output: {
67349
- entryFileNames: "assets/[name].js"
67480
+ entryFileNames: "[name].js"
67350
67481
  }
67351
67482
  },
67352
67483
  ssr: true,
@@ -67364,7 +67495,10 @@ async function loadLocalSchema(config) {
67364
67495
  if (!isSecondaryBuild()) {
67365
67496
  await buildLocalSchema(config);
67366
67497
  }
67367
- const { default: schema } = await import(path2.join(config.rootDir, "temp", "assets", `schema.js?${Date.now().valueOf()}}`));
67498
+ const { default: schema } = await import(path2.join(
67499
+ conventions_exports.temp_dir(config, "schema"),
67500
+ `schema.js?${Date.now().valueOf()}}`
67501
+ ));
67368
67502
  return schema;
67369
67503
  }
67370
67504
 
@@ -67401,6 +67535,7 @@ var Config = class {
67401
67535
  schemaPollHeaders;
67402
67536
  pluginMode = false;
67403
67537
  plugins = [];
67538
+ adapter;
67404
67539
  componentFields = {};
67405
67540
  constructor({
67406
67541
  filepath,
@@ -78197,12 +78332,12 @@ async function packageJSON(targetPath, frameworkInfo) {
78197
78332
  }
78198
78333
  packageJSON2.devDependencies = {
78199
78334
  ...packageJSON2.devDependencies,
78200
- houdini: "^1.2.50"
78335
+ houdini: "^1.2.51"
78201
78336
  };
78202
78337
  if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
78203
78338
  packageJSON2.devDependencies = {
78204
78339
  ...packageJSON2.devDependencies,
78205
- "houdini-svelte": "^1.2.50"
78340
+ "houdini-svelte": "^1.2.51"
78206
78341
  };
78207
78342
  } else {
78208
78343
  throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
@@ -1,5 +1,6 @@
1
1
  import * as graphql from 'graphql';
2
2
  import type { CachePolicies, ConfigFile, PaginateModes } from '../runtime/lib';
3
+ import { type Adapter } from './router';
3
4
  import type { LogLevels, PluginConfig, PluginHooks, ValueMap } from './types';
4
5
  export type PluginMeta = PluginHooks & {
5
6
  name: string;
@@ -37,6 +38,7 @@ export declare class Config {
37
38
  schemaPollHeaders: ((env: any) => Record<string, string>) | Record<string, string | ((env: any) => string)>;
38
39
  pluginMode: boolean;
39
40
  plugins: PluginMeta[];
41
+ adapter?: Adapter;
40
42
  componentFields: Record<string, Record<string, {
41
43
  fragment: string;
42
44
  directive: graphql.DirectiveNode;
@@ -19,6 +19,7 @@ export declare function read_pageView(base: string): Promise<string[] | null[]>;
19
19
  export declare function read_layoutQuery(base: string): Promise<(string | null)[]>;
20
20
  /** Load the layout view for the given route from disk */
21
21
  export declare function read_layoutView(base: string): Promise<string[] | null[]>;
22
+ export declare function temp_dir(config: Config, key: string): string;
22
23
  export declare function router_index_path(config: Config): string;
23
24
  export declare function is_layout(path: string): boolean;
24
25
  /** Transforms paths to ids */
@@ -1,6 +1,6 @@
1
1
  import type { ProjectManifest, routerConventions } from '.';
2
2
  import type { Config } from '../config';
3
- export type Adapter = (args: {
3
+ export type Adapter = ((args: {
4
4
  config: Config;
5
5
  conventions: typeof routerConventions;
6
6
  sourceDir: string;
@@ -8,4 +8,14 @@ export type Adapter = (args: {
8
8
  outDir: string;
9
9
  manifest: ProjectManifest;
10
10
  adapterPath: string;
11
- }) => void | Promise<void>;
11
+ }) => void | Promise<void>) & {
12
+ includePaths?: Record<string, string>;
13
+ disableServer?: boolean;
14
+ pre?: (args: {
15
+ config: Config;
16
+ conventions: typeof routerConventions;
17
+ sourceDir: string;
18
+ publicBase: string;
19
+ outDir: string;
20
+ }) => Promise<void> | void;
21
+ };
@@ -63501,6 +63501,7 @@ __export(conventions_exports, {
63501
63501
  router_path: () => router_path,
63502
63502
  serialized_manifest_path: () => serialized_manifest_path,
63503
63503
  server_adapter_path: () => server_adapter_path,
63504
+ temp_dir: () => temp_dir,
63504
63505
  units_dir: () => units_dir,
63505
63506
  vite_render_path: () => vite_render_path
63506
63507
  });
@@ -63562,6 +63563,9 @@ async function read_layoutView(base) {
63562
63563
  }
63563
63564
  return [null, null];
63564
63565
  }
63566
+ function temp_dir(config, key) {
63567
+ return path_exports.join(config.rootDir, "temp", key);
63568
+ }
63565
63569
  function router_index_path(config) {
63566
63570
  return path_exports.join(config.routesDir, "..", "+index.jsx");
63567
63571
  }
@@ -67447,7 +67451,7 @@ function internalRoutes(config) {
67447
67451
  async function buildLocalSchema(config) {
67448
67452
  const { build } = await import("vite");
67449
67453
  const schema = import_node_path2.default.join(config.localApiDir, "+schema");
67450
- const outDir = import_node_path2.default.join(config.rootDir, "temp");
67454
+ const outDir = conventions_exports.temp_dir(config, "schema");
67451
67455
  process.env.HOUDINI_SECONDARY_BUILD = "true";
67452
67456
  try {
67453
67457
  await fs_exports.remove(import_node_path2.default.join(outDir, "assets", "schema.js"));
@@ -67466,7 +67470,7 @@ async function buildLocalSchema(config) {
67466
67470
  schema
67467
67471
  },
67468
67472
  output: {
67469
- entryFileNames: "assets/[name].js"
67473
+ entryFileNames: "[name].js"
67470
67474
  }
67471
67475
  },
67472
67476
  ssr: true,
@@ -67484,7 +67488,10 @@ async function loadLocalSchema(config) {
67484
67488
  if (!isSecondaryBuild()) {
67485
67489
  await buildLocalSchema(config);
67486
67490
  }
67487
- const { default: schema } = await import(import_node_path2.default.join(config.rootDir, "temp", "assets", `schema.js?${Date.now().valueOf()}}`));
67491
+ const { default: schema } = await import(import_node_path2.default.join(
67492
+ conventions_exports.temp_dir(config, "schema"),
67493
+ `schema.js?${Date.now().valueOf()}}`
67494
+ ));
67488
67495
  return schema;
67489
67496
  }
67490
67497
 
@@ -67784,6 +67791,7 @@ var Config = class {
67784
67791
  schemaPollHeaders;
67785
67792
  pluginMode = false;
67786
67793
  plugins = [];
67794
+ adapter;
67787
67795
  componentFields = {};
67788
67796
  constructor({
67789
67797
  filepath,
@@ -63417,6 +63417,7 @@ __export(conventions_exports, {
63417
63417
  router_path: () => router_path,
63418
63418
  serialized_manifest_path: () => serialized_manifest_path,
63419
63419
  server_adapter_path: () => server_adapter_path,
63420
+ temp_dir: () => temp_dir,
63420
63421
  units_dir: () => units_dir,
63421
63422
  vite_render_path: () => vite_render_path
63422
63423
  });
@@ -63478,6 +63479,9 @@ async function read_layoutView(base) {
63478
63479
  }
63479
63480
  return [null, null];
63480
63481
  }
63482
+ function temp_dir(config, key) {
63483
+ return path_exports.join(config.rootDir, "temp", key);
63484
+ }
63481
63485
  function router_index_path(config) {
63482
63486
  return path_exports.join(config.routesDir, "..", "+index.jsx");
63483
63487
  }
@@ -67363,7 +67367,7 @@ function internalRoutes(config) {
67363
67367
  async function buildLocalSchema(config) {
67364
67368
  const { build } = await import("vite");
67365
67369
  const schema = path2.join(config.localApiDir, "+schema");
67366
- const outDir = path2.join(config.rootDir, "temp");
67370
+ const outDir = conventions_exports.temp_dir(config, "schema");
67367
67371
  process.env.HOUDINI_SECONDARY_BUILD = "true";
67368
67372
  try {
67369
67373
  await fs_exports.remove(path2.join(outDir, "assets", "schema.js"));
@@ -67382,7 +67386,7 @@ async function buildLocalSchema(config) {
67382
67386
  schema
67383
67387
  },
67384
67388
  output: {
67385
- entryFileNames: "assets/[name].js"
67389
+ entryFileNames: "[name].js"
67386
67390
  }
67387
67391
  },
67388
67392
  ssr: true,
@@ -67400,7 +67404,10 @@ async function loadLocalSchema(config) {
67400
67404
  if (!isSecondaryBuild()) {
67401
67405
  await buildLocalSchema(config);
67402
67406
  }
67403
- const { default: schema } = await import(path2.join(config.rootDir, "temp", "assets", `schema.js?${Date.now().valueOf()}}`));
67407
+ const { default: schema } = await import(path2.join(
67408
+ conventions_exports.temp_dir(config, "schema"),
67409
+ `schema.js?${Date.now().valueOf()}}`
67410
+ ));
67404
67411
  return schema;
67405
67412
  }
67406
67413
 
@@ -67699,6 +67706,7 @@ var Config = class {
67699
67706
  schemaPollHeaders;
67700
67707
  pluginMode = false;
67701
67708
  plugins = [];
67709
+ adapter;
67702
67710
  componentFields = {};
67703
67711
  constructor({
67704
67712
  filepath,
@@ -56710,6 +56710,7 @@ var Config = class {
56710
56710
  schemaPollHeaders;
56711
56711
  pluginMode = false;
56712
56712
  plugins = [];
56713
+ adapter;
56713
56714
  componentFields = {};
56714
56715
  constructor({
56715
56716
  filepath,
@@ -56706,6 +56706,7 @@ var Config = class {
56706
56706
  schemaPollHeaders;
56707
56707
  pluginMode = false;
56708
56708
  plugins = [];
56709
+ adapter;
56709
56710
  componentFields = {};
56710
56711
  constructor({
56711
56712
  filepath,
@@ -66251,6 +66251,7 @@ __export(conventions_exports, {
66251
66251
  router_path: () => router_path,
66252
66252
  serialized_manifest_path: () => serialized_manifest_path,
66253
66253
  server_adapter_path: () => server_adapter_path,
66254
+ temp_dir: () => temp_dir,
66254
66255
  units_dir: () => units_dir,
66255
66256
  vite_render_path: () => vite_render_path
66256
66257
  });
@@ -66312,6 +66313,9 @@ async function read_layoutView(base) {
66312
66313
  }
66313
66314
  return [null, null];
66314
66315
  }
66316
+ function temp_dir(config2, key) {
66317
+ return path_exports.join(config2.rootDir, "temp", key);
66318
+ }
66315
66319
  function router_index_path(config2) {
66316
66320
  return path_exports.join(config2.routesDir, "..", "+index.jsx");
66317
66321
  }
@@ -68845,7 +68849,7 @@ function isSecondaryBuild() {
68845
68849
  async function buildLocalSchema(config2) {
68846
68850
  const { build } = await import("vite");
68847
68851
  const schema = import_node_path2.default.join(config2.localApiDir, "+schema");
68848
- const outDir = import_node_path2.default.join(config2.rootDir, "temp");
68852
+ const outDir = conventions_exports.temp_dir(config2, "schema");
68849
68853
  process.env.HOUDINI_SECONDARY_BUILD = "true";
68850
68854
  try {
68851
68855
  await fs_exports.remove(import_node_path2.default.join(outDir, "assets", "schema.js"));
@@ -68864,7 +68868,7 @@ async function buildLocalSchema(config2) {
68864
68868
  schema
68865
68869
  },
68866
68870
  output: {
68867
- entryFileNames: "assets/[name].js"
68871
+ entryFileNames: "[name].js"
68868
68872
  }
68869
68873
  },
68870
68874
  ssr: true,
@@ -68882,7 +68886,10 @@ async function loadLocalSchema(config2) {
68882
68886
  if (!isSecondaryBuild()) {
68883
68887
  await buildLocalSchema(config2);
68884
68888
  }
68885
- const { default: schema } = await import(import_node_path2.default.join(config2.rootDir, "temp", "assets", `schema.js?${Date.now().valueOf()}}`));
68889
+ const { default: schema } = await import(import_node_path2.default.join(
68890
+ conventions_exports.temp_dir(config2, "schema"),
68891
+ `schema.js?${Date.now().valueOf()}}`
68892
+ ));
68886
68893
  return schema;
68887
68894
  }
68888
68895
 
@@ -68920,6 +68927,7 @@ var Config = class {
68920
68927
  schemaPollHeaders;
68921
68928
  pluginMode = false;
68922
68929
  plugins = [];
68930
+ adapter;
68923
68931
  componentFields = {};
68924
68932
  constructor({
68925
68933
  filepath,
@@ -78708,6 +78716,7 @@ function Plugin(opts = {}) {
78708
78716
  enforce: "pre",
78709
78717
  async config(userConfig, env2) {
78710
78718
  config = await getConfig(opts);
78719
+ config.adapter = opts.adapter;
78711
78720
  viteEnv = env2;
78712
78721
  let result = {
78713
78722
  server: {
@@ -78770,8 +78779,10 @@ function Plugin(opts = {}) {
78770
78779
  }
78771
78780
  await fs_exports.mkdirp(config.routerBuildDirectory);
78772
78781
  const manifest = await load_manifest({ config, includeArtifacts: true });
78773
- await fs_exports.recursiveCopy(path_exports.join(sourceDir, "ssr"), path_exports.join(outDir, "ssr"));
78774
- await fs_exports.rmdir(path_exports.join(sourceDir, "ssr"));
78782
+ if (!config.adapter?.disableServer) {
78783
+ await fs_exports.recursiveCopy(path_exports.join(sourceDir, "ssr"), path_exports.join(outDir, "ssr"));
78784
+ await fs_exports.rmdir(path_exports.join(sourceDir, "ssr"));
78785
+ }
78775
78786
  await fs_exports.recursiveCopy(sourceDir, path_exports.join(outDir, "assets"));
78776
78787
  await opts.adapter({
78777
78788
  config,
@@ -78787,6 +78798,15 @@ function Plugin(opts = {}) {
78787
78798
  }
78788
78799
  },
78789
78800
  async buildStart(args) {
78801
+ if (config.adapter?.pre && viteEnv.command === "build" && !isSecondaryBuild()) {
78802
+ await config.adapter.pre({
78803
+ config,
78804
+ conventions: conventions_exports,
78805
+ sourceDir: viteConfig.build.outDir,
78806
+ publicBase: viteConfig.base,
78807
+ outDir: config.routerBuildDirectory
78808
+ });
78809
+ }
78790
78810
  for (const plugin2 of config.plugins) {
78791
78811
  if (typeof plugin2.vite?.buildStart !== "function") {
78792
78812
  continue;
@@ -79109,7 +79129,7 @@ function artifact_import({
79109
79129
  function vite_default(opts) {
79110
79130
  process.env.HOUDINI_PLUGIN = "true";
79111
79131
  const watchSchemaListref = { list: [] };
79112
- return isSecondaryBuild() ? [] : [
79132
+ return [
79113
79133
  Plugin(opts),
79114
79134
  watch_remote_schema(opts),
79115
79135
  watch_local_schema(watchSchemaListref),
@@ -66245,6 +66245,7 @@ __export(conventions_exports, {
66245
66245
  router_path: () => router_path,
66246
66246
  serialized_manifest_path: () => serialized_manifest_path,
66247
66247
  server_adapter_path: () => server_adapter_path,
66248
+ temp_dir: () => temp_dir,
66248
66249
  units_dir: () => units_dir,
66249
66250
  vite_render_path: () => vite_render_path
66250
66251
  });
@@ -66306,6 +66307,9 @@ async function read_layoutView(base) {
66306
66307
  }
66307
66308
  return [null, null];
66308
66309
  }
66310
+ function temp_dir(config2, key) {
66311
+ return path_exports.join(config2.rootDir, "temp", key);
66312
+ }
66309
66313
  function router_index_path(config2) {
66310
66314
  return path_exports.join(config2.routesDir, "..", "+index.jsx");
66311
66315
  }
@@ -68839,7 +68843,7 @@ function isSecondaryBuild() {
68839
68843
  async function buildLocalSchema(config2) {
68840
68844
  const { build } = await import("vite");
68841
68845
  const schema = path2.join(config2.localApiDir, "+schema");
68842
- const outDir = path2.join(config2.rootDir, "temp");
68846
+ const outDir = conventions_exports.temp_dir(config2, "schema");
68843
68847
  process.env.HOUDINI_SECONDARY_BUILD = "true";
68844
68848
  try {
68845
68849
  await fs_exports.remove(path2.join(outDir, "assets", "schema.js"));
@@ -68858,7 +68862,7 @@ async function buildLocalSchema(config2) {
68858
68862
  schema
68859
68863
  },
68860
68864
  output: {
68861
- entryFileNames: "assets/[name].js"
68865
+ entryFileNames: "[name].js"
68862
68866
  }
68863
68867
  },
68864
68868
  ssr: true,
@@ -68876,7 +68880,10 @@ async function loadLocalSchema(config2) {
68876
68880
  if (!isSecondaryBuild()) {
68877
68881
  await buildLocalSchema(config2);
68878
68882
  }
68879
- const { default: schema } = await import(path2.join(config2.rootDir, "temp", "assets", `schema.js?${Date.now().valueOf()}}`));
68883
+ const { default: schema } = await import(path2.join(
68884
+ conventions_exports.temp_dir(config2, "schema"),
68885
+ `schema.js?${Date.now().valueOf()}}`
68886
+ ));
68880
68887
  return schema;
68881
68888
  }
68882
68889
 
@@ -68913,6 +68920,7 @@ var Config = class {
68913
68920
  schemaPollHeaders;
68914
68921
  pluginMode = false;
68915
68922
  plugins = [];
68923
+ adapter;
68916
68924
  componentFields = {};
68917
68925
  constructor({
68918
68926
  filepath,
@@ -78701,6 +78709,7 @@ function Plugin(opts = {}) {
78701
78709
  enforce: "pre",
78702
78710
  async config(userConfig, env2) {
78703
78711
  config = await getConfig(opts);
78712
+ config.adapter = opts.adapter;
78704
78713
  viteEnv = env2;
78705
78714
  let result = {
78706
78715
  server: {
@@ -78763,8 +78772,10 @@ function Plugin(opts = {}) {
78763
78772
  }
78764
78773
  await fs_exports.mkdirp(config.routerBuildDirectory);
78765
78774
  const manifest = await load_manifest({ config, includeArtifacts: true });
78766
- await fs_exports.recursiveCopy(path_exports.join(sourceDir, "ssr"), path_exports.join(outDir, "ssr"));
78767
- await fs_exports.rmdir(path_exports.join(sourceDir, "ssr"));
78775
+ if (!config.adapter?.disableServer) {
78776
+ await fs_exports.recursiveCopy(path_exports.join(sourceDir, "ssr"), path_exports.join(outDir, "ssr"));
78777
+ await fs_exports.rmdir(path_exports.join(sourceDir, "ssr"));
78778
+ }
78768
78779
  await fs_exports.recursiveCopy(sourceDir, path_exports.join(outDir, "assets"));
78769
78780
  await opts.adapter({
78770
78781
  config,
@@ -78780,6 +78791,15 @@ function Plugin(opts = {}) {
78780
78791
  }
78781
78792
  },
78782
78793
  async buildStart(args) {
78794
+ if (config.adapter?.pre && viteEnv.command === "build" && !isSecondaryBuild()) {
78795
+ await config.adapter.pre({
78796
+ config,
78797
+ conventions: conventions_exports,
78798
+ sourceDir: viteConfig.build.outDir,
78799
+ publicBase: viteConfig.base,
78800
+ outDir: config.routerBuildDirectory
78801
+ });
78802
+ }
78783
78803
  for (const plugin2 of config.plugins) {
78784
78804
  if (typeof plugin2.vite?.buildStart !== "function") {
78785
78805
  continue;
@@ -79102,7 +79122,7 @@ function artifact_import({
79102
79122
  function vite_default(opts) {
79103
79123
  process.env.HOUDINI_PLUGIN = "true";
79104
79124
  const watchSchemaListref = { list: [] };
79105
- return isSecondaryBuild() ? [] : [
79125
+ return [
79106
79126
  Plugin(opts),
79107
79127
  watch_remote_schema(opts),
79108
79128
  watch_local_schema(watchSchemaListref),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini",
3
- "version": "1.2.50",
3
+ "version": "1.2.51",
4
4
  "description": "The disappearing GraphQL clients",
5
5
  "keywords": [
6
6
  "typescript",
@@ -26,7 +26,7 @@
26
26
  "prettier": "^2.8.3",
27
27
  "rollup": "^3.7.4",
28
28
  "vite": "^4.1.4",
29
- "vitest": "^0.28.3",
29
+ "vitest": "^1.6.0",
30
30
  "scripts": "^1.0.0"
31
31
  },
32
32
  "dependencies": {