houdini 2.0.0-go.18 → 2.0.0-go.19

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.
package/build/cmd/init.js CHANGED
@@ -433,12 +433,12 @@ async function packageJSON(targetPath, frameworkInfo) {
433
433
  }
434
434
  packageJSON2.devDependencies = {
435
435
  ...packageJSON2.devDependencies,
436
- houdini: "^2.0.0-go.18"
436
+ houdini: "^2.0.0-go.19"
437
437
  };
438
438
  if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
439
439
  packageJSON2.devDependencies = {
440
440
  ...packageJSON2.devDependencies,
441
- "houdini-svelte": "^3.0.0-go.19"
441
+ "houdini-svelte": "^3.0.0-go.20"
442
442
  };
443
443
  } else {
444
444
  throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
@@ -12,5 +12,5 @@ export declare function find_exported_fn(body: Statement[], name: string): {
12
12
  declaration: FunctionDeclaration | FunctionExpression | ArrowFunctionExpression | null | Identifier | CallExpression;
13
13
  export: ExportNamedDeclaration;
14
14
  } | null;
15
- export declare function find_exported_id(program: Program, name: string): recast.types.namedTypes.ExportNamedDeclaration | undefined;
15
+ export declare function find_exported_id(program: Program, name: string): recast.types.namedTypes.ExportNamedDeclaration;
16
16
  export {};
@@ -206,7 +206,7 @@ export declare class Config {
206
206
  });
207
207
  schema_path(): string;
208
208
  get localApiDir(): string;
209
- api_url(): Promise<string | undefined>;
209
+ api_url(): Promise<string>;
210
210
  get include(): Array<string>;
211
211
  includeFile(filepath: string, { root }?: {
212
212
  root?: string;
@@ -217,7 +217,7 @@ export declare class Config {
217
217
  root?: string;
218
218
  }): boolean;
219
219
  schema_pull_headers(): Promise<any>;
220
- process_env_values(env: Record<string, string | undefined>, value: string | ((env: any) => string)): string | undefined;
220
+ process_env_values(env: Record<string, string | undefined>, value: string | ((env: any) => string)): string;
221
221
  get artifact_dir(): string;
222
222
  get routes_dir(): string;
223
223
  artifactPath(document: graphql.DocumentNode): string;
package/build/lib/fs.d.ts CHANGED
@@ -23,7 +23,7 @@ type MockFilesystem = {
23
23
  export declare function mock(target: MockFilesystem[string], filepath?: string): Promise<void>;
24
24
  export declare function recursiveCopy(source: string, target: string, transforms?: Record<string, (content: string, filepath: string) => string | Promise<string>>, notRoot?: boolean): Promise<void>;
25
25
  export declare function snapshot(base?: string): {
26
- [k: string]: string | null;
26
+ [k: string]: string;
27
27
  };
28
28
  export declare function glob(pattern: string): Promise<string[]>;
29
29
  export declare namespace glob {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini",
3
- "version": "2.0.0-go.18",
3
+ "version": "2.0.0-go.19",
4
4
  "description": "The disappearing GraphQL clients",
5
5
  "keywords": [
6
6
  "typescript",
@@ -31,7 +31,7 @@
31
31
  "prettier": "^2.8.3",
32
32
  "rollup": "^4.28.1",
33
33
  "scripts": "workspace:^",
34
- "vite": "^7.0.0",
34
+ "vite": "^8.0.0",
35
35
  "vitest": "^1.6.0"
36
36
  },
37
37
  "dependencies": {
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "peerDependencies": {
65
65
  "graphql": ">=16",
66
- "vite": "^7.0.0"
66
+ "vite": "^8.0.0"
67
67
  },
68
68
  "files": [
69
69
  "adapter",
@@ -15,13 +15,13 @@ export declare function layout_unit_path(config: Config, id: string, base?: stri
15
15
  export declare function componentField_unit_path(config: Config, id: string, base?: string): string;
16
16
  export declare function fallback_unit_path(config: Config, which: 'page' | 'layout', id: string, base?: string): string;
17
17
  /** Load the page query for the given route from disk */
18
- export declare function read_pageQuery(base: string): Promise<(string | null)[]>;
18
+ export declare function read_pageQuery(base: string): Promise<string[]>;
19
19
  /** Load the page view for the given route from disk */
20
- export declare function read_pageView(base: string): Promise<string[] | null[]>;
20
+ export declare function read_pageView(base: string): Promise<string[]>;
21
21
  /** Load the layout query for the given route from disk */
22
- export declare function read_layoutQuery(base: string): Promise<(string | null)[]>;
22
+ export declare function read_layoutQuery(base: string): Promise<string[]>;
23
23
  /** Load the layout view for the given route from disk */
24
- export declare function read_layoutView(base: string): Promise<string[] | null[]>;
24
+ export declare function read_layoutView(base: string): Promise<string[]>;
25
25
  export declare function houdini_root(config: Config): string;
26
26
  export declare function temp_dir(config: Config, key: string): string;
27
27
  export declare function routes_dir(config: Config): string;
@@ -27,7 +27,7 @@ export declare function parse_page_pattern(id: string): {
27
27
  * and will be returned as `['']`.
28
28
  */
29
29
  export declare function get_route_segments(route: string): string[];
30
- export declare function exec(match: RegExpMatchArray, params: RouteParam[]): Record<string, string> | undefined;
30
+ export declare function exec(match: RegExpMatchArray, params: RouteParam[]): Record<string, string>;
31
31
  export declare function parseScalar(config: ConfigFile, type: string, value?: string): string | number | boolean | undefined;
32
32
  export {};
33
33
  /**
@@ -1,8 +1,7 @@
1
1
  import { createServerAdapter } from '@whatwg-node/server';
2
2
  import type { ServerAdapterRequestHandler } from '@whatwg-node/server';
3
3
  import type { GraphQLSchema } from 'graphql';
4
- import { YogaServer } from 'graphql-yoga';
5
- import type { YogaSchemaDefinition } from 'graphql-yoga/typings/plugins/use-schema';
4
+ import { YogaServer, type YogaServerOptions as YogaConfig } from 'graphql-yoga';
6
5
  import type { ConfigFile } from '../lib/config.js';
7
6
  import type { HoudiniClient } from '../runtime/client.js';
8
7
  import type { RouterManifest, RouterPageManifest, YogaServerOptions } from './types';
@@ -27,6 +26,7 @@ export declare function _serverHandler<ComponentType = unknown>({ schema, server
27
26
  export declare const serverAdapterFactory: (args: Parameters<typeof _serverHandler>[0]) => ReturnType<typeof createServerAdapter>;
28
27
  export type ServerAdapterFactory = typeof serverAdapterFactory;
29
28
  type YogaParams = Required<ConstructorParameters<typeof YogaServer>>[0];
29
+ type YogaSchemaDefinition<TContext> = NonNullable<YogaConfig<any, TContext>['schema']>;
30
30
  type ConstructorParams = Omit<YogaParams, 'schema' | 'graphqlEndpoint'>;
31
31
  export declare class Server<ServerContext extends Record<string, any>, UserContext extends Record<string, any>> {
32
32
  opts: ConstructorParams | null;
@@ -1,5 +1,7 @@
1
1
  import { createServerAdapter } from "@whatwg-node/server";
2
- import { YogaServer } from "graphql-yoga";
2
+ import {
3
+ YogaServer
4
+ } from "graphql-yoga";
3
5
  import { serialize as encodeCookie } from "./cookies";
4
6
  import { find_match } from "./match";
5
7
  import { get_session, handle_request, session_cookie_name } from "./session";
@@ -29,7 +29,7 @@ export declare class Cache {
29
29
  forceStale?: boolean;
30
30
  }): SubscriptionSpec[];
31
31
  read(...args: Parameters<CacheInternal['getSelection']>): {
32
- data: GraphQLObject | null;
32
+ data: GraphQLObject;
33
33
  partial: boolean;
34
34
  stale: boolean;
35
35
  };
@@ -48,7 +48,7 @@ export declare class Cache {
48
48
  field?: string;
49
49
  when?: {};
50
50
  }): void;
51
- getFieldTime(id: string, field: string): number | null | undefined;
51
+ getFieldTime(id: string, field: string): number;
52
52
  config(): ConfigFile;
53
53
  serialize(): string;
54
54
  hydrate(...args: Parameters<InMemoryStorage['hydrate']>): void;
@@ -377,7 +377,7 @@ class CacheInternal {
377
377
  });
378
378
  }
379
379
  } else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
380
- let oldIDs = [...previousValue || []];
380
+ let oldIDs = [...Array.isArray(previousValue) ? previousValue : []];
381
381
  if (updates?.includes("append") || updates?.includes("prepend")) {
382
382
  oldIDs = oldIDs.filter((id) => {
383
383
  for (const layer2 of this.storage.data) {
@@ -7,8 +7,8 @@ export declare class ListManager {
7
7
  constructor(cache: Cache, rootID: string);
8
8
  lists: Map<string, Map<string, ListCollection>>;
9
9
  private listsByField;
10
- get(listName: string, id?: string, allLists?: boolean, skipMatches?: Set<string>): ListCollection | null;
11
- getLists(listName: string, id?: string, allLists?: boolean): ListCollection | null | undefined;
10
+ get(listName: string, id?: string, allLists?: boolean, skipMatches?: Set<string>): ListCollection;
11
+ getLists(listName: string, id?: string, allLists?: boolean): ListCollection;
12
12
  remove(listName: string, id: string): void;
13
13
  add(list: {
14
14
  name: string;
@@ -56,9 +56,9 @@ export declare class List {
56
56
  variables?: {};
57
57
  layer?: Layer;
58
58
  }): void;
59
- addToList(selection: SubscriptionSelection, data: {}, variables: {} | undefined, where: 'first' | 'last', layer?: Layer): void;
60
- removeID(id: string, variables?: {}, layer?: Layer): true | undefined;
61
- remove(data: {}, variables?: {}, layer?: Layer): true | undefined;
59
+ addToList(selection: SubscriptionSelection, data: {}, variables: {}, where: 'first' | 'last', layer?: Layer): void;
60
+ removeID(id: string, variables?: {}, layer?: Layer): boolean;
61
+ remove(data: {}, variables?: {}, layer?: Layer): boolean;
62
62
  listType(data: {
63
63
  __typename?: string;
64
64
  }): string;
@@ -1,5 +1,5 @@
1
1
  import type { ConfigFile } from 'houdini';
2
- export declare function getMockConfig(): ConfigFile | null;
2
+ export declare function getMockConfig(): ConfigFile;
3
3
  export declare function setMockConfig(config: ConfigFile | null): void;
4
4
  export declare function defaultConfigValues(file: ConfigFile): ConfigFile;
5
5
  export declare function keyFieldsForType(configFile: ConfigFile, type: string): string[];
@@ -24,16 +24,22 @@ function houdini(ctx) {
24
24
  ctx.config.root_dir,
25
25
  ctx.config.config_file.runtimeDir ?? ".houdini"
26
26
  );
27
+ const houdiniAliases = {
28
+ $houdini: runtimeDir,
29
+ "$houdini/*": path.join(runtimeDir, "*"),
30
+ "~": path.join(ctx.config.root_dir, "src"),
31
+ "~/*": path.join(ctx.config.root_dir, "src", "*")
32
+ };
27
33
  return {
28
34
  resolve: {
29
35
  ...userConfig.resolve,
30
- alias: {
31
- ...userConfig.resolve?.alias,
32
- $houdini: runtimeDir,
33
- "$houdini/*": path.join(runtimeDir, "*"),
34
- "~": path.join(ctx.config.root_dir, "src"),
35
- "~/*": path.join(ctx.config.root_dir, "src", "*")
36
- }
36
+ alias: Array.isArray(userConfig.resolve?.alias) ? [
37
+ ...userConfig.resolve.alias,
38
+ ...Object.entries(houdiniAliases).map(([find, replacement]) => ({
39
+ find,
40
+ replacement
41
+ }))
42
+ ] : { ...userConfig.resolve?.alias, ...houdiniAliases }
37
43
  },
38
44
  server: {
39
45
  ...userConfig.server,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini",
3
- "version": "2.0.0-go.18",
3
+ "version": "2.0.0-go.19",
4
4
  "description": "The disappearing GraphQL clients",
5
5
  "keywords": [
6
6
  "typescript",
@@ -25,7 +25,7 @@
25
25
  "@types/ws": "^8.18.1",
26
26
  "prettier": "^2.8.3",
27
27
  "rollup": "^4.28.1",
28
- "vite": "^7.0.0",
28
+ "vite": "^8.0.0",
29
29
  "vitest": "^1.6.0",
30
30
  "scripts": "^2.0.0-go.2"
31
31
  },
@@ -54,11 +54,11 @@
54
54
  "npx-import": "^1.1.3",
55
55
  "recast": "^0.23.1",
56
56
  "ws": "^8.18.0",
57
- "houdini-core": "^2.0.0-go.12"
57
+ "houdini-core": "^2.0.0-go.13"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "graphql": ">=16",
61
- "vite": "^7.0.0"
61
+ "vite": "^8.0.0"
62
62
  },
63
63
  "files": [
64
64
  "build"