-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing the houdini output folder #391
Comments
It's not currently possible to change that path but I would gladly review a PR that adds a |
I have never worked or contributed on a npm repo before so if I did it would be my first time. Lines 154 to 157 in 6e71762
A lot places in the source code uses the Also to note, it doesn't seem like the |
@AlecAivazis is there any reason the $houdini folder is created in the project root? If it could be placed anywhere in the src dir we can skip configuring vite to serve the root directory. houdini/example/svelte.config.js Line 25 in 70f9f71
|
@Nukiloco That's no problem at all! If you are up for it, I'll help you any way I can. Basically there are two parts to this feature. One part is where the actual @david-plugge the convention of putting it in root pre-dates SvelteKit requiring the extra vite config to resolve the import. I think the best solution to this problem is to change the way users install houdini to use a SvelteKit/Vite plugin which should let us do the ugly |
After reading this, I'm still confused on why there would be two config options here instead of one which should just be a path. |
Unforuntately we can't have one path that works in both situations because the file system is only accessible through vite aliases ( |
it may work: // houdini.config.js
/** @type {import('houdini').ConfigFile} \*/
const config = {
runtimePath: './src/houdini',
...
};
export default config; // svelte.config.js
import houdiniConfig from './houdini.config.js'
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [
preprocess(),
houdini(houdiniConfig)
],
kit: {
alias: houdiniConfig.runtimePath
}
};
export default config; That way we could even pass the config to the preprocessor without having to specify the config path (#395) |
additionally, customizing |
You mean to have it lowercase? Or being able to customize "what you want"? 👀 |
maybe a format string? an option with prefix and case would be good enough |
would fit into
|
Would it be crazy to use the examples as the pattern? At least that way it's more descriptive of what will be generated. I imagine it'd look something like: {
pattern: "QueryName",
// or
pattern: "GQL_Query_Name"
} |
Isn´t it sufficient to just add a prefix config option? I´m not sure but is the name is extracted from the Graphql query/mutation... ? If so the prefix should be enough right? |
not sure how this works internally, if the query portion is derived from the query text then yeah just prefix would be good |
Now that the #460 tangent is closed, is this planned as well? |
We'll add this as part of the Houdini 2.0 release We'll also be changing the default output folder to For this feature, upgrading an old repo to the new one would either just be updating the type alias in the tsconfig, or adding one line in the houdini config to point to the old |
I'm currently reading https://www.houdinigraphql.com/api/config and I can't seem to find the field that changes the path or name of the
$houdini
folder.The text was updated successfully, but these errors were encountered: