diff --git a/.changeset/seven-peaches-battle.md b/.changeset/seven-peaches-battle.md new file mode 100644 index 0000000000..ac1753b3e4 --- /dev/null +++ b/.changeset/seven-peaches-battle.md @@ -0,0 +1,5 @@ +--- +'create-houdini': patch +--- + +More improvements to create template diff --git a/.changeset/smart-boxes-travel.md b/.changeset/smart-boxes-travel.md new file mode 100644 index 0000000000..77a5a449c5 --- /dev/null +++ b/.changeset/smart-boxes-travel.md @@ -0,0 +1,5 @@ +--- +'create-houdini': patch +--- + +More template improvements for create diff --git a/packages/create-houdini/bin.js b/packages/create-houdini/bin.js index f300aa1fe0..dfacae75bf 100755 --- a/packages/create-houdini/bin.js +++ b/packages/create-houdini/bin.js @@ -184,13 +184,6 @@ if (localSchema) { copy(sourcePath('./fragments/localSchema/' + template)) } -// If anything goes wrong, we don't want to block the user -let sponsor_msg = '' -try { - const selected = await getSponsors() - sponsor_msg = `🙏 Special thanks to the ${bold(white(selected))} for supporting Houdini!` -} catch (error) {} - p.outro(`🎉 Everything is ready! 👉 Next Steps @@ -381,43 +374,3 @@ function pCancel(cancelText = 'Operation cancelled.') { p.cancel(cancelText) process.exit(1) } - -async function getSponsors() { - const res = await fetch( - 'https://raw.githubusercontent.com/HoudiniGraphql/sponsors/main/generated/sponsors.json' - ) - const /**@type {any[]} */ jsonData = await res.json() - - /** @returns {[number, string]} */ - function getTier(/**@type {number}*/ value) { - if (value >= 1500) { - return [10, 'Wizard'] - } - if (value >= 500) { - return [5, 'Mage'] - } - if (value >= 25) { - return [2, "Magician's Apprentice"] - } - if (value >= 10) { - return [1, 'Supportive Muggle'] - } - // don't display the past sponsors - return [0, 'Past Sponsors'] - } - - const list = jsonData.flatMap( - (/** @type {{sponsor: {name: string}, monthlyDollars: number}} */ c) => { - const [coef, title] = getTier(c.monthlyDollars) - const names = [] - for (let i = 0; i < coef; i++) { - names.push(`${title}, ${c.sponsor.name}`) - } - return names - } - ) - - const selected_to_display = list[Math.floor(Math.random() * list.length)] - - return selected_to_display -} diff --git a/packages/create-houdini/fragments/localSchema/react-typescript/src/api/+schema.ts b/packages/create-houdini/fragments/localSchema/react-typescript/src/api/+schema.ts index 9875af5e66..4c90c3be59 100644 --- a/packages/create-houdini/fragments/localSchema/react-typescript/src/api/+schema.ts +++ b/packages/create-houdini/fragments/localSchema/react-typescript/src/api/+schema.ts @@ -3,12 +3,12 @@ import { createSchema } from 'graphql-yoga' export default createSchema({ typeDefs: /* GraphQL */ ` type Query { - hello: String + message: String } `, resolvers: { Query: { - hello: () => 'Greetings from your local api 👋', + message: () => 'Greetings from your local api 👋', }, }, }) diff --git a/packages/create-houdini/fragments/localSchema/react-typescript/src/routes/+page.tsx b/packages/create-houdini/fragments/localSchema/react-typescript/src/routes/+page.tsx index 356a706682..4805ac27e8 100644 --- a/packages/create-houdini/fragments/localSchema/react-typescript/src/routes/+page.tsx +++ b/packages/create-houdini/fragments/localSchema/react-typescript/src/routes/+page.tsx @@ -1,11 +1,11 @@ import { PageProps } from './$types' -export default function ({ Hello }: PageProps) { +export default function ({ HelloHoudini }: PageProps) { return (
{Hello.message}
+{HelloHoudini.message}
{Hello.message}
+{HelloHoudini.message}