houdini 2.0.0-go.16 → 2.0.0-go.18
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 +19 -6
- package/build/lib/config.d.ts +6 -0
- package/build/lib/parse.js +17 -13
- package/build/package.json +12 -12
- package/build/runtime/types.d.ts +4 -0
- package/build/vite/schema.js +2 -1
- package/package.json +14 -14
package/build/cmd/init.js
CHANGED
|
@@ -177,7 +177,10 @@ async function init(_path, args) {
|
|
|
177
177
|
} else if (frameworkInfo.framework === "kit") {
|
|
178
178
|
await svelteConfig(targetPath, typescript);
|
|
179
179
|
}
|
|
180
|
-
await gitIgnore(
|
|
180
|
+
await gitIgnore({
|
|
181
|
+
targetPath,
|
|
182
|
+
schemaPath: is_remote_endpoint ? schemaPath : void 0
|
|
183
|
+
});
|
|
181
184
|
await graphqlRC(targetPath);
|
|
182
185
|
await viteConfig(targetPath, frameworkInfo, typescript);
|
|
183
186
|
await tjsConfig(targetPath, frameworkInfo);
|
|
@@ -264,7 +267,7 @@ export default new HoudiniClient({
|
|
|
264
267
|
// fetchParams({ session }) {
|
|
265
268
|
// return {
|
|
266
269
|
// headers: {
|
|
267
|
-
//
|
|
270
|
+
// Authorization: \`Bearer \${session.token}\`,
|
|
268
271
|
// }
|
|
269
272
|
// }
|
|
270
273
|
// }
|
|
@@ -323,11 +326,21 @@ export default config;
|
|
|
323
326
|
`;
|
|
324
327
|
await fs.writeFile(svelteConfigPath, typescript ? newContentTs : newContentJs);
|
|
325
328
|
}
|
|
326
|
-
async function gitIgnore(targetPath) {
|
|
329
|
+
async function gitIgnore({ targetPath, schemaPath }) {
|
|
327
330
|
const filepath = path.join(targetPath, ".gitignore");
|
|
328
331
|
const existing = await fs.readFile(filepath) || "";
|
|
332
|
+
let newIgnores = "";
|
|
329
333
|
if (!existing.includes("\n.houdini\n")) {
|
|
330
|
-
|
|
334
|
+
newIgnores += ".houdini\n";
|
|
335
|
+
}
|
|
336
|
+
if (schemaPath && !existing.includes(`
|
|
337
|
+
${schemaPath}
|
|
338
|
+
`)) {
|
|
339
|
+
newIgnores += `${schemaPath}
|
|
340
|
+
`;
|
|
341
|
+
}
|
|
342
|
+
if (newIgnores) {
|
|
343
|
+
await fs.writeFile(filepath, existing + "\n" + newIgnores);
|
|
331
344
|
}
|
|
332
345
|
}
|
|
333
346
|
async function graphqlRC(targetPath) {
|
|
@@ -420,12 +433,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
420
433
|
}
|
|
421
434
|
packageJSON2.devDependencies = {
|
|
422
435
|
...packageJSON2.devDependencies,
|
|
423
|
-
houdini: "^2.0.0-go.
|
|
436
|
+
houdini: "^2.0.0-go.18"
|
|
424
437
|
};
|
|
425
438
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
426
439
|
packageJSON2.devDependencies = {
|
|
427
440
|
...packageJSON2.devDependencies,
|
|
428
|
-
"houdini-svelte": "^
|
|
441
|
+
"houdini-svelte": "^3.0.0-go.19"
|
|
429
442
|
};
|
|
430
443
|
} else {
|
|
431
444
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|
package/build/lib/config.d.ts
CHANGED
|
@@ -174,6 +174,12 @@ export type WatchSchemaConfig = {
|
|
|
174
174
|
* logic you need
|
|
175
175
|
*/
|
|
176
176
|
headers?: Record<string, string | ((env: Record<string, string | undefined>) => string)> | ((env: Record<string, string | undefined>) => Record<string, string>);
|
|
177
|
+
/**
|
|
178
|
+
* When set to false, the pulled schema will not be written to disk.
|
|
179
|
+
* Useful when schemaPath is a glob pointing to multiple files.
|
|
180
|
+
* Defaults to true.
|
|
181
|
+
*/
|
|
182
|
+
writePolledSchema?: boolean;
|
|
177
183
|
};
|
|
178
184
|
export type ScalarSpec = {
|
|
179
185
|
type: string;
|
package/build/lib/parse.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { parse as parseJavascript } from "@babel/parser";
|
|
2
|
-
import { print, prettyPrint } from "recast";
|
|
2
|
+
import { parse as recastParse, print, prettyPrint } from "recast";
|
|
3
3
|
import { deepMerge } from "./deepMerge.js";
|
|
4
|
+
const defaultBabelConfig = {
|
|
5
|
+
plugins: ["typescript", "importAssertions", "decorators-legacy", "explicitResourceManagement"],
|
|
6
|
+
sourceType: "module"
|
|
7
|
+
};
|
|
4
8
|
function parseJS(str, config) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
],
|
|
12
|
-
sourceType: "module"
|
|
13
|
-
};
|
|
14
|
-
return parseJavascript(str || "", config ? deepMerge("", defaultConfig, config) : defaultConfig).program;
|
|
9
|
+
const mergedConfig = config ? deepMerge("", defaultBabelConfig, config) : defaultBabelConfig;
|
|
10
|
+
return recastParse(str || "", {
|
|
11
|
+
parser: {
|
|
12
|
+
parse: (src) => parseJavascript(src, { ...mergedConfig, tokens: true })
|
|
13
|
+
}
|
|
14
|
+
}).program;
|
|
15
15
|
}
|
|
16
16
|
async function printJS(script, options) {
|
|
17
|
+
const defaultOptions = { tabWidth: 4 };
|
|
17
18
|
if (options?.pretty) {
|
|
18
|
-
return prettyPrint(
|
|
19
|
+
return prettyPrint(
|
|
20
|
+
script,
|
|
21
|
+
options ? deepMerge("", defaultOptions, options) : defaultOptions
|
|
22
|
+
);
|
|
19
23
|
} else {
|
|
20
|
-
return print(script, options);
|
|
24
|
+
return print(script, options ? deepMerge("", defaultOptions, options) : defaultOptions);
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
export {
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini",
|
|
3
|
-
"version": "2.0.0-go.
|
|
3
|
+
"version": "2.0.0-go.18",
|
|
4
4
|
"description": "The disappearing GraphQL clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"estree-walker": "^3.0.1",
|
|
52
52
|
"fs-extra": "^10.1.0",
|
|
53
53
|
"glob": "^11.0.1",
|
|
54
|
-
"graphql": "^15.8.0",
|
|
55
54
|
"graphql-yoga": "^4.0.4",
|
|
56
55
|
"memfs": "^3.4.7",
|
|
57
56
|
"kleur": "^4.1.5",
|
|
@@ -63,6 +62,7 @@
|
|
|
63
62
|
"ws": "^8.18.0"
|
|
64
63
|
},
|
|
65
64
|
"peerDependencies": {
|
|
65
|
+
"graphql": ">=16",
|
|
66
66
|
"vite": "^7.0.0"
|
|
67
67
|
},
|
|
68
68
|
"files": [
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"import": "./adapter/index.js"
|
|
91
91
|
},
|
|
92
92
|
"./adapter/*": {
|
|
93
|
-
"types": "./adapter
|
|
94
|
-
"import": "./adapter
|
|
93
|
+
"types": "./adapter/*.d.ts",
|
|
94
|
+
"import": "./adapter/*.js"
|
|
95
95
|
},
|
|
96
96
|
"./cmd": {
|
|
97
97
|
"types": "./cmd/index.d.ts",
|
|
@@ -118,16 +118,16 @@
|
|
|
118
118
|
"import": "./router/index.js"
|
|
119
119
|
},
|
|
120
120
|
"./router/*": {
|
|
121
|
-
"types": "./router
|
|
122
|
-
"import": "./router
|
|
121
|
+
"types": "./router/*.d.ts",
|
|
122
|
+
"import": "./router/*.js"
|
|
123
123
|
},
|
|
124
124
|
"./runtime": {
|
|
125
125
|
"types": "./runtime/index.d.ts",
|
|
126
126
|
"import": "./runtime/index.js"
|
|
127
127
|
},
|
|
128
128
|
"./runtime/*": {
|
|
129
|
-
"types": "./runtime
|
|
130
|
-
"import": "./runtime
|
|
129
|
+
"types": "./runtime/*.d.ts",
|
|
130
|
+
"import": "./runtime/*.js"
|
|
131
131
|
},
|
|
132
132
|
"./runtime/cache": {
|
|
133
133
|
"types": "./runtime/cache/index.d.ts",
|
|
@@ -150,16 +150,16 @@
|
|
|
150
150
|
"import": "./test/index.js"
|
|
151
151
|
},
|
|
152
152
|
"./test/*": {
|
|
153
|
-
"types": "./test
|
|
154
|
-
"import": "./test
|
|
153
|
+
"types": "./test/*.d.ts",
|
|
154
|
+
"import": "./test/*.js"
|
|
155
155
|
},
|
|
156
156
|
"./vite": {
|
|
157
157
|
"types": "./vite/index.d.ts",
|
|
158
158
|
"import": "./vite/index.js"
|
|
159
159
|
},
|
|
160
160
|
"./vite/*": {
|
|
161
|
-
"types": "./vite
|
|
162
|
-
"import": "./vite
|
|
161
|
+
"types": "./vite/*.d.ts",
|
|
162
|
+
"import": "./vite/*.js"
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
165
|
"typesVersions": {
|
package/build/runtime/types.d.ts
CHANGED
|
@@ -270,6 +270,10 @@ export type FetchParams<_Input> = {
|
|
|
270
270
|
* You can do what you want with it!
|
|
271
271
|
*/
|
|
272
272
|
metadata?: App.Metadata;
|
|
273
|
+
/**
|
|
274
|
+
* An abort controller to abort the operation
|
|
275
|
+
*/
|
|
276
|
+
abortController?: AbortController;
|
|
273
277
|
};
|
|
274
278
|
export type FetchFn<_Data extends GraphQLObject, _Input = any> = (params?: FetchParams<_Input>) => Promise<QueryResult<_Data, _Input>>;
|
|
275
279
|
export type CursorHandlers<_Data extends GraphQLObject, _Input> = {
|
package/build/vite/schema.js
CHANGED
|
@@ -66,7 +66,8 @@ function poll_remote_schema(ctx) {
|
|
|
66
66
|
api_url,
|
|
67
67
|
config.config_file.watchSchema?.timeout ?? 3e4,
|
|
68
68
|
config.schema_path(),
|
|
69
|
-
await config.schema_pull_headers()
|
|
69
|
+
await config.schema_pull_headers(),
|
|
70
|
+
!(config.config_file.watchSchema?.writePolledSchema ?? true)
|
|
70
71
|
);
|
|
71
72
|
error_count = 0;
|
|
72
73
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini",
|
|
3
|
-
"version": "2.0.0-go.
|
|
3
|
+
"version": "2.0.0-go.18",
|
|
4
4
|
"description": "The disappearing GraphQL clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"rollup": "^4.28.1",
|
|
28
28
|
"vite": "^7.0.0",
|
|
29
29
|
"vitest": "^1.6.0",
|
|
30
|
-
"scripts": "^2.0.0-go.
|
|
30
|
+
"scripts": "^2.0.0-go.2"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/parser": "^7.24.6",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"estree-walker": "^3.0.1",
|
|
46
46
|
"fs-extra": "^10.1.0",
|
|
47
47
|
"glob": "^11.0.1",
|
|
48
|
-
"graphql": "^15.8.0",
|
|
49
48
|
"graphql-yoga": "^4.0.4",
|
|
50
49
|
"memfs": "^3.4.7",
|
|
51
50
|
"kleur": "^4.1.5",
|
|
@@ -55,9 +54,10 @@
|
|
|
55
54
|
"npx-import": "^1.1.3",
|
|
56
55
|
"recast": "^0.23.1",
|
|
57
56
|
"ws": "^8.18.0",
|
|
58
|
-
"houdini-core": "^2.0.0-go.
|
|
57
|
+
"houdini-core": "^2.0.0-go.12"
|
|
59
58
|
},
|
|
60
59
|
"peerDependencies": {
|
|
60
|
+
"graphql": ">=16",
|
|
61
61
|
"vite": "^7.0.0"
|
|
62
62
|
},
|
|
63
63
|
"files": [
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"import": "./build/adapter/index.js"
|
|
79
79
|
},
|
|
80
80
|
"./adapter/*": {
|
|
81
|
-
"types": "./build/adapter
|
|
82
|
-
"import": "./build/adapter
|
|
81
|
+
"types": "./build/adapter/*.d.ts",
|
|
82
|
+
"import": "./build/adapter/*.js"
|
|
83
83
|
},
|
|
84
84
|
"./cmd": {
|
|
85
85
|
"types": "./build/cmd/index.d.ts",
|
|
@@ -106,16 +106,16 @@
|
|
|
106
106
|
"import": "./build/router/index.js"
|
|
107
107
|
},
|
|
108
108
|
"./router/*": {
|
|
109
|
-
"types": "./build/router
|
|
110
|
-
"import": "./build/router
|
|
109
|
+
"types": "./build/router/*.d.ts",
|
|
110
|
+
"import": "./build/router/*.js"
|
|
111
111
|
},
|
|
112
112
|
"./runtime": {
|
|
113
113
|
"types": "./build/runtime/index.d.ts",
|
|
114
114
|
"import": "./build/runtime/index.js"
|
|
115
115
|
},
|
|
116
116
|
"./runtime/*": {
|
|
117
|
-
"types": "./build/runtime
|
|
118
|
-
"import": "./build/runtime
|
|
117
|
+
"types": "./build/runtime/*.d.ts",
|
|
118
|
+
"import": "./build/runtime/*.js"
|
|
119
119
|
},
|
|
120
120
|
"./runtime/cache": {
|
|
121
121
|
"types": "./build/runtime/cache/index.d.ts",
|
|
@@ -138,16 +138,16 @@
|
|
|
138
138
|
"import": "./build/test/index.js"
|
|
139
139
|
},
|
|
140
140
|
"./test/*": {
|
|
141
|
-
"types": "./build/test
|
|
142
|
-
"import": "./build/test
|
|
141
|
+
"types": "./build/test/*.d.ts",
|
|
142
|
+
"import": "./build/test/*.js"
|
|
143
143
|
},
|
|
144
144
|
"./vite": {
|
|
145
145
|
"types": "./build/vite/index.d.ts",
|
|
146
146
|
"import": "./build/vite/index.js"
|
|
147
147
|
},
|
|
148
148
|
"./vite/*": {
|
|
149
|
-
"types": "./build/vite
|
|
150
|
-
"import": "./build/vite
|
|
149
|
+
"types": "./build/vite/*.d.ts",
|
|
150
|
+
"import": "./build/vite/*.js"
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
"typesVersions": {
|