diff --git a/.changeset/young-beans-scream.md b/.changeset/young-beans-scream.md new file mode 100644 index 0000000000..f40e0ee66d --- /dev/null +++ b/.changeset/young-beans-scream.md @@ -0,0 +1,6 @@ +--- +'houdini': patch +'houdini-svelte': patch +--- + +update templates diff --git a/packages/houdini-svelte/src/plugin/fsPatch.ts b/packages/houdini-svelte/src/plugin/fsPatch.ts index cba7ffe74c..a5392eb332 100644 --- a/packages/houdini-svelte/src/plugin/fsPatch.ts +++ b/packages/houdini-svelte/src/plugin/fsPatch.ts @@ -123,18 +123,12 @@ filesystem.statSync = function (filepath: string, options: Parameters { + // before we start anything, let's make sure they have initialized their project + try { + await fs.stat(path.resolve('./src')) + } catch { + throw new Error( + 'Please initialize your project first before running init. For svelte projects, you should follow the instructions here: https://kit.svelte.dev/' + ) + } + let headers = {} if ((args.headers ?? []).length > 0) { headers = args.headers!.reduce((total, header) => { @@ -48,7 +57,7 @@ export default async function init( message: "What's the URL for your api?", name: 'url', type: 'text', - initial: 'http://localhost:4000/api/graphql', + initial: 'http://localhost:4000/graphql', }, { onCancel() { @@ -75,6 +84,9 @@ export default async function init( console.log('❌ That URL is not accepting GraphQL queries. Please try again.') return await init(_path, args, false) } + + // make sure we can parse the response as json + await response.json() } catch (e) { console.log('❌ Something went wrong: ' + (e as Error).message) return await init(_path, args, false) diff --git a/packages/houdini/src/lib/config.ts b/packages/houdini/src/lib/config.ts index 27aba77352..0daa0b2084 100644 --- a/packages/houdini/src/lib/config.ts +++ b/packages/houdini/src/lib/config.ts @@ -775,9 +775,8 @@ export async function getConfig({ // if there is a framework specified, tell them they need to change things if (!configFile.plugins) { throw new HoudiniError({ - message: 'framework config value has been removed.', - description: - 'Please visit the release notes here: http://www.houdinigraphql.com/guide/release-notes#0170', + message: + 'Welcome to 0.17.0! Please following the migration guide here: http://www.houdinigraphql.com/guide/release-notes#0170', }) }