houdini 1.0.0-next.8 → 1.0.0
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/README.md +4 -1
- package/build/cmd-cjs/index.js +2325 -121
- package/build/cmd-esm/index.js +2325 -121
- package/build/codegen/generators/runtime/runtimeConfig.d.ts +7 -0
- package/build/codegen/generators/typescript/typeReference.d.ts +4 -2
- package/build/codegen/generators/typescript/types.d.ts +0 -1
- package/build/codegen/utils/flattenSelections.d.ts +1 -1
- package/build/codegen-cjs/index.js +2919 -689
- package/build/codegen-esm/index.js +2919 -689
- package/build/lib/config.d.ts +4 -6
- package/build/lib/types.d.ts +18 -15
- package/build/lib-cjs/index.js +3159 -171
- package/build/lib-esm/index.js +3152 -171
- package/build/runtime/cache/storage.d.ts +18 -15
- package/build/runtime/client/documentStore.d.ts +15 -13
- package/build/runtime/client/index.d.ts +1 -1
- package/build/runtime/client/plugins/cache.d.ts +1 -1
- package/build/runtime/client/plugins/fetch.d.ts +1 -1
- package/build/runtime/client/plugins/fetchParams.d.ts +1 -1
- package/build/runtime/client/plugins/mutation.d.ts +1 -1
- package/build/runtime/client/plugins/query.d.ts +1 -1
- package/build/runtime/client/plugins/subscription.d.ts +1 -1
- package/build/runtime/client/plugins/throwOnError.d.ts +1 -1
- package/build/runtime/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime/imports/pluginConfig.d.ts +3 -0
- package/build/runtime/lib/config.d.ts +2 -2
- package/build/runtime/lib/scalars.d.ts +1 -1
- package/build/runtime/lib/types.d.ts +42 -42
- package/build/runtime-cjs/cache/storage.d.ts +18 -15
- package/build/runtime-cjs/cache/storage.js +9 -11
- package/build/runtime-cjs/client/documentStore.d.ts +15 -13
- package/build/runtime-cjs/client/documentStore.js +11 -8
- package/build/runtime-cjs/client/index.d.ts +1 -1
- package/build/runtime-cjs/client/index.js +16 -13
- package/build/runtime-cjs/client/plugins/cache.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/cache.js +6 -6
- package/build/runtime-cjs/client/plugins/fetch.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/fetch.js +9 -9
- package/build/runtime-cjs/client/plugins/fetchParams.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/fetchParams.js +3 -3
- package/build/runtime-cjs/client/plugins/mutation.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/mutation.js +3 -3
- package/build/runtime-cjs/client/plugins/query.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/query.js +4 -4
- package/build/runtime-cjs/client/plugins/subscription.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/subscription.js +5 -5
- package/build/runtime-cjs/client/plugins/throwOnError.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/throwOnError.js +3 -3
- package/build/runtime-cjs/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime-cjs/imports/pluginConfig.d.ts +3 -0
- package/build/runtime-cjs/imports/pluginConfig.js +27 -0
- package/build/runtime-cjs/lib/config.d.ts +2 -2
- package/build/runtime-cjs/lib/config.js +11 -1
- package/build/runtime-cjs/lib/scalars.d.ts +1 -1
- package/build/runtime-cjs/lib/scalars.js +13 -2
- package/build/runtime-cjs/lib/types.d.ts +42 -42
- package/build/runtime-cjs/lib/types.js +26 -30
- package/build/runtime-esm/cache/storage.d.ts +18 -15
- package/build/runtime-esm/cache/storage.js +9 -11
- package/build/runtime-esm/client/documentStore.d.ts +15 -13
- package/build/runtime-esm/client/documentStore.js +12 -9
- package/build/runtime-esm/client/index.d.ts +1 -1
- package/build/runtime-esm/client/index.js +13 -10
- package/build/runtime-esm/client/plugins/cache.d.ts +1 -1
- package/build/runtime-esm/client/plugins/cache.js +5 -5
- package/build/runtime-esm/client/plugins/fetch.d.ts +1 -1
- package/build/runtime-esm/client/plugins/fetch.js +8 -8
- package/build/runtime-esm/client/plugins/fetchParams.d.ts +1 -1
- package/build/runtime-esm/client/plugins/fetchParams.js +2 -2
- package/build/runtime-esm/client/plugins/mutation.d.ts +1 -1
- package/build/runtime-esm/client/plugins/mutation.js +2 -2
- package/build/runtime-esm/client/plugins/query.d.ts +1 -1
- package/build/runtime-esm/client/plugins/query.js +3 -3
- package/build/runtime-esm/client/plugins/subscription.d.ts +1 -1
- package/build/runtime-esm/client/plugins/subscription.js +4 -4
- package/build/runtime-esm/client/plugins/throwOnError.d.ts +1 -1
- package/build/runtime-esm/client/plugins/throwOnError.js +2 -2
- package/build/runtime-esm/client/utils/documentPlugins.d.ts +2 -2
- package/build/runtime-esm/imports/pluginConfig.d.ts +3 -0
- package/build/runtime-esm/imports/pluginConfig.js +5 -0
- package/build/runtime-esm/lib/config.d.ts +2 -2
- package/build/runtime-esm/lib/config.js +11 -1
- package/build/runtime-esm/lib/scalars.d.ts +1 -1
- package/build/runtime-esm/lib/scalars.js +13 -2
- package/build/runtime-esm/lib/types.d.ts +42 -42
- package/build/runtime-esm/lib/types.js +26 -30
- package/build/test-cjs/index.js +2302 -98
- package/build/test-esm/index.js +2302 -98
- package/build/vite/houdini.d.ts +2 -0
- package/build/vite-cjs/index.js +2328 -122
- package/build/vite-esm/index.js +2328 -122
- package/package.json +2 -2
package/build/lib/config.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as graphql from 'graphql';
|
|
2
|
-
import type { ConfigFile } from '../runtime/lib';
|
|
3
|
-
import {
|
|
4
|
-
import type { PluginConfig, PluginHooks } from './types';
|
|
5
|
-
import { LogLevel } from './types';
|
|
2
|
+
import type { CachePolicies, ConfigFile } from '../runtime/lib';
|
|
3
|
+
import type { LogLevels, PluginConfig, PluginHooks } from './types';
|
|
6
4
|
export type PluginMeta = PluginHooks & {
|
|
7
5
|
name: string;
|
|
8
6
|
filepath: string;
|
|
@@ -19,7 +17,7 @@ export declare class Config {
|
|
|
19
17
|
scalars?: ConfigFile['scalars'];
|
|
20
18
|
module: 'commonjs' | 'esm';
|
|
21
19
|
cacheBufferSize?: number;
|
|
22
|
-
defaultCachePolicy:
|
|
20
|
+
defaultCachePolicy: CachePolicies;
|
|
23
21
|
defaultPartial: boolean;
|
|
24
22
|
internalListPosition: 'first' | 'last';
|
|
25
23
|
defaultListTarget: 'all' | null;
|
|
@@ -28,7 +26,7 @@ export declare class Config {
|
|
|
28
26
|
defaultKeys: string[];
|
|
29
27
|
typeConfig: ConfigFile['types'];
|
|
30
28
|
configFile: ConfigFile;
|
|
31
|
-
logLevel:
|
|
29
|
+
logLevel: LogLevels;
|
|
32
30
|
defaultFragmentMasking: 'enable' | 'disable';
|
|
33
31
|
configIsRoute: ((filepath: string) => boolean) | null;
|
|
34
32
|
routesDir: string;
|
package/build/lib/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type graphql from 'graphql';
|
|
2
2
|
import type * as recast from 'recast';
|
|
3
|
-
import type { CustomPluginOptions, LoadResult, ObjectHook, PluginContext, ResolveIdResult } from 'rollup';
|
|
3
|
+
import type { CustomPluginOptions, LoadResult, ObjectHook, PluginContext, ResolveIdResult, SourceMapInput } from 'rollup';
|
|
4
4
|
import type { ConfigFile } from '../runtime/lib/config';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ArtifactKinds, BaseCompiledDocument, DocumentArtifact, ValueOf } from '../runtime/lib/types';
|
|
6
6
|
import type { TransformPage } from '../vite/houdini';
|
|
7
7
|
import type { Config } from './config';
|
|
8
8
|
type Program = recast.types.namedTypes.Program;
|
|
@@ -25,7 +25,7 @@ export type Document = {
|
|
|
25
25
|
/**
|
|
26
26
|
* A field you can use to distinguish documents by type (query, mutation, subscription, fragment)
|
|
27
27
|
*/
|
|
28
|
-
kind:
|
|
28
|
+
kind: ArtifactKinds;
|
|
29
29
|
/**
|
|
30
30
|
* The artifact generated for the document. This will only have a value in the last phase
|
|
31
31
|
* of the Generation Pipeline.
|
|
@@ -60,14 +60,15 @@ export type Document = {
|
|
|
60
60
|
/**
|
|
61
61
|
* Refetch logic that has been built up throughout the pipeline
|
|
62
62
|
*/
|
|
63
|
-
refetch?: BaseCompiledDocument['refetch'];
|
|
63
|
+
refetch?: BaseCompiledDocument<'HoudiniQuery'>['refetch'];
|
|
64
64
|
};
|
|
65
|
-
export declare
|
|
66
|
-
Full
|
|
67
|
-
Summary
|
|
68
|
-
ShortSummary
|
|
69
|
-
Quiet
|
|
70
|
-
}
|
|
65
|
+
export declare const LogLevel: {
|
|
66
|
+
readonly Full: "full";
|
|
67
|
+
readonly Summary: "summary";
|
|
68
|
+
readonly ShortSummary: "short-summary";
|
|
69
|
+
readonly Quiet: "quiet";
|
|
70
|
+
};
|
|
71
|
+
export type LogLevels = ValueOf<typeof LogLevel>;
|
|
71
72
|
export type Plugin = (args?: PluginConfig) => Promise<(PluginHooks | PluginInit) | (PluginHooks | PluginInit)[] | null | false>;
|
|
72
73
|
export type PluginInit = {
|
|
73
74
|
__plugin_init__: boolean;
|
|
@@ -104,10 +105,9 @@ export type PluginHooks = {
|
|
|
104
105
|
content: string;
|
|
105
106
|
}) => string>;
|
|
106
107
|
/**
|
|
107
|
-
*
|
|
108
|
-
* that you return will be deeply merged with the previous value.
|
|
108
|
+
* An module with an default export that sets configuration values.
|
|
109
109
|
*/
|
|
110
|
-
config?:
|
|
110
|
+
config?: string;
|
|
111
111
|
/**
|
|
112
112
|
*
|
|
113
113
|
* Add environment variables to houdini's pipeline (ie, for schema polling headers, url, etc.)
|
|
@@ -186,7 +186,7 @@ export type PluginHooks = {
|
|
|
186
186
|
artifactData?: (args: {
|
|
187
187
|
config: Config;
|
|
188
188
|
document: Document;
|
|
189
|
-
}) => Record<string, any
|
|
189
|
+
}) => Record<string, any> | void;
|
|
190
190
|
/**
|
|
191
191
|
* A hook to customize the hash generated for your document.
|
|
192
192
|
*/
|
|
@@ -196,7 +196,7 @@ export type PluginHooks = {
|
|
|
196
196
|
}) => string;
|
|
197
197
|
/**
|
|
198
198
|
* A hook to customize the return type of the graphql function. If you need to add an import to the file
|
|
199
|
-
* in order to resolve the import, you can use the `
|
|
199
|
+
* in order to resolve the import, you can use the `ensureImport` utility.
|
|
200
200
|
*/
|
|
201
201
|
graphqlTagReturn?: (args: {
|
|
202
202
|
config: Config;
|
|
@@ -231,8 +231,10 @@ export type PluginHooks = {
|
|
|
231
231
|
*/
|
|
232
232
|
transformFile?: (page: TransformPage) => Promise<{
|
|
233
233
|
code: string;
|
|
234
|
+
map?: SourceMapInput | string;
|
|
234
235
|
}> | {
|
|
235
236
|
code: string;
|
|
237
|
+
map?: SourceMapInput | string;
|
|
236
238
|
};
|
|
237
239
|
vite?: {
|
|
238
240
|
resolveId?: ObjectHook<(this: PluginContext, source: string, importer: string | undefined, options: {
|
|
@@ -272,3 +274,4 @@ export type PluginConfig = {
|
|
|
272
274
|
} & Partial<ConfigFile>;
|
|
273
275
|
export * from '../runtime/lib/types';
|
|
274
276
|
export * from '../runtime/lib/config';
|
|
277
|
+
export * from '../runtime/client';
|