diff --git a/examples/output|output_envelope.output.test.txt b/examples/output|output_envelope.output.test.txt new file mode 100644 index 000000000..bc978db6e --- /dev/null +++ b/examples/output|output_envelope.output.test.txt @@ -0,0 +1,27 @@ +---------------------------------------- SHOW ---------------------------------------- +{ + data: { + continents: [ + { name: 'Africa' }, + { name: 'Antarctica' }, + { name: 'Asia' }, + { name: 'Europe' }, + { name: 'North America' }, + { name: 'Oceania' }, + { name: 'South America' } + ] + }, + errors: undefined, + extensions: undefined, + response: Response { + status: 200, + statusText: '', + headers: DYNAMIC_VALUE, + body: ReadableStream { locked: true, state: 'closed', supportsBYOB: true }, + bodyUsed: true, + ok: true, + redirected: false, + type: 'basic', + url: 'https://countries.trevorblades.com/graphql' + } +} \ No newline at end of file diff --git a/examples/output|output_envelope.output.txt b/examples/output|output_envelope.output.txt index 209342d9b..69ce1a8a9 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-yul1970029-YUL', + 'x-served-by': 'cache-yul1970051-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: '110231', + age: '158583', 'cache-control': 'public, s-maxage=2628000, stale-while-revalidate=2628000', 'x-cache': 'HIT', - 'x-cache-hits': '3', + 'x-cache-hits': '36', 'gcdn-cache': 'HIT', - '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-budget-remaining': '44', + 'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=44;refill=60', 'stellate-rate-limit-decision': 'pass', 'stellate-rate-limit-budget-required': '5', 'content-encoding': 'br' diff --git a/examples/output|output_envelope_envelope-error__envelope-error.output.txt b/examples/output|output_envelope_envelope-error__envelope-error.output.txt new file mode 100644 index 000000000..0dd2a03f9 --- /dev/null +++ b/examples/output|output_envelope_envelope-error__envelope-error.output.txt @@ -0,0 +1,21 @@ +---------------------------------------- SHOW ---------------------------------------- +{ + errors: [ + ContextualError: There was an error in the extension "anonymous" (use named functions to improve this error message) while running hook "encode". + at runPipeline (/some/path/to/runPipeline.ts:76:18) + at async Object.run (/some/path/to/main.ts:286:22) + at async run (/some/path/to/client.ts:256:20) + at async executeRootType (/some/path/to/client.ts:185:12) + at async executeRootTypeField (/some/path/to/client.ts:216:20) + at async (/some/path/to/output|output_envelope_envelope-error__envelope-error.ts:24:16) { + context: { + hookName: 'encode', + source: 'extension', + extensionName: 'anonymous' + }, + cause: Error: Something went wrong. + at (/some/path/to/output|output_envelope_envelope-error__envelope-error.ts:20:9) + at applyBody (/some/path/to/main.ts:310:28) + } + ] +} \ No newline at end of file diff --git a/examples/output|output_envelope_envelope-error__envelope-error.ts b/examples/output|output_envelope_envelope-error__envelope-error.ts new file mode 100644 index 000000000..8fb733200 --- /dev/null +++ b/examples/output|output_envelope_envelope-error__envelope-error.ts @@ -0,0 +1,26 @@ +/** + * This example shows how to configure output to embed errors into the envelope. + */ + +import { Atlas } from './$/generated-clients/atlas/__.js' +import { show } from './$/helpers.js' + +// dprint-ignore +const atlas = Atlas.create({ + output: { + envelope: { + errors: { +// ^^^^^^ + execution: true, // default + other: true, + }, + }, + }, +}).use(({ encode: _ }) => { + throw new Error(`Something went wrong.`) +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +}) + +const result = await atlas.query.continents({ name: true }) + +show(result) diff --git a/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.output.txt b/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.output.txt new file mode 100644 index 000000000..39243cefb --- /dev/null +++ b/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.output.txt @@ -0,0 +1,23 @@ +/some/path/to/runPipeline.ts:76 + return new ContextualError(message, { + ^ + + +ContextualError: There was an error in the extension "anonymous" (use named functions to improve this error message) while running hook "encode". + at runPipeline (/some/path/to/runPipeline.ts:76:18) + at async Object.run (/some/path/to/main.ts:286:22) + at async run (/some/path/to/client.ts:256:20) + at async executeRootType (/some/path/to/client.ts:185:12) + at async executeRootTypeField (/some/path/to/client.ts:216:20) + at async (/some/path/to/output|output_envelope_envelope_error-throw__envelope-error-throw.ts:22:1) { + context: { + hookName: 'encode', + source: 'extension', + extensionName: 'anonymous' + }, + cause: Error: Something went wrong. + at (/some/path/to/output|output_envelope_envelope_error-throw__envelope-error-throw.ts:18:9) + at applyBody (/some/path/to/main.ts:310:28) +} + +Node.js vXX.XX.XX \ No newline at end of file diff --git a/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.ts b/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.ts new file mode 100644 index 000000000..799c047c5 --- /dev/null +++ b/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.ts @@ -0,0 +1,22 @@ +/** + * This example shows how to configure output to throw errors even when using the envelope. + */ + +import { Atlas } from './$/generated-clients/atlas/__.js' + +// dprint-ignore +const atlas = Atlas.create({ + output: { + envelope: { + errors: { + execution: false, + other: false, // default + } + }, + }, +}).use(({ encode: _ }) => { + throw new Error(`Something went wrong.`) +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +}) + +await atlas.query.continents({ name: true }) diff --git a/examples/transport-http|transport-http_extension_headers__dynamicHeaders.output.test.txt b/examples/transport-http|transport-http_extension_headers__dynamicHeaders.output.test.txt new file mode 100644 index 000000000..a6153f31a --- /dev/null +++ b/examples/transport-http|transport-http_extension_headers__dynamicHeaders.output.test.txt @@ -0,0 +1,13 @@ +---------------------------------------- SHOW ---------------------------------------- +{ + methodMode: 'post', + headers: Headers { + accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', + 'content-type': 'application/json', + 'x-sent-at-time': 'DYNAMIC_VALUE' + }, + signal: undefined, + method: 'post', + url: 'https://countries.trevorblades.com/graphql', + body: '{"query":"{ languages { code } }"}' +} \ No newline at end of file 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 c6a7de32d..261118f59 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': '1725929436225' + 'x-sent-at-time': '1725977788513' }, signal: undefined, method: 'post', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f94a8694b..12f99313c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1258,17 +1258,17 @@ packages: '@vitest/utils@2.0.5': resolution: {integrity: sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==} - '@vue/compiler-core@3.5.3': - resolution: {integrity: sha512-adAfy9boPkP233NTyvLbGEqVuIfK/R0ZsBsIOW4BZNfb4BRpRW41Do1u+ozJpsb+mdoy80O20IzAsHaihRb5qA==} + '@vue/compiler-core@3.5.4': + resolution: {integrity: sha512-oNwn+BAt3n9dK9uAYvI+XGlutwuTq/wfj4xCBaZCqwwVIGtD7D6ViihEbyYZrDHIHTDE3Q6oL3/hqmAyFEy9DQ==} - '@vue/compiler-dom@3.5.3': - resolution: {integrity: sha512-wnzFArg9zpvk/811CDOZOadJRugf1Bgl/TQ3RfV4nKfSPok4hi0w10ziYUQR6LnnBAUlEXYLUfZ71Oj9ds/+QA==} + '@vue/compiler-dom@3.5.4': + resolution: {integrity: sha512-yP9RRs4BDLOLfldn6ah+AGCNovGjMbL9uHvhDHf5wan4dAHLnFGOkqtfE7PPe4HTXIqE7l/NILdYw53bo1C8jw==} - '@vue/compiler-sfc@3.5.3': - resolution: {integrity: sha512-P3uATLny2tfyvMB04OQFe7Sczteno7SLFxwrOA/dw01pBWQHB5HL15a8PosoNX2aG/EAMGqnXTu+1LnmzFhpTQ==} + '@vue/compiler-sfc@3.5.4': + resolution: {integrity: sha512-P+yiPhL+NYH7m0ZgCq7AQR2q7OIE+mpAEgtkqEeH9oHSdIRvUO+4X6MPvblJIWcoe4YC5a2Gdf/RsoyP8FFiPQ==} - '@vue/compiler-ssr@3.5.3': - resolution: {integrity: sha512-F/5f+r2WzL/2YAPl7UlKcJWHrvoZN8XwEBLnT7S4BXwncH25iDOabhO2M2DWioyTguJAGavDOawejkFXj8EM1w==} + '@vue/compiler-ssr@3.5.4': + resolution: {integrity: sha512-acESdTXsxPnYr2C4Blv0ggx5zIFMgOzZmYU2UgvIff9POdRGbRNBHRyzHAnizcItvpgerSKQbllUc9USp3V7eg==} '@vue/devtools-api@7.4.4': resolution: {integrity: sha512-Iqqy9yBFWBbPb/jHlJzU/OrU+iHSJ/e9p/v5pZhm/L5pUCX26z32bvvjPa28vMXxRehbAZTgX8zovOeqBTnhdg==} @@ -1279,22 +1279,22 @@ packages: '@vue/devtools-shared@7.4.4': resolution: {integrity: sha512-yeJULXFHOKIm8yL2JFO050a9ztTVqOCKTqN9JHFxGTJN0b+gjtfn6zC+FfyHUgjwCwf6E3hfKrlohtthcqoYqw==} - '@vue/reactivity@3.5.3': - resolution: {integrity: sha512-2w61UnRWTP7+rj1H/j6FH706gRBHdFVpIqEkSDAyIpafBXYH8xt4gttstbbCWdU3OlcSWO8/3mbKl/93/HSMpw==} + '@vue/reactivity@3.5.4': + resolution: {integrity: sha512-HKKbEuP7tYSGCq4e4nK6ZW6l5hyG66OUetefBp4budUyjvAYsnQDf+bgFzg2RAgnH0CInyqXwD9y47jwJEHrQw==} - '@vue/runtime-core@3.5.3': - resolution: {integrity: sha512-5b2AQw5OZlmCzSsSBWYoZOsy75N4UdMWenTfDdI5bAzXnuVR7iR8Q4AOzQm2OGoA41xjk53VQKrqQhOz2ktWaw==} + '@vue/runtime-core@3.5.4': + resolution: {integrity: sha512-f3ek2sTA0AFu0n+w+kCtz567Euqqa3eHewvo4klwS7mWfSj/A+UmYTwsnUFo35KeyAFY60JgrCGvEBsu1n/3LA==} - '@vue/runtime-dom@3.5.3': - resolution: {integrity: sha512-wPR1DEGc3XnQ7yHbmkTt3GoY0cEnVGQnARRdAkDzZ8MbUKEs26gogCQo6AOvvgahfjIcnvWJzkZArQ1fmWjcSg==} + '@vue/runtime-dom@3.5.4': + resolution: {integrity: sha512-ofyc0w6rbD5KtjhP1i9hGOKdxGpvmuB1jprP7Djlj0X7R5J/oLwuNuE98GJ8WW31Hu2VxQHtk/LYTAlW8xrJdw==} - '@vue/server-renderer@3.5.3': - resolution: {integrity: sha512-28volmaZVG2PGO3V3+gBPKoSHvLlE8FGfG/GKXKkjjfxLuj/50B/0OQGakM/g6ehQeqCrZYM4eHC4Ks48eig1Q==} + '@vue/server-renderer@3.5.4': + resolution: {integrity: sha512-FbjV6DJLgKRetMYFBA1UXCroCiED/Ckr53/ba9wivyd7D/Xw9fpo0T6zXzCnxQwyvkyrL7y6plgYhWhNjGxY5g==} peerDependencies: - vue: 3.5.3 + vue: 3.5.4 - '@vue/shared@3.5.3': - resolution: {integrity: sha512-Jp2v8nylKBT+PlOUjun2Wp/f++TfJVFjshLzNtJDdmFJabJa7noGMncqXRM1vXGX+Yo2V7WykQFNxusSim8SCA==} + '@vue/shared@3.5.4': + resolution: {integrity: sha512-L2MCDD8l7yC62Te5UUyPVpmexhL9ipVnYRw9CsWfm/BGRL5FwDX4a25bcJ/OJSD3+Hx+k/a8LDKcG2AFdJV3BA==} '@vueuse/core@11.0.3': resolution: {integrity: sha512-RENlh64+SYA9XMExmmH1a3TPqeIuJBNNB/63GT35MZI+zpru3oMRUA6cEFr9HmGqEgUisurwGwnIieF6qu3aXw==} @@ -3644,8 +3644,8 @@ packages: '@vue/composition-api': optional: true - vue@3.5.3: - resolution: {integrity: sha512-xvRbd0HpuLovYbOHXRHlSBsSvmUJbo0pzbkKTApWnQGf3/cu5Z39mQeA5cZdLRVIoNf3zI6MSoOgHUT5i2jO+Q==} + vue@3.5.4: + resolution: {integrity: sha512-3yAj2gkmiY+i7+22A1PWM+kjOVXjU74UPINcTiN7grIVPyFFI0lpGwHlV/4xydDmobaBn7/xmi+YG8HeSlCTcg==} peerDependencies: typescript: '*' peerDependenciesMeta: @@ -4909,10 +4909,10 @@ snapshots: '@typescript-eslint/types': 8.5.0 eslint-visitor-keys: 3.4.3 - '@vitejs/plugin-vue@5.1.3(vite@5.4.3(@types/node@22.5.4))(vue@3.5.3(typescript@5.6.2))': + '@vitejs/plugin-vue@5.1.3(vite@5.4.3(@types/node@22.5.4))(vue@3.5.4(typescript@5.6.2))': dependencies: vite: 5.4.3(@types/node@22.5.4) - vue: 3.5.3(typescript@5.6.2) + vue: 3.5.4(typescript@5.6.2) '@vitest/expect@2.0.5': dependencies: @@ -4947,35 +4947,35 @@ snapshots: loupe: 3.1.1 tinyrainbow: 1.2.0 - '@vue/compiler-core@3.5.3': + '@vue/compiler-core@3.5.4': dependencies: '@babel/parser': 7.25.6 - '@vue/shared': 3.5.3 + '@vue/shared': 3.5.4 entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.2.1 - '@vue/compiler-dom@3.5.3': + '@vue/compiler-dom@3.5.4': dependencies: - '@vue/compiler-core': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/compiler-core': 3.5.4 + '@vue/shared': 3.5.4 - '@vue/compiler-sfc@3.5.3': + '@vue/compiler-sfc@3.5.4': dependencies: '@babel/parser': 7.25.6 - '@vue/compiler-core': 3.5.3 - '@vue/compiler-dom': 3.5.3 - '@vue/compiler-ssr': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/compiler-core': 3.5.4 + '@vue/compiler-dom': 3.5.4 + '@vue/compiler-ssr': 3.5.4 + '@vue/shared': 3.5.4 estree-walker: 2.0.2 magic-string: 0.30.11 postcss: 8.4.45 source-map-js: 1.2.1 - '@vue/compiler-ssr@3.5.3': + '@vue/compiler-ssr@3.5.4': dependencies: - '@vue/compiler-dom': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/compiler-dom': 3.5.4 + '@vue/shared': 3.5.4 '@vue/devtools-api@7.4.4': dependencies: @@ -4995,45 +4995,45 @@ snapshots: dependencies: rfdc: 1.4.1 - '@vue/reactivity@3.5.3': + '@vue/reactivity@3.5.4': dependencies: - '@vue/shared': 3.5.3 + '@vue/shared': 3.5.4 - '@vue/runtime-core@3.5.3': + '@vue/runtime-core@3.5.4': dependencies: - '@vue/reactivity': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/reactivity': 3.5.4 + '@vue/shared': 3.5.4 - '@vue/runtime-dom@3.5.3': + '@vue/runtime-dom@3.5.4': dependencies: - '@vue/reactivity': 3.5.3 - '@vue/runtime-core': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/reactivity': 3.5.4 + '@vue/runtime-core': 3.5.4 + '@vue/shared': 3.5.4 csstype: 3.1.3 - '@vue/server-renderer@3.5.3(vue@3.5.3(typescript@5.6.2))': + '@vue/server-renderer@3.5.4(vue@3.5.4(typescript@5.6.2))': dependencies: - '@vue/compiler-ssr': 3.5.3 - '@vue/shared': 3.5.3 - vue: 3.5.3(typescript@5.6.2) + '@vue/compiler-ssr': 3.5.4 + '@vue/shared': 3.5.4 + vue: 3.5.4(typescript@5.6.2) - '@vue/shared@3.5.3': {} + '@vue/shared@3.5.4': {} - '@vueuse/core@11.0.3(vue@3.5.3(typescript@5.6.2))': + '@vueuse/core@11.0.3(vue@3.5.4(typescript@5.6.2))': dependencies: '@types/web-bluetooth': 0.0.20 '@vueuse/metadata': 11.0.3 - '@vueuse/shared': 11.0.3(vue@3.5.3(typescript@5.6.2)) - vue-demi: 0.14.10(vue@3.5.3(typescript@5.6.2)) + '@vueuse/shared': 11.0.3(vue@3.5.4(typescript@5.6.2)) + vue-demi: 0.14.10(vue@3.5.4(typescript@5.6.2)) transitivePeerDependencies: - '@vue/composition-api' - vue - '@vueuse/integrations@11.0.3(focus-trap@7.5.4)(vue@3.5.3(typescript@5.6.2))': + '@vueuse/integrations@11.0.3(focus-trap@7.5.4)(vue@3.5.4(typescript@5.6.2))': dependencies: - '@vueuse/core': 11.0.3(vue@3.5.3(typescript@5.6.2)) - '@vueuse/shared': 11.0.3(vue@3.5.3(typescript@5.6.2)) - vue-demi: 0.14.10(vue@3.5.3(typescript@5.6.2)) + '@vueuse/core': 11.0.3(vue@3.5.4(typescript@5.6.2)) + '@vueuse/shared': 11.0.3(vue@3.5.4(typescript@5.6.2)) + vue-demi: 0.14.10(vue@3.5.4(typescript@5.6.2)) optionalDependencies: focus-trap: 7.5.4 transitivePeerDependencies: @@ -5042,9 +5042,9 @@ snapshots: '@vueuse/metadata@11.0.3': {} - '@vueuse/shared@11.0.3(vue@3.5.3(typescript@5.6.2))': + '@vueuse/shared@11.0.3(vue@3.5.4(typescript@5.6.2))': dependencies: - vue-demi: 0.14.10(vue@3.5.3(typescript@5.6.2)) + vue-demi: 0.14.10(vue@3.5.4(typescript@5.6.2)) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -7579,17 +7579,17 @@ snapshots: '@shikijs/core': 1.16.3 '@shikijs/transformers': 1.16.3 '@types/markdown-it': 14.1.2 - '@vitejs/plugin-vue': 5.1.3(vite@5.4.3(@types/node@22.5.4))(vue@3.5.3(typescript@5.6.2)) + '@vitejs/plugin-vue': 5.1.3(vite@5.4.3(@types/node@22.5.4))(vue@3.5.4(typescript@5.6.2)) '@vue/devtools-api': 7.4.4 - '@vue/shared': 3.5.3 - '@vueuse/core': 11.0.3(vue@3.5.3(typescript@5.6.2)) - '@vueuse/integrations': 11.0.3(focus-trap@7.5.4)(vue@3.5.3(typescript@5.6.2)) + '@vue/shared': 3.5.4 + '@vueuse/core': 11.0.3(vue@3.5.4(typescript@5.6.2)) + '@vueuse/integrations': 11.0.3(focus-trap@7.5.4)(vue@3.5.4(typescript@5.6.2)) focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 7.1.0 shiki: 1.16.3 vite: 5.4.3(@types/node@22.5.4) - vue: 3.5.3(typescript@5.6.2) + vue: 3.5.4(typescript@5.6.2) optionalDependencies: postcss: 8.4.45 transitivePeerDependencies: @@ -7655,17 +7655,17 @@ snapshots: - supports-color - terser - vue-demi@0.14.10(vue@3.5.3(typescript@5.6.2)): + vue-demi@0.14.10(vue@3.5.4(typescript@5.6.2)): dependencies: - vue: 3.5.3(typescript@5.6.2) + vue: 3.5.4(typescript@5.6.2) - vue@3.5.3(typescript@5.6.2): + vue@3.5.4(typescript@5.6.2): dependencies: - '@vue/compiler-dom': 3.5.3 - '@vue/compiler-sfc': 3.5.3 - '@vue/runtime-dom': 3.5.3 - '@vue/server-renderer': 3.5.3(vue@3.5.3(typescript@5.6.2)) - '@vue/shared': 3.5.3 + '@vue/compiler-dom': 3.5.4 + '@vue/compiler-sfc': 3.5.4 + '@vue/runtime-dom': 3.5.4 + '@vue/server-renderer': 3.5.4(vue@3.5.4(typescript@5.6.2)) + '@vue/shared': 3.5.4 optionalDependencies: typescript: 5.6.2 diff --git a/scripts/generate-examples-derivatives/generate-docs.ts b/scripts/generate-examples-derivatives/generate-docs.ts index c11df74b0..cf913b5b2 100644 --- a/scripts/generate-examples-derivatives/generate-docs.ts +++ b/scripts/generate-examples-derivatives/generate-docs.ts @@ -185,7 +185,10 @@ const transformRewriteHelperImports = (example: Example) => { * 1. Remove eslint directives. */ const transformOther = (example: Example) => { - const newContent = example.file.content.replaceAll(`/* eslint-disable */`, ``) + const newContent = example.file.content.replaceAll(`/* eslint-disable */`, ``).replaceAll( + /.*\/\/ dprint-ignore.*\n/g, + ``, + ) return { ...example, file: { diff --git a/scripts/generate-examples-derivatives/generate-outputs.ts b/scripts/generate-examples-derivatives/generate-outputs.ts index fe11268e0..d3a2eadb1 100644 --- a/scripts/generate-examples-derivatives/generate-outputs.ts +++ b/scripts/generate-examples-derivatives/generate-outputs.ts @@ -1,8 +1,6 @@ -import { execaCommand } from 'execa' import * as FS from 'node:fs/promises' -import stripAnsi from 'strip-ansi' import { deleteFiles } from '../lib/deleteFiles.js' -import { readExampleFiles } from './helpers.js' +import { readExampleFiles, runExample } from './helpers.js' export const generateOutputs = async () => { // Handle case of renaming or deleting examples. @@ -11,8 +9,8 @@ export const generateOutputs = async () => { const exampleFiles = await readExampleFiles() await Promise.all(exampleFiles.map(async (file) => { - const result = await execaCommand(`pnpm tsx ./examples/${file.name}.ts`) - const exampleResult = stripAnsi(result.stdout) + const filePath = `./examples/${file.name}.ts` + const exampleResult = await runExample(filePath) await FS.writeFile(`./examples/${file.name}.output.txt`, exampleResult) })) diff --git a/scripts/generate-examples-derivatives/generate-tests.ts b/scripts/generate-examples-derivatives/generate-tests.ts index ea5a79938..c7b05aa85 100644 --- a/scripts/generate-examples-derivatives/generate-tests.ts +++ b/scripts/generate-examples-derivatives/generate-tests.ts @@ -21,14 +21,14 @@ export const generateTests = async () => { encoderFilePath.includes(`${file.name}.output-encoder.ts`) ) const snapshotFileName = `../../${file.path.dir}/${file.name}.output${encoderFilePath ? `.test` : ``}.txt` + const exampleFilePath = `./examples/${file.name}.ts` const code = `// @vitest-environment node // WARNING: // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' import { expect, test } from 'vitest'${ encoderFilePath ? `\nimport { encode } from '${Path.relative(outputDir, encoderFilePath.replace(`.ts`, `.js`))}'` @@ -36,16 +36,14 @@ import { expect, test } from 'vitest'${ } test(\`${file.name}\`, async () => { - const result = await execaCommand(\`pnpm tsx ./examples/${file.name}.ts\`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(\`${exampleFilePath}\`) // Examples should output their data results. - const exampleResult = ${encoderFilePath ? `encode(stripAnsi(result.stdout))` : `stripAnsi(result.stdout)`} + const exampleResultMaybeEncoded = ${encoderFilePath ? `encode(exampleResult)` : `exampleResult`} // 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(\`${snapshotFileName}\`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot(\`${snapshotFileName}\`) }) ` - await FS.writeFile(Path.join(outputDir, `${file.name}.test.ts`), code) })) diff --git a/scripts/generate-examples-derivatives/helpers.ts b/scripts/generate-examples-derivatives/helpers.ts index efb994ed7..466e3e28f 100644 --- a/scripts/generate-examples-derivatives/helpers.ts +++ b/scripts/generate-examples-derivatives/helpers.ts @@ -1,4 +1,6 @@ import { capitalize, kebabCase } from 'es-toolkit' +import { execa } from 'execa' +import stripAnsi from 'strip-ansi' import { showPartition } from '../../examples/$/helpers.js' import { type File, readFiles } from '../lib/readFiles.js' @@ -127,3 +129,22 @@ export const computeCombinations = (arr: string[]): string[][] => { return result } + +export const runExample = async (filePath: string) => { + const result = await execa({ reject: false })`pnpm tsx ${filePath}` + + let exampleOutput = `` + + exampleOutput = result.failed ? result.stderr : result.stdout + exampleOutput = stripAnsi(exampleOutput) + exampleOutput = rewriteDynamicError(exampleOutput) + + return exampleOutput +} + +export const rewriteDynamicError = (value: string) => { + return value + .replaceAll(/\/.*\/(.+)\.ts/g, `/some/path/to/$1.ts`) + // When Node.js process exits via an uncaught thrown error, version is printed at bottom. + .replaceAll(/Node\.js v.+/g, `Node.js vXX.XX.XX`) +} diff --git a/src/layers/0_functions/types.ts b/src/layers/0_functions/types.ts index a198600ff..ca80ebe37 100644 --- a/src/layers/0_functions/types.ts +++ b/src/layers/0_functions/types.ts @@ -17,13 +17,13 @@ export type BaseInput<$Document extends DocumentInput = DocumentInput> = document: $Document operationName?: OperationNameInput } - & ( + & NoInfer<( $Document extends TypedDocumentString ? GetVariablesInputFromString> : string extends $Document ? { variables?: StandardScalarVariables } : GetVariablesInputFromDocumentNode> - ) + )> // dprint-ignore type GetVariablesInputFromString<$Document extends TypedDocumentString> = diff --git a/tests/examples/generated|generated_arguments__arguments.test.ts b/tests/examples/generated|generated_arguments__arguments.test.ts index 10fcbc164..30dea3e45 100644 --- a/tests/examples/generated|generated_arguments__arguments.test.ts +++ b/tests/examples/generated|generated_arguments__arguments.test.ts @@ -4,18 +4,16 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`generated|generated_arguments__arguments`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/generated|generated_arguments__arguments.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/generated|generated_arguments__arguments.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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( + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( `../.././examples/generated|generated_arguments__arguments.output.txt`, ) }) diff --git a/tests/examples/other|transport-memory.test.ts b/tests/examples/other|transport-memory.test.ts index 567a85844..96124daa5 100644 --- a/tests/examples/other|transport-memory.test.ts +++ b/tests/examples/other|transport-memory.test.ts @@ -4,16 +4,14 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`other|transport-memory`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/other|transport-memory.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/other|transport-memory.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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/other|transport-memory.output.txt`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot(`../.././examples/other|transport-memory.output.txt`) }) diff --git a/tests/examples/output|output_default.test.ts b/tests/examples/output|output_default.test.ts index 5401fdf19..41e22be21 100644 --- a/tests/examples/output|output_default.test.ts +++ b/tests/examples/output|output_default.test.ts @@ -4,16 +4,14 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`output|output_default`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/output|output_default.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/output|output_default.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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/output|output_default.output.txt`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot(`../.././examples/output|output_default.output.txt`) }) diff --git a/tests/examples/output|output_envelope.test.ts b/tests/examples/output|output_envelope.test.ts index 1c529bd0d..fff3fbe9f 100644 --- a/tests/examples/output|output_envelope.test.ts +++ b/tests/examples/output|output_envelope.test.ts @@ -4,17 +4,15 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' import { encode } from '../../examples/output|output_envelope.output-encoder.js' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`output|output_envelope`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/output|output_envelope.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/output|output_envelope.ts`) // Examples should output their data results. - const exampleResult = encode(stripAnsi(result.stdout)) + const exampleResultMaybeEncoded = encode(exampleResult) // 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/output|output_envelope.output.test.txt`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot(`../.././examples/output|output_envelope.output.test.txt`) }) diff --git a/tests/examples/output|output_envelope_envelope-error__envelope-error.test.ts b/tests/examples/output|output_envelope_envelope-error__envelope-error.test.ts new file mode 100644 index 000000000..e7f9ed4b1 --- /dev/null +++ b/tests/examples/output|output_envelope_envelope-error__envelope-error.test.ts @@ -0,0 +1,19 @@ +// @vitest-environment node + +// WARNING: +// This test is generated by scripts/generate-example-derivatives/generate.ts +// Do not modify this file directly. + +import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' + +test(`output|output_envelope_envelope-error__envelope-error`, async () => { + const exampleResult = await runExample(`./examples/output|output_envelope_envelope-error__envelope-error.ts`) + // Examples should output their data results. + const exampleResultMaybeEncoded = exampleResult + // 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(exampleResultMaybeEncoded).toMatchFileSnapshot( + `../.././examples/output|output_envelope_envelope-error__envelope-error.output.txt`, + ) +}) diff --git a/tests/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.test.ts b/tests/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.test.ts new file mode 100644 index 000000000..13d5b5797 --- /dev/null +++ b/tests/examples/output|output_envelope_envelope_error-throw__envelope-error-throw.test.ts @@ -0,0 +1,21 @@ +// @vitest-environment node + +// WARNING: +// This test is generated by scripts/generate-example-derivatives/generate.ts +// Do not modify this file directly. + +import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' + +test(`output|output_envelope_envelope_error-throw__envelope-error-throw`, async () => { + const exampleResult = await runExample( + `./examples/output|output_envelope_envelope_error-throw__envelope-error-throw.ts`, + ) + // Examples should output their data results. + const exampleResultMaybeEncoded = exampleResult + // 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(exampleResultMaybeEncoded).toMatchFileSnapshot( + `../.././examples/output|output_envelope_envelope_error-throw__envelope-error-throw.output.txt`, + ) +}) diff --git a/tests/examples/raw|raw.test.ts b/tests/examples/raw|raw.test.ts index f10a788e4..0c51ec7d5 100644 --- a/tests/examples/raw|raw.test.ts +++ b/tests/examples/raw|raw.test.ts @@ -4,16 +4,14 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`raw|raw`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/raw|raw.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/raw|raw.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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|raw.output.txt`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot(`../.././examples/raw|raw.output.txt`) }) diff --git a/tests/examples/raw|raw_rawString__rawString.test.ts b/tests/examples/raw|raw_rawString__rawString.test.ts index 1a1d73f36..81ee25957 100644 --- a/tests/examples/raw|raw_rawString__rawString.test.ts +++ b/tests/examples/raw|raw_rawString__rawString.test.ts @@ -4,16 +4,16 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`raw|raw_rawString__rawString`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/raw|raw_rawString__rawString.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/raw|raw_rawString__rawString.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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|raw_rawString__rawString.output.txt`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( + `../.././examples/raw|raw_rawString__rawString.output.txt`, + ) }) diff --git a/tests/examples/raw|raw_rawString_rawTyped__rawString-typed.test.ts b/tests/examples/raw|raw_rawString_rawTyped__rawString-typed.test.ts index 1e767bfd9..dc2c28a03 100644 --- a/tests/examples/raw|raw_rawString_rawTyped__rawString-typed.test.ts +++ b/tests/examples/raw|raw_rawString_rawTyped__rawString-typed.test.ts @@ -4,18 +4,16 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' 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) + const exampleResult = await runExample(`./examples/raw|raw_rawString_rawTyped__rawString-typed.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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( + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( `../.././examples/raw|raw_rawString_rawTyped__rawString-typed.output.txt`, ) }) diff --git a/tests/examples/raw|raw_rawTyped__raw-typed.test.ts b/tests/examples/raw|raw_rawTyped__raw-typed.test.ts index 3305c8b6f..1f5512e64 100644 --- a/tests/examples/raw|raw_rawTyped__raw-typed.test.ts +++ b/tests/examples/raw|raw_rawTyped__raw-typed.test.ts @@ -4,16 +4,14 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' 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) + const exampleResult = await runExample(`./examples/raw|raw_rawTyped__raw-typed.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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|raw_rawTyped__raw-typed.output.txt`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot(`../.././examples/raw|raw_rawTyped__raw-typed.output.txt`) }) diff --git a/tests/examples/transport-http|transport-http_abort.test.ts b/tests/examples/transport-http|transport-http_abort.test.ts index 97471fd9e..efac00cc6 100644 --- a/tests/examples/transport-http|transport-http_abort.test.ts +++ b/tests/examples/transport-http|transport-http_abort.test.ts @@ -4,16 +4,16 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`transport-http|transport-http_abort`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/transport-http|transport-http_abort.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/transport-http|transport-http_abort.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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-http|transport-http_abort.output.txt`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( + `../.././examples/transport-http|transport-http_abort.output.txt`, + ) }) diff --git a/tests/examples/transport-http|transport-http_extension_fetch__custom-fetch.test.ts b/tests/examples/transport-http|transport-http_extension_fetch__custom-fetch.test.ts index a6492303a..0c0f85de6 100644 --- a/tests/examples/transport-http|transport-http_extension_fetch__custom-fetch.test.ts +++ b/tests/examples/transport-http|transport-http_extension_fetch__custom-fetch.test.ts @@ -4,20 +4,16 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`transport-http|transport-http_extension_fetch__custom-fetch`, async () => { - const result = await execaCommand( - `pnpm tsx ./examples/transport-http|transport-http_extension_fetch__custom-fetch.ts`, - ) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/transport-http|transport-http_extension_fetch__custom-fetch.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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( + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( `../.././examples/transport-http|transport-http_extension_fetch__custom-fetch.output.txt`, ) }) diff --git a/tests/examples/transport-http|transport-http_extension_headers__dynamicHeaders.test.ts b/tests/examples/transport-http|transport-http_extension_headers__dynamicHeaders.test.ts index 8893894f0..e1b0520f7 100644 --- a/tests/examples/transport-http|transport-http_extension_headers__dynamicHeaders.test.ts +++ b/tests/examples/transport-http|transport-http_extension_headers__dynamicHeaders.test.ts @@ -4,21 +4,19 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' import { encode } from '../../examples/transport-http|transport-http_extension_headers__dynamicHeaders.output-encoder.js' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`transport-http|transport-http_extension_headers__dynamicHeaders`, async () => { - const result = await execaCommand( - `pnpm tsx ./examples/transport-http|transport-http_extension_headers__dynamicHeaders.ts`, + const exampleResult = await runExample( + `./examples/transport-http|transport-http_extension_headers__dynamicHeaders.ts`, ) - expect(result.exitCode).toBe(0) // Examples should output their data results. - const exampleResult = encode(stripAnsi(result.stdout)) + const exampleResultMaybeEncoded = encode(exampleResult) // 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( + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( `../.././examples/transport-http|transport-http_extension_headers__dynamicHeaders.output.test.txt`, ) }) diff --git a/tests/examples/transport-http|transport-http_headers_raw__headers.test.ts b/tests/examples/transport-http|transport-http_headers_raw__headers.test.ts index 47faa5542..a88962128 100644 --- a/tests/examples/transport-http|transport-http_headers_raw__headers.test.ts +++ b/tests/examples/transport-http|transport-http_headers_raw__headers.test.ts @@ -4,18 +4,16 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`transport-http|transport-http_headers_raw__headers`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/transport-http|transport-http_headers_raw__headers.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/transport-http|transport-http_headers_raw__headers.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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( + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( `../.././examples/transport-http|transport-http_headers_raw__headers.output.txt`, ) }) diff --git a/tests/examples/transport-http|transport-http_method-get.test.ts b/tests/examples/transport-http|transport-http_method-get.test.ts index 2f3f0ced1..e74682945 100644 --- a/tests/examples/transport-http|transport-http_method-get.test.ts +++ b/tests/examples/transport-http|transport-http_method-get.test.ts @@ -4,18 +4,16 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`transport-http|transport-http_method-get`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/transport-http|transport-http_method-get.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/transport-http|transport-http_method-get.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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( + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( `../.././examples/transport-http|transport-http_method-get.output.txt`, ) }) diff --git a/tests/examples/transport-http|transport-http_raw.test.ts b/tests/examples/transport-http|transport-http_raw.test.ts index 8adaa505f..dfb1ca5eb 100644 --- a/tests/examples/transport-http|transport-http_raw.test.ts +++ b/tests/examples/transport-http|transport-http_raw.test.ts @@ -4,16 +4,16 @@ // This test is generated by scripts/generate-example-derivatives/generate.ts // Do not modify this file directly. -import { execaCommand } from 'execa' -import stripAnsi from 'strip-ansi' import { expect, test } from 'vitest' +import { runExample } from '../../scripts/generate-examples-derivatives/helpers.js' test(`transport-http|transport-http_raw`, async () => { - const result = await execaCommand(`pnpm tsx ./examples/transport-http|transport-http_raw.ts`) - expect(result.exitCode).toBe(0) + const exampleResult = await runExample(`./examples/transport-http|transport-http_raw.ts`) // Examples should output their data results. - const exampleResult = stripAnsi(result.stdout) + const exampleResultMaybeEncoded = exampleResult // 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-http|transport-http_raw.output.txt`) + await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( + `../.././examples/transport-http|transport-http_raw.output.txt`, + ) }) diff --git a/website/.vitepress/configExamples.ts b/website/.vitepress/configExamples.ts index 0a311a52e..f7f3342b4 100644 --- a/website/.vitepress/configExamples.ts +++ b/website/.vitepress/configExamples.ts @@ -30,6 +30,14 @@ { "text": "Envelope", "link": "/examples/output-envelope" + }, + { + "text": "Envelope Error", + "link": "/examples/output-envelope-error" + }, + { + "text": "Envelope Error Throw", + "link": "/examples/output-envelope-error-throw" } ] }, diff --git a/website/.vitepress/theme/custom.css b/website/.vitepress/theme/custom.css index 94ecee31f..9bfcb0c85 100644 --- a/website/.vitepress/theme/custom.css +++ b/website/.vitepress/theme/custom.css @@ -78,7 +78,7 @@ } .dark .twoslash-highlighted { - --twoslash-highlighted-bg: hsla(208.91, 100%, 84.25%, 0.05); + --twoslash-highlighted-bg: hsla(257, 85%, 51%, 0.38); } diff --git a/website/content/examples/output-envelope-error-throw.md b/website/content/examples/output-envelope-error-throw.md new file mode 100644 index 000000000..ccf24ca98 --- /dev/null +++ b/website/content/examples/output-envelope-error-throw.md @@ -0,0 +1,60 @@ +--- +aside: false +--- + +# Envelope Error Throw + +This example shows how to configure output to throw errors even when using the envelope. + + +```ts twoslash +// ---cut--- +import { Graffle as Atlas } from './graffle/__.js' + +const atlas = Atlas.create({ + output: { + envelope: { + errors: { + execution: false, + other: false, // default + } + }, + }, +}).use(({ encode: _ }) => { + throw new Error(`Something went wrong.`) +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +}) + +await atlas.query.continents({ name: true }) +``` + + +#### Outputs + + +```txt +/some/path/to/runPipeline.ts:76 + return new ContextualError(message, { + ^ + + +ContextualError: There was an error in the extension "anonymous" (use named functions to improve this error message) while running hook "encode". + at runPipeline (/some/path/to/runPipeline.ts:76:18) + at async Object.run (/some/path/to/main.ts:286:22) + at async run (/some/path/to/client.ts:256:20) + at async executeRootType (/some/path/to/client.ts:185:12) + at async executeRootTypeField (/some/path/to/client.ts:216:20) + at async (/some/path/to/output|output_envelope_envelope_error-throw__envelope-error-throw.ts:22:1) { + context: { + hookName: 'encode', + source: 'extension', + extensionName: 'anonymous' + }, + cause: Error: Something went wrong. + at (/some/path/to/output|output_envelope_envelope_error-throw__envelope-error-throw.ts:18:9) + at applyBody (/some/path/to/main.ts:310:28) +} + +Node.js vXX.XX.XX +``` + diff --git a/website/content/examples/output-envelope-error.md b/website/content/examples/output-envelope-error.md new file mode 100644 index 000000000..f34633634 --- /dev/null +++ b/website/content/examples/output-envelope-error.md @@ -0,0 +1,61 @@ +--- +aside: false +--- + +# Envelope Error + +This example shows how to configure output to embed errors into the envelope. + + +```ts twoslash +// ---cut--- +import { Graffle as Atlas } from './graffle/__.js' + +const atlas = Atlas.create({ + output: { + envelope: { + errors: { +// ^^^^^^ + execution: true, // default + other: true, + }, + }, + }, +}).use(({ encode: _ }) => { + throw new Error(`Something went wrong.`) +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +}) + +const result = await atlas.query.continents({ name: true }) + +console.log(result) +// ^? +``` + + +#### Outputs + + +```txt +{ + errors: [ + ContextualError: There was an error in the extension "anonymous" (use named functions to improve this error message) while running hook "encode". + at runPipeline (/some/path/to/runPipeline.ts:76:18) + at async Object.run (/some/path/to/main.ts:286:22) + at async run (/some/path/to/client.ts:256:20) + at async executeRootType (/some/path/to/client.ts:185:12) + at async executeRootTypeField (/some/path/to/client.ts:216:20) + at async (/some/path/to/output|output_envelope_envelope-error__envelope-error.ts:24:16) { + context: { + hookName: 'encode', + source: 'extension', + extensionName: 'anonymous' + }, + cause: Error: Something went wrong. + at (/some/path/to/output|output_envelope_envelope-error__envelope-error.ts:20:9) + at applyBody (/some/path/to/main.ts:310:28) + } + ] +} +``` + diff --git a/website/content/examples/output-envelope.md b/website/content/examples/output-envelope.md index 2dbf1f2ff..b69c6c8df 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-yul1970029-YUL', + 'x-served-by': 'cache-yul1970051-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: '110231', + age: '158583', 'cache-control': 'public, s-maxage=2628000, stale-while-revalidate=2628000', 'x-cache': 'HIT', - 'x-cache-hits': '3', + 'x-cache-hits': '36', 'gcdn-cache': 'HIT', - '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-budget-remaining': '44', + 'stellate-rate-limit-rules': '"IP limit";type="RequestCount";budget=50;limited=?0;remaining=44;refill=60', 'stellate-rate-limit-decision': 'pass', 'stellate-rate-limit-budget-required': '5', 'content-encoding': 'br' diff --git a/website/content/examples/transport-http-dynamic-headers.md b/website/content/examples/transport-http-dynamic-headers.md index 1e126c481..4003fa538 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': '1725929436225' + 'x-sent-at-time': '1725977788513' }, signal: undefined, method: 'post', diff --git a/website/content/guides/_example_links/envelope-error.md b/website/content/guides/_example_links/envelope-error.md new file mode 100644 index 000000000..7c5215773 --- /dev/null +++ b/website/content/guides/_example_links/envelope-error.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error](../../examples/output-envelope-error.md) diff --git a/website/content/guides/_example_links/envelope.md b/website/content/guides/_example_links/envelope.md index 43f2da472..4e7a95f27 100644 --- a/website/content/guides/_example_links/envelope.md +++ b/website/content/guides/_example_links/envelope.md @@ -1 +1 @@ -###### Examples -> [Envelope](../../examples/output-envelope.md) +###### Examples -> [Envelope](../../examples/output-envelope.md) / [Envelope Error](../../examples/output-envelope-error.md) / [Envelope Error Throw](../../examples/output-envelope-error-throw.md) / [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/envelope_envelope-error.md b/website/content/guides/_example_links/envelope_envelope-error.md new file mode 100644 index 000000000..7c5215773 --- /dev/null +++ b/website/content/guides/_example_links/envelope_envelope-error.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error](../../examples/output-envelope-error.md) diff --git a/website/content/guides/_example_links/envelope_envelope.md b/website/content/guides/_example_links/envelope_envelope.md new file mode 100644 index 000000000..ad08b8ff8 --- /dev/null +++ b/website/content/guides/_example_links/envelope_envelope.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/envelope_envelope_error-throw.md b/website/content/guides/_example_links/envelope_envelope_error-throw.md new file mode 100644 index 000000000..ad08b8ff8 --- /dev/null +++ b/website/content/guides/_example_links/envelope_envelope_error-throw.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/envelope_error-throw.md b/website/content/guides/_example_links/envelope_error-throw.md new file mode 100644 index 000000000..75adc0935 --- /dev/null +++ b/website/content/guides/_example_links/envelope_error-throw.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error Throw](../../examples/output-envelope-error-throw.md) / [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/error-throw.md b/website/content/guides/_example_links/error-throw.md new file mode 100644 index 000000000..ad08b8ff8 --- /dev/null +++ b/website/content/guides/_example_links/error-throw.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/output.md b/website/content/guides/_example_links/output.md index e76d6f07a..3ea9def67 100644 --- a/website/content/guides/_example_links/output.md +++ b/website/content/guides/_example_links/output.md @@ -1 +1 @@ -###### Examples -> [Default](../../examples/output-default.md) / [Envelope](../../examples/output-envelope.md) +###### Examples -> [Default](../../examples/output-default.md) / [Envelope](../../examples/output-envelope.md) / [Envelope Error](../../examples/output-envelope-error.md) / [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/output_envelope-error.md b/website/content/guides/_example_links/output_envelope-error.md new file mode 100644 index 000000000..7c5215773 --- /dev/null +++ b/website/content/guides/_example_links/output_envelope-error.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error](../../examples/output-envelope-error.md) diff --git a/website/content/guides/_example_links/output_envelope.md b/website/content/guides/_example_links/output_envelope.md index 43f2da472..4e7a95f27 100644 --- a/website/content/guides/_example_links/output_envelope.md +++ b/website/content/guides/_example_links/output_envelope.md @@ -1 +1 @@ -###### Examples -> [Envelope](../../examples/output-envelope.md) +###### Examples -> [Envelope](../../examples/output-envelope.md) / [Envelope Error](../../examples/output-envelope-error.md) / [Envelope Error Throw](../../examples/output-envelope-error-throw.md) / [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/output_envelope_envelope-error.md b/website/content/guides/_example_links/output_envelope_envelope-error.md new file mode 100644 index 000000000..7c5215773 --- /dev/null +++ b/website/content/guides/_example_links/output_envelope_envelope-error.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error](../../examples/output-envelope-error.md) diff --git a/website/content/guides/_example_links/output_envelope_envelope.md b/website/content/guides/_example_links/output_envelope_envelope.md new file mode 100644 index 000000000..ad08b8ff8 --- /dev/null +++ b/website/content/guides/_example_links/output_envelope_envelope.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/output_envelope_envelope_error-throw.md b/website/content/guides/_example_links/output_envelope_envelope_error-throw.md new file mode 100644 index 000000000..ad08b8ff8 --- /dev/null +++ b/website/content/guides/_example_links/output_envelope_envelope_error-throw.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/output_envelope_error-throw.md b/website/content/guides/_example_links/output_envelope_error-throw.md new file mode 100644 index 000000000..75adc0935 --- /dev/null +++ b/website/content/guides/_example_links/output_envelope_error-throw.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error Throw](../../examples/output-envelope-error-throw.md) / [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/content/guides/_example_links/output_error-throw.md b/website/content/guides/_example_links/output_error-throw.md new file mode 100644 index 000000000..ad08b8ff8 --- /dev/null +++ b/website/content/guides/_example_links/output_error-throw.md @@ -0,0 +1 @@ +###### Examples -> [Envelope Error Throw](../../examples/output-envelope-error-throw.md) diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index 3c016624b..9f5704d72 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -25,7 +25,7 @@ importers: version: 1.17.0 floating-vue: specifier: ^5.2.2 - version: 5.2.2(vue@3.5.3(typescript@5.6.2)) + version: 5.2.2(vue@3.5.4(typescript@5.6.2)) globby: specifier: ^14.0.2 version: 14.0.2 @@ -631,17 +631,17 @@ packages: '@volar/source-map@2.4.4': resolution: {integrity: sha512-xG3PZqOP2haG8XG4Pg3PD1UGDAdqZg24Ru8c/qYjYAnmcj6GBR64mstx+bZux5QOyRaJK+/lNM/RnpvBD3489g==} - '@vue/compiler-core@3.5.3': - resolution: {integrity: sha512-adAfy9boPkP233NTyvLbGEqVuIfK/R0ZsBsIOW4BZNfb4BRpRW41Do1u+ozJpsb+mdoy80O20IzAsHaihRb5qA==} + '@vue/compiler-core@3.5.4': + resolution: {integrity: sha512-oNwn+BAt3n9dK9uAYvI+XGlutwuTq/wfj4xCBaZCqwwVIGtD7D6ViihEbyYZrDHIHTDE3Q6oL3/hqmAyFEy9DQ==} - '@vue/compiler-dom@3.5.3': - resolution: {integrity: sha512-wnzFArg9zpvk/811CDOZOadJRugf1Bgl/TQ3RfV4nKfSPok4hi0w10ziYUQR6LnnBAUlEXYLUfZ71Oj9ds/+QA==} + '@vue/compiler-dom@3.5.4': + resolution: {integrity: sha512-yP9RRs4BDLOLfldn6ah+AGCNovGjMbL9uHvhDHf5wan4dAHLnFGOkqtfE7PPe4HTXIqE7l/NILdYw53bo1C8jw==} - '@vue/compiler-sfc@3.5.3': - resolution: {integrity: sha512-P3uATLny2tfyvMB04OQFe7Sczteno7SLFxwrOA/dw01pBWQHB5HL15a8PosoNX2aG/EAMGqnXTu+1LnmzFhpTQ==} + '@vue/compiler-sfc@3.5.4': + resolution: {integrity: sha512-P+yiPhL+NYH7m0ZgCq7AQR2q7OIE+mpAEgtkqEeH9oHSdIRvUO+4X6MPvblJIWcoe4YC5a2Gdf/RsoyP8FFiPQ==} - '@vue/compiler-ssr@3.5.3': - resolution: {integrity: sha512-F/5f+r2WzL/2YAPl7UlKcJWHrvoZN8XwEBLnT7S4BXwncH25iDOabhO2M2DWioyTguJAGavDOawejkFXj8EM1w==} + '@vue/compiler-ssr@3.5.4': + resolution: {integrity: sha512-acESdTXsxPnYr2C4Blv0ggx5zIFMgOzZmYU2UgvIff9POdRGbRNBHRyzHAnizcItvpgerSKQbllUc9USp3V7eg==} '@vue/compiler-vue2@2.7.16': resolution: {integrity: sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==} @@ -663,22 +663,22 @@ packages: typescript: optional: true - '@vue/reactivity@3.5.3': - resolution: {integrity: sha512-2w61UnRWTP7+rj1H/j6FH706gRBHdFVpIqEkSDAyIpafBXYH8xt4gttstbbCWdU3OlcSWO8/3mbKl/93/HSMpw==} + '@vue/reactivity@3.5.4': + resolution: {integrity: sha512-HKKbEuP7tYSGCq4e4nK6ZW6l5hyG66OUetefBp4budUyjvAYsnQDf+bgFzg2RAgnH0CInyqXwD9y47jwJEHrQw==} - '@vue/runtime-core@3.5.3': - resolution: {integrity: sha512-5b2AQw5OZlmCzSsSBWYoZOsy75N4UdMWenTfDdI5bAzXnuVR7iR8Q4AOzQm2OGoA41xjk53VQKrqQhOz2ktWaw==} + '@vue/runtime-core@3.5.4': + resolution: {integrity: sha512-f3ek2sTA0AFu0n+w+kCtz567Euqqa3eHewvo4klwS7mWfSj/A+UmYTwsnUFo35KeyAFY60JgrCGvEBsu1n/3LA==} - '@vue/runtime-dom@3.5.3': - resolution: {integrity: sha512-wPR1DEGc3XnQ7yHbmkTt3GoY0cEnVGQnARRdAkDzZ8MbUKEs26gogCQo6AOvvgahfjIcnvWJzkZArQ1fmWjcSg==} + '@vue/runtime-dom@3.5.4': + resolution: {integrity: sha512-ofyc0w6rbD5KtjhP1i9hGOKdxGpvmuB1jprP7Djlj0X7R5J/oLwuNuE98GJ8WW31Hu2VxQHtk/LYTAlW8xrJdw==} - '@vue/server-renderer@3.5.3': - resolution: {integrity: sha512-28volmaZVG2PGO3V3+gBPKoSHvLlE8FGfG/GKXKkjjfxLuj/50B/0OQGakM/g6ehQeqCrZYM4eHC4Ks48eig1Q==} + '@vue/server-renderer@3.5.4': + resolution: {integrity: sha512-FbjV6DJLgKRetMYFBA1UXCroCiED/Ckr53/ba9wivyd7D/Xw9fpo0T6zXzCnxQwyvkyrL7y6plgYhWhNjGxY5g==} peerDependencies: - vue: 3.5.3 + vue: 3.5.4 - '@vue/shared@3.5.3': - resolution: {integrity: sha512-Jp2v8nylKBT+PlOUjun2Wp/f++TfJVFjshLzNtJDdmFJabJa7noGMncqXRM1vXGX+Yo2V7WykQFNxusSim8SCA==} + '@vue/shared@3.5.4': + resolution: {integrity: sha512-L2MCDD8l7yC62Te5UUyPVpmexhL9ipVnYRw9CsWfm/BGRL5FwDX4a25bcJ/OJSD3+Hx+k/a8LDKcG2AFdJV3BA==} '@vueuse/core@11.0.3': resolution: {integrity: sha512-RENlh64+SYA9XMExmmH1a3TPqeIuJBNNB/63GT35MZI+zpru3oMRUA6cEFr9HmGqEgUisurwGwnIieF6qu3aXw==} @@ -1212,8 +1212,8 @@ packages: peerDependencies: vue: ^3.0.0 - vue@3.5.3: - resolution: {integrity: sha512-xvRbd0HpuLovYbOHXRHlSBsSvmUJbo0pzbkKTApWnQGf3/cu5Z39mQeA5cZdLRVIoNf3zI6MSoOgHUT5i2jO+Q==} + vue@3.5.4: + resolution: {integrity: sha512-3yAj2gkmiY+i7+22A1PWM+kjOVXjU74UPINcTiN7grIVPyFFI0lpGwHlV/4xydDmobaBn7/xmi+YG8HeSlCTcg==} peerDependencies: typescript: '*' peerDependenciesMeta: @@ -1618,14 +1618,14 @@ snapshots: '@shikijs/vitepress-twoslash@1.16.3(typescript@5.6.2)': dependencies: '@shikijs/twoslash': 1.16.3(typescript@5.6.2) - floating-vue: 5.2.2(vue@3.5.3(typescript@5.6.2)) + floating-vue: 5.2.2(vue@3.5.4(typescript@5.6.2)) mdast-util-from-markdown: 2.0.1 mdast-util-gfm: 3.0.0 mdast-util-to-hast: 13.2.0 shiki: 1.16.3 twoslash: 0.2.11(typescript@5.6.2) twoslash-vue: 0.2.11(typescript@5.6.2) - vue: 3.5.3(typescript@5.6.2) + vue: 3.5.4(typescript@5.6.2) transitivePeerDependencies: - '@nuxt/kit' - supports-color @@ -1677,10 +1677,10 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-vue@5.1.3(vite@5.4.3)(vue@3.5.3(typescript@5.6.2))': + '@vitejs/plugin-vue@5.1.3(vite@5.4.3)(vue@3.5.4(typescript@5.6.2))': dependencies: vite: 5.4.3 - vue: 3.5.3(typescript@5.6.2) + vue: 3.5.4(typescript@5.6.2) '@volar/language-core@2.4.4': dependencies: @@ -1688,35 +1688,35 @@ snapshots: '@volar/source-map@2.4.4': {} - '@vue/compiler-core@3.5.3': + '@vue/compiler-core@3.5.4': dependencies: '@babel/parser': 7.25.6 - '@vue/shared': 3.5.3 + '@vue/shared': 3.5.4 entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.2.1 - '@vue/compiler-dom@3.5.3': + '@vue/compiler-dom@3.5.4': dependencies: - '@vue/compiler-core': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/compiler-core': 3.5.4 + '@vue/shared': 3.5.4 - '@vue/compiler-sfc@3.5.3': + '@vue/compiler-sfc@3.5.4': dependencies: '@babel/parser': 7.25.6 - '@vue/compiler-core': 3.5.3 - '@vue/compiler-dom': 3.5.3 - '@vue/compiler-ssr': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/compiler-core': 3.5.4 + '@vue/compiler-dom': 3.5.4 + '@vue/compiler-ssr': 3.5.4 + '@vue/shared': 3.5.4 estree-walker: 2.0.2 magic-string: 0.30.11 postcss: 8.4.45 source-map-js: 1.2.1 - '@vue/compiler-ssr@3.5.3': + '@vue/compiler-ssr@3.5.4': dependencies: - '@vue/compiler-dom': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/compiler-dom': 3.5.4 + '@vue/shared': 3.5.4 '@vue/compiler-vue2@2.7.16': dependencies: @@ -1744,9 +1744,9 @@ snapshots: '@vue/language-core@2.1.6(typescript@5.6.2)': dependencies: '@volar/language-core': 2.4.4 - '@vue/compiler-dom': 3.5.3 + '@vue/compiler-dom': 3.5.4 '@vue/compiler-vue2': 2.7.16 - '@vue/shared': 3.5.3 + '@vue/shared': 3.5.4 computeds: 0.0.1 minimatch: 9.0.5 muggle-string: 0.4.1 @@ -1754,45 +1754,45 @@ snapshots: optionalDependencies: typescript: 5.6.2 - '@vue/reactivity@3.5.3': + '@vue/reactivity@3.5.4': dependencies: - '@vue/shared': 3.5.3 + '@vue/shared': 3.5.4 - '@vue/runtime-core@3.5.3': + '@vue/runtime-core@3.5.4': dependencies: - '@vue/reactivity': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/reactivity': 3.5.4 + '@vue/shared': 3.5.4 - '@vue/runtime-dom@3.5.3': + '@vue/runtime-dom@3.5.4': dependencies: - '@vue/reactivity': 3.5.3 - '@vue/runtime-core': 3.5.3 - '@vue/shared': 3.5.3 + '@vue/reactivity': 3.5.4 + '@vue/runtime-core': 3.5.4 + '@vue/shared': 3.5.4 csstype: 3.1.3 - '@vue/server-renderer@3.5.3(vue@3.5.3(typescript@5.6.2))': + '@vue/server-renderer@3.5.4(vue@3.5.4(typescript@5.6.2))': dependencies: - '@vue/compiler-ssr': 3.5.3 - '@vue/shared': 3.5.3 - vue: 3.5.3(typescript@5.6.2) + '@vue/compiler-ssr': 3.5.4 + '@vue/shared': 3.5.4 + vue: 3.5.4(typescript@5.6.2) - '@vue/shared@3.5.3': {} + '@vue/shared@3.5.4': {} - '@vueuse/core@11.0.3(vue@3.5.3(typescript@5.6.2))': + '@vueuse/core@11.0.3(vue@3.5.4(typescript@5.6.2))': dependencies: '@types/web-bluetooth': 0.0.20 '@vueuse/metadata': 11.0.3 - '@vueuse/shared': 11.0.3(vue@3.5.3(typescript@5.6.2)) - vue-demi: 0.14.10(vue@3.5.3(typescript@5.6.2)) + '@vueuse/shared': 11.0.3(vue@3.5.4(typescript@5.6.2)) + vue-demi: 0.14.10(vue@3.5.4(typescript@5.6.2)) transitivePeerDependencies: - '@vue/composition-api' - vue - '@vueuse/integrations@11.0.3(focus-trap@7.5.4)(vue@3.5.3(typescript@5.6.2))': + '@vueuse/integrations@11.0.3(focus-trap@7.5.4)(vue@3.5.4(typescript@5.6.2))': dependencies: - '@vueuse/core': 11.0.3(vue@3.5.3(typescript@5.6.2)) - '@vueuse/shared': 11.0.3(vue@3.5.3(typescript@5.6.2)) - vue-demi: 0.14.10(vue@3.5.3(typescript@5.6.2)) + '@vueuse/core': 11.0.3(vue@3.5.4(typescript@5.6.2)) + '@vueuse/shared': 11.0.3(vue@3.5.4(typescript@5.6.2)) + vue-demi: 0.14.10(vue@3.5.4(typescript@5.6.2)) optionalDependencies: focus-trap: 7.5.4 transitivePeerDependencies: @@ -1801,9 +1801,9 @@ snapshots: '@vueuse/metadata@11.0.3': {} - '@vueuse/shared@11.0.3(vue@3.5.3(typescript@5.6.2))': + '@vueuse/shared@11.0.3(vue@3.5.4(typescript@5.6.2))': dependencies: - vue-demi: 0.14.10(vue@3.5.3(typescript@5.6.2)) + vue-demi: 0.14.10(vue@3.5.4(typescript@5.6.2)) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -1943,11 +1943,11 @@ snapshots: dependencies: to-regex-range: 5.0.1 - floating-vue@5.2.2(vue@3.5.3(typescript@5.6.2)): + floating-vue@5.2.2(vue@3.5.4(typescript@5.6.2)): dependencies: '@floating-ui/dom': 1.1.1 - vue: 3.5.3(typescript@5.6.2) - vue-resize: 2.0.0-alpha.1(vue@3.5.3(typescript@5.6.2)) + vue: 3.5.4(typescript@5.6.2) + vue-resize: 2.0.0-alpha.1(vue@3.5.4(typescript@5.6.2)) focus-trap@7.5.4: dependencies: @@ -2430,17 +2430,17 @@ snapshots: '@shikijs/core': 1.16.3 '@shikijs/transformers': 1.16.3 '@types/markdown-it': 14.1.2 - '@vitejs/plugin-vue': 5.1.3(vite@5.4.3)(vue@3.5.3(typescript@5.6.2)) + '@vitejs/plugin-vue': 5.1.3(vite@5.4.3)(vue@3.5.4(typescript@5.6.2)) '@vue/devtools-api': 7.4.4 - '@vue/shared': 3.5.3 - '@vueuse/core': 11.0.3(vue@3.5.3(typescript@5.6.2)) - '@vueuse/integrations': 11.0.3(focus-trap@7.5.4)(vue@3.5.3(typescript@5.6.2)) + '@vue/shared': 3.5.4 + '@vueuse/core': 11.0.3(vue@3.5.4(typescript@5.6.2)) + '@vueuse/integrations': 11.0.3(focus-trap@7.5.4)(vue@3.5.4(typescript@5.6.2)) focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 7.1.0 shiki: 1.16.3 vite: 5.4.3 - vue: 3.5.3(typescript@5.6.2) + vue: 3.5.4(typescript@5.6.2) optionalDependencies: postcss: 8.4.45 transitivePeerDependencies: @@ -2471,21 +2471,21 @@ snapshots: - typescript - universal-cookie - vue-demi@0.14.10(vue@3.5.3(typescript@5.6.2)): + vue-demi@0.14.10(vue@3.5.4(typescript@5.6.2)): dependencies: - vue: 3.5.3(typescript@5.6.2) + vue: 3.5.4(typescript@5.6.2) - vue-resize@2.0.0-alpha.1(vue@3.5.3(typescript@5.6.2)): + vue-resize@2.0.0-alpha.1(vue@3.5.4(typescript@5.6.2)): dependencies: - vue: 3.5.3(typescript@5.6.2) + vue: 3.5.4(typescript@5.6.2) - vue@3.5.3(typescript@5.6.2): + vue@3.5.4(typescript@5.6.2): dependencies: - '@vue/compiler-dom': 3.5.3 - '@vue/compiler-sfc': 3.5.3 - '@vue/runtime-dom': 3.5.3 - '@vue/server-renderer': 3.5.3(vue@3.5.3(typescript@5.6.2)) - '@vue/shared': 3.5.3 + '@vue/compiler-dom': 3.5.4 + '@vue/compiler-sfc': 3.5.4 + '@vue/runtime-dom': 3.5.4 + '@vue/server-renderer': 3.5.4(vue@3.5.4(typescript@5.6.2)) + '@vue/shared': 3.5.4 optionalDependencies: typescript: 5.6.2