create-houdini 1.2.58 → 1.2.60
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/bin.js +1 -49
- package/fragments/localSchema/react/src/api/+schema.js +2 -2
- package/fragments/localSchema/react/src/routes/+page.jsx +2 -2
- package/fragments/localSchema/react-typescript/src/api/+schema.ts +2 -2
- package/fragments/localSchema/react-typescript/src/routes/+page.tsx +2 -2
- package/package.json +1 -1
- package/templates/react-typescript/src/+index.tsx +1 -1
package/bin.js
CHANGED
|
@@ -184,13 +184,6 @@ if (localSchema) {
|
|
|
184
184
|
copy(sourcePath('./fragments/localSchema/' + template))
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
// If anything goes wrong, we don't want to block the user
|
|
188
|
-
let sponsor_msg = ''
|
|
189
|
-
try {
|
|
190
|
-
const selected = await getSponsors()
|
|
191
|
-
sponsor_msg = `🙏 Special thanks to the ${bold(white(selected))} for supporting Houdini!`
|
|
192
|
-
} catch (error) {}
|
|
193
|
-
|
|
194
187
|
p.outro(`🎉 Everything is ready!
|
|
195
188
|
|
|
196
189
|
👉 Next Steps
|
|
@@ -203,8 +196,7 @@ console.log(
|
|
|
203
196
|
italic(
|
|
204
197
|
`${bold('❔ More help')} ` +
|
|
205
198
|
`at ${cyan('https://houdinigraphql.com')} ` +
|
|
206
|
-
`(📄 Docs, ⭐ Github, 📣 Discord, ...) `
|
|
207
|
-
`${sponsor_msg ? `\n${sponsor_msg}` : ``}\n`
|
|
199
|
+
`(📄 Docs, ⭐ Github, 📣 Discord, ...) `
|
|
208
200
|
)
|
|
209
201
|
)
|
|
210
202
|
)
|
|
@@ -381,43 +373,3 @@ function pCancel(cancelText = 'Operation cancelled.') {
|
|
|
381
373
|
p.cancel(cancelText)
|
|
382
374
|
process.exit(1)
|
|
383
375
|
}
|
|
384
|
-
|
|
385
|
-
async function getSponsors() {
|
|
386
|
-
const res = await fetch(
|
|
387
|
-
'https://raw.githubusercontent.com/HoudiniGraphql/sponsors/main/generated/sponsors.json'
|
|
388
|
-
)
|
|
389
|
-
const /**@type {any[]} */ jsonData = await res.json()
|
|
390
|
-
|
|
391
|
-
/** @returns {[number, string]} */
|
|
392
|
-
function getTier(/**@type {number}*/ value) {
|
|
393
|
-
if (value >= 1500) {
|
|
394
|
-
return [10, 'Wizard']
|
|
395
|
-
}
|
|
396
|
-
if (value >= 500) {
|
|
397
|
-
return [5, 'Mage']
|
|
398
|
-
}
|
|
399
|
-
if (value >= 25) {
|
|
400
|
-
return [2, "Magician's Apprentice"]
|
|
401
|
-
}
|
|
402
|
-
if (value >= 10) {
|
|
403
|
-
return [1, 'Supportive Muggle']
|
|
404
|
-
}
|
|
405
|
-
// don't display the past sponsors
|
|
406
|
-
return [0, 'Past Sponsors']
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
const list = jsonData.flatMap(
|
|
410
|
-
(/** @type {{sponsor: {name: string}, monthlyDollars: number}} */ c) => {
|
|
411
|
-
const [coef, title] = getTier(c.monthlyDollars)
|
|
412
|
-
const names = []
|
|
413
|
-
for (let i = 0; i < coef; i++) {
|
|
414
|
-
names.push(`${title}, ${c.sponsor.name}`)
|
|
415
|
-
}
|
|
416
|
-
return names
|
|
417
|
-
}
|
|
418
|
-
)
|
|
419
|
-
|
|
420
|
-
const selected_to_display = list[Math.floor(Math.random() * list.length)]
|
|
421
|
-
|
|
422
|
-
return selected_to_display
|
|
423
|
-
}
|
|
@@ -3,12 +3,12 @@ import { createSchema } from 'graphql-yoga'
|
|
|
3
3
|
export default createSchema({
|
|
4
4
|
typeDefs: /* GraphQL */ `
|
|
5
5
|
type Query {
|
|
6
|
-
|
|
6
|
+
message: String
|
|
7
7
|
}
|
|
8
8
|
`,
|
|
9
9
|
resolvers: {
|
|
10
10
|
Query: {
|
|
11
|
-
|
|
11
|
+
message: () => 'Greetings from your local api 👋',
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
})
|
|
@@ -3,12 +3,12 @@ import { createSchema } from 'graphql-yoga'
|
|
|
3
3
|
export default createSchema({
|
|
4
4
|
typeDefs: /* GraphQL */ `
|
|
5
5
|
type Query {
|
|
6
|
-
|
|
6
|
+
message: String
|
|
7
7
|
}
|
|
8
8
|
`,
|
|
9
9
|
resolvers: {
|
|
10
10
|
Query: {
|
|
11
|
-
|
|
11
|
+
message: () => 'Greetings from your local api 👋',
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
})
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PageProps } from './$types'
|
|
2
2
|
|
|
3
|
-
export default function ({
|
|
3
|
+
export default function ({ HelloHoudini }: PageProps) {
|
|
4
4
|
return (
|
|
5
5
|
<div className="flex flex-col gap-8">
|
|
6
6
|
<h2>Home</h2>
|
|
7
7
|
|
|
8
|
-
<p>{
|
|
8
|
+
<p>{HelloHoudini.message}</p>
|
|
9
9
|
</div>
|
|
10
10
|
)
|
|
11
11
|
}
|
package/package.json
CHANGED