houdini 0.16.7 → 0.16.8
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/CHANGELOG.md +8 -0
- package/build/cmd/generate.js +9 -1
- package/build/cmd.js +11 -4
- package/build/common/config.js +1 -1
- package/build/preprocess-cjs/index.js +1 -1
- package/build/preprocess-esm/index.js +1 -1
- package/build/runtime-cjs/meta.json +1 -1
- package/build/runtime-esm/meta.json +1 -1
- package/build/vite-cjs/index.js +10 -3
- package/build/vite-esm/index.js +10 -3
- package/package.json +1 -1
- package/site/src/routes/api/mutation.svx +2 -2
- package/site/src/routes/guides/faq.svx +31 -0
- package/src/cmd/generate.ts +14 -0
- package/src/common/config.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# houdini
|
|
2
2
|
|
|
3
|
+
## 0.16.8
|
|
4
|
+
|
|
5
|
+
### 🐛 Fixes
|
|
6
|
+
|
|
7
|
+
- [#595](https://github.com/HoudiniGraphql/houdini/pull/595) [`3421404`](https://github.com/HoudiniGraphql/houdini/commit/3421404e58697bc8e066d3f0b2d9c74c77c0318a) Thanks [@AlecAivazis](https://github.com/AlecAivazis)! - Don't consider the schema path as an source for generation
|
|
8
|
+
|
|
9
|
+
- [#594](https://github.com/HoudiniGraphql/houdini/pull/594) [`4ee9db3`](https://github.com/HoudiniGraphql/houdini/commit/4ee9db312c8ef9db3244bcd2f10f877d596e6f8d) Thanks [@AlecAivazis](https://github.com/AlecAivazis)! - Fixed bug preventing documents from being discovered on windows
|
|
10
|
+
|
|
3
11
|
## 0.16.7
|
|
4
12
|
|
|
5
13
|
### 🐛 Fixes
|
package/build/cmd/generate.js
CHANGED
|
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.runPipeline = void 0;
|
|
30
30
|
const glob_1 = __importDefault(require("glob"));
|
|
31
31
|
const graphql = __importStar(require("graphql"));
|
|
32
|
+
const minimatch_1 = __importDefault(require("minimatch"));
|
|
32
33
|
const path_1 = __importDefault(require("path"));
|
|
33
34
|
const svelte = __importStar(require("svelte/compiler"));
|
|
34
35
|
const util_1 = require("util");
|
|
@@ -192,7 +193,14 @@ async function collectDocuments(config) {
|
|
|
192
193
|
let sourceFiles = [
|
|
193
194
|
...new Set((await Promise.all(config.include.map((filepath) => (0, util_1.promisify)(glob_1.default)(path_1.default.join(config.projectRoot, filepath)))))
|
|
194
195
|
.flat()
|
|
195
|
-
.filter((filepath) => config.includeFile(filepath))
|
|
196
|
+
.filter((filepath) => config.includeFile(filepath))
|
|
197
|
+
// don't include the schema path as a source file
|
|
198
|
+
.filter((filepath) => {
|
|
199
|
+
const prefix = config.schemaPath?.startsWith('./') ? './' : '';
|
|
200
|
+
return (!config.schemaPath ||
|
|
201
|
+
!(0, minimatch_1.default)(prefix +
|
|
202
|
+
path_1.default.relative(config.projectRoot, filepath).replaceAll('\\', '/'), config.schemaPath));
|
|
203
|
+
})),
|
|
196
204
|
];
|
|
197
205
|
// the list of documents we found
|
|
198
206
|
const documents = [];
|
package/build/cmd.js
CHANGED
|
@@ -154492,7 +154492,7 @@ ${hasDefault
|
|
|
154492
154492
|
if (match) {
|
|
154493
154493
|
filename = path$h.join(this.projectRoot, filename.substring(match[1].length));
|
|
154494
154494
|
}
|
|
154495
|
-
return filename;
|
|
154495
|
+
return posixify(filename);
|
|
154496
154496
|
}
|
|
154497
154497
|
async walkRouteDir(visitor, dirpath = this.routesDir) {
|
|
154498
154498
|
// if we run into any child with a query, we have a route
|
|
@@ -159345,7 +159345,7 @@ async function runPipeline(config, docs) {
|
|
|
159345
159345
|
// if we detected a version change, we're nuking everything so don't bother with a summary
|
|
159346
159346
|
if (newTimestamp) {
|
|
159347
159347
|
console.log('💣 Detected new version of Houdini. Regenerating all documents...');
|
|
159348
|
-
console.log('🎉 Welcome to 0.16.
|
|
159348
|
+
console.log('🎉 Welcome to 0.16.8!');
|
|
159349
159349
|
// if the user is coming from a version pre-15, point them to the migration guide
|
|
159350
159350
|
const major = parseInt(previousVersion.split('.')[1]);
|
|
159351
159351
|
if (major < 16) {
|
|
@@ -159390,7 +159390,14 @@ async function collectDocuments(config) {
|
|
|
159390
159390
|
let sourceFiles = [
|
|
159391
159391
|
...new Set((await Promise.all(config.include.map((filepath) => promisify$1(globExports)(path$h.join(config.projectRoot, filepath)))))
|
|
159392
159392
|
.flat()
|
|
159393
|
-
.filter((filepath) => config.includeFile(filepath))
|
|
159393
|
+
.filter((filepath) => config.includeFile(filepath))
|
|
159394
|
+
// don't include the schema path as a source file
|
|
159395
|
+
.filter((filepath) => {
|
|
159396
|
+
const prefix = config.schemaPath?.startsWith('./') ? './' : '';
|
|
159397
|
+
return (!config.schemaPath ||
|
|
159398
|
+
!minimatch$2(prefix +
|
|
159399
|
+
path$h.relative(config.projectRoot, filepath).replaceAll('\\', '/'), config.schemaPath));
|
|
159400
|
+
})),
|
|
159394
159401
|
];
|
|
159395
159402
|
// the list of documents we found
|
|
159396
159403
|
const documents = [];
|
|
@@ -166289,7 +166296,7 @@ async function updatePackageJSON(targetPath) {
|
|
|
166289
166296
|
// houdini & graphql should be a dev dependencies
|
|
166290
166297
|
packageJSON.devDependencies = {
|
|
166291
166298
|
...packageJSON.devDependencies,
|
|
166292
|
-
houdini: '^0.16.
|
|
166299
|
+
houdini: '^0.16.8',
|
|
166293
166300
|
graphql: '^15.5.0',
|
|
166294
166301
|
};
|
|
166295
166302
|
await writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
package/build/common/config.js
CHANGED
|
@@ -544,7 +544,7 @@ ${hasDefault
|
|
|
544
544
|
if (match) {
|
|
545
545
|
filename = path_1.default.join(this.projectRoot, filename.substring(match[1].length));
|
|
546
546
|
}
|
|
547
|
-
return filename;
|
|
547
|
+
return posixify(filename);
|
|
548
548
|
}
|
|
549
549
|
async walkRouteDir(visitor, dirpath = this.routesDir) {
|
|
550
550
|
// if we run into any child with a query, we have a route
|
|
@@ -152145,7 +152145,7 @@ ${hasDefault
|
|
|
152145
152145
|
if (match) {
|
|
152146
152146
|
filename = path__default["default"].join(this.projectRoot, filename.substring(match[1].length));
|
|
152147
152147
|
}
|
|
152148
|
-
return filename;
|
|
152148
|
+
return posixify(filename);
|
|
152149
152149
|
}
|
|
152150
152150
|
async walkRouteDir(visitor, dirpath = this.routesDir) {
|
|
152151
152151
|
// if we run into any child with a query, we have a route
|
|
@@ -152107,7 +152107,7 @@ ${hasDefault
|
|
|
152107
152107
|
if (match) {
|
|
152108
152108
|
filename = path$h.join(this.projectRoot, filename.substring(match[1].length));
|
|
152109
152109
|
}
|
|
152110
|
-
return filename;
|
|
152110
|
+
return posixify(filename);
|
|
152111
152111
|
}
|
|
152112
152112
|
async walkRouteDir(visitor, dirpath = this.routesDir) {
|
|
152113
152113
|
// if we run into any child with a query, we have a route
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.16.
|
|
1
|
+
{"version":"0.16.8","timestamp":1665211264930}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.16.
|
|
1
|
+
{"version":"0.16.8","timestamp":1665211263656}
|
package/build/vite-cjs/index.js
CHANGED
|
@@ -156632,7 +156632,7 @@ ${hasDefault
|
|
|
156632
156632
|
if (match) {
|
|
156633
156633
|
filename = path__default["default"].join(this.projectRoot, filename.substring(match[1].length));
|
|
156634
156634
|
}
|
|
156635
|
-
return filename;
|
|
156635
|
+
return posixify(filename);
|
|
156636
156636
|
}
|
|
156637
156637
|
async walkRouteDir(visitor, dirpath = this.routesDir) {
|
|
156638
156638
|
// if we run into any child with a query, we have a route
|
|
@@ -161475,7 +161475,7 @@ async function runPipeline(config, docs) {
|
|
|
161475
161475
|
// if we detected a version change, we're nuking everything so don't bother with a summary
|
|
161476
161476
|
if (newTimestamp) {
|
|
161477
161477
|
console.log('💣 Detected new version of Houdini. Regenerating all documents...');
|
|
161478
|
-
console.log('🎉 Welcome to 0.16.
|
|
161478
|
+
console.log('🎉 Welcome to 0.16.8!');
|
|
161479
161479
|
// if the user is coming from a version pre-15, point them to the migration guide
|
|
161480
161480
|
const major = parseInt(previousVersion.split('.')[1]);
|
|
161481
161481
|
if (major < 16) {
|
|
@@ -161520,7 +161520,14 @@ async function collectDocuments(config) {
|
|
|
161520
161520
|
let sourceFiles = [
|
|
161521
161521
|
...new Set((await Promise.all(config.include.map((filepath) => require$$0$1.promisify(globExports)(path__default["default"].join(config.projectRoot, filepath)))))
|
|
161522
161522
|
.flat()
|
|
161523
|
-
.filter((filepath) => config.includeFile(filepath))
|
|
161523
|
+
.filter((filepath) => config.includeFile(filepath))
|
|
161524
|
+
// don't include the schema path as a source file
|
|
161525
|
+
.filter((filepath) => {
|
|
161526
|
+
const prefix = config.schemaPath?.startsWith('./') ? './' : '';
|
|
161527
|
+
return (!config.schemaPath ||
|
|
161528
|
+
!minimatch$2(prefix +
|
|
161529
|
+
path__default["default"].relative(config.projectRoot, filepath).replaceAll('\\', '/'), config.schemaPath));
|
|
161530
|
+
})),
|
|
161524
161531
|
];
|
|
161525
161532
|
// the list of documents we found
|
|
161526
161533
|
const documents = [];
|
package/build/vite-esm/index.js
CHANGED
|
@@ -156593,7 +156593,7 @@ ${hasDefault
|
|
|
156593
156593
|
if (match) {
|
|
156594
156594
|
filename = path$j.join(this.projectRoot, filename.substring(match[1].length));
|
|
156595
156595
|
}
|
|
156596
|
-
return filename;
|
|
156596
|
+
return posixify(filename);
|
|
156597
156597
|
}
|
|
156598
156598
|
async walkRouteDir(visitor, dirpath = this.routesDir) {
|
|
156599
156599
|
// if we run into any child with a query, we have a route
|
|
@@ -161436,7 +161436,7 @@ async function runPipeline(config, docs) {
|
|
|
161436
161436
|
// if we detected a version change, we're nuking everything so don't bother with a summary
|
|
161437
161437
|
if (newTimestamp) {
|
|
161438
161438
|
console.log('💣 Detected new version of Houdini. Regenerating all documents...');
|
|
161439
|
-
console.log('🎉 Welcome to 0.16.
|
|
161439
|
+
console.log('🎉 Welcome to 0.16.8!');
|
|
161440
161440
|
// if the user is coming from a version pre-15, point them to the migration guide
|
|
161441
161441
|
const major = parseInt(previousVersion.split('.')[1]);
|
|
161442
161442
|
if (major < 16) {
|
|
@@ -161481,7 +161481,14 @@ async function collectDocuments(config) {
|
|
|
161481
161481
|
let sourceFiles = [
|
|
161482
161482
|
...new Set((await Promise.all(config.include.map((filepath) => promisify$1(globExports)(path$j.join(config.projectRoot, filepath)))))
|
|
161483
161483
|
.flat()
|
|
161484
|
-
.filter((filepath) => config.includeFile(filepath))
|
|
161484
|
+
.filter((filepath) => config.includeFile(filepath))
|
|
161485
|
+
// don't include the schema path as a source file
|
|
161486
|
+
.filter((filepath) => {
|
|
161487
|
+
const prefix = config.schemaPath?.startsWith('./') ? './' : '';
|
|
161488
|
+
return (!config.schemaPath ||
|
|
161489
|
+
!minimatch$2(prefix +
|
|
161490
|
+
path$j.relative(config.projectRoot, filepath).replaceAll('\\', '/'), config.schemaPath));
|
|
161491
|
+
})),
|
|
161485
161492
|
];
|
|
161486
161493
|
// the list of documents we found
|
|
161487
161494
|
const documents = [];
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ specified by the first argument to the handler. The second argument to the resul
|
|
|
38
38
|
can be used to configure its behavior. The following values can be provided:
|
|
39
39
|
|
|
40
40
|
- `optimisticResponse` specifies a value to use instead of waiting for the server to return a value.
|
|
41
|
-
For more information, see the [optimistic responses](#optimistic-responses) section.
|
|
41
|
+
For more information, see the [optimistic responses](#optimistic-responses) section.
|
|
42
42
|
|
|
43
43
|
### Notes
|
|
44
44
|
|
|
@@ -143,7 +143,7 @@ and provide an "optimistic response" for the mutation with the second argument t
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
}
|
|
146
|
+
})
|
|
147
147
|
}
|
|
148
148
|
</script>
|
|
149
149
|
|
|
@@ -88,6 +88,37 @@ If you haven't seen Houdini's document stores before, please check out the [Work
|
|
|
88
88
|
You should use the `metadata` parameter in the document store to pass arbitrary information into your client's network function. For more information,
|
|
89
89
|
please visit [the query store docs](/api/query#passing-metadata).
|
|
90
90
|
|
|
91
|
+
### Can I use .env files for pre-processing?
|
|
92
|
+
|
|
93
|
+
Yes you can! You can pass any [valid configuration value](/api/config#fields) to the vite plugin to use your environment variable:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
97
|
+
import houdini from 'houdini/vite';
|
|
98
|
+
import type { UserConfigExport } from 'vite';
|
|
99
|
+
import { defineConfig, loadEnv } from 'vite';
|
|
100
|
+
|
|
101
|
+
const config: UserConfigExport = defineConfig(({ mode }) => {
|
|
102
|
+
// loads env files
|
|
103
|
+
// supports the use of seperate .env, .env.production, and .env.development files
|
|
104
|
+
const env = loadEnv(mode, process.cwd());
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
plugins: [
|
|
108
|
+
houdini({
|
|
109
|
+
apiUrl: env.VITE_SECRET_ENDPOINT,
|
|
110
|
+
schemaPollHeaders: {
|
|
111
|
+
'X-Header': env.VITE_CUSTOM_HEADER
|
|
112
|
+
}
|
|
113
|
+
}),
|
|
114
|
+
sveltekit()
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export default config;
|
|
120
|
+
```
|
|
121
|
+
|
|
91
122
|
### What is this `Generated an empty chunk...` warning from vite?
|
|
92
123
|
|
|
93
124
|
If you have a route directory that does not contain a `+page.js` file and does not have an inline query in your `+page.svelte`, the
|
package/src/cmd/generate.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import glob from 'glob'
|
|
2
2
|
import * as graphql from 'graphql'
|
|
3
|
+
import minimatch from 'minimatch'
|
|
3
4
|
import path from 'path'
|
|
4
5
|
import * as recast from 'recast'
|
|
5
6
|
import * as svelte from 'svelte/compiler'
|
|
@@ -210,6 +211,19 @@ async function collectDocuments(config: Config): Promise<CollectedGraphQLDocumen
|
|
|
210
211
|
)
|
|
211
212
|
.flat()
|
|
212
213
|
.filter((filepath) => config.includeFile(filepath))
|
|
214
|
+
// don't include the schema path as a source file
|
|
215
|
+
.filter((filepath) => {
|
|
216
|
+
const prefix = config.schemaPath?.startsWith('./') ? './' : ''
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
!config.schemaPath ||
|
|
220
|
+
!minimatch(
|
|
221
|
+
prefix +
|
|
222
|
+
path.relative(config.projectRoot, filepath).replaceAll('\\', '/'),
|
|
223
|
+
config.schemaPath
|
|
224
|
+
)
|
|
225
|
+
)
|
|
226
|
+
})
|
|
213
227
|
),
|
|
214
228
|
]
|
|
215
229
|
|
package/src/common/config.ts
CHANGED