diff --git a/examples/transport-memory.output.txt b/examples/other|transport-memory.output.txt similarity index 100% rename from examples/transport-memory.output.txt rename to examples/other|transport-memory.output.txt diff --git a/examples/transport-memory.ts b/examples/other|transport-memory.ts similarity index 100% rename from examples/transport-memory.ts rename to examples/other|transport-memory.ts diff --git a/examples/output|output_envelope.output.txt b/examples/output|output_envelope.output.txt index c0054a3ba..1f5c8a717 100644 --- a/examples/output|output_envelope.output.txt +++ b/examples/output|output_envelope.output.txt @@ -19,7 +19,7 @@ headers: Headers { connection: 'keep-alive', 'content-length': '119', - 'x-served-by': 'cache-yul1970039-YUL', + 'x-served-by': 'cache-yul1970035-YUL', 'accept-ranges': 'bytes', date: 'Sun, 08 Sep 2024 18:13:26 GMT', 'content-type': 'application/graphql-response+json; charset=utf-8', @@ -32,13 +32,13 @@ 'alt-svc': 'h3=":443"; ma=86400', 'access-control-allow-origin': '*', 'x-powered-by': 'Stellate', - age: '109533', + age: '109762', 'cache-control': 'public, s-maxage=2628000, stale-while-revalidate=2628000', 'x-cache': 'HIT', - 'x-cache-hits': '17', + 'x-cache-hits': '9', 'gcdn-cache': 'HIT', - 'stellate-rate-limit-budget-remaining': '45', - 'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=45;refill=60', + '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-decision': 'pass', 'stellate-rate-limit-budget-required': '5', 'content-encoding': 'br' diff --git a/examples/raw.output.txt b/examples/raw|raw.output.txt similarity index 100% rename from examples/raw.output.txt rename to examples/raw|raw.output.txt diff --git a/examples/raw.ts b/examples/raw|raw.ts similarity index 100% rename from examples/raw.ts rename to examples/raw|raw.ts diff --git a/examples/raw_rawString__rawString.output.txt b/examples/raw|raw_rawString__rawString.output.txt similarity index 100% rename from examples/raw_rawString__rawString.output.txt rename to examples/raw|raw_rawString__rawString.output.txt diff --git a/examples/raw_rawString__rawString.ts b/examples/raw|raw_rawString__rawString.ts similarity index 100% rename from examples/raw_rawString__rawString.ts rename to examples/raw|raw_rawString__rawString.ts diff --git a/examples/raw_rawString_rawTyped__rawString-typed.output.txt b/examples/raw|raw_rawString_rawTyped__rawString-typed.output.txt similarity index 100% rename from examples/raw_rawString_rawTyped__rawString-typed.output.txt rename to examples/raw|raw_rawString_rawTyped__rawString-typed.output.txt diff --git a/examples/raw_rawString_rawTyped__rawString-typed.ts b/examples/raw|raw_rawString_rawTyped__rawString-typed.ts similarity index 100% rename from examples/raw_rawString_rawTyped__rawString-typed.ts rename to examples/raw|raw_rawString_rawTyped__rawString-typed.ts diff --git a/examples/raw_rawTyped__raw-typed.output.txt b/examples/raw|raw_rawTyped__raw-typed.output.txt similarity index 100% rename from examples/raw_rawTyped__raw-typed.output.txt rename to examples/raw|raw_rawTyped__raw-typed.output.txt diff --git a/examples/raw_rawTyped__raw-typed.ts b/examples/raw|raw_rawTyped__raw-typed.ts similarity index 100% rename from examples/raw_rawTyped__raw-typed.ts rename to examples/raw|raw_rawTyped__raw-typed.ts diff --git a/examples/transport-http|transport-http_extension_headers__dynamicHeaders.output.txt b/examples/transport-http|transport-http_extension_headers__dynamicHeaders.output.txt index df27e446c..7929f9e46 100644 --- a/examples/transport-http|transport-http_extension_headers__dynamicHeaders.output.txt +++ b/examples/transport-http|transport-http_extension_headers__dynamicHeaders.output.txt @@ -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': '1725928738805' + 'x-sent-at-time': '1725928966760' }, signal: undefined, method: 'post', diff --git a/tests/examples/transport-memory.test.ts b/tests/examples/other|transport-memory.test.ts similarity index 78% rename from tests/examples/transport-memory.test.ts rename to tests/examples/other|transport-memory.test.ts index 7088beb66..567a85844 100644 --- a/tests/examples/transport-memory.test.ts +++ b/tests/examples/other|transport-memory.test.ts @@ -8,12 +8,12 @@ import { execaCommand } from 'execa' import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' -test(`transport-memory`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/transport-memory.ts`) +test(`other|transport-memory`, async () => { + const result = await execaCommand(`pnpm tsx ./examples/other|transport-memory.ts`) expect(result.exitCode).toBe(0) // Examples should output their data results. const exampleResult = stripAnsi(result.stdout) // If ever outputs vary by Node version, you can use this to snapshot by Node version. // const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` - await expect(exampleResult).toMatchFileSnapshot(`../.././examples/transport-memory.output.txt`) + await expect(exampleResult).toMatchFileSnapshot(`../.././examples/other|transport-memory.output.txt`) }) diff --git a/tests/examples/raw.test.ts b/tests/examples/raw|raw.test.ts similarity index 83% rename from tests/examples/raw.test.ts rename to tests/examples/raw|raw.test.ts index ef845b2ef..f10a788e4 100644 --- a/tests/examples/raw.test.ts +++ b/tests/examples/raw|raw.test.ts @@ -8,12 +8,12 @@ import { execaCommand } from 'execa' import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' -test(`raw`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/raw.ts`) +test(`raw|raw`, async () => { + const result = await execaCommand(`pnpm tsx ./examples/raw|raw.ts`) expect(result.exitCode).toBe(0) // Examples should output their data results. const exampleResult = stripAnsi(result.stdout) // If ever outputs vary by Node version, you can use this to snapshot by Node version. // const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` - await expect(exampleResult).toMatchFileSnapshot(`../.././examples/raw.output.txt`) + await expect(exampleResult).toMatchFileSnapshot(`../.././examples/raw|raw.output.txt`) }) diff --git a/tests/examples/raw_rawTyped__raw-typed.test.ts b/tests/examples/raw|raw_rawString__rawString.test.ts similarity index 76% rename from tests/examples/raw_rawTyped__raw-typed.test.ts rename to tests/examples/raw|raw_rawString__rawString.test.ts index 8fa66d2e8..1a1d73f36 100644 --- a/tests/examples/raw_rawTyped__raw-typed.test.ts +++ b/tests/examples/raw|raw_rawString__rawString.test.ts @@ -8,12 +8,12 @@ import { execaCommand } from 'execa' import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' -test(`raw_rawTyped__raw-typed`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/raw_rawTyped__raw-typed.ts`) +test(`raw|raw_rawString__rawString`, async () => { + const result = await execaCommand(`pnpm tsx ./examples/raw|raw_rawString__rawString.ts`) expect(result.exitCode).toBe(0) // Examples should output their data results. const exampleResult = stripAnsi(result.stdout) // If ever outputs vary by Node version, you can use this to snapshot by Node version. // const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` - await expect(exampleResult).toMatchFileSnapshot(`../.././examples/raw_rawTyped__raw-typed.output.txt`) + await expect(exampleResult).toMatchFileSnapshot(`../.././examples/raw|raw_rawString__rawString.output.txt`) }) diff --git a/tests/examples/raw_rawString_rawTyped__rawString-typed.test.ts b/tests/examples/raw|raw_rawString_rawTyped__rawString-typed.test.ts similarity index 64% rename from tests/examples/raw_rawString_rawTyped__rawString-typed.test.ts rename to tests/examples/raw|raw_rawString_rawTyped__rawString-typed.test.ts index f40d0028e..1e767bfd9 100644 --- a/tests/examples/raw_rawString_rawTyped__rawString-typed.test.ts +++ b/tests/examples/raw|raw_rawString_rawTyped__rawString-typed.test.ts @@ -8,12 +8,14 @@ import { execaCommand } from 'execa' import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' -test(`raw_rawString_rawTyped__rawString-typed`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/raw_rawString_rawTyped__rawString-typed.ts`) +test(`raw|raw_rawString_rawTyped__rawString-typed`, async () => { + const result = await execaCommand(`pnpm tsx ./examples/raw|raw_rawString_rawTyped__rawString-typed.ts`) expect(result.exitCode).toBe(0) // Examples should output their data results. const exampleResult = stripAnsi(result.stdout) // If ever outputs vary by Node version, you can use this to snapshot by Node version. // const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` - await expect(exampleResult).toMatchFileSnapshot(`../.././examples/raw_rawString_rawTyped__rawString-typed.output.txt`) + await expect(exampleResult).toMatchFileSnapshot( + `../.././examples/raw|raw_rawString_rawTyped__rawString-typed.output.txt`, + ) }) diff --git a/tests/examples/raw_rawString__rawString.test.ts b/tests/examples/raw|raw_rawTyped__raw-typed.test.ts similarity index 77% rename from tests/examples/raw_rawString__rawString.test.ts rename to tests/examples/raw|raw_rawTyped__raw-typed.test.ts index 906f546ef..3305c8b6f 100644 --- a/tests/examples/raw_rawString__rawString.test.ts +++ b/tests/examples/raw|raw_rawTyped__raw-typed.test.ts @@ -8,12 +8,12 @@ import { execaCommand } from 'execa' import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' -test(`raw_rawString__rawString`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/raw_rawString__rawString.ts`) +test(`raw|raw_rawTyped__raw-typed`, async () => { + const result = await execaCommand(`pnpm tsx ./examples/raw|raw_rawTyped__raw-typed.ts`) expect(result.exitCode).toBe(0) // Examples should output their data results. const exampleResult = stripAnsi(result.stdout) // If ever outputs vary by Node version, you can use this to snapshot by Node version. // const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` - await expect(exampleResult).toMatchFileSnapshot(`../.././examples/raw_rawString__rawString.output.txt`) + await expect(exampleResult).toMatchFileSnapshot(`../.././examples/raw|raw_rawTyped__raw-typed.output.txt`) }) diff --git a/website/.vitepress/configExamples.ts b/website/.vitepress/configExamples.ts index 8672658da..f03209a6b 100644 --- a/website/.vitepress/configExamples.ts +++ b/website/.vitepress/configExamples.ts @@ -2,26 +2,6 @@ import { DefaultTheme } from 'vitepress' export const sidebarExamples:DefaultTheme.SidebarItem[] = [ - { - "text": "Transport Memory", - "link": "/examples/transport-memory" - }, - { - "text": "Raw Typed", - "link": "/examples/raw-typed" - }, - { - "text": "Raw String Typed", - "link": "/examples/raw-string-typed" - }, - { - "text": "Raw String", - "link": "/examples/raw-string" - }, - { - "text": "Raw", - "link": "/examples/raw" - }, { "text": "Generated", "items": [ @@ -31,6 +11,15 @@ } ] }, + { + "text": "Other", + "items": [ + { + "text": "Transport Memory", + "link": "/examples/other-transport-memory" + } + ] + }, { "text": "Output", "items": [ @@ -44,6 +33,27 @@ } ] }, + { + "text": "Raw", + "items": [ + { + "text": "", + "link": "/examples/raw-" + }, + { + "text": "Raw String", + "link": "/examples/raw-raw-string" + }, + { + "text": "Raw String Typed", + "link": "/examples/raw-raw-string-typed" + }, + { + "text": "Raw Typed", + "link": "/examples/raw-raw-typed" + } + ] + }, { "text": "Transport Http", "items": [ diff --git a/website/content/examples/transport-memory.md b/website/content/examples/other-transport-memory.md similarity index 100% rename from website/content/examples/transport-memory.md rename to website/content/examples/other-transport-memory.md diff --git a/website/content/examples/output-envelope.md b/website/content/examples/output-envelope.md index e88a27efb..492b8d4c0 100644 --- a/website/content/examples/output-envelope.md +++ b/website/content/examples/output-envelope.md @@ -46,7 +46,7 @@ console.log(result) headers: Headers { connection: 'keep-alive', 'content-length': '119', - 'x-served-by': 'cache-yul1970039-YUL', + 'x-served-by': 'cache-yul1970035-YUL', 'accept-ranges': 'bytes', date: 'Sun, 08 Sep 2024 18:13:26 GMT', 'content-type': 'application/graphql-response+json; charset=utf-8', @@ -59,13 +59,13 @@ console.log(result) 'alt-svc': 'h3=":443"; ma=86400', 'access-control-allow-origin': '*', 'x-powered-by': 'Stellate', - age: '109533', + age: '109762', 'cache-control': 'public, s-maxage=2628000, stale-while-revalidate=2628000', 'x-cache': 'HIT', - 'x-cache-hits': '17', + 'x-cache-hits': '9', 'gcdn-cache': 'HIT', - 'stellate-rate-limit-budget-remaining': '45', - 'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=45;refill=60', + '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-decision': 'pass', 'stellate-rate-limit-budget-required': '5', 'content-encoding': 'br' diff --git a/website/content/examples/raw.md b/website/content/examples/raw-.md similarity index 99% rename from website/content/examples/raw.md rename to website/content/examples/raw-.md index f0f5789e3..59fdc3cd7 100644 --- a/website/content/examples/raw.md +++ b/website/content/examples/raw-.md @@ -2,7 +2,7 @@ aside: false --- -# Raw +# ```ts twoslash diff --git a/website/content/examples/raw-string-typed.md b/website/content/examples/raw-raw-string-typed.md similarity index 100% rename from website/content/examples/raw-string-typed.md rename to website/content/examples/raw-raw-string-typed.md diff --git a/website/content/examples/raw-string.md b/website/content/examples/raw-raw-string.md similarity index 100% rename from website/content/examples/raw-string.md rename to website/content/examples/raw-raw-string.md diff --git a/website/content/examples/raw-typed.md b/website/content/examples/raw-raw-typed.md similarity index 100% rename from website/content/examples/raw-typed.md rename to website/content/examples/raw-raw-typed.md diff --git a/website/content/examples/transport-http-dynamic-headers.md b/website/content/examples/transport-http-dynamic-headers.md index 3cd61c5bd..09383144e 100644 --- a/website/content/examples/transport-http-dynamic-headers.md +++ b/website/content/examples/transport-http-dynamic-headers.md @@ -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': '1725928738805' + 'x-sent-at-time': '1725928966760' }, signal: undefined, method: 'post', diff --git a/website/content/guides/_example_links/raw.md b/website/content/guides/_example_links/raw.md index 6b1e61d9e..f07b497a4 100644 --- a/website/content/guides/_example_links/raw.md +++ b/website/content/guides/_example_links/raw.md @@ -1 +1 @@ -###### Examples -> [Raw](../../examples/raw.md) / [Raw String](../../examples/raw-string.md) / [Raw String Typed](../../examples/raw-string-typed.md) / [Raw Typed](../../examples/raw-typed.md) / [Headers](../../examples/transport-http-headers.md) / [Raw](../../examples/transport-http-raw.md) +###### 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) diff --git a/website/content/guides/_example_links/rawString.md b/website/content/guides/_example_links/rawString.md index cca15510f..72301a7ed 100644 --- a/website/content/guides/_example_links/rawString.md +++ b/website/content/guides/_example_links/rawString.md @@ -1 +1 @@ -###### Examples -> [Raw String](../../examples/raw-string.md) / [Raw String Typed](../../examples/raw-string-typed.md) +###### Examples -> [Raw String](../../examples/raw-raw-string.md) / [Raw String Typed](../../examples/raw-raw-string-typed.md) diff --git a/website/content/guides/_example_links/rawString_rawTyped.md b/website/content/guides/_example_links/rawString_rawTyped.md index 3db5afc13..15ee419e4 100644 --- a/website/content/guides/_example_links/rawString_rawTyped.md +++ b/website/content/guides/_example_links/rawString_rawTyped.md @@ -1 +1 @@ -###### Examples -> [Raw String Typed](../../examples/raw-string-typed.md) +###### Examples -> [Raw String Typed](../../examples/raw-raw-string-typed.md) diff --git a/website/content/guides/_example_links/rawTyped.md b/website/content/guides/_example_links/rawTyped.md index ed1c436e2..6f367a11c 100644 --- a/website/content/guides/_example_links/rawTyped.md +++ b/website/content/guides/_example_links/rawTyped.md @@ -1 +1 @@ -###### Examples -> [Raw String Typed](../../examples/raw-string-typed.md) / [Raw Typed](../../examples/raw-typed.md) +###### Examples -> [Raw String Typed](../../examples/raw-raw-string-typed.md) / [Raw Typed](../../examples/raw-raw-typed.md) diff --git a/website/content/guides/_example_links/raw_rawString.md b/website/content/guides/_example_links/raw_rawString.md index cca15510f..72301a7ed 100644 --- a/website/content/guides/_example_links/raw_rawString.md +++ b/website/content/guides/_example_links/raw_rawString.md @@ -1 +1 @@ -###### Examples -> [Raw String](../../examples/raw-string.md) / [Raw String Typed](../../examples/raw-string-typed.md) +###### Examples -> [Raw String](../../examples/raw-raw-string.md) / [Raw String Typed](../../examples/raw-raw-string-typed.md) diff --git a/website/content/guides/_example_links/raw_rawString_rawTyped.md b/website/content/guides/_example_links/raw_rawString_rawTyped.md index 3db5afc13..15ee419e4 100644 --- a/website/content/guides/_example_links/raw_rawString_rawTyped.md +++ b/website/content/guides/_example_links/raw_rawString_rawTyped.md @@ -1 +1 @@ -###### Examples -> [Raw String Typed](../../examples/raw-string-typed.md) +###### Examples -> [Raw String Typed](../../examples/raw-raw-string-typed.md) diff --git a/website/content/guides/_example_links/raw_rawTyped.md b/website/content/guides/_example_links/raw_rawTyped.md index ed1c436e2..6f367a11c 100644 --- a/website/content/guides/_example_links/raw_rawTyped.md +++ b/website/content/guides/_example_links/raw_rawTyped.md @@ -1 +1 @@ -###### Examples -> [Raw String Typed](../../examples/raw-string-typed.md) / [Raw Typed](../../examples/raw-typed.md) +###### Examples -> [Raw String Typed](../../examples/raw-raw-string-typed.md) / [Raw Typed](../../examples/raw-raw-typed.md) diff --git a/website/content/guides/_example_links/transport-memory.md b/website/content/guides/_example_links/transport-memory.md index b35a97979..56d2f79c5 100644 --- a/website/content/guides/_example_links/transport-memory.md +++ b/website/content/guides/_example_links/transport-memory.md @@ -1 +1 @@ -###### Examples -> [Transport Memory](../../examples/transport-memory.md) +###### Examples -> [Transport Memory](../../examples/other-transport-memory.md)