Skip to content

Commit

Permalink
chore(docs): fix raw example listing
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Sep 10, 2024
1 parent 6c84840 commit 6bbe63f
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions examples/output|output_envelope.output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
headers: Headers {
connection: 'keep-alive',
'content-length': '119',
'x-served-by': 'cache-yul1970035-YUL',
'x-served-by': 'cache-yul1970029-YUL',
'accept-ranges': 'bytes',
date: 'Sun, 08 Sep 2024 18:13:26 GMT',
'content-type': 'application/graphql-response+json; charset=utf-8',
Expand All @@ -32,13 +32,13 @@
'alt-svc': 'h3=":443"; ma=86400',
'access-control-allow-origin': '*',
'x-powered-by': 'Stellate',
age: '109762',
age: '110231',
'cache-control': 'public, s-maxage=2628000, stale-while-revalidate=2628000',
'x-cache': 'HIT',
'x-cache-hits': '9',
'x-cache-hits': '3',
'gcdn-cache': 'HIT',
'stellate-rate-limit-budget-remaining': '38',
'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=38;refill=21',
'stellate-rate-limit-budget-remaining': '49',
'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=49;refill=60',
'stellate-rate-limit-decision': 'pass',
'stellate-rate-limit-budget-required': '5',
'content-encoding': 'br'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
headers: Headers {
accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8',
'content-type': 'application/json',
'x-sent-at-time': '1725928966760'
'x-sent-at-time': '1725929436225'
},
signal: undefined,
method: 'post',
Expand Down
5 changes: 3 additions & 2 deletions scripts/generate-examples-derivatives/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ const parseFileName = (fileName: string): Example['fileName'] => {
const [group, fileNameWithoutGroup] = fileName.includes(`|`) ? fileName.split(`|`) : [null, fileName]
const [tagsExpression, titleExpression] = fileNameWithoutGroup.split(`__`)
// If group name is duplicated by tags then omit that from the canonical title.
const tagsExpressionWithoutGroupName = tagsExpression
? parseTags(tagsExpression).map(tag => tag === group ? `` : tag).filter(Boolean).join(` `)
const tags = tagsExpression ? parseTags(tagsExpression) : null
const tagsExpressionWithoutGroupName = tags
? (tags.length > 1 ? tags.map(tag => tag === group ? `` : tag).filter(Boolean) : tags).join(` `)
: null
const canonicalTitleExpression = titleExpression ?? tagsExpressionWithoutGroupName ?? `impossible`
return {
Expand Down
2 changes: 1 addition & 1 deletion website/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default defineConfig({
aside: 'left',
nav: [
{ text: 'Guides', link: '/guides/overview/introduction' },
{ text: 'Examples', link: '/examples/raw' },
{ text: 'Examples', link: '/examples/raw-raw' },
],
sidebar: {
'/examples/': sidebarExamples,
Expand Down
4 changes: 2 additions & 2 deletions website/.vitepress/configExamples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"text": "Raw",
"items": [
{
"text": "",
"link": "/examples/raw-"
"text": "Raw",
"link": "/examples/raw-raw"
},
{
"text": "Raw String",
Expand Down
10 changes: 5 additions & 5 deletions website/content/examples/output-envelope.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ console.log(result)
headers: Headers {
connection: 'keep-alive',
'content-length': '119',
'x-served-by': 'cache-yul1970035-YUL',
'x-served-by': 'cache-yul1970029-YUL',
'accept-ranges': 'bytes',
date: 'Sun, 08 Sep 2024 18:13:26 GMT',
'content-type': 'application/graphql-response+json; charset=utf-8',
Expand All @@ -59,13 +59,13 @@ console.log(result)
'alt-svc': 'h3=":443"; ma=86400',
'access-control-allow-origin': '*',
'x-powered-by': 'Stellate',
age: '109762',
age: '110231',
'cache-control': 'public, s-maxage=2628000, stale-while-revalidate=2628000',
'x-cache': 'HIT',
'x-cache-hits': '9',
'x-cache-hits': '3',
'gcdn-cache': 'HIT',
'stellate-rate-limit-budget-remaining': '38',
'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=38;refill=21',
'stellate-rate-limit-budget-remaining': '49',
'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=49;refill=60',
'stellate-rate-limit-decision': 'pass',
'stellate-rate-limit-budget-required': '5',
'content-encoding': 'br'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
aside: false
---

#
# Raw

<!-- dprint-ignore-start -->
```ts twoslash
Expand Down
2 changes: 1 addition & 1 deletion website/content/examples/transport-http-dynamic-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ await graffle.rawString({ document: `{ languages { code } }` })
headers: Headers {
accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8',
'content-type': 'application/json',
'x-sent-at-time': '1725928966760'
'x-sent-at-time': '1725929436225'
},
signal: undefined,
method: 'post',
Expand Down
2 changes: 1 addition & 1 deletion website/content/guides/_example_links/raw.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
###### Examples -> [](../../examples/raw-.md) / [Raw String](../../examples/raw-raw-string.md) / [Raw String Typed](../../examples/raw-raw-string-typed.md) / [Raw Typed](../../examples/raw-raw-typed.md) / [Headers](../../examples/transport-http-headers.md) / [Raw](../../examples/transport-http-raw.md)
###### Examples -> [Raw](../../examples/raw-raw.md) / [Raw String](../../examples/raw-raw-string.md) / [Raw String Typed](../../examples/raw-raw-string-typed.md) / [Raw Typed](../../examples/raw-raw-typed.md) / [Headers](../../examples/transport-http-headers.md) / [Raw](../../examples/transport-http-raw.md)
2 changes: 1 addition & 1 deletion website/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hero:
link: /guides/overview/introduction
- theme: alt
text: Examples
link: /examples/raw
link: /examples/raw-raw
image:
src: /_assets/logo-dark.png
alt: Graffle
Expand Down

0 comments on commit 6bbe63f

Please sign in to comment.